i believe that one of the best ways to learn a new programming
language is to read software written in it

when reading Scala code, I rarely say "i don't understand how that
works" and when I do, there's usually a good explanation of it
somewhere on the web.

usually I find myself asking "where is that defined?" or "what part of
the language is that?"

Scala is not like, for example, BASIC, where you can look up FOR, IF/
THEN/ELSE. there's lots of individual and compound punctuation marks
that are very difficult to search for online and in PDFs (try
searching for "!").

a lot of scala also relies on syntactic sugar, such as omitted types
(no ": T" after a val/var/def); the dreaded underbar; operator
overloading; and implicit conversions. you can hate on Java's
verbosity (i know i have), but brevity has its own difficulties.

On Oct 22, 11:44 pm, Naftoli Gugenheim <naftoli...@gmail.com> wrote:
> The last use of _, as in empty_?, is not a special scala meaning. As on Java, 
> underscores can be part of an identifier. Scala takes advantage of this to 
> combine letters and symbols in one name. These names, like empty_?, are a 
> Lift convention, as well as ..._! for use-with-care methods. The scala 
> library uses isEmpty. David, is it your original convention?.
> -------------------------------------
> tiro<tim.romb...@googlemail.com> wrote:
> > override def validations = validPriority _ :: super.validations
> funny, I had stumbled on exactly the same line of code when beginning.
> Took me more than a day to understand what's going on. Especially
> because when you copied code from the PDF version of the Liftbook/Lift
> getting started guide, it would mess up spaces, so I would keep
> loooking for a "_::" operator.
> The Scala guys have really pushed it a bit hard on the use of the
> underscore. At least four different uses:
> - "it" for defining anonymous functions like above
> - default value
> - matching placeholder whose value is ignored
> - use for constructing setter method names boolean functions (empty_?)
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to