Haxe Pattern Matching Syntax

Showing 1-6 of 6 messages
Haxe Pattern Matching Syntax Laurence Taylor 12/8/12 1:55 AM
Is there any description of the pattern matching syntax anywhere? 
abstract types too, as I'm at it.

regards,
Laurence
Re: [haxe] Haxe Pattern Matching Syntax Simon Krajewski 12/8/12 1:57 AM
Am 08.12.2012 10:55, schrieb Laurence Taylor:
> Is there any description of the pattern matching syntax anywhere?
> abstract types too, as I'm at it.

I will write a full description once the syntax is final, but this gist
should show the gist of it: https://gist.github.com/6dede0058961cb3ba6ab

Simon
Re: [haxe] Haxe Pattern Matching Syntax Laurence Taylor 12/8/12 2:03 AM
brilliant, thanks


Re: [haxe] Haxe Pattern Matching Syntax Laurence Taylor 12/8/12 2:20 AM

Is it limited to macros? I've tried lensing through enums, and the 'in' syntax

case Enum1(Enum2(s) : trace(s);//"Unknown Identifier"
case Enum1(s) in (s == 'wotcha') : s; //This expression is not allowed outside a for loop

regards,
Laurence

Re: [haxe] Haxe Pattern Matching Syntax Simon Krajewski 12/8/12 2:21 AM
Am 08.12.2012 11:20, schrieb Laurence Taylor:

Is it limited to macros? I've tried lensing through enums, and the 'in' syntax

case Enum1(Enum2(s) : trace(s);//"Unknown Identifier"
case Enum1(s) in (s == 'wotcha') : s; //This expression is not allowed outside a for loop

Do you have -D pattern_matching in place?

Simon
Re: [haxe] Haxe Pattern Matching Syntax Laurence Taylor 12/8/12 2:22 AM
thought there might be a compiler switch,
thanks

On Sat, Dec 8, 2012 at 11:21 AM, Simon Krajewski <si...@haxe.org> wrote:
have -D pattern_matching