[racket] Maybe a silly question: Why racket don't have aconstructor?

From: Chen Xiao (chenxiao770117 at gmail.com)
Date: Thu Dec 20 00:43:58 EST 2012

Get it! Thanks.

2012/12/20 Mike G. <mikeg at psg.com>

> > class: field element is not an optionally renamed identifier-expression
> > pair
> >   at: ((x 10))
> >   in: (class object% (super-new) (displayln "hello world") (field ((x
> > 10)))
> > (displayln x))
>
> There was an extra pair of parentheses around (x 10).  Try this:
>
> (new (class object%
>        (super-new)
>        (displayln "hello world")
>        (field [x 10])
>        (displayln x)))
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20121220/972b0af8/attachment.html>

Posted on the users mailing list.