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 :)<br>
<br>-Patrick<br><br><div class="gmail_quote">On 17 August 2012 14:52, Danny Yoo <span dir="ltr"><<a href="mailto:dyoo@hashcollision.org" target="_blank">dyoo@hashcollision.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br><br>On Friday, August 17, 2012, Rouben Rostamian wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is there the equivalent of Common Lisp's /structure/ type in<br>
Racket? I looked through Racket's User Guide and Reference<br>
manuals but did not see something similar, although it's<br>
quite possible that I saw one but did not recognize it.<br><br></blockquote><div><span><br></span></div></div><div><span dir="ltr">Racket's default structure constructors are functions with positional arguments. </span><span>Racket does support functions with optional keyword arguments,</span><div>
</div><div><br> <a href="http://docs.racket-lang.org/guide/lambda.html#%28part._lambda-keywords%29" target="_blank">http://docs.racket-lang.org/guide/lambda.html#(part._lambda-keywords)</a></div><div><br></div><div>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.<span></span></div>
</div>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br>