Just ran into this sample code learning about Commands in Scalatra:
protected def handle: Handler = {
case c: CreateTodoCommand =>
add(newTodo(~c.name.value))
}
In this particular case, what exactly is the relevance of ~
in ~c.name.value
? Not sure where to find more documentation on this particular symbol.
In Scala:
~x
translates to
x.unary_~
(this also applies to +
,-
and !
as explained in this post). So your example translates to:
add(newTodo(c.name.value.unary_~))
The documentation can hence be found at the type of value
.