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: Why not support (begin), (cond), (case-lambda), etc? Date: Thu, 05 Jan 2012 19:49:44 -0500 Message-ID: <871urdd593.fsf@netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1325811015 31758 80.91.229.12 (6 Jan 2012 00:50:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 Jan 2012 00:50:15 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jan 06 01:50:11 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 1Riy0Z-00012l-4k for guile-devel@m.gmane.org; Fri, 06 Jan 2012 01:50:11 +0100 Original-Received: from localhost ([::1]:58278 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Riy0Y-00060G-Dk for guile-devel@m.gmane.org; Thu, 05 Jan 2012 19:50:10 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:54286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Riy0U-0005xh-Tb for guile-devel@gnu.org; Thu, 05 Jan 2012 19:50:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Riy0S-0006qt-4v for guile-devel@gnu.org; Thu, 05 Jan 2012 19:50:06 -0500 Original-Received: from world.peace.net ([96.39.62.75]:56066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Riy0S-0006q4-23 for guile-devel@gnu.org; Thu, 05 Jan 2012 19:50:04 -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 1Riy0M-0007IL-Fi; Thu, 05 Jan 2012 19:49:58 -0500 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:13333 Archived-At: Hello all, I'd like to argue in favor of supporting (begin), (cond), (case-lambda) and other such degenerate forms, for the same reason that we support (*), (+), and (let () ...). First of all: Is there any compelling reason not to support them? I can't think of one. Can you? If so, please do tell. Imagine if we didn't support (*) and (+). Then you couldn't simply write (apply + xs) to add a list of numbers; instead you'd have to write (if (null? xs) 0 (apply + xs)). In other words, they simplify higher-order programming by freeing the user from handling degenerate cases specially. The same argument applies to (begin), (cond), and (case-lambda). They simplify writing robust syntax transformers without having to handle degenerate cases specially. Apart from this general argument, I can think of one particularly compelling reason to support (begin). Suppose you have a macro that generates a sequence of local definitions. How do you return an empty sequence of definitions without terminating definition context? The only way I can think of is to generate a dummy definition with a gensym name. That's very ugly. Why force users into such complications needlessly? Mark