On Thu, Jun 28, 2012 at 7:32 PM, Warren Lynn <wrn.l...@gmail.com> wrote:

> This is an off-shoot subject from my last post "General subsequence
> function".
>
> I found people had similar questions before (one year ago):
>
> http://groups.google.com/group/clojure/browse_thread/thread/712711f049507c63/aea7cf438aa22922
>
> As of Clojure 1.4, seems nothing changed, as "source" show here:
>
> user> (source last)
> (def
>  ^{:arglists '([coll])
>    :doc "Return the last item in coll, in linear time"
>    :added "1.0"
>    :static true}
>  last (fn ^:static last [s]
>         (if (next s)
>           (recur (next s))
>           (first s))))
>
> Any reason for that? Thanks.


Don't hold your breath. Assume that the language was designed after much
consideration. last is a sequence operation, not a collection operation. If
the distinction doesn't make sense, I suggest you explore the design
decision by writing some non-trivial Clojure code so you can arrive at your
own satisfying answer why this was done. Otherwise you'll just listen to
people repeat the same answer without hearing what is being said.

David

-- 
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