It's nasty because it could blow up with either exception or null -
neither of which we like in scala land!
Boxing values keeps things far more managable
Cheers, Tim
Sent from my iPhone
On 8 Jan 2010, at 21:52, Gang <wangga...@gmail.com> wrote:
Why is Box.open_! nasty? is it just returning the value held in Box?
Thanks_!
On Jan 8, 3:14 pm, David Pollak <feeder.of.the.be...@gmail.com> wrote:
On Fri, Jan 8, 2010 at 11:54 AM, harmanjd <harma...@gmail.com> wrote:
I am reading through the lift book to start getting an understanding
of lift.
I saw code like this
override def readPermission_? = true
override def writePermission_? = true
protected def i_obscure_!(in : BigDecimal) = defaultValue
protected def real_i_set_!(value : BigDecimal): BigDecimal = {
if (value != data) {
data = value
dirty_?(true)
}
data
}
Something that ends in _? should return a Boolean (readPermission_?
looks
more natural to me than hasReadPermission)
Something that ends in _! means "think twice before using this method
because it can do something nasty" like Box.open_! or Mapper.delete_!
My question is if there is some implied meaning by ending a field in
_! or not? It seems confusing as a newbie to have that when scala
has
an _ operator and a _*. I got confused with names like 'dirty_?'
and have to think 'is that an operator of some sort that I need to
lookup or is that just a name?
Thanks,
James
--
You received this message because you are subscribed to the Google
Groups
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to
liftweb+unsubscr...@googlegroups.com<liftweb
%2bunsubscr...@googlegroups.com >
.
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en.
--
Lift, the simply functional web frameworkhttp://liftweb.net
Beginning Scalahttp://www.apress.com/book/view/1430219890
Follow me:http://twitter.com/dpp
Surf the harmonics- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -
--
You received this message because you are subscribed to the Google
Groups "Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com
.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en
.
--
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en.