[racket] help with syntax-splicing in small macro

From: Eduardo Bellani (ebellani at gmail.com)
Date: Mon Sep 24 14:10:52 EDT 2012

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 <dyoo at hashcollision.org> wrote:
>
>> 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 #`(#, at attr-list)))]))
>>
>> But solving it directly through the template is much better.
>
>
> Hi Eduardo,
>
>
> But do you even need macros for the problem?  Could a plain vanilla function
> work as well?  I just want to make sure I understand why we're in macro-land
> in the first place.
>
>
> Good luck!



-- 
Eduardo Bellani

"Resolve to serve no more, and you are at once freed."

Posted on the users mailing list.