Tag: interpreted language

Take a Byte of Copper

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.

Progress Report #9

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”