Skip to content

clojure.core/drop-last

View this page on ClojureDocs

Type: function Added: Clojure 1.0 Examples: 2 Runnable: 1
([coll] [n coll])

Return a lazy sequence of all but the last n (default 1) items in coll

Examples

by zmila on
by Crowbrammer on . May have evaluation errors.

Note by huahaiy

drop-last is lazy and implemented with map, whereas butlast is not lazy and implemented with loop and recur.

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.