freenode/#lisp - IRC Chatlog
Search
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.
0:32:53
no-defun-allowed
Your (setf foo) function has to setf the value in question too, by the way.
0:40:05
asarch
But then: There is no applicable method for the generic function #<STANDARD-GENERIC-FUNCTION (COMMON-LISP:SETF COMMON-LISP-USER::X1) (1)> when called with arguments (3 #<POINT {10021926E3}>).
0:42:56
asarch
Oh, the same error: There is no applicable method for the generic function #<STANDARD-GENERIC-FUNCTION (COMMON-LISP:SETF COMMON-LISP-USER::X1) (1)> when called with arguments (3 #<RECT {10021926E3}>).
1:02:22
asarch
Another stupid question: what's the point of defgeneric if it will overriden by defmethod?
1:03:46
p_l
asarch: defmethod will, on all implementation I know of, implicitly add the same information as defgeneric... but only if defgeneric is missing
1:04:14
p_l
defgeneric lets you declare the interface in one concise place (and extended options allow you to include method implementations as well)
1:50:28
tsandstr
I've got a problem that I think is due to SLIME that I can't quite figure out. When I run the function READ with no arguments, Emacs informs me that there is a pipelined request involving swank:simple-completion. The repl freezes up, and it's a pain to get out of. Any ideas on how to fix it?
1:56:09
tsandstr
It works as expected when I run sbcl from the command line. The issue only arises when using SLIME.
2:19:39
oni-on-ion
READ with no args expects user input btw, i won't assume that you did not know this if it is indeed why it seems like it is freezing up
2:23:58
lispy2
hey are people around? im having trouble hooking up emacs to my sbcl instance on fedora 29 and was looking for people to get ideas from
2:26:37
voices
it seems that the order of (let ...) (labels ...) (macrolet ...) etc. in a function doesn't matter, but is there a standard order / best practice ?
2:27:38
vsync
ACTION just knows he had a let-when macro and was annoyed when he found out The Done Thing is when-let
2:29:11
tsandstr
oni-on-ion: I know that read expects input. It lets me type a few characters before freezing. Pressing <C-g> lets me type one more character, so by doing that every other character I can brute force my way through. It's a pain thouugh
2:30:11
oni-on-ion
tsandstr, this is strange. i suggest try install a new slime, which could explain the swank request message
2:37:15
tsandstr
oni-on-ion: I updated SLIME, still no luck. Although I have realized that if I disable auto-complete-mode in the repl, the issue goes away.
2:41:36
oni-on-ion
not sure if that will make any change, but, i am also using paredit and snoopy-mode for slime so a lot of things should just work
2:41:56
oni-on-ion
it feels like a version mismatch somewhere as i've had swank complaints fixed with similar actions previously
2:42:42
tsandstr
oni-on-ion, do you know what the variable slime-inhibit-pipelining does? I read the short description in the help and I don't quite understand it. COuld tweaking that value help me out at all?
2:44:14
oni-on-ion
tsandstr, hmm very possibly that variable. i would look at some other settings and check emacs configs to make sure its closer to stock. i am on 2.23 =) but i've got some extensions enabled as well
2:45:21
oni-on-ion
here is my slime config for both of you if any of it helps: http://ix.io/1P1T/elisp
2:49:22
tsandstr
oni-on-ion: This is all of my SLIME related config: https://plaster.tymoon.eu/view/1459#1459