Ah, thank you.

So what are the use cases for defrecord and deftype, now?

Earlier Rich Hickey said we should prefer deftype to defstruct
unconditionally.  Is this role now played by defrecord?  And if so,
will defstruct be deprecated?

And where should deftype be used instead?



On Apr 18, 10:53 am, David Nolen <[email protected]> wrote:
> On Sun, Apr 18, 2010 at 1:49 PM, Rob Lachlan <[email protected]>wrote:
>
> > For deeftype, has the syntax for field accessors changed too?
>
> > I can't get it to work:
>
> > user> (deftype someType [b f])
> > user.someType
> > user> (def y (new someType 2 3))
> > #'user/y
> > user> (:b y)
> > nil
> > user> (:f y)
> > nil
>
> > defrecord works as expected, though.
>
> deftype now generates a Java class.
>
> (.b y)
> (.f y)
>
> should work
>
> David
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group 
> athttp://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to