I'm assuming you know that it has a third, Failure state, and you're asking 
about the names.
I guess open_! is in keeping with the metaphor of a box (or originally, a can). 
The _! is Lift's way of saying, Danger! And I guess 'or' is just shorter. (Lift 
tends to put practicality before academic functionalness etc.)

-------------------------------------
Daniel Spiewak<[email protected]> wrote:

I'm sure this has been discussed before, but I'm curious as to the
rationale for the Box ADT.  I'm most distressed by the fact that it
seems to be masquerading as a drop-in Option replacement, and yet the
mathematical properties of the ADT are widely divergent.  What's more,
the API is very, very different, leading to a great deal of confusion
whenever I'm working with code which touches both ADTs (as I often
do).  Things like `or` vs `orElse`, `open_!` vs `get` and so on are
very confusing.  The implicit conversion Box[A] => Option[A] doesn't
help either, since it means I can easily forget and use Option methods
on Box values, accidentally triggering a conversion.

The whole `or` vs `orElse` thing is particularly annoying since I
spend a fair amount of time wading through research which discusses
the `orElse` function in its abstract monadic sense.  Given the
standard nature of the name (dating back long before Scala), I'm
surprised that Box went with something else.

I'm sure there are good reasons for all of this, I would just like to
know what they are.  :-)

Daniel

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to