From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs Subject: bug#30237: Generalizing =?UTF-8?Q?=E2=80=98and=3D>=E2=80=99?= Date: Tue, 30 Jan 2018 23:31:52 -0500 Message-ID: <87shamvebr.fsf@netris.org> References: <877es731ar.fsf@gnu.org> <877es7ti5j.fsf@netris.org> <87y3kn10li.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1517373081 24745 195.159.176.226 (31 Jan 2018 04:31:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 31 Jan 2018 04:31:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cc: 30237@debbugs.gnu.org To: Mathieu Lirzin Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Jan 31 05:31:17 2018 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egk3F-0005wK-27 for guile-bugs@m.gmane.org; Wed, 31 Jan 2018 05:31:13 +0100 Original-Received: from localhost ([::1]:32816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egk5F-0006dn-Ts for guile-bugs@m.gmane.org; Tue, 30 Jan 2018 23:33:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egk54-0006de-Eo for bug-guile@gnu.org; Tue, 30 Jan 2018 23:33:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egk50-0005sC-H1 for bug-guile@gnu.org; Tue, 30 Jan 2018 23:33:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42279) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1egk50-0005s3-Bu for bug-guile@gnu.org; Tue, 30 Jan 2018 23:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1egk50-0006uN-5l for bug-guile@gnu.org; Tue, 30 Jan 2018 23:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 31 Jan 2018 04:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30237 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 30237-submit@debbugs.gnu.org id=B30237.151737315726525 (code B ref 30237); Wed, 31 Jan 2018 04:33:02 +0000 Original-Received: (at 30237) by debbugs.gnu.org; 31 Jan 2018 04:32:37 +0000 Original-Received: from localhost ([127.0.0.1]:50176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egk4b-0006tk-2r for submit@debbugs.gnu.org; Tue, 30 Jan 2018 23:32:37 -0500 Original-Received: from world.peace.net ([50.252.239.5]:51314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egk4Z-0006tS-H0 for 30237@debbugs.gnu.org; Tue, 30 Jan 2018 23:32:35 -0500 Original-Received: from pool-72-93-27-251.bstnma.east.verizon.net ([72.93.27.251] helo=jojen) by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1egk4T-0001us-E1; Tue, 30 Jan 2018 23:32:29 -0500 In-Reply-To: <87y3kn10li.fsf@gnu.org> (Mathieu Lirzin's message of "Wed, 24 Jan 2018 21:08:25 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8992 Archived-At: Mathieu Lirzin writes: > IMO It would be nice if multiple values > were handled too. here is one solution inspired by =E2=80=98compose=E2= =80=99. > > (define and=3D> > (case-lambda > ((val proc) (and val (proc val))) > ((val proc . procs) > (let loop ((p proc) (ps procs)) > (if (null? ps) > (p val) > (loop (lambda args > (call-with-values (lambda () (apply p args)) > (lambda (arg0 . args*) > (and arg0 (apply (car ps) arg0 args*))))) > (cdr ps))))))) This generalization will inevitably slow it down, and it's not clear that this is useful in practice. It's also not particularly natural, because these return value(s) somehow need to be interpreted as a boolean. There are multiple ways to do that, and it's not clear which is the best way. I think we should resist the temptation to make simple things more complicated without good reason. Making things more complicated always has a cost. I'm a big believer in keeping things simple, especially the widely used primitive operations. Thoughts? Mark