Three Value Logic
Russell Allen
russell.allen at firebirdmedia.com
Thu Dec 9 04:14:11 UTC 1999
John M. McIntosh <johnmci at smalltalkconsulting.com> wrote:
>Hi, many years ago I worked with a 4GL that support this, however it was
>true, false, null. Some interesting things happened because.
>
>true & null -> null
>false & null -> null
>false = null -> null
>
>null ifTrue -> nope
>null ifFalse -> yes!
>
In the scheme I'm using, unknown is either true or false, but we don't know
which. This leads to:
true & unknown -> unknown
false & unknown -> false
true | unknown -> true
false | unknown -> unknown
x ifFalse: [] in this scheme means "if we know that x is false, do the block",
so
unknown ifFalse -> no!
which seems to make a little more sense. However,
(x not) ifFalse
x ifTrue
now have different behavior...
>This of course doesn't answer your question, but be careful about control
>statements that are binary in logic.
I will
:)
Russell
----------------------------------------
Russell Allen
russell.allen at firebirdmedia.com
----------------------------------------
More information about the Squeak-dev
mailing list
|