Re: A trivial question about type and class

2008-11-06 Thread Chanwoo Yoo
I really appreciate your answer... and exciting 'Clojure', Rich. :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from t

Re: A trivial question about type and class

2008-11-06 Thread Chanwoo Yoo
Thanks hoeck and mb for your detailed explanation! Now I can understand your points. :) It's so exciting to read 'Programming Clojure', and I'm really happy that 'a lisp book' is printed from 'The Pragmatic Programmers', which is my favorite book publisher. --~--~-~--~~~---

Re: A trivial question about type and class

2008-11-06 Thread Rich Hickey
On Nov 6, 7:50 am, mb <[EMAIL PROTECTED]> wrote: > Hi, > > On 6 Nov., 13:30, Chanwoo Yoo <[EMAIL PROTECTED]> wrote: > > > > Is {:a 1} not a hash-map? It seems that there is some inconsistency... > > Clojure holds promises about the interface and the performance > characteristics of the provided

Re: A trivial question about type and class

2008-11-06 Thread mb
Hi, On 6 Nov., 13:30, Chanwoo Yoo <[EMAIL PROTECTED]> wrote: > > Is {:a 1} not a hash-map? It seems that there is some inconsistency... Clojure holds promises about the interface and the performance characteristics of the provided functions. In general Clojure is a lot about abstract interfaces.

Re: A trivial question about type and class

2008-11-06 Thread hoeck
On Nov 6, 8:27 am, "Michael Wood" <[EMAIL PROTECTED]> wrote: > On Thu, Nov 6, 2008 at 8:25 AM, Chanwoo Yoo <[EMAIL PROTECTED]> wrote: > > > Hi all. In Stuart's book - Programming Clojure, there is a multi > > method like following: > > > (defmulti blank? class) > > (defmethod blank? String [s] (

Re: A trivial question about type and class

2008-11-06 Thread Chanwoo Yoo
Aha, I'm sorry for my laziness and spamming. {:a 1} is not a hash-map. I guess there is some reason of performance about this... Anyway, as mac pointed out, dispatching based on types will be inappropriate to clojure data structures. Thank you mac for the thread link~ user> (class {:a 1}) #=cloju

Re: A trivial question about type and class

2008-11-06 Thread Chanwoo Yoo
Thanks~ "clojure.lang.PersistentHashMap" works~ :) But I feel something is strange.. See next code, especially arrowed line. user> clojure.lang.PersistentHashMap #=clojure.lang.PersistentHashMap user> (= (class {:a 1 :b 2}) clojure.lang.PersistentHashMap) true user> (= (class {}) clojure.lang.Per

Re: A trivial question about type and class

2008-11-05 Thread Michael Wood
On Thu, Nov 6, 2008 at 8:25 AM, Chanwoo Yoo <[EMAIL PROTECTED]> wrote: > > Hi all. In Stuart's book - Programming Clojure, there is a multi > method like following: > > (defmulti blank? class) > (defmethod blank? String [s] (every? #{\space} s)) > (defmethod blank? nil [_] true) > > After reading

Re: A trivial question about type and class

2008-11-05 Thread mac
On 6 Nov, 07:25, Chanwoo Yoo <[EMAIL PROTECTED]> wrote: > Hi all. In Stuart's book - Programming Clojure, there is a multi > method like following: > > (defmulti blank? class) > (defmethod blank? String [s] (every? #{\space} s)) > (defmethod blank? nil [_] true) > > After reading the method, I wa

A trivial question about type and class

2008-11-05 Thread Chanwoo Yoo
Hi all. In Stuart's book - Programming Clojure, there is a multi method like following: (defmulti blank? class) (defmethod blank? String [s] (every? #{\space} s)) (defmethod blank? nil [_] true) After reading the method, I was curious about type or class of native data structures of Clojure. So