Hello!
Currently, 'pop' throws an exception if the collection is empty:

clojure.core/pop
([coll])
  For a list or queue, returns a new list/queue without the first
  item, for a vector, returns a new vector without the last item. If
  the collection is empty, throws an exception.  Note - not the same
  as next/butlast.

user=> (pop ())
java.lang.IllegalStateException: Can't pop empty list (NO_SOURCE_FILE:
0)
user=> (pop [])
java.lang.IllegalStateException: Can't pop empty vector
(NO_SOURCE_FILE:0)

Should (pop nil) also throw an exception or is returning 'nil' ok??
user=> (pop nil)
nil

Thank you, Frantisek
--~--~---------~--~----~------------~-------~--~----~
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 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