Musicoll / Kiwi

:kiwi_fruit: Realtime collaborative audio patching

Home Page:http://musicoll.github.io/Kiwi/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Atom - bool type - lack of consistency ?

eliottparis opened this issue · comments

For now :

Atom atom = true;
atom.isBool();          // => true, ok.
atom.isNumber();        // => true, (why not) (?)
long long_val = atom;   // long_val == 1

atom = 1;
atom.isNumber();        // => true, ok
atom.isBool();          // => false, (why) (??)
bool bool_val = atom;   // bool_val == true

|=> a bool is considered as a number but a number not as a bool

  • is bool a number ?

More generally
Do we really need to support a BOOLEAN type in the Atom class ?

Should this test pass ?

Atom a1 = true;
Atom a2 = 1;
REQUIRE(a1 == a2);    // ok

BOOLEAN Type has been removed of the Atom class.