[Chicken-users] struggling with macros

2012-11-11 Thread Răzvan Rotaru
Hi, I'm trying to write a simple javascript DSL, and got stuck in the macros :). (I'm coming from lisp macros) Take for example this one: (define-syntax js (ir-macro-transformer (lambda (expr inject compare) (let ((body (cdr expr)) (next (cadr expr))) (printf next=~a~n next)

Re: [Chicken-users] struggling with macros

2012-11-11 Thread Peter Bex
On Sun, Nov 11, 2012 at 01:23:13PM +0100, Răzvan Rotaru wrote: Hi, Hi! I'm trying to write a simple javascript DSL, and got stuck in the macros :). (I'm coming from lisp macros) Take for example this one: (define-syntax js (ir-macro-transformer (lambda (expr inject compare)

Re: [Chicken-users] struggling with macros

2012-11-11 Thread Răzvan Rotaru
On 11 November 2012 13:30, Peter Bex peter@xs4all.nl wrote: On Sun, Nov 11, 2012 at 01:23:13PM +0100, Răzvan Rotaru wrote: Hi, Hi! I'm trying to write a simple javascript DSL, and got stuck in the macros :). (I'm coming from lisp macros) Take for example this one:

Re: [Chicken-users] struggling with macros

2012-11-11 Thread Peter Bex
On Sun, Nov 11, 2012 at 02:24:17PM +0100, Răzvan Rotaru wrote: On 11 November 2012 13:30, Peter Bex peter@xs4all.nl wrote: Yes, behaviour is correct, but implementation is not complete, hence the next version of js-macro. You're trying to use MAP on a macro. That's not possible because

Re: [Chicken-users] struggling with macros

2012-11-11 Thread Kristian Lein-Mathisen
Hi Răzvan, Just as a side-note: It may be a good idea to play around with your implementation as a normal function, and them wrap that in a macro once it's up on its feet. That way you can isolate problems with your implementation and problems with the macros. This approach is taken by the bind