A very simple byte extension was added to Copper’s extension collection recently. It’s just a convenience class with a few features including byte flipping, bit flipping, bit setting and getting. The ByteObject class extends NumericObject, so math operations are possible. Creating a byte instance is done using strings rather than numbers or hex because the Copper VM does not support hex numbers.
mybyte = byte("00001101")
The full byte does not need to be given. Any number of bits less than 8 can be given, and these will set the lowest bits of the byte. The above code could have been written:
mybyte = byte("1101")
Functions are documented at the top of file cu_bytebasics.h.
Lately, I’ve been integrating Copper into projects and everything is working seamlessly. Copper has finally matured to being robust enough for full scale applications, not just tinker projects.
Continue reading “Integration Report”
A number of little updates have been applied to the Copper interpreter and documentation this week including better type identification and string-related methods.
Continue reading “Progress Report #11”
After some critical debugging of the recently changed runFunctionObject() (used for callbacks), I decided to add a new boolean function in the spirit of doing things fast and efficiently: xall(). This function is the equivalent of any(all(…), nall(…)) where “…” represents the same arguments. Using xall() is much less error prone (since you only need to type the argument names once) and much faster because it’s all on the C++ side.
In other news…
Continue reading “Progress Report #9”