Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In FunctionalJava.List, what does "snoc" mean?

FunctionJava's List class has a snoc method that does append: snoc

The description is as follows:

Appends (snoc) the given element to this list to produce a new list.

What does the word "snoc" here mean? I have tried to look it up in Wikipedia and as an acronym with no success. Does this mean it is doing some special kind of append?

Edit: Thanks all for pointing me to cons

like image 844
John B Avatar asked Oct 06 '11 12:10

John B


2 Answers

It's "cons" reversed as cons prepends, snoc appends.

cons originates from Lisp, I think.

like image 51
egaga Avatar answered Oct 18 '22 01:10

egaga


The name snoc is cons backwards.

Hope this helps.

http://jlambda.com/~iop/GraphicsActor2D/doc/g2d/jlambda/List.html

like image 5
Sean Chapman Avatar answered Oct 18 '22 00:10

Sean Chapman