Arc Forumnew | comments | leaders | submitlogin
1 point by kennytilton 6172 days ago | link | parent

I am puzzled by how (let (t (cdr v))...) could work for you in vec-get when it should be (let tbl (cdr v)...) -- note that as an aside I am avoiding rebinding t just from long CL experience. Also, it seems unusable because no one wants to rebind some local variable holding the vector just because they added an element. And it is unworkable because you make a new cons of count and hash but you keep the same hash, so anyone with a binding with a lower count who now goes to add will be writing over values added by other code working on the same vector (say if I pass the vector to a subroutine for further work and then resume work on it myself). My final concern is finding a hashtable inside something called "vector". :) Anyway, the fix is to modify the car of the "vector" when changing the count instead of consing up a new count-hash pair. But really I would mush rather see a size declared when creating the vector and then requiring an index on the add (in which case it is more of a set).


1 point by bcater 6171 days ago | link

"My final concern is finding a hashtable inside something called \"vector\"."

Yeah, I didn't actually know how to create a vector, so I used this instead.

Also, I realized just after posting that setting the car really was the right way to do this (all else being equal, of course).

-----