2 ms·
the reference to a 5-bit number in the intro was intriguing; i don't think i've ever seen a language that would support that (maybe pascal with type subsetting)
by zem 9y ago
the reference to a 5-bit number in the intro was intriguing; i don't think i've ever seen a language that would support that (maybe pascal with type subsetting).
this seems to be the best description of it: http://andrewkelley.me/post/a-better-way-to-implement-bit-fields.html http://andrewkelley.me/post/a-better-way-to-implement-bit-fi...
- kbp 9y agoCommon Lisp allows integer types of however many bits you want using SIGNED-BYTE and UNSIGNED-BYTE (don't let the names confuse you; a byte isn't necessarily 8 bits): CL-USER> (the (unsigned-byte 5) 31) 31 CL-USER> (the (unsigned-byte 5) 32) ; Evaluation aborted on #<SIMPLE-TYPE-ERROR expected-type: (UNSIGNED-BYTE 5) datum: 32>.