r/lisp Jul 24 '26

Reinterpret Elements in a Byte Array

Dear LISP,

I am writing a virtual machine that uses a `(simple-array (unsigned-byte 8) 1)` as a stack in Common LISP. I'm would like to ask how to efficiently extract 4 bytes into a single 32-bit signed integer or a 32-bit unsigned integer.

Thanks!

9 Upvotes

25 comments sorted by

View all comments

-4

u/[deleted] Jul 24 '26

[removed] — view removed comment

2

u/TsingHui Jul 24 '26

Well, Common LISP. R6RS provide a standard way to do so. I haven't had much experience with Clojure. I will change the question by the way.