I read some java source code which including Scala source code.
I found Nil.$colon$colon(Object arg)
What does keywords $colon
mean?
And what does this line mean?
$colon is a mangling for the symbol :. Since : (and other letters) is an illegal letter in java for method names but allowed in scala, a strategy is needed to encode it into a legal name. Hence, the $colon
Here your code translate to arg :: Nil which adds arg to the empty list, constructing a List with arg as single element.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With