Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does "::" mean in Scala ? [duplicate]

Tags:

symbols

scala

What does :: mean here ?

listeners ::= listener
list = num :: list

Specially I don't understand the "::" operator.

like image 686
Gamoonbi Avatar asked Feb 22 '15 07:02

Gamoonbi


1 Answers

Its the list cons operator. It creates a new list whose head is first argument and whose tail is contents of the second argument.

like image 113
Gil Avatar answered Sep 27 '22 19:09

Gil