Prepend vs Cons - What's the difference?
prepend | cons |
(computing, linguistics, transitive) To attach (an expression, phrase, etc.) to another, as a prefix.
(computing) A data structure in LISP that is a pair of pointers, car and cdr, used mainly for lists.
(computing) To obtain a list from a cons or a nesting of conses; to prepend an element to a list by forming a cons of that element and the list; to obtain a list from a smaller one by repeated application of such kind of prepending.
(con)
----
As verbs the difference between prepend and cons
is that prepend is (computing|linguistics|transitive) to attach (an expression, phrase, etc) to another, as a prefix or prepend can be (rare|transitive) to premeditate; to weigh up mentally while cons is (computing) to obtain a list from a cons or a nesting of conses; to prepend an element to a list by forming a cons of that element and the list; to obtain a list from a smaller one by repeated application of such kind of prepending or cons can be (con).As a noun cons is
or cons can be (computing) a data structure in lisp that is a pair of pointers, car and cdr, used mainly for lists.prepend
English
Etymology 1
From pre-'' + ''(ap)pend , by analogy with append .Verb
(en verb)Etymology 2
From pre-'' + Latin ''pendere ‘weigh’.See also
* append * prefixAnagrams
*cons
English
Etymology 1
Noun
(head)Etymology 2
Abbreviation of construct .Noun
(conses)Synonyms
* cons cellVerb
(es)- In addition to specifying the whole list at once using square brackets and commas, you can build them up piece by piece using the (:) operator. This process is often referred to as consing.