Logo

Programming-Idioms

History of Idiom 165 > diff from v57 to v58

Edit summary for version 58 by misha:
[Clojure] rename argument

Version 57

2020-04-30, 09:17:13

Version 58

2020-04-30, 09:19:39

Idiom #165 Last element of list

Assign to variable x the last element of list items.

Idiom #165 Last element of list

Assign to variable x the last element of list items.

Code
(peek coll)
Code
(peek items)
Comments bubble
When coll is a vector or queue, because last would be linear time.
Comments bubble
When items is a vector or queue, because last would be linear time.
Doc URL
https://clojure.org/reference/data_structures#Vectors
Doc URL
https://clojure.org/reference/data_structures#Vectors