From: Rob Stewart (stewart_at_[hidden])
Date: 2004-05-28 09:52:03
From: Haim Cohen <haim.cohen_at_[hidden]>
> First of all, my first comment is about the library's name, as
> well as the class name. In logic circuit simulation, there are
> 4 values : 0, 1, x ( which is tribool referred to as
> undetermine ), and z ( represents high impedance - or
> disconnection, and sometime referred to as "tri state" ). So,
> I think users will find it quite confusing when they see the
> 'tri' in the library's name. Since the library implements a
> logic value which has some value that is unknown, I would
> suggest 'unknown bool' or 'x bool'.
First, you say that the indeterminate value should be named "x"
because "x" is the indeterminate state in electronics. When
looking for a non-descriptive identifier, one often resorts to
things like "x," so there's some programming precedent for "x"
meaning "arbitrary value." However, "indeterminate" leaves no
doubt as to the meaning of the value and doesn't depend upon
one's experience with electronics. Another possibility would be
"unknown" as that is equally descriptive and is definitely
shorter (less typing!).
Second, you say that the library name should not be "tribool" but
instead should be "unknown_bool" or "x_bool" to avoid confusion
with tristate logic. Do you seriously think electronics domain
programmers will think that "boost::tribool" is related to
tristate logic? I don't see that as likely. That doesn't mean
there isn't value in your suggestion to change the library name.
As I've already rejected the "x" notion, that leaves
"unknown_bool" or, by extension, "indeterminate_bool." While
these names suggest that there is an unknown or indeterminate
Boolean value, they don't suggest to me a type that includes
true, false, *and* unknown/indeterminate. "tribool," OTOH,
clearly indicates that it is a type that includes exactly three
logic states, though it doesn't name any of them. Furthermore,
"tribool" paves the way for the possibility of adding quadbool or
multibool to Boost.
-- Rob Stewart stewart_at_[hidden] Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk