On Sun, Apr 26, 2009 at 7:45 AM, [email protected] <
[email protected]> wrote:

>
> > The type of a if expression (without and else) is always Unit.  Unit is
> > always blank in XML, and thus you never get anything.
>   Why ?? It doesn't make sense??


What is the type of the expression:

if (someBoolExpr) "Hello"

It can't be String, because if the test fails, what value is returned by the
expression.

An if without an else has the expression type of Unit.


>
>
>  With an "else" then you get a type, isn't it a bit magical ?


Not at all.  The if without else expression has no meaningful return value,
thus Unit.


>
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~---------~--~----~------------~-------~--~----~
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