write function that returns the number of bytes written.
import io
main:
buffer := io.Buffer
buffer.big-endian.write-int32 0x12345678
// The most significant byte 0x12 is at index 0.
print buffer.bytes // => #[0x12, 0x34, 0x56, 0x78]
import io
main:
buffer := io.Buffer // A writer.
buffer.little-endian.write-int32 0x12345678
// The least significant byte 0x78 is at index 0.
print buffer.bytes // => #[0x78, 0x56, 0x34, 0x12]
class Pin:
number/int
constructor .number:
operator == other:
if other is not Pin: return false
return number == other.number
hash-code method. That is, if a class has a hash-code member, then the equality and hash-code must agree. If two instances are equal (a == b), then their hash codes must also be equal (a.hash-code == b.hash-code).