Clojure-Learn

Follow clojure.core’s example for idiomatic names like pred and coll.

in fns

  • f, g, h - function input

  • n - integer input usually a size

  • index - integer index

  • x, y - numbers

  • s - string input

  • coll - a collection

  • pred - a predicate closure

  • & more - variadic input

in macros

  • expr - an expression

  • body - a macro body

  • binding - a macro binding vector


first and rest are defined in terms of position, and work on anything that can be treated as an ordered collection

peek and pop work in terms of "natural insertion order" and only work with things that behave like a stack - (so not lazy-seqs, strings, etc.)

lists push and pop from the front, vectors push and pop from the end, queues push to one end, pop from the other