Skip to content

Conversation

@Yehouda
Copy link

@Yehouda Yehouda commented Mar 22, 2020

[edit: that ended in the wrong place apparently. It was supposed to be about mgi/binary-io ]

Inside the function pack the variable result is currently bound to (make-array m), which create a simple-vector with NILs. then the call to ldb gets NIL as third argument and errors. That happens when running the tests.

It needs to be initialized with Zeroes, by being bound to (make-array m :initial-element 0).

I am not actually pulling the code, I am just raising an issue. I do it in a pull request because I didn't find the issues for this project.

mgi added 30 commits March 14, 2017 17:50
a :reader, a :writer and a :size (or any combination of them). For
example:

;; Just a reader and a size for this unsigned integer
(define-binary-type unsigned-integer (bytes bits-per-byte)
  (:reader (in)
    (loop with value = 0
       for low-bit downfrom (* bits-per-byte (1- bytes)) to 0 by bits-per-byte do
         (setf (ldb (byte bits-per-byte low-bit) value) (read-byte in))
       finally (return value)))
  (:size () bytes))

A not present :reader, :writer or :size will error out at call time.
one can obtain the byte size of a binary class object.
size of a read-byte.

start to optimize a bit.
and now io stream should be of type '(unsigned-byte 8) for most
data-type.
mgi and others added 30 commits March 19, 2019 16:29
[read|write]-value-at interface instead.
Add support for variable length string in
`binary-io.common-datatypes:8bit-string'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants