Hello, you have come here looking for the meaning of the word cons. In DICTIOUS you will not only get to know all the dictionary meanings for the word cons, but we will also tell you about its etymology, its characteristics and you will know how to say cons in singular and plural. Everything you need to know about the word cons you have here. The definition of the word cons will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofcons, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
cons (third-person singular simple presentconses, present participleconsing, simple past and past participleconsed)
(programming) 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.
1992, Peter Norvig, Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp, Morgan Kaufmann, →ISBN, page 62:
This version of length arises naturally from the recursive definition of a list: “a list is either the empty list or an element consed onto another list.”