Re: [Chicken-users] define-macro in Chicken 4.0

2009-03-15 Thread Tobia Conforto
I wrote: (import-for-syntax matchable) (define-syntax define-macro (lambda (m . _) `(define-syntax ,(caadr m) (lambda (e . _) (match e (,(cadr m) ,@(cddr m))) Eduardo, does this work for you? I've tried it with some old macros I had lying around and it

Re: [Chicken-users] define-macro in Chicken 4.0

2009-03-15 Thread felix winkelmann
On Sat, Mar 14, 2009 at 10:27 AM, Eduardo Cavazos wayo.cava...@gmail.com wrote: Well, I have some portable Scheme code; i.e. code that runs on a few implementations. In that code are some macros which intentionally break hygiene. So that rules out syntax-rules. Just about everybody supports

Re: [Chicken-users] define-macro in Chicken 4.0

2009-03-15 Thread felix winkelmann
On Sun, Mar 15, 2009 at 11:22 AM, Tobia Conforto tobia.confo...@gmail.com wrote: I wrote: (import-for-syntax matchable) (define-syntax define-macro  (lambda (m . _)    `(define-syntax ,(caadr m)       (lambda (e . _)         (match e           (,(cadr m) ,@(cddr m))) Eduardo, does

Re: [Chicken-users] define-macro in Chicken 4.0

2009-03-15 Thread Tobia Conforto
felix winkelmann wrote: Sorry, but this does not work. An identifier introduced by a previous (hygienic) macro expansion will not be correctly expanded. Does this mean that you can't mix define-macro macros (with my definition) and syntax-rules macros, or that two or more define-macro

Re: [Chicken-users] define-macro in Chicken 4.0

2009-03-15 Thread felix winkelmann
On Sun, Mar 15, 2009 at 12:31 PM, Tobia Conforto tobia.confo...@gmail.com wrote: felix winkelmann wrote: Sorry, but this does not work. An identifier introduced by a previous (hygienic) macro expansion will not be correctly expanded. Does this mean that you can't mix define-macro macros

Re: [Chicken-users] define-macro in Chicken 4.0

2009-03-14 Thread felix winkelmann
On Fri, Mar 13, 2009 at 8:48 PM, Eduardo Cavazos wayo.cava...@gmail.com wrote: Hello, Is there a way to define 'define-macro' in terms of the new explicit renaming macros of Chicken 4.0? Or is it offered somewhere and I just missed it? I know I know... 'define-macro' is bad. :-) But I have

Re: [Chicken-users] define-macro in Chicken 4.0

2009-03-14 Thread Eduardo Cavazos
On Fri, Mar 13, 2009 at 8:48 PM, Eduardo Cavazos wayo.cava...@gmail.com wrote: Is there a way to define 'define-macro' in terms of the new explicit renaming macros of Chicken 4.0? Or is it offered somewhere and I just missed it? I know I know... 'define-macro' is bad. :-) But I have a bunch

[Chicken-users] define-macro in Chicken 4.0

2009-03-13 Thread Eduardo Cavazos
Hello, Is there a way to define 'define-macro' in terms of the new explicit renaming macros of Chicken 4.0? Or is it offered somewhere and I just missed it? I know I know... 'define-macro' is bad. :-) But I have a bunch of code that I'd like to have just work in Chicken 4.0 and worry about

Re: [Chicken-users] define-macro in Chicken 4.0

2009-03-13 Thread John Cowan
Eduardo Cavazos scripsit: Is there a way to define 'define-macro' in terms of the new explicit renaming macros of Chicken 4.0? Or is it offered somewhere and I just missed it? Quick and dirty approach: For (define-macro name (lambda exp body ...)) read (define-syntax name (lambda (exp

Re: [Chicken-users] define-macro in Chicken 4.0

2009-03-13 Thread John Cowan
cowan scripsit: For (define-macro name (lambda exp body ...)) read (define-syntax name (lambda (exp junk-1 junk-2) body ...)) Ooopsie. Make that (define-syntax (er-macro-transformer (lambda ...))) -- John Cowanco...@ccil.org http://www.ccil.org/~cowan But no living man am I! You

Re: [Chicken-users] define-macro in Chicken 4.0

2009-03-13 Thread Tobia Conforto
Eduardo Cavazos wrote: Hello, Is there a way to define 'define-macro' in terms of the new explicit renaming macros of Chicken 4.0? Sure! (import-for-syntax matchable) (define-syntax define-macro (lambda (m . _) `(define-syntax ,(caadr m) (lambda (e . _) (match e