Understanding the quoting of a symbol in a list

2012-01-03 Thread Bill Caputo
Hi All, So, I've been doing some experimentation in order to better understand the reader, and I can't figure out why I get the following results for these four calls: = ('foo); ((quote foo)) java.lang.IllegalArgumentException: Wrong number of args (0) passed to: Symbol

Re: Understanding the quoting of a symbol in a list

2012-01-03 Thread nchurch
If I could hazard a guess, it has to do with symbol lookup in maps. Try the following: ('foo {'foo 1}) ('foo {'bloo 1} 4) when you do ('foo 1), it can't find foo in 1 (because it isn't there, and 1 isn't even a map), so it returns nil. If you do ('foo 1 2), you've just provided a default

Re: Understanding the quoting of a symbol in a list

2012-01-03 Thread JuanManuel Gimeno Illa
I'm not 100% sure but this is a side effect of the property that symbols can be used as functions that find themselves on maps. For instance: (def m {'a 1 'b 2 'c 3}) ('a m) ;= 1 ('b m) ;= 2 and, when the symbols is not found, we have: ('d m) ;= nilurn ('d m :nono) ;= :nono So a symbol is a

Re: Understanding the quoting of a symbol in a list

2012-01-03 Thread Bill Caputo
On Tue, Jan 3, 2012 at 2:11 PM, JuanManuel Gimeno Illa jmgim...@gmail.com wrote: I'm not 100% sure but this is a side effect of the property that symbols can be used as functions that find themselves on maps. Thanks Juan Manuel - that's the thing I was missing (and thanks for the source link).