On 10/26/13 12:17 PM, Walter Bright wrote:
On 10/26/2013 8:42 AM, Andrei Alexandrescu wrote:
While messing with std.allocator I explored the type below. I ended up
not using
it, but was surprised that implementing it was quite nontrivial.
Should we add
it to stdlib?
Theory: http://en.wikipedia.org/wiki/Three-state_logic
When I worked on the ABEL programming language, which was for designing
programmable logic devices, we found it useful to have an additional
state, "don't care".
Yah, that would be four-valued logic:
http://en.wikipedia.org/wiki/Four-valued_logic.
One challenge in Tristate (or the as-of-yet-unwritten Fourstate) is to
define the primitives |, &, ^, and ~ with minimum of operations. For
example Tristate still has conditionals in two of them, which I think
could be cleverly avoided.
Andrei