Ceylon doesn't do pattern matching, it does the simpler type casing.

In Scala, to say that something is a String, Int, or Exception you have to
create a sealed case class hierarchy - more or less that's the same thing as
what other languages (like ML and Haskell) call an algebraic datatype (ADT).


Anyway, in some of the slides King says Ceylon will let you say something
like

void foo(T param) given T satisfies String | Int | Exception

I can't remember the exact syntax and can't be bothered to look it up :)
 But whatever it is, the idea is that you don't necessarily have to create
an ADT to get simple things like that.  It's not huge, but seems nice.

Note that some of the slides indicate that Ceylon will also have full
ADT-like capability for when union types don't meet your needs.

On Wed, Apr 13, 2011 at 1:49 PM, Rémi Forax <[email protected]> wrote:

>
> Ok, call me stupid but I don't see the difference between Ceylon union
> types and
> Scala case classes and pattern matching:
> http://www.scala-lang.org/node/107
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "JVM 
Languages" 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/jvm-languages?hl=en.

Reply via email to