Scala has symbols - names that start with a single quote \' and which are a kind of string constants.
I know symbols from Ruby (where they start with a colon). In Ru
I can name one case when symbols are really used in Scala. Play 2.2 uses anorm to access database. Here goes a code sample for the simple add entity method:
def add(e:Entity): Option[Long] = {
DB.withConnection {implicit conn =>
SQL("insert into ENTITY(name, description) values({name}, {description})").on('name -> e.name, 'description -> e.description).executeInsert()
}
}
so you can see the usage of symbols in the .on(bla bla bla) It is also absolutely valid to use String literals instead of symbols and some guys are doing so, but in the anorm source code the corresponding method signature really use Symbol paremeter type.