[nem-en] Re: match on specific parameter

Kamil Skalski kamil.skalski at gmail.com
Sun Jan 29 19:33:58 CET 2006


>
>  yeah, I was just thinking about something like that.
>  but on the 1st parameters, seems more intuitive than going backwards from
> the last ones.
>
>  tt( a, b, c )
>   | (1, true) => ...
>   | (-1, true) => ...
>   | (0, false) => ...
>
>  would match on a & b ?
>  it could get complicated (compiler wise) when you factor in 'which params
> inference' on top of type inference ??

Currently it is done very early in parser, so it is not a problem. But
this this implicit matchin on *some* parameters is it not clear if we
have:

tt( a : int * bool, b, c)
   |  (1, true) =>  // match only on a

or

tt (a : int, b : bool, c)
  | (1, false) => // match on a & b


--
Kamil Skalski
http://nazgul.omega.pl



More information about the devel-en mailing list