unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guile-devel@gnu.org
Subject: Re: Enhancement to the syntax system?
Date: Tue, 10 Jul 2012 15:35:27 +0200	[thread overview]
Message-ID: <CAGua6m2G+ZTKxdczsX+8JCP1qe9wWfK7p_2oHgY27D-=rkE=OA@mail.gmail.com> (raw)
In-Reply-To: <87sjd058ia.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1952 bytes --]

I did miss something when trying in racket, it's a psyntax bug!

Look!

racket:
(define-for-syntax (f x) #`(let ((x 1)) #,x))
> (define-syntax (g x) (syntax-case x ()((_ y) #`(let ((x y)) #,(f #'x))))
)
> (g 4)
4

In guile,
scheme@(guile-user)> (define (f x) #`(let ((x 1)) #,x))
scheme@(guile-user)> (define-syntax g (lambda (x) (syntax-case x () ((_ y)
#`(let ((x y)) #,(f #'x))))))
scheme@(guile-user)> (g 4)
$1 = 1
!

I much prefer rackets version here. I will file a bug report and also try
to understand what spec that racket is following!


On Tue, Jul 10, 2012 at 10:24 AM, Ludovic Courtès <ludo@gnu.org> wrote:

> Hi!
>
> Stefan Israelsson Tampe <stefan.itampe@gmail.com> skribis:
>
> > | It’s true that it’s annoying that the wrong binding is silently used.
> > | Do you think it’s common enough to justify new syntax?
> >
> > Yes this highlights a comon problem when implementing racket match with
> #`.
>
> Sure, but it’s not good-style.  ;-)  In general, ‘syntax-case’ is great,
> but it’s low-level plumbing to be used with care, compared to
> ‘syntax-rules’.
>
> > I do think
> > that the best solution is to somehow extend the syntax expander to mimic
> my
> > sugested
> > #. and #.@. The simple solution is to rewrite according to
> >
> > #`(... #.((x y) (f #'x #'y)))
> >
> > ->
> >
> > #`(let-syntax ((g (lambda (x) (syntax-case x () ((_ x y) (f #'x #'y))))))
> >       (... (g x y))
>
> Unlike syntax-{quote,unquote,...}, #. has no non-syntax-prefixed
> equivalent.  And what it does is non-trivial.  So I don’t feel
> comfortable with this extension, FWIW.
>
> [...]
>
> > I also feel that the issue needs to be
> > liffted up to the
> > community of at least syntax-case user crowd before doing anything Ill
> try
> > to spur
> > some discussions on it and come back later!
>
> Yes, this should be discussed on c.l.s or scheme-reports.
>
> Thanks,
> Ludo’.
>

[-- Attachment #2: Type: text/html, Size: 2531 bytes --]

  reply	other threads:[~2012-07-10 13:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-30 15:22 Enhancement to the syntax system? Stefan Israelsson Tampe
2012-07-02 19:28 ` Ludovic Courtès
2012-07-02 20:43   ` Stefan Israelsson Tampe
2012-07-02 22:41     ` Ludovic Courtès
2012-07-03 14:37       ` Stefan Israelsson Tampe
2012-07-03 21:33         ` Ludovic Courtès
2012-07-03 21:52           ` Stefan Israelsson Tampe
2012-07-04  7:47             ` Marijn
2012-07-04  8:04               ` Stefan Israelsson Tampe
2012-07-09 15:52             ` Ludovic Courtès
2012-07-09 17:40               ` Stefan Israelsson Tampe
2012-07-10  8:24                 ` Ludovic Courtès
2012-07-10 13:35                   ` Stefan Israelsson Tampe [this message]
2012-07-10 14:34                     ` Marijn
2012-07-10 14:51                       ` [racket-dev] " Eli Barzilay
     [not found]                         ` <20476.16781.257276.194149-a5nvgYPMCZcx/1z6v04GWfZ8FUJU4vz8@public.gmane.org>
2012-07-10 15:03                           ` Matthew Flatt
2012-07-10 15:26                             ` [racket-dev] " Ludovic Courtès
2012-07-10 15:44                               ` Stefan Israelsson Tampe
2012-07-10 17:47                                 ` Stefan Israelsson Tampe
2012-07-10 16:48                             ` Eli Barzilay
2014-05-03 21:29                             ` Marijn Schouten (hkBst)
2012-07-10 15:44                           ` Ryan Culpepper
2012-07-10 15:22                     ` Ludovic Courtès
2012-07-10  7:36               ` Stefan Israelsson Tampe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGua6m2G+ZTKxdczsX+8JCP1qe9wWfK7p_2oHgY27D-=rkE=OA@mail.gmail.com' \
    --to=stefan.itampe@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).