Re: define-syntax-rule

2011-09-04 Thread Andy Wingo
On Sat 03 Sep 2011 22:25, l...@gnu.org (Ludovic Courtès) writes: > Andy Wingo skribis: > >> @deffn {Syntax} define-syntax-rule (keyword . pattern) [docstring] >> template >> Define @var{keyword} as a new @code{syntax-rules} macro with one clause. >> @end deffn > > Do other implementa

Re: define-syntax-rule

2011-09-03 Thread Ludovic Courtès
Hi Andy! Andy Wingo skribis: > @deffn {Syntax} define-syntax-rule (keyword . pattern) [docstring] > template > Define @var{keyword} as a new @code{syntax-rules} macro with one clause. > @end deffn Do other implementations have this macro? Thanks, Ludo’.

Re: define-syntax

2010-06-18 Thread Marco Maggi
"Andy Wingo" wrote: > Probably not a good assumption to make on this list :) The message from the OP started with: > From R6RS Section 10: > > define-syntax form The expander expands and evaluates the >right-hand-side expression and binds the keyword to the resulting >transformer. -- M

Re: define-syntax

2010-06-18 Thread Andy Wingo
On Wed 16 Jun 2010 09:35, Marco Maggi writes: > "Ludovic Courtès" wrote: >> (define-syntax + >>(let ((plus +)) > > I am assuming you are starting the program with: > > (import (rnrs)) Probably not a good assumption to make on this list :) Andy -- http://wingolog.org/

Re: define-syntax

2010-06-16 Thread Marco Maggi
"Ludovic Courtès" wrote: > (define-syntax + >(let ((plus +)) I am assuming you are starting the program with: (import (rnrs)) or you are importing at level 1 a library which exports "+"; if this is the case, and you want R6RS compatibility, IMHO this should fail because you are redefinin

Re: define-syntax

2010-06-15 Thread Ludovic Courtès
Hey! Andy Wingo writes: > Indeed + does resolve to whatever + was bound to before the definition; > it's just that when you define the + macro it usually defines at > compile-time too! By compiling ahead of time and exiting we leave + in > its pristine state. See also the discussion of > eval-sy

Re: define-syntax

2010-06-15 Thread Andy Wingo
Hi, On Tue 15 Jun 2010 22:48, l...@gnu.org (Ludovic Courtès) writes: > From R6RS Section 10: > > define-syntax form The expander expands and evaluates the > right-hand-side expression and binds the keyword to the resulting > transformer. > > Thus I think the following should work: > A

Re: define-syntax

2008-12-09 Thread Neil Jerram
2008/12/9 Pach Roman (DGS-EC/ESG3) <[EMAIL PROTECTED]>: > > take look at the results > > (1) dummy => (lambda () (string-concatenate (list "a" "b" "c"))) > (2) dummy => (lambda () "abc") > > in the case of define-syntax (1) the string "abc" will be computed at > the run time, > the macro version (2

Re: define-syntax

2008-12-09 Thread Neil Jerram
2008/12/9 Pach Roman (DGS-EC/ESG3) <[EMAIL PROTECTED]>: > I've performed following two short tests. > > test 1: > --- > > (use-syntax (ice-9 syncase)) > > (define-syntax my-macro-1 > (syntax-rules () > ((_ par1 par2 par3) > (begin >(string-concatenate (list par1 par2 par3