From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: Why not support (begin), (cond), (case-lambda), etc? Date: Fri, 06 Jan 2012 12:11:12 -0500 Message-ID: <87boqgbvtb.fsf@netris.org> References: <871urdd593.fsf@netris.org> <87obuhbey2.fsf@netris.org> <87k455b6l2.fsf@netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1325869902 16388 80.91.229.12 (6 Jan 2012 17:11:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 Jan 2012 17:11:42 +0000 (UTC) Cc: guile-devel@gnu.org To: Alex Shinn Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jan 06 18:11:37 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RjDKJ-0006kq-Ot for guile-devel@m.gmane.org; Fri, 06 Jan 2012 18:11:35 +0100 Original-Received: from localhost ([::1]:45625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjDKJ-0006Nc-61 for guile-devel@m.gmane.org; Fri, 06 Jan 2012 12:11:35 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:56739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjDKG-0006Lr-OK for guile-devel@gnu.org; Fri, 06 Jan 2012 12:11:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RjDKF-0005B0-Iw for guile-devel@gnu.org; Fri, 06 Jan 2012 12:11:32 -0500 Original-Received: from world.peace.net ([96.39.62.75]:50845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjDKF-0005Aq-Ax for guile-devel@gnu.org; Fri, 06 Jan 2012 12:11:31 -0500 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1RjDKA-0001Cu-8w; Fri, 06 Jan 2012 12:11:26 -0500 In-Reply-To: (Alex Shinn's message of "Fri, 6 Jan 2012 21:08:57 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 96.39.62.75 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13358 Archived-At: Alex Shinn writes: >> Of course, it is not hard to work around these seemingly pointless >> prohibitions, just as it would not be hard to write >> >> =C2=A0(if (null? xs) 0 (apply + xs)) >> >> instead of >> >> =C2=A0(apply + xs) >> >> but I don't understand why we should have to. =C2=A0What's the compelling >> argument on the other side that justifies these annoyances? > > This analogy is meaningless, but for the record > you should be using fold or reduce here. Yes, I'm aware that using `fold' or `reduce' is more robust for large lists. You could just as easily correct anyone who uses alists in a simple example and say "for the record you should be using a balanced tree instead." Or perhaps you're advocating (reduce + 0 xs) over (apply + xs) as a matter of style. If so, I happen to agree with you, but that's not the point. The point is, (apply + xs) is a sensible thing for someone to do if xs is not huge, and it's good that Scheme treats this degenerate case properly. Similarly, if we are generating a sequence of expressions to be evaluated for effects only, then an empty sequence has a perfectly logical and obvious meaning. Thanks, Mark