Re: [racket] Simplified scut-like macro

2012-02-23 Thread Paul Pereira
Thanks Jay and Gary, I remember seeing something like this in an APL variant and it was one of the few features I didn't know how to translate into scheme. Cheers, Paul Pereira On 23 February 2012 14:36, Jay McCarthy wrote: > I think you should look at the Macro Stepper output for your failing

Re: [racket] Simplified scut-like macro

2012-02-23 Thread Jay McCarthy
I think you should look at the Macro Stepper output for your failing example, because you'll see that the code that references y appears in the branch that doesn't have access to a y. You'd want to do something in the macro to determine which function to compile to. Jay p.s. I'm glad you like sup

Re: [racket] Simplified scut-like macro

2012-02-22 Thread Gary Baumgartner
#lang racket (define-syntax (fun stx) (syntax-case stx () ((fun body rest ...) (with-syntax ((x (datum->syntax #'body 'x)) (y (datum->syntax #'body 'y)) (z (datum->syntax #'body 'z))) (let ([y? (identifier-binding #'y)] [z? (iden