[plt-dev] some Racket proposals & implementation
On Apr 3, Jay McCarthy wrote:
> On Sat, Apr 3, 2010 at 3:47 PM, Eli Barzilay <eli at barzilay.org> wrote:
> > 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
Ah, that's would unuglify it.
> > 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.
Yeah, probably too much. (But to clarify the above "this thing" -- I
meant to say that regardless of what I'm saying, I like your
extensions.)
> > 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).
Right -- I'm only talking about multiple constructors.
> 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.
One with defaults and one without? One where fields are just filled
with `#f's?
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!