Re: Enhancement to the syntax system?

2012-07-10 Thread Ludovic Courtès
Hi! Stefan Israelsson Tampe stefan.ita...@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

Re: Enhancement to the syntax system?

2012-07-10 Thread Stefan Israelsson Tampe
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)

Re: Enhancement to the syntax system?

2012-07-10 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10-07-12 15:35, Stefan Israelsson Tampe wrote: I did miss something when trying in racket, it's a psyntax bug! I'm glad you're finally looking harder at the Racket behavior. racket: (define-for-syntax (f x) #`(let ((x 1)) #,x)) (define-syntax

Re: [racket-dev] Enhancement to the syntax system?

2012-07-10 Thread Eli Barzilay
20 minutes ago, Marijn wrote: It seems to me that both these results cannot be correct simultaneously, but I'll await the experts' opinion on that. This does look weird: #lang racket (define-for-syntax (f stx) #`(let ([x 1]) #,stx)) (define-syntax (m stx) (with-syntax ([zz (f

Re: Enhancement to the syntax system?

2012-07-10 Thread Ludovic Courtès
Hi, Stefan Israelsson Tampe stefan.ita...@gmail.com skribis: 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)

Re: [racket-dev] Enhancement to the syntax system?

2012-07-10 Thread Ludovic Courtès
Hi, Matthew Flatt mfl...@cs.utah.edu skribis: It's natural --- but not correct --- to think that #` is responsible for hygiene, in which case `(f #'x)' should keep the given `x' separate from the `let'-bound `x' in the result. [...] If you change the example to #lang racket

Re: [racket-dev] Enhancement to the syntax system?

2012-07-10 Thread Stefan Israelsson Tampe
samth made a pointer to http://srfi.schemers.org/srfi-72/srfi-72.html It does not look like guile racket etc. have implemented this yet. Am I wrong? This is precisely what I'm after! On Tue, Jul 10, 2012 at 5:26 PM, Ludovic Courtès l...@gnu.org wrote: Hi, Matthew Flatt mfl...@cs.utah.edu

Re: [racket-dev] Enhancement to the syntax system?

2012-07-10 Thread Matthew Flatt
At Tue, 10 Jul 2012 10:51:57 -0400, Eli Barzilay wrote: 20 minutes ago, Marijn wrote: It seems to me that both these results cannot be correct simultaneously, but I'll await the experts' opinion on that. This does look weird: #lang racket (define-for-syntax (f stx) #`(let ([x

Re: [racket-dev] Enhancement to the syntax system?

2012-07-10 Thread Ryan Culpepper
On 07/10/2012 10:51 AM, Eli Barzilay wrote: 20 minutes ago, Marijn wrote: It seems to me that both these results cannot be correct simultaneously, but I'll await the experts' opinion on that. This does look weird: #lang racket (define-for-syntax (f stx) #`(let ([x 1]) #,stx))

Re: [racket-dev] Enhancement to the syntax system?

2012-07-10 Thread Eli Barzilay
An hour and a half ago, Matthew Flatt wrote: It's natural --- but not correct --- to think that #` is responsible for hygiene, in which case `(f #'x)' should keep the given `x' separate from the `let'-bound `x' in the result. Instead, hygiene is the responsibility of macro invocation, and

srfi-72

2012-07-10 Thread Stefan Israelsson Tampe
Hi, I have thought about what abstraction is needed to be supported by psyntax in order to implement srfi-72. Consider macro expansion of code #'C, ideally we would like to write the expansion as E#'C with E an expansion operator. For two expansion operators E,F we would expect to support this