When working with the highly useful Can class from
net.liftweb.util
, the ?~
operator is equivalent to asking "is this Can empty?", but has the added bonus of returning a Failure object if it is. This makes for pleasantly terse expressions that handle failure cases inline.
2 comments:
Only nitpicking -- I don't think Scala has operators as such. ?~ is just a method on Can. A good choice of a language and framework! I am loving Scala as I am getting used to it. :)
Sure, technically ?~ is just a method on Can, but to the programmer it parses visually as an operator.
Post a Comment