This should fix (or at least kickstart) #85, #86 and #87. The technical write up is in #87, the refactoring schedule has been updated a bit. This changes a lot of the internals (in the C code as well), I wouldn't mind having more than one review on it. I would advise to review each commit separately, instead of looking at the full diff.
The changes include:
Add a numbool macro that preserves the old behaviour of num. This is used in locations where we actually return a number or a boolean, or if we aren't sure of the input value. The perfect case would be to remove this macro eventually, but we might have to stick with it. The macro has some documentation
Add jtrue and jfalse macros, replace the old num(0) and num(1) entries with these. The names have been inspired by the suggestion for jarray, and we needed some prefix to distinguish them from true and false.
Create a separate lookup table for the boolean, use those every time we try to return a boolean instead of Bnum. The booleans in Bnum are now unused.
Replace the (unused) booleans in Bnum with integers 0 and 1, and replace zeroionei with num
Remove the duplicated integers in Bnum and update all lookup indices.
Cleanup refactorme_num a little bit, add some documentation (mostly copied from numbool), rename it to num and undefine the C macro. The C++ code that includes header.hpp will now use the new implementation.
This should fix (or at least kickstart) #85, #86 and #87. The technical write up is in #87, the refactoring schedule has been updated a bit. This changes a lot of the internals (in the C code as well), I wouldn't mind having more than one review on it. I would advise to review each commit separately, instead of looking at the full diff.
The changes include:
numbool
macro that preserves the old behaviour ofnum
. This is used in locations where we actually return a number or a boolean, or if we aren't sure of the input value. The perfect case would be to remove this macro eventually, but we might have to stick with it. The macro has some documentationjtrue
andjfalse
macros, replace the oldnum(0)
andnum(1)
entries with these. The names have been inspired by the suggestion forjarray
, and we needed some prefix to distinguish them fromtrue
andfalse
.Bnum
. The booleans inBnum
are now unused.Bnum
with integers 0 and 1, and replacezeroionei
withnum
Bnum
and update all lookup indices.refactorme_num
a little bit, add some documentation (mostly copied fromnumbool
), rename it tonum
and undefine the C macro. The C++ code that includesheader.hpp
will now use the new implementation.