From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Compall Newsgroups: gmane.lisp.guile.devel Subject: [patch] variable datums with syncase transformer Date: Fri, 14 Dec 2007 02:06:56 -0600 Message-ID: <1197619616.5218.34.camel@nocandy.dyndns.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0724804620==" X-Trace: ger.gmane.org 1197619632 7058 80.91.229.12 (14 Dec 2007 08:07:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Dec 2007 08:07:12 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Dec 14 09:07:24 2007 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J35Zr-0000Dy-P8 for guile-devel@m.gmane.org; Fri, 14 Dec 2007 09:07:24 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J35ZY-0005DM-VA for guile-devel@m.gmane.org; Fri, 14 Dec 2007 03:07:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J35ZV-0005DF-Oo for guile-devel@gnu.org; Fri, 14 Dec 2007 03:07:01 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J35ZT-0005D2-5o for guile-devel@gnu.org; Fri, 14 Dec 2007 03:07:00 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J35ZT-0005Cz-04 for guile-devel@gnu.org; Fri, 14 Dec 2007 03:06:59 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J35ZS-0004PG-Av for guile-devel@gnu.org; Fri, 14 Dec 2007 03:06:58 -0500 Original-Received: from mxsf09.insightbb.com ([74.128.0.79]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J35ZR-0003cK-Sh for guile-devel@gnu.org; Fri, 14 Dec 2007 03:06:58 -0500 X-IronPort-AV: E=Sophos;i="4.24,165,1196658000"; d="asc'?scan'208";a="173816190" Original-Received: from unknown (HELO asav00.insightbb.com) ([172.31.249.124]) by mxsf09.insightbb.com with ESMTP; 14 Dec 2007 03:06:56 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAIPIYUdKiZK7/2dsb2JhbAAIqQw X-IronPort-AV: E=Sophos;i="4.24,165,1196658000"; d="asc'?scan'208";a="140322750" Original-Received: from 74-137-146-187.dhcp.insightbb.com (HELO [192.168.10.2]) ([74.137.146.187]) by asav00.insightbb.com with ESMTP; 14 Dec 2007 03:06:56 -0500 X-Mailer: Evolution 2.12.0-2mdv2008.0 X-detected-kernel: by mx20.gnu.org: Genre and OS details not recognized. X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:6934 Archived-At: --===============0724804620== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-yZqGJQ3t4nmVoaXIra51" --=-yZqGJQ3t4nmVoaXIra51 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Issue most easily explained with a simple reproduction: guile> (use-syntax (ice-9 syncase)) guile> (@ (guile) car) ERROR: invalid syntax #= > The reasoning of the fix is best described in the long comment in the patch below. If you would rather that I modify psyntax.ss to use a new procedure name rather than `self-evaluating?' please let me know. Patch does not include log entries, listed immediately below instead: ice-9/ChangeLog: 2007-12-14 Stephen Compall * syncase.scm: Support datums where (variable? DATUM) =3D> #t when syncase transformer is installed. test-suite/ChangeLog: 2007-12-14 Stephen Compall * tests/syncase.test: Test that @-forms can be expanded by the syncase transformer. Index: ice-9/syncase.scm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/guile/guile/guile-core/ice-9/syncase.scm,v retrieving revision 1.35 diff -u -d -u -r1.35 syncase.scm --- ice-9/syncase.scm 16 Apr 2006 23:43:48 -0000 1.35 +++ ice-9/syncase.scm 14 Dec 2007 07:55:49 -0000 @@ -194,6 +194,18 @@ "syncase's gensym expected 0 or 1 arguments, got " (length rest))))))))) =20 +;; The question syncase is asking when it asks `self-evaluating?' is +;; not really whether a given datum is self-evaluating, but whether it +;; should pass the datum through as-is to the evaluator. With that in +;; mind, we wrap core `self-evaluating?' here so that syncase will +;; pass-through variables, meaning (variable? datum) =3D> #t, to the +;; evaluator. Without this, the system transformer will see a +;; variable datum as invalid syntax, which it is not to the core +;; transformer. +(define (self-evaluating? datum) + (or ((@ (guile) self-evaluating?) datum) + (variable? datum))) + ;;; Load the preprocessed code =20 (let ((old-debug #f) Index: test-suite/tests/syncase.test =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/guile/guile/guile-core/test-suite/tests/syncase.test,v retrieving revision 1.5 diff -u -d -u -r1.5 syncase.test --- test-suite/tests/syncase.test 16 Apr 2006 23:27:14 -0000 1.5 +++ test-suite/tests/syncase.test 14 Dec 2007 07:55:49 -0000 @@ -34,3 +34,15 @@ =20 (pass-if "basic syncase macro" (=3D (plus 1 2 3) (+ 1 2 3))) + +(pass-if "variable?s recognized as datums" + (false-if-exception + (begin (eq? car (eval '(@ (guile) car) (current-module))) + #t))) + +(define-syntax export-safe-plus + (syntax-rules () + ((_ x ...) ((@ (guile) +) x ...)))) + +(pass-if "variable?s passed through to evaluator" + (=3D (export-safe-plus 1 2 3) (+ 1 2 3))) --=20 Our last-ditch plan is to change the forums into a podcast, then send RSS feeds into the blogosphere so our users can further debate the legality of mashups amongst this month's 20 'sexiest' gadgets. --Richard "Lowtax" Kyanka --=-yZqGJQ3t4nmVoaXIra51 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBHYjmbYWjD35Pp0wIRAhYYAJ97NFs/OEoowcYiniFH1SsqeyngrgCgiKHY 9HojUdZ0RUrdDyymNZYK9jU= =xr2v -----END PGP SIGNATURE----- --=-yZqGJQ3t4nmVoaXIra51-- --===============0724804620== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel --===============0724804620==--