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 <[email protected]> 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

