libera/#commonlisp - IRC Chatlog
Search
23:09:46
pl
random-nick: on linux (and windows), the really nice stuff would be to implement io_uring
2:02:12
shunter
Quick question on WITH-XYZ macros that bind VAR -- is it recommended to declare that VAR has dynamic extent? VAR shouldn't be used outside the body anyways, so I think it fits with what dynamic extent is supposed to be, right?
2:03:07
shunter
It shouldn't, because the meaningful resource is closed by the time execution leaves the body
2:04:47
shunter
Very much like a with-open-stream: `(let ((,var (wl-display-connect ,@args)) (unwind-protect (progn ,@body) (wl-display-close ,var)))
2:05:55
Bike
if the value is actually inaccessible than using dx is fine. unless wl-display-connect inlines to something special, i doubt the declaration will really do anything, though.
2:52:00
Bike
it'll make your code very confusing, as it will mean calling a function alters the global definition of some other function.
3:03:47
dbotton
First in clog lingo - When you instantiate an instance of a clog panel there is an on-setup handler, so in that handler I want to sometimes define a function. - so in CL lingo - this is a function say create-panel generated by the builder that includes code by the user to run each time create-panel is used. So wanted to understand potential pitfalls if they add a defun
3:05:15
dbotton
As I can say have a canvas, draw a circle when created, then reuses the same code in say the on-click
3:05:48
Bike
well having code that messes with the global environment is messy for the same reason messing with the global environment usually is.
3:10:38
Bike
rationale what, in the standard? defun is just a normal form, so there's no reason to disallow it anywhere, and no specific rationale for allowing it anywhere
3:33:42
emacs-dwim
nij-: Of course, CL has: *evalhook* *applyhook* *macroexpandhook* #'evalhook #'applyhook.
3:40:37
dbotton
Bike, this seems interesting as a result - (defmethod draw ((obj (eql panel)) circle-color) nil) if I want a more JavaScript style of OO to place the defmethods in the create function.
6:03:06
hayley
I heard *eval-hook* was removed as it did nothing in compiled code, making it rather awkward.
8:31:49
pve
Hi, if I nreverse a vector with a fill pointer, will the result also have a fill pointer?
8:37:20
phoe
sbcl, ccl, ecl, abcl, clisp, lw, acl all pass (let ((v (make-array 5 :initial-contents '(1 2 3 4 5) :fill-pointer 3))) (assert (eq v (nreverse v))))
8:38:41
phoe
so, yes, all implementations mutate the vector in-place rather than constructing a new one
8:39:52
phoe
pve: if the returned vector is EQ to the original one, this means that it has a fill pointer, and by common practice you can depend on this
8:53:27
jackdaniel
truth to be told implementing reverse usually involves (nreverse (copy-sequence seq)) unless you are a masochist
9:19:17
phoe
Shinmera: nope, I am too lazy to do this, I just type the following in my repl: sbcl ccl ecl cmucl abcl clisp acl
9:19:52
Shinmera
phoe: you might want to do it though, it's quite convenient for exactly that https://github.com/shinmera/cl-all
9:20:48
phoe
Shinmera: yes, I am aware; I just can't do it at the moment since my will and strength are going elsewhere