On Tue, 3 Dec 2002, Dan Sugalski wrote:

> At 4:29 PM -0500 12/3/02, David Robins wrote:
> >Enlightenment appreciated as always.
>
> This is something that'll come up with perl 6 reasonably soon as
> well. The solution for us is to have truth and falsehood be an
> optional property on the variable, potentially separate from the
> variable's value. The mechanism for that's not in yet. (I'd
> forgotten. It's on the todo list now)

Was this discussed earlier (and if so, got a link?) or just sketched out
and /* TODO */'d?

Adding an extra knob doesn't seem like all that good a solution (seems
you'd run into weird issues, like a boolean PMC that was both true and
false at the same time, or an undef value that was true); why not -

- create immutable "true" and "false" PMCs
- have not P0, P1 set P0 to $1->get_bool ? true : false
-      and P0, P1, P2 set P0 to $1->get_bool ? $2->get_bool ? $2 : $1
                                             : false
-      or P0, P1, P2 set P0 to $1->get_bool ? $1
                                            : $2->get_bool ? $2 : false
-      xor P0, P1, P2 set P0 to whichever is set, false if both/neither

- plus optionally allow a not Ix, Px op which sets Ix to 1 or 0, etc.

Dave
Isa. 40:31

Reply via email to