[gambit-list] Vector of Scheme Objects

James Long longster at gmail.com
Thu May 21 14:55:07 EDT 2009


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 at 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 at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>
>



More information about the Gambit-list mailing list