[racket] Are there Racket structures similar to Common Lisp's?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Aug 17 16:39:28 EDT 2012

Absolutely! 

On Aug 17, 2012, at 4:02 PM, Patrick Mahoney wrote:

> I like the idea of having optional keyword arguments available in struct field construction. In many cases, I find it more declarative upon reading the code, though input takes longer. I just tend to recall names better than constructor/argument order. It could help to understand the code if the struct declaration is located further away from the site of struct construction as well, especially if there is a different problem in the source that prevents syntax colouring from succeeding and thus the handy DrRacket file and module navigation from being available :)
> 
> -Patrick
> 
> On 17 August 2012 14:52, Danny Yoo <dyoo at hashcollision.org> wrote:
> 
> 
> On Friday, August 17, 2012, Rouben Rostamian wrote:
> Is there the equivalent of Common Lisp's /structure/ type in
> Racket?  I looked through Racket's User Guide and Reference
> manuals but did not see something similar, although it's
> quite possible that I saw one but did not recognize it.
> 
> 
> Racket's default structure constructors are functions with positional arguments.  Racket does support functions with optional keyword arguments,
> 
>     http://docs.racket-lang.org/guide/lambda.html#(part._lambda-keywords)
> 
> so it should be technically possble to do what Common Lisp does here.  Other responses to this thread show some macros to autogenerate a helper function that uses keyword arguments.
> 
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
> 
> 
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120817/cdb61606/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4373 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20120817/cdb61606/attachment-0001.p7s>

Posted on the users mailing list.