Linked Questions

441 votes
12 answers
140k views

Scala syntax has a lot of symbols. Since these kinds of names are difficult to find using search engines, a comprehensive list of them would be helpful. What are all of the symbols in Scala, and what ...
0__'s user avatar
  • 67.5k
20 votes
2 answers
17k views

I meet some scala code with "?" but do not know what it mean in scala, could anyone explain it to me ? Thanks. And here's one example def getJobId(conf: Configuration): String = ?(conf.get("...
zjffdu's user avatar
  • 29.7k
4 votes
5 answers
3k views

I often find myself doing things like: println(foo) when I'd like to do: println foo The compiler does not allow this. Also, println is a mouthful, I really just want to say: echo foo So, in a ...
virtualeyes's user avatar
  • 11.3k
5 votes
2 answers
9k views

Why are special characters (except underscore) not allowed in variable names of programming languages? Is there a reason related to computer architecture or organisation?
user3287367's user avatar
3 votes
2 answers
5k views

I know that scala allows overloading for it's default operators (+, - ! etc.) . Is it possible to define custom operators and make something like the |.| operator so that | -3| that evaluates to 3. Or ...
user2887596's user avatar
2 votes
3 answers
726 views

i tried type ?[_] = Option[_] def f(x: ?[Int]) = for (y <- x) yield y (but i don't know what i am doing.) insofar as types are just objects, i should be able to define a postix operator (i.e. ...
sam boosalis's user avatar
  • 1,997
6 votes
2 answers
2k views

Why this fails to compile: scala> val a? = true <console>:1: error: illegal start of simple pattern val a? = true ^ and this works? scala> val a_? = true a_?: Boolean = ...
Rogach's user avatar
  • 27.5k
0 votes
1 answer
359 views

I want to write some code for currency stuff, so I try to use € for some nice postfix notation. But I get this compiler error Error:(46, 9) illegal character '\u20ac' def € = EUR ^ Am I doing ...
Nabil A.'s user avatar
  • 3,400
0 votes
1 answer
249 views

Just saw an example that looks like the following: val b_* = grater[Book].asObject(dbo) What is the significance of the asterisk in b_* here? What's the name for it in Scala and what affect does it ...
randombits's user avatar
  • 48.7k
1 vote
2 answers
82 views

I am often in the situation of doing this type of filtering: allPeople .filter(person => englishPeopleIds contains person.id) and it would make my life easier and my code more readable if there ...
MoutonGros's user avatar