Hi,

Am 15.11.2010 um 17:52 schrieb Chris:

> If you have a function that needs to treat multiple arguments as a
> group, what forces drive you to represent this as a single sequence
> argument vs. an "&" argument?  To give a concrete example, why does
> "+" work like
> 
> (+ 1 2 3 4)
> 
> instead of
> 
> (+ [1 2 3 4])
> 
> Is it performance?  Aesthetics?  Composability concerns?  Not having
> to call "apply" all the time?

Semantics?

+ is a binary operator. Allowing more arguments is a convenience I guess. The 
mathematically honest definition would have arity 2.

Eg. filter on the other hand acts on a sequence. That's why it is not defined 
as (filter even? 1 2 3 4). (See also map for example where apply wouldn't help.)

Does this make sense?

Sincerely
Meikel

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to