[plt-dev] some Racket proposals & implementation

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Apr 6 12:04:56 EDT 2010

On Mon, Apr 5, 2010 at 1:25 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> So, I'm starting to think that we should leave `define-struct' alone
> (for backward compatibility) and use a different name for structure
> types in Racket...

I'm definitely in favor of that, since we go back to the
trivial-to-port and can have lots of "#lang racket" files in the
distribution from the get-go.

How about we just drop the word 'define' from 'define-struct'?

We could do something like this:

 (struct id maybe-super-id (field ...) option ...)

         maybe-super-id =
                        | super-id

where it generally looks like define-struct does now but without the
extra parens in the super case, and it binds the same things that
define-struct does now, except that 'id' becomes the maker instead of
'make-id'?

Given a different name, we have the opportunity to go with a more
radically different syntax (things like what were proposed here with
function arguments in the place where "(field ...)" above) but I'm not
sure that we should be spending our energy on that right now. Instead,
how about we just make sure we aren't precluding that extension in
this form and put it off until some time after Racket is officially
released?

Robby


Posted on the dev mailing list.