List of references in Mojo
I'm a bit out of the loop with the latest Mojo developments, so I could use some guidance.
In Python, creating a list of references is simple:
How would we achieve similar functionality in Mojo nowadays?
Is UnsafePointer still the way to go, something like:
Or is there now a more elegant/safer way to achieve this using References?
Thx 🙏
6 Replies
I think you might just want a
List[List[Int]]
This will copy the lists as far as i see:
The
Reference
type is usable but still kinda a pain. Arc
is also an optionIt would be great if someone could post how to implement this example with References (and/or Arc) - never used them so not sure how to do it
this looks great, thanks a lot