From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.devel Subject: Re: Enhancement to the syntax system? Date: Tue, 3 Jul 2012 16:37:14 +0200 Message-ID: References: <877gumufmq.fsf@gnu.org> <87r4stss4d.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d04478755b9743f04c3edd9e3 X-Trace: dough.gmane.org 1341326261 12322 80.91.229.3 (3 Jul 2012 14:37:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 3 Jul 2012 14:37:41 +0000 (UTC) Cc: guile-devel@gnu.org To: =?ISO-8859-1?Q?Ludovic_Court=E8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jul 03 16:37:39 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sm4EQ-0003sB-DH for guile-devel@m.gmane.org; Tue, 03 Jul 2012 16:37:34 +0200 Original-Received: from localhost ([::1]:36317 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm4EM-0007md-VV for guile-devel@m.gmane.org; Tue, 03 Jul 2012 10:37:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm4EF-0007ke-9P for guile-devel@gnu.org; Tue, 03 Jul 2012 10:37:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sm4E9-0004FP-Kd for guile-devel@gnu.org; Tue, 03 Jul 2012 10:37:22 -0400 Original-Received: from mail-yw0-f41.google.com ([209.85.213.41]:59571) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm4E9-0004EF-DV; Tue, 03 Jul 2012 10:37:17 -0400 Original-Received: by yhr47 with SMTP id 47so7216859yhr.0 for ; Tue, 03 Jul 2012 07:37:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qTHuohNonlwInRHWCRhXPo5PYTt3to2/khISCg9XOaw=; b=MX/GsZ9U9YkxmDnSspo1mwTPDmvABPPJ866F1/7IcHKmiz/gihYlOLOoOFQRN5nG3H ppg751nMtEiFn+26lz98UfVPHTG1tqvfKZyY5Hn7JFTxZfDGiaSneodWvXvOfiwI3CG2 maMGtZhfoASN9hzx4PVxLKkd9ZGWdDp/T5B8pnZj6rFXzJ1gowAEhT8NJ9Vc7NmbOK4l zR6TaDvLkzHJUqWz7sF+W0lW/L/afIQO9jctyTgj8bseYXwzV3LeAO9S1/KZqQtqnnha UHmuM6OicfFwdY6SWfkqurHufzQilUxRIek7DFnCnA+IKrsSEdwkgu1poUyF2is3czJ2 Nr4Q== Original-Received: by 10.50.237.72 with SMTP id va8mr8413916igc.17.1341326234317; Tue, 03 Jul 2012 07:37:14 -0700 (PDT) Original-Received: by 10.50.41.196 with HTTP; Tue, 3 Jul 2012 07:37:14 -0700 (PDT) In-Reply-To: <87r4stss4d.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.213.41 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:14697 Archived-At: --f46d04478755b9743f04c3edd9e3 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On Tue, Jul 3, 2012 at 12:41 AM, Ludovic Court=E8s wrote: > Hey! > > Stefan Israelsson Tampe skribis: > > > Maybe this help to see what I'm after, > > > > #'(let ((x v)) #.(f #'x)) > > > > <=3D> > > > > (let-syntax ((g (lambda (stx) (syntax-case stx ((_ x) (f #'x))))) > > #'(let ((x v)) (g x)) > > Sorry, I fail to understand the problem you=92re trying to solve. > > Hmm The #' probably need to be moved to the left of the expression and there might be problems with phases in this analogy but I guess you saw that I wanted to spin the function f on a syntax argument that contained the binding of x done in the let which is not the case If you do a simple #= , The above idiom is not frequent to the point that special syntax is > needed, is it? > > If you want to code your macros like Alex does in ice-9/match.scm then it's not a problem. If you want to try another path using functions in stead of macros and working hard with #, and #,@ you will for complex macros like a matcher need to gensym by hand or destroy the readability of the code. As illustrated by the simple example above. It's not that a devastating issue because I have coded quite a lot of CL macros before and can cope with gensymming, but I find it frustrating to know that there probably exists a better way. > Thanks, > Ludo=92. > /Stefan --f46d04478755b9743f04c3edd9e3 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable

On Tue, Jul 3, 2012 at 12:41 AM, Ludovic= Court=E8s <ludo@gnu.org> wrote:

Stefan Israelsson Tampe <stef= an.itampe@gmail.com> skribis:

> Maybe this help to see what I'm after,
>
> #'(let ((x v)) #.(f #'x))
>
> <=3D>
>
> (let-syntax ((g (lambda (stx) (syntax-case =A0stx ((_ x) (f #'x)))= ))
> =A0 =A0#'(let ((x v)) (g x))

Sorry, I fail to understand the problem you=92re trying to solve.

Hmm The #' probably need to be moved to the left = of the expression and=20 there might be problems with phases in this analogy but I guess you saw=20 that I wanted to spin the function f on a syntax argument that contained the binding of x done in the let which is not the case If you do a=20 simple #,
=A0

The above idiom is not frequent to the point that special syntax is
needed, is it?

=A0
If you want to code your macros lik= e Alex does in ice-9/match.scm then it's not a problem.
If you want = to try another path using functions in stead of macros and working hard wit= h #, and #,@
you will for complex macros like a matcher need to gensym by hand or destro= y the readability of the
code. As illustrated by the simple example abo= ve. It's not that a devastating issue because I have coded quite a lot = of CL macros before and can cope with gensymming, but I find it frustrating= to know that there probably exists a better way.
=A0
Thanks,
Ludo=92.

/Stefan
--f46d04478755b9743f04c3edd9e3--