Re: [racket] help with syntax-splicing in small macro

2012-09-24 Thread Eduardo Bellani
You were right about not needing macros in that example Danny. A simple apply was all that I needed. I forgot that the struct constructor is a simple function, and I was trying to splice things needlessly. Thanks again. On Thu, Sep 20, 2012 at 4:14 PM, Danny Yoo wrote: > >> Thanks for the help. T

Re: [racket] help with syntax-splicing in small macro

2012-09-20 Thread Danny Yoo
> Thanks for the help. The domain was about trying to get the output of a > csv into > a struct. I had already solved (badly) the problem with > > (define-syntax list->tst > (syntax-rules () > [(_ attr-list) (apply tst (syntax->datum #`(#,@attr-list)))])) > > But solving it directly through t

Re: [racket] help with syntax-splicing in small macro

2012-09-20 Thread Eduardo Bellani
Hello Danny, Thanks for the help. The domain was about trying to get the output of a csv into a struct. I had already solved (badly) the problem with (define-syntax list->tst (syntax-rules () [(_ attr-list) (apply tst (syntax->datum #`(#,@attr-list)))])) But solving it directly through th

Re: [racket] help with syntax-splicing in small macro

2012-09-19 Thread Danny Yoo
On Wed, Sep 19, 2012 at 3:10 PM, Eduardo Bellani wrote: > Hello list. > > Could anyone give me a hand and explaing why this > > #lang racket > (struct tst (attr1 attr2)) > > (define-syntax (list->struct stx) > (syntax-case stx () > [(_ attr-list) #`(tst #,@attr-list)])) Do you have an exam

[racket] help with syntax-splicing in small macro

2012-09-19 Thread Eduardo Bellani
Hello list. Could anyone give me a hand and explaing why this #lang racket (struct tst (attr1 attr2)) (define-syntax (list->struct stx) (syntax-case stx () [(_ attr-list) #`(tst #,@attr-list)])) Fails? -- Eduardo Bellani "Resolve to serve no more, and you are at once freed." __