This seems like a really dumb question, and it's probably in the manual, but I can't find it.
So I know that I can make a vector of u8s / floats, etc ... but what if I want a vector of scheme objects (and I want the pointer from the vector to the scheme object to be considered a link for the purpose of garbage collection). What do I use for this? I don't want lists since they're O(n), nor maps since they're O(log n), i could use a hashtable ... but I'd prefer to use an array.
Thanks!
Afficher les réponses par date
Heterogenous vectors are standardized in R5RS, so they aren't in the Gambit manual. Just drop the type annotation on all of the vector procedures:
(make-vector 5) (vector "foo" '(1 2 3) #t) (vector-ref bar 0) ...
On Thu, May 21, 2009 at 2:41 PM, lowly coder lowlycoder@huoyanjinjing.com wrote:
This seems like a really dumb question, and it's probably in the manual, but I can't find it.
So I know that I can make a vector of u8s / floats, etc ... but what if I want a vector of scheme objects (and I want the pointer from the vector to the scheme object to be considered a link for the purpose of garbage collection). What do I use for this? I don't want lists since they're O(n), nor maps since they're O(log n), i could use a hashtable ... but I'd prefer to use an array.
Thanks!
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list