From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: syntax-local-binding Date: Mon, 23 Jan 2012 17:05:43 +0100 Message-ID: <871uqqpfoo.fsf@pobox.com> References: <874nvw99za.fsf@pobox.com> <87zkdo7uf5.fsf@pobox.com> <87sjjbvs12.fsf@pobox.com> <87sjjaunme.fsf@netris.org> <87r4yurruv.fsf@pobox.com> <87obtyuj4k.fsf@netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1327335439 22125 80.91.229.12 (23 Jan 2012 16:17:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 23 Jan 2012 16:17:19 +0000 (UTC) Cc: guile-devel To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jan 23 17:17:15 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 1RpMa2-00015H-Vi for guile-devel@m.gmane.org; Mon, 23 Jan 2012 17:17:15 +0100 Original-Received: from localhost ([::1]:38709 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpMa2-0005LI-GR for guile-devel@m.gmane.org; Mon, 23 Jan 2012 11:17:14 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:35946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpMZu-0005Fi-V2 for guile-devel@gnu.org; Mon, 23 Jan 2012 11:17:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RpMZp-0000EO-RA for guile-devel@gnu.org; Mon, 23 Jan 2012 11:17:06 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:59645 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpMZp-0000EF-KD for guile-devel@gnu.org; Mon, 23 Jan 2012 11:17:01 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 5C0D17C95; Mon, 23 Jan 2012 11:17:00 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=ehRbCmps0r6KuLzla0+i48g2CDM=; b=sCRvVW 1PI7J+MNWEk8zMN3TiEmit8di0aI8iiEkOj/eXgVKqYjJGscnzrgVOTe6xlgUVME 35Y3Xgl50g3MTFGQEy6BiCwD9mDpZhvnczuMWHpjoKmvc/b5OdcVTqiMv0uob7un 50Zv/KEEkMIojGSRT/zxNU6YFcKrTzbMTh1OM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=kGcpnpRCpXG7GArwtms6nGE73A3k/2Qd Y4kwOvEMSxxIQkOpq/FQhLew8rM+3g1b9FV/bcV/q0LBhkEh2ZWHFFi0LzzNN+T2 Cu2+2juNYQq4wrSgOK10dRctDWRXFNZza1gnB8z/GNsH9O9k1UkLkbOv1DUc6CPB jxK2mr0d3dM= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 55AB27C94; Mon, 23 Jan 2012 11:17:00 -0500 (EST) Original-Received: from badger (unknown [90.163.36.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 8B2C27C93; Mon, 23 Jan 2012 11:16:59 -0500 (EST) In-Reply-To: <87obtyuj4k.fsf@netris.org> (Mark H. Weaver's message of "Fri, 20 Jan 2012 17:03:23 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Pobox-Relay-ID: AD6877C6-45DD-11E1-952B-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 74.115.168.62 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:13646 Archived-At: Heya Mark, On Fri 20 Jan 2012 23:03, Mark H Weaver writes: > (let ((x 1)) > (syntax-local-binding #'x)) > > is not equivalent to: > > (let ((x 1)) > (local-eval '(syntax-local-binding #'x) (the-environment))) Indeed; bummer! I think, though, that this is simply a consequence of giving more power to macro writers. It is analogous in some ways to the changes that identifier-syntax introduce into macro writing: with identifier-syntax, one can no longer write a code walker with syntax-rules pattern matching, as single identifiers may expand out to complicated expressions, possibly even with side effects. >> Why do you think that? The procedures do carry metadata; I understood >> that that was your strategy, to use the serialization of the >> syntax-rules form in the procedure metadata. > > Well, this was in the context of a new strategy where psyntax would > include a new core form called `call-with-current-local-expander' that > calls its parameter (a procedure or macro) with a procedure that accepts > an expression and returns an expanded form. In this case, the most > straightforward implementation would simply serialize the (r w mod) > structures directly. > > Toward that end, I was thinking it would be nice to keep those > structures serializable. The only part that's not currently > serializable are the transformer procedures for local macros. > Thus the change in representation. I have been staring at this empty page here for a little while, writing and re-writing, but I can't get over a feeling that I really don't want this kind of work in psyntax itself. Who knows, maybe you have really convincing arguments here, but this particular argument should not be driving a decision about e.g. including syntax-local-binding or not. That sounds negative, and in a way of course it is -- but still, I'd much rather enable people to make powerful syntactic abstractions like local-eval outside psyntax. Syntax-parse, for example, if it ever lands, will land in the form of a module In this case there are lots of strategies you could use. We could change psyntax to embed the syntax objects in the procedure meta-data, like I said. Ice-9 local-eval could #:replace its own syntax-rules. We could (and probably should) do procedure serialization. Regards, Andy -- http://wingolog.org/