[racket] keyword initialization of structs?

From: Tom McNulty (tom.mcnulty at gmail.com)
Date: Mon Mar 5 13:58:18 EST 2012

There's an example macro to do this here, although it'll only work for structures you define.

http://www.mail-archive.com/users@racket-lang.org/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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.racket-lang.org/users/archive/attachments/20120305/7039e846/attachment.sig>

Posted on the users mailing list.