From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Compall Newsgroups: gmane.lisp.guile.user Subject: Re: Using a macro with FOLD alters FOLD procedure! Date: Fri, 15 Apr 2005 14:50:48 -0500 Message-ID: <1113594648.3650.8.camel@cslabpc3.evansville.edu> References: <56190b6c05041511382ae259d@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1113596084 4564 80.91.229.2 (15 Apr 2005 20:14:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Apr 2005 20:14:44 +0000 (UTC) Cc: Guile User List Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Apr 15 22:14:41 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DMXCr-0001Rh-DS for guile-user@m.gmane.org; Fri, 15 Apr 2005 22:14:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DMXGP-0003FD-Nc for guile-user@m.gmane.org; Fri, 15 Apr 2005 16:18:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DMXDD-0001Lt-Pj for guile-user@gnu.org; Fri, 15 Apr 2005 16:14:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DMXDB-0001Ki-IN for guile-user@gnu.org; Fri, 15 Apr 2005 16:14:47 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DMX4V-0007X7-PZ for guile-user@gnu.org; Fri, 15 Apr 2005 16:05:47 -0400 Original-Received: from [192.195.225.6] (helo=cslabpc3.evansville.edu) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1DMWql-0005jB-Dj for guile-user@gnu.org; Fri, 15 Apr 2005 15:51:35 -0400 Original-Received: from cslabpc3.evansville.edu (localhost.localdomain [127.0.0.1]) by cslabpc3.evansville.edu (8.13.1/8.13.1) with ESMTP id j3FJomYr003807; Fri, 15 Apr 2005 14:50:49 -0500 Original-Received: (from sc87@localhost) by cslabpc3.evansville.edu (8.13.1/8.13.1/Submit) id j3FJomj5003806; Fri, 15 Apr 2005 14:50:48 -0500 X-Authentication-Warning: cslabpc3.evansville.edu: sc87 set sender to s11@member.fsf.org using -f Original-To: Steve Juranich In-Reply-To: <56190b6c05041511382ae259d@mail.gmail.com> X-Mailer: Evolution 2.0.2 (2.0.2-3) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:4377 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:4377 On Fri, 2005-04-15 at 11:38 -0700, Steve Juranich wrote: > I was wondering, is this "expected behavior", or have I uncovered > something? If this is expected behavior, I'd suggest that FOLD should > do a check to make sure that the KONS argument is not a macro. If > I've uncovered a bug, I'll file a bug report. `fold' in SRFI-1 mentions that KONS is supposed to be a function. If you give a macro to fold, the macro gets expanded and memoized as such, when the macro is called normally, as it is as an optimization in the common case of one list. Try passing multiple lists; I bet you will get a type error on `apply'. As for checking whether KONS is a function, well, here is from SRFI-1: @q Note that statements of the form "it is an error" merely mean "don't do that." They are not a guarantee that a conforming implementation will "catch" such improper use by, for example, raising some kind of exception. Regrettably, R5RS Scheme requires no firmer guarantee even for basic operators such as car and cdr, so there's little point in requiring these procedures to do more. @end q So I would say "it is an error" to pass a macro to fold. Seems like a serious error, of course, that leaves the system in an undefined state unlike errors that don't modify the implementation :); I am no authority on whether this should be fixed (which is the only issue; the fix is trivial, but has potential philosophical implications). -- Stephen Compall _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user