<nij->
While serializing my data to READably printably format, I need to hack #'print-object for vectors for the result to be more portable. Currently, wihtout any change sbcl prints vectors into #(a b c). However, that doesn't work for all lisp implementations. Instead, I want it to be printed as (vector a b c). However, my attempt makes the repl hangs.. as I think vectors printing is so fundamental for the repl.
<hayley>
I believe specialising a method for a generic function in the CL package, and on a class in the CL package like that is undefined behaviour.
<hayley>
clhs 11.1.2.1.2 #19
<nij->
hmm
occ has joined #commonlisp
Noisytoot has quit [Ping timeout: 246 seconds]
igemnace has quit [Quit: WeeChat 3.8]
<yitzi>
nij-: You could make a custom pprint-dispatch table that has a dispatch entry for vector and only bind it to *pprint-dispatch* when you need it.
<yitzi>
Provided you are using pretty printing.
brettgilio has joined #commonlisp
Noisytoot has joined #commonlisp
phantomics has quit [Ping timeout: 276 seconds]
deadmarshal_ has joined #commonlisp
igemnace has joined #commonlisp
phantomics has joined #commonlisp
igemnace has quit [Remote host closed the connection]
<nij->
Thanks hayley yitzi I will give it a try.
<nij->
Before that I'd like to try a dirty trick - modifying the serialized document directly with regex.
<nij->
; Evaluation aborted on #<CL-PPCRE:PPCRE-SYNTAX-ERROR "Opening paren has no matching closing paren." {703AA4C5B3}>
<nij->
How could it be? "#((" should be read as a string.
<hayley>
That is a regular expression.
<hayley>
Try "#\\(\\("
X-Scale has quit [Quit: Client closed]
<nij->
Ah yeah.. thanks!
tibfulv has quit [Read error: Connection reset by peer]
tibfulv has joined #commonlisp
kagev has quit [Ping timeout: 268 seconds]
X-Scale has joined #commonlisp
kagev has joined #commonlisp
random-nick has quit [Ping timeout: 248 seconds]
clos-encounters has quit [Quit: issued !quit command]
X-Scale has quit [Quit: Client closed]
Spawns_Carpeting has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
Spawns_Carpeting has joined #commonlisp
jeosol has joined #commonlisp
<jeosol>
ober: thanks for your message. It's a corporate laptop I think brew install is disabled, it seems, from what they said.
<jeosol>
but it could be possible to build from binaries.
<jeosol>
pjb: ok, so just like we do on a fresh linux, get an old binary, and then use that to build a more recent SBCL version
Lord_of_Life has quit [Ping timeout: 268 seconds]
Lord_of_Life has joined #commonlisp
igemnace has joined #commonlisp
<pjb>
jeosol: right. You can also get a new binary, on the sbcl download page, there are recent binaries for the main OSes.
<jeosol>
pjb: thanks, that's my suggested so far, I'll see if I get their laptop I can do it for. I have done the old binary, then new sbcl on my fresh linux boxes in the past
<jeosol>
pjb: btw, I was commenting on your beautiful CL array code you shared other day - nice code, not sure you saw my comment. Learnt a thing or two from it.
mingus1 has joined #commonlisp
mingus has quit [Ping timeout: 252 seconds]
mingus1 is now known as mingus
tyson2 has quit [Read error: Connection reset by peer]
tibfulv_ has joined #commonlisp
tibfulv has quit [Ping timeout: 276 seconds]
tibfulv_ is now known as tibfulv
<cpli>
okay, i could write a c wrapper which simply `malloc`s a pointer and returns it with ownership that i then wrap again in common lisp
<ixelp>
cl-sqlite/sqlite.lisp at master · TeMPOraL/cl-sqlite · GitHub
<cpli>
this is stopping me from writing this project in common lisp.
<Bike>
with-foreign-object allocates an object with dynamic extent. just like in C, returning such an object will not work.
<Bike>
if you want indefinite extent, you can use foreign-alloc, which is analogous to malloc.
<Bike>
the sqlite code uses with-foreign-object for the pointer, but then dereferences the pointer, and presumably that object is created/whatever by sqlite3-open and outlasts the pointer
<Bike>
i don't know anything about evdev (or sqlite for that matter) so i can't give any specific advice, but i think it was already suggested you think about how you would do this in C and then translate it. foreign-alloc is like malloc. with-foreign-object is like declaring a local variable with automatic storage duration.
occ has quit [Ping timeout: 260 seconds]
jeosol has quit [Quit: Client closed]
occ has joined #commonlisp
<cpli>
Bike, yes the bytes allocated by `cffi:with-foreign-object` may be scoped, but the allocation on libevdev's behalf is not, the entire issue revolves around passing a double pointer to a struct (wherein we only need to allocate a buffer large enough for libevdev to write the new allocation to) and then successfully dereference that scoped allocation to get our "out argument" to return from `make-uinput`
<cpli>
[..] to write the *pointer to* the new allocation [..]
jon_atack has joined #commonlisp
jonatack has quit [Ping timeout: 246 seconds]
<cpli>
since we've been failing to do so, could someone help us and transliterate this from c to cl? https://0x0.st/H-SR.c
<aeth>
ugh
<aeth>
I'm like "Oh, I do that all of the time, how hard can this be?"
<aeth>
Then I click
<cpli>
aeth q-q i just wanna replace kmonad/kanata with something that is **actually** a lisp
<cpli>
both of those "keyboard remapping"-programs have lisp-like config
<cpli>
aeth, what happened after click..
<aeth>
then I saw: struct uinput *uinput_create(struct libevdev* evdev) {
<ElKowar>
aeth same man, it's 5 AM, these guys have been talking about this for two days now, and now theyve been trying to fix this for the entire night, I just wanna sleep TwT
<cpli>
aeth, what sounds problematic here? (i genuinely don't know what the implication is..) is it the styleguide i'm using?
chip_x has joined #commonlisp
chip_x has quit [Remote host closed the connection]
chip_x has joined #commonlisp
<ElKowar>
Context: im laying in bed next to cpli at his computer
<cpli>
and it's been going alright, i.e. evdev holds a `(:pointer (:struct evdev))` which works, but uinput specifically is giving us issues
<buffet>
aeth: we are struggling to make the "out pointer" part work. there is no way to "address of", since ref and area and deref all deref; using pointer pointer evdev, passing that, then derefing also doesn't seem to work; we found cl-sqlite which just passed (:pointer sqlite-statement), and it just adds the level of indirection or smth, completely unclear how that works
chipxxx has joined #commonlisp
<aeth>
yeah, this is way more complicated than I expected... maybe ask borodust
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
Noisytoot has quit [Ping timeout: 255 seconds]
<Bike>
cpli: cffi does not have addressof; instead you only deal with addresses. when you with-foreign-object or foreign-alloc an :int, the variable bound is not "an int", it's a pointer to storage for an int. so e.g., { int x; x = 7; return x; } is translated as (with-foreign-object (x int) (setf (mem-ref x :int) 7) (mem-ref x :int))
Noisytoot has joined #commonlisp
X-Scale has quit [Quit: Client closed]
<Bike>
cpli: so for your code here, you'd (with-foreign-object (uinput (:pointer libevdev-uinput)) ...), then in that body do (libevdev-uinput-create-from-device ... uinput), and end with (mem-ref uinput '(:pointer libevdev-uinput))
aartaka has joined #commonlisp
aartaka has quit [Ping timeout: 246 seconds]
jmdaemon has joined #commonlisp
MajorBiscuit has quit [Quit: WeeChat 3.6]
jmdaemon has quit [Ping timeout: 250 seconds]
<buffet>
Bike: we just figured it out! thanks!
pranavats has left #commonlisp [Error from remote client]
<Bike>
no problem
pranavats has joined #commonlisp
avocadoist has quit [Remote host closed the connection]
avocadoist has joined #commonlisp
kevingal has joined #commonlisp
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
jon_atack has quit [Ping timeout: 246 seconds]
jmdaemon has joined #commonlisp
cdegroot has quit [Ping timeout: 255 seconds]
cdegroot has joined #commonlisp
jon_atack has joined #commonlisp
jeosol has joined #commonlisp
jmdaemon has quit [Ping timeout: 248 seconds]
<cpli>
thank you, Bike!
tyson2 has joined #commonlisp
skin has joined #commonlisp
inline__ has joined #commonlisp
Inline has quit [Ping timeout: 268 seconds]
cdegroot has quit [Ping timeout: 250 seconds]
cdegroot has joined #commonlisp
jmdaemon has joined #commonlisp
cognemo has joined #commonlisp
Gleefre has joined #commonlisp
X-Scale has joined #commonlisp
jonatack has joined #commonlisp
jon_atack has quit [Ping timeout: 256 seconds]
Cymew has quit [Ping timeout: 264 seconds]
jmdaemon has quit [Ping timeout: 248 seconds]
jmdaemon has joined #commonlisp
X-Scale has quit [Ping timeout: 260 seconds]
jmdaemon has quit [Ping timeout: 248 seconds]
X-Scale has joined #commonlisp
Oladon has joined #commonlisp
morganw has joined #commonlisp
Lycurgus has joined #commonlisp
Lycurgus has quit [Quit: Exeunt: personae.ai-integration.biz]
<char[m]>
is iterate still maintained?
Gleefre has quit [Remote host closed the connection]
<Demosthenex>
char[m]: did you find a problem with it?
jmdaemon has joined #commonlisp
<char[m]>
Demosthenex: Yeah. the error reporting for code used in the iterate (but not related to iterate) is not reported for the correct location. For example in the body have (undefined-function). For iterate the orange underline is on the iterate:iterate, for loop the orange underline is under (undefined-function).
<Demosthenex>
orange underline? you mean in emacs or similar?
<yitzi>
iterate uses code walking, does it even have to ability to report source code references like that?
kevingal has quit [Ping timeout: 255 seconds]
<Demosthenex>
could be old cached values in slime/swank
<char[m]>
Demosthenex: Yeah sly's error reporting in emacs. I don't think it is cached because it happens even for new code I write. yitzi Error reporting should have accurate location data as long as iterate is outputting the original source lists. It should be able to do that since the body forms shouldn't need to be modified.
inline__ has quit [Remote host closed the connection]
inline__ has joined #commonlisp
<yitzi>
I seriously doubt that. As I recall only SBCL and CLASP support with-current-source-form and I don't see any usage of that in the iterate code.
<Bike>
if it's an undefined function warning, it's being signaled by the implementation rather than by the iterate macroexpander, so w-c-s-f shouldn't come into it, i would guess
<Bike>
if it is being signaled by iterate that would be another problem
<char[m]>
Bike: Exactly I'm talking about problems reported by the implementation; nothing to do with wcsf.
<scymtym>
it seems like iterate reconstitutes every walked form out of fresh conses, even if the reconstituted form is EQUAL to the original form. that explains why the implementation loses the source information
perrierjouet has quit [Ping timeout: 264 seconds]
Gleefre has joined #commonlisp
perrierjouet has joined #commonlisp
inline__ has quit [Remote host closed the connection]
Inline has joined #commonlisp
<char[m]>
scymtym: That is what I was thinking. I feel like it should be more frowned upon, especially if it is not needed for the macro to work.
Oladon has quit [Quit: Leaving.]
amoroso has joined #commonlisp
azimut has quit [Ping timeout: 255 seconds]
amoroso has quit [Quit: Client closed]
tyson2 has quit [Remote host closed the connection]
attila_lendvai has quit [Ping timeout: 255 seconds]
Gleefre has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
lxi_ has quit [Ping timeout: 265 seconds]
LW has joined #commonlisp
X-Scale has quit [Quit: Client closed]
tyson2 has quit [Remote host closed the connection]
bsteger has quit [Quit: Leaving]
pve has quit [Quit: leaving]
scymtym has quit [Ping timeout: 246 seconds]
Brucio-61 has quit [Ping timeout: 260 seconds]
Brucio-61 has joined #commonlisp
shka has quit [Ping timeout: 250 seconds]
aartaka has joined #commonlisp
notzmv has quit [Ping timeout: 265 seconds]
tyson2 has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
scymtym has joined #commonlisp
LW has quit [Quit: WeeChat 3.6]
skin has quit [Ping timeout: 276 seconds]
X-Scale has joined #commonlisp
morganw has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
Gleefre has quit [Ping timeout: 260 seconds]
nij- has joined #commonlisp
Gleefre has joined #commonlisp
azimut has joined #commonlisp
X-Scale has quit [Quit: Client closed]
aartaka has quit [Ping timeout: 255 seconds]
Gleefre has quit [Remote host closed the connection]