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

From: Patrick Mahoney (paddy.mahoney at gmail.com)
Date: Fri Aug 17 16:02:47 EDT 2012

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 :)


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120817/da13586a/attachment.html>

Posted on the users mailing list.