Re: Why the need for an explicit new operator in Clojure?

165 views
Skip to first unread message
Message has been deleted

Gary Trakhman

unread,
May 16, 2013, 3:23:13 PM5/16/13
to clo...@googlegroups.com
speculating, 'new' might be more convenient for code-gen, in the same way that (. obj func) is more convenient than (.func obj)


On Thu, May 16, 2013 at 8:57 AM, Andrew McAuliffe <a...@mca.id.au> wrote:
Hi.

My understanding of Java (or jvm) is that you can not call a constructor without using a new operator. Why then (even with the suffix dot syntactic sugar notation) is the new operator required explicitly at all? What are the disadvantages to having it implicit?

Thanks in advance
amca

--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Meikel Brandmeyer (kotarak)

unread,
May 17, 2013, 1:43:00 AM5/17/13
to clo...@googlegroups.com
Hi,

how do you distinguish between accessing the class itself and creating a new instance of it?

Meikel

Timothy Baldridge

unread,
May 17, 2013, 1:48:19 AM5/17/13
to clo...@googlegroups.com
>>how do you distinguish between accessing the class itself and creating a new >>instance of it?

(Foo. 42)

vs 

(instance? Foo 42)

Is that what you mean?

Timothy

--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
“One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.”
(Robert Firth)

Meikel Brandmeyer (kotarak)

unread,
May 17, 2013, 1:50:42 AM5/17/13
to clo...@googlegroups.com
Yes. But I guess I misunderstood the OP rereading the original post again.

(Foo 42) vs. (instance? Foo 42) was my understanding (so no operator), but I guess it's more about (new Foo 42) vs. (Foo. 42).
Reply all
Reply to author
Forward
0 new messages