libera/#commonlisp - IRC Chatlog
Search
21:23:37
jeosol
I wanted to ask for any one using Mac Book Pro, I normally only use Linux so installing sbcl (building from source) is what I normally follow. What is the procedure to install on a Mac Book Pro. I wanted to help someone install SBCL. I see MacOS(Darwin) on the download page, not sure. Thanks
21:48:17
pjb
jeosol: note: macports downloads an old (validated) version of sbcl, and compiles more recent sources with it.
0:01:07
cpli
i understand how to use the C library. in their code TeMPOraL does the same with an identical out-argument and using similar code does not work on any of our three laptops: https://github.com/TeMPOraL/cl-sqlite/blob/master/sqlite.lisp#L91-L98
0:21:02
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.
0:22:43
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.
0:32:44
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.
1:01:34
nij-
Before that I'd like to try a dirty trick - modifying the serialized document directly with regex.
1:01:51
nij-
; Evaluation aborted on #<CL-PPCRE:PPCRE-SYNTAX-ERROR "Opening paren has no matching closing paren." {703AA4C5B3}>
2:24:30
jeosol
ober: thanks for your message. It's a corporate laptop I think brew install is disabled, it seems, from what they said.
2:25:31
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
2:40:07
pjb
jeosol: right. You can also get a new binary, on the sbcl download page, there are recent binaries for the main OSes.
2:41:19
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
2:42:28
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.
3:21:44
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
3:23:00
cpli
but i would really want to do something akin to https://github.com/TeMPOraL/cl-sqlite/blob/master/sqlite.lisp#L91-L98 in https://git.sr.ht/~cpli/clayboard/tree/dev/item/src/evdev.lisp#L112
3:35:47
Bike
with-foreign-object allocates an object with dynamic extent. just like in C, returning such an object will not work.
3:35:58
Bike
if you want indefinite extent, you can use foreign-alloc, which is analogous to malloc.
3:37:27
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
3:40:43
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.
4:06:18
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`
4:18:15
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
4:20:48
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
4:23:10
cpli
aeth, what sounds problematic here? (i genuinely don't know what the implication is..) is it the styleguide i'm using?
4:27:55
cpli
aeth: our current progress is: https://git.sr.ht/~cpli/clayboard/tree/dev/item/src/evdev.lisp
4:29:05
cpli
and it's been going alright, i.e. evdev holds a `(:pointer (:struct evdev))` which works, but uinput specifically is giving us issues
4:31:15
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
6:47:53
Josh_2
or the logo :joy: Imagine thinking "hmm yes I run CL subreddit, how about I use uki flag instead of idk lisp alien mascot"
6:53:14
aeth
new.reddit.com for those who use the old reddit and are confused by seeing the default style subreddit
6:57:13
hayley
r/lispmemes trivia: there was a very short-lived HyperSpec CSS theme, which lasted a few hours from memory.
7:08:52
Josh_2
The chances that the mods of the subreddit aren't in here? About 0. Most of the CL community is moderated by the same few people