freenode/#lisp - IRC Chatlog
Search
13:24:50
ck_
Xach: watching the repositories and contacting people with sparse attendance schedule when they are active. It wasn't really meant seriously.
13:50:42
Bike
that interface probably isn't intended foor your use. sb-sys is an internal sbcl package.
13:51:55
scymtym
seok: you should work with the socket from which the stream has been created using the socket interface: http://www.sbcl.org/manual/#General-Sockets
17:51:07
littlelisper
Oh sure, I ll be sure to hang out there if I came across anything i need help with
17:53:03
jackdaniel
I hope to make a new video soon showing how to write a simple toolkit based on dragonstone library (lower-level abstractions which make CLIM possible, something like silica)
17:54:09
jackdaniel
namely I have a working immediate gui mode prototype, so making from it a tutorial seems like a nice idea
18:43:43
puchacz
hi, for javascript-like array/vector slice functionality, what library shall I use please?
18:52:10
puchacz
okay, if I want to destructively insert an element into existing array before index, can I do it without manually push-vector-extend first and then rewriting all elements to next index after my insertion?
20:37:12
aeth
puchacz: I think vector-pop will just move the fill-pointer, sort of like how there's a vector-push and a vector-push-extend. If vector-pop could shrink, there would probably be a vector-pop-shrink or vector-pop-contract or something
20:38:38
puchacz
aeth - but subseq returns a new pointer, so I would have to update all references to old vector....
20:39:43
aeth
puchacz: You can add a layer of abstraction, e.g. with defclass or defstruct. It's what you'd need to do with using a list (which might be more efficient if you need it to shrink), since the list would add/remove from the front.
20:41:54
aeth
puchacz: it looks like there's an adjust-array. http://www.lispworks.com/documentation/HyperSpec/Body/f_adjust.htm
20:43:49
puchacz
aeth: yes - and I could not find what it really does when you shrink dimension by 1.
20:44:11
puchacz
but it is not that relevant, it is meant to be used for return value, not modification in place
20:47:41
puchacz
gigamonkey says "they abstract the actual storage, allowing the vector to grow and shrink as elements are added and removed"
20:50:57
aeth
I think an adjustable vector is something like this #(0 1 _ _) and then you vector-push-extend 3 times and get something like #(0 1 2 3 4 _ _ _) where vector-pop could make it #(0 1 _ _ _ _ _ _) eventually, where the exact details of e.g. if it doubles or does something else is afaik unspecified
20:58:48
Josh_2
puchacz: you could wrap around vector-pop and just overwrite what is about to be removed before
20:59:28
aeth
You could also have a fixed-sized vector, but this will probably wind up on average taking more overall memory, just a predetermined amount of it
21:00:22
puchacz
Josh_2: placeholders in vector beyond fill-pointer can be empty, but the placeholders themselves take up memory
21:00:33
Josh_2
Well It's no longer a leak if you have overwritten the data that was previously is that slot
21:03:57
aeth
puchacz: If you want guaranteed shrinking, you need to wrap with defclass or defstruct and occasionally subseq (or whatever equivalent will work) afaik.
21:04:29
aeth
Most people won't want this because it'll be slower and create more garbage as vectors expand and contract
21:05:13
puchacz
aeth: yes, this is what I figured out :( unless I find a website that says that Lisp can and X, Y and Z implementations do it.