[racket] Size matters

From: Laurent (laurent.orseau at gmail.com)
Date: Mon Jun 10 09:58:14 EDT 2013

On Mon, Jun 10, 2013 at 3:46 PM, Sam Tobin-Hochstadt <samth at ccs.neu.edu>wrote:

> On Mon, Jun 10, 2013 at 9:09 AM, Matthias Felleisen
> <matthias at ccs.neu.edu> wrote:
> >
> > On Jun 10, 2013, at 8:51 AM, Laurent wrote:
> >
> > On Sun, Jun 9, 2013 at 7:54 PM, Matthias Felleisen <matthias at ccs.neu.edu
> >
> > wrote:
> >>
> >>      (struct-open item item1 weight value volume)
> >
> >
> > I would love to see such an addition to core Racket!
> >
> > It's on my todo-list.
>
> I don't understand what's better about `struct-open` than:
>
>     (match-define (item weight value volume) item1)
>
> which is a far more general form. I don't think we should add a
> version of `match-define` specialized for structs unless there's a
> particular need for it.
>

Yeah, you're probably right; There's no real need when you have
 `match-define'. Though I prefer the order of the arguments in
`struct-open', because in general I write the `item1' first and then
go back to writing the new bindings. (Which is true also for
`define': in general I write/think about the expression first, and only
then the name of the identifier.)

Laurent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130610/f7ebc761/attachment.html>

Posted on the users mailing list.