[racket-dev] Instantiation syntax of `new`

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sun Feb 3 11:03:51 EST 2013

I wouldn't worry too much about make-object and instantiate since they
exist essentially only for backwards compatibility.

Robby



On Sun, Feb 3, 2013 at 10:00 AM, Asumu Takikawa <asumu at ccs.neu.edu> wrote:

> On 2013-02-03 10:50:31 -0500, Tony Garnock-Jones wrote:
> > How about
> >
> > (inst c% 1 2 3)
> > (inst c% #:x 1 #:y 2)
> > (inst c% 1 2 #:z 3)
> > ;; not sure what to do about the last one
>
> I considered something like this, where the keyword's symbolic name is
> just used for the corresponding init arg (so it's backwards compatible)
> and you could write
>
>   (class object%
>     (super-new)
>     (init-field #:x 5))
>
> for example.
>
> It seems like it could just be more of a mess, though, since it then
> offers a fourth way to instantiate classes. It would be nicely
> compatible with function syntax though.
>
> Matthias also suggested in passing a `new` that uses a special marker:
>
>   (new c% [z 3] % 1 2)
>   (new c% % 1 2 3)
>
> to make it unambiguous. I'm not sure if this has enough advantages over
> `instantiate` (aside from the name) though.
>
> Cheers,
> Asumu
> _________________________
>   Racket Developers list:
>   http://lists.racket-lang.org/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20130203/52617e4b/attachment.html>

Posted on the dev mailing list.