
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
disconnection, and sometime referred to as "tri state" ). So, I think users will find it quite confusing when they see the 'tri' in
----- Original Message ----- From: "Haim Cohen" <haim.cohen@analog.com> tribool referred to as undetermine ), and z ( represents high impedance - or 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'.
Now to the interface. I think that a macro which enables renaming of the x value should not be supplied. This will make people's code less standard.
Ironically, it was disagreements over the name of the 3rd state that resulted in the macro, although I think I agree with you. Users may just have to deal with our choice of name (for their own good <g>).
Same as we all know what 'true' and 'false' mean, we should adopt a unique name for 'unknown yet quite determined logic value'. I think the default 'undetermine' name is not a good name. My suggestions : logic_x, x_value, x_logic, unknwon_bool .
Some point for thought : Users might want arrays of tribools, with all
I agree with Rob Stewart's comments about using "x". As for "unknown", I'm pretty flexible: tribool originally had "unknown", but I seem to recall that earlier informal review favored "indeterminate". the support of bitwise operations.
Is this should be a part of tribool as well ? I do not know.
So, I suggest to change implementation to use class-static fixed array to
I think this would be a useful feature, and I believe Pavel (?) had mentioned interest in writing something like this. It would probably be similar to dynamic_bitset. [snip] perform calculations. Agreed.
I hope this review would be found useful.
Absolutely. Thank you. Doug