From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steve Juranich Newsgroups: gmane.lisp.guile.user Subject: Using a macro with FOLD alters FOLD procedure! Date: Fri, 15 Apr 2005 11:38:11 -0700 Message-ID: <56190b6c05041511382ae259d@mail.gmail.com> Reply-To: Steve Juranich NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_3693_11275193.1113590291618" X-Trace: sea.gmane.org 1113592513 25173 80.91.229.2 (15 Apr 2005 19:15:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Apr 2005 19:15:13 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Apr 15 21:15:11 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DMWHA-0002sD-Fn for guile-user@m.gmane.org; Fri, 15 Apr 2005 21:14:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DMWKi-0006Jq-SA for guile-user@m.gmane.org; Fri, 15 Apr 2005 15:18:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DMWKX-0006JP-QK for guile-user@gnu.org; Fri, 15 Apr 2005 15:18:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DMWKW-0006J0-82 for guile-user@gnu.org; Fri, 15 Apr 2005 15:18:17 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DMWIO-0005oc-6n for guile-user@gnu.org; Fri, 15 Apr 2005 15:16:04 -0400 Original-Received: from [64.233.170.194] (helo=rproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DMVkH-0001e8-6l for guile-user@gnu.org; Fri, 15 Apr 2005 14:40:49 -0400 Original-Received: by rproxy.gmail.com with SMTP id 40so378782rnz for ; Fri, 15 Apr 2005 11:39:53 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type; b=lxBbpISUWZFAPFCoCm3fWnBMeaRJyLxW6/OH0fsfWZypfMSy9Mjd/Tq/vkqw1l5vfraR0rq9tJmwDE7I/0qEOr1xmHSZBlTWW7oD9V6JPV6aH98VFAN1PIKYejGWzqmUdqy15YFCUEASFhTQfCbTXFjlsnW3daQf1gNhkqGxzz4= Original-Received: by 10.38.8.31 with SMTP id 31mr2519610rnh; Fri, 15 Apr 2005 11:39:53 -0700 (PDT) Original-Received: by 10.54.17.19 with HTTP; Fri, 15 Apr 2005 11:38:11 -0700 (PDT) Original-To: Guile User List 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:4376 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:4376 ------=_Part_3693_11275193.1113590291618 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I've noticed some strange behavior from (srfi-1) "fold" using a macro as the KONS argument. I've attached a file that exhibits the problem. In a nutshell, using a macro as the KONS argument for FOLD results in the procedure source for FOLD being altered. 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. --=20 Steve Juranich Tucson, AZ USA ------=_Part_3693_11275193.1113590291618 Content-Type: text/x-scheme; name=exhibit-bug.scm; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="exhibit-bug.scm" #! /bin/bash exec guile -s "$0" !# (use-modules (ice-9 pretty-print) (srfi srfi-1)) ;;; First, show that "fold" is in a good state (cf. srfi/srfi-1.scm). (display "Original source for FOLD:\n") (pretty-print (procedure-source fold)) (display "\n\n") ;;; Run "fold" with "+" as the KONS. (fold + 0 '(1 2 3 4 5)) ;;; Show that the source has NOT been altered (substantially) (display "(More or less) Unaltered source for FOLD:\n") (pretty-print (procedure-source fold)) (display "\n\n") ;;; Run "fold" with a macro as the KONS argument. (define-macro (++ a b) `(+ ,a ,b)) (fold ++ 0 '(1 2 3 4 5)) (display "Altered (broken) source for FOLD:\n") (pretty-print (procedure-source fold)) (display "\n\n") ------=_Part_3693_11275193.1113590291618 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user ------=_Part_3693_11275193.1113590291618--