sergiotaborda / lense-lang

The Lense Language Compiler
1 stars 0 forks source link

Switch with mapping features #30

Open sergiotaborda opened 8 years ago

sergiotaborda commented 8 years ago

The switch directive should be capable of more feature the just matching numbers and strings.

Possibilities include checking an interval and checking a type

switch (x) {
    case (value)   {
         // run if the value of x is "value". "value" does not need to be a constant
    } 
   case  in ( interval ) {
       // run if interval contains x
   }
   case is String  {
           // run if x is a String
   }
}