[racket] keyword initialization of structs?

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Mon Mar 5 15:20:31 EST 2012

And something more powerful:

https://github.com/jeapostrophe/exp/blob/master/sstruct-tests.ss

Jay

On 3/5/12, Tom McNulty <tom.mcnulty at gmail.com> wrote:
> There's an example macro to do this here, although it'll only work for
> structures you define.
>
> http:[email protected]/msg03392.html (See
> Matthias' response)
>
> I recall this example quite well, as it was very helpful when I was learning
> Racket macros.
>
>
> On 2012-03-05, at 8:16 AM, Dmitry Pavlov wrote:
>
>> Hello,
>>
>> I was wondering if Racket's struct instances can be initialized
>> with keywords, like in the following example written in CL:
>>
>>
>> * (defstruct foo bar baz)
>> FOO
>>
>> * (make-foo :bar 1 :baz 2)
>> #S(FOO :BAR 1 :BAZ 2)
>>
>>
>> Best regards,
>>
>> Dmitry
>> ____________________
>> Racket Users list:
>> http://lists.racket-lang.org/users
>
>


-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

Posted on the users mailing list.