Array access et al #219
Locked
SebastianMestre
started this conversation in
Interpreter Implementation
Replies: 1 comment
-
I ended up doing the first one in #224 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We don't currently have a way to write to some position of an array. How can we implement this?
I thought of two things:
Reference
. This would be pretty easy and require no changes to how we implement assignment in the interpreter.Reference
-like type, but for array elements. It would store a pointer to the array, along with an index. This would be relatively easy and require no changes to how we store arrays in the interpreter.I prefer the second approach.
An issue I have identified with it is that we would have two reference-like types going around in the interpreter, meaning
unboxed()
would be slightly more complicatedAlso, what a bad name
unboxed
is! We need a better one. I came up withvalue_of
, off the top of my head, but something else would be good, too.Beta Was this translation helpful? Give feedback.
All reactions