[plt-dev] some Racket proposals & implementation

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Sat Apr 3 18:03:23 EDT 2010

On Sat, Apr 3, 2010 at 3:47 PM, Eli Barzilay <eli at barzilay.org> wrote:
> When I try this, I get
>
>  context expected 1 value, received 2 values: ()
>  #<syntax:/home/eli/tmp/sstruct.ss:31:12 ()>

That's what the patch to syntax/parse fixes

> One thing that bugs me in all of this is that it's very much like a
> function definition, except that with the name outside the parens it
> reminds me of `defun'.  Perhaps something like changing
>
>  (define-struct a (x #:y [y x]))
>
> to
>
>  (define-struct (a x #:y [y x]))
>
> which will look ugly with a super struct,

We could do _that_ but drop the super struct syntax and use #:super

> so maybe a more drastic jump:
>
>  (define (a x #:y [y x]) #:struct)
>
> But I like this thing in any case.

Blasphemy!

I can imagine getting used to it but it looks too weird for me right now.

> One more thing that might make sense is to make a few constructors?

Right now my code errors with multiple #:constructor, #:predicate,
#:mutator, or #:accessor args. They aren't a problem but it's just as
easy for the user to put in a (define new-mutator old-mutator).

Is what you mean to have different constructor styles? I can see sense
in having a constructor that is purely positional and doesn't support
the default args and another that has kws and defaults. I'm not sure
what other styles could mean.

Jay

-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93


Posted on the dev mailing list.