[e-lang] Atomic expansion of MatchBindExpr to trinary-define

Dean Tribble tribble at deantribble.com
Mon May 1 11:40:12 EDT 2006


If the kernel pattern match is non-atomic, then the expansion could be:

# (def a := b) || (def c := d)
keyword if (def a := b) {
     keyword __brokenFromBooleanFlow =~ &c
     [&c, &a, true]
} else {
     if (def c := d) {
         keyword __brokenFromBooleanFlow =~ &a
         [&c, &a, true]
     } else {
         __makeBooleanFlowFailure(2)
     }
} =~ [&c, &a, ==true]

where the two failure methods provide "false" as the last argument.

On Mon, 1 May 2006, Kevin Reid wrote:

> On May 1, 2006, at 1:46, Mark S. Miller wrote:

> The expansion using LTR defines rather than =~ is:
> 
> # (def a := b) || (def c := d)
> keyword if (def a := b) {
>      keyword __brokenFromBooleanFlow =~ &c
>      [true, &c, &a]
> } else {
>      if (def c := d) {
>          keyword __brokenFromBooleanFlow =~ &a
>          [true, &c, &a]
>      } else {
>          __makeBooleanFlowFailure(2)
>      }
> } =~ [res__1, &c, &a]
> res__1
> 
> Note that no trinary-defines of either type are involved here.




More information about the e-lang mailing list