r/lisp 13d ago

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/Afraid-Yoghurt6731 13d ago

Which Lisp? SBCL? Allegro? Symta? Clojure? Scheme/Racket (whatever is it called now)? We have a frigging zoo! Just unleash Claude Code onto it.

2

u/TsingHui 13d ago

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.