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
> 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
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
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
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."
__
5 matches
Mail list logo