IRC channel logs
2024-08-18.log
back to list of logs
<cpli>lilyp when using optional arguments it can get kind of messy. i.e. (define* (f #:optional arg1 #:key #:allow-other-keys #:rest args) ... i can't emulate that behavior with just (f . args) q-q <haugh>cpli, are you familiar with parameters? Couldn't find the root of your issue but if you're getting frustrated passing settings down through nested layers of invocations, that's a principle application of dynamic scope. <lilyp>cpli (f #:optional a b c #:rest rest) ? <dsmith>13 years of guildhall? What happened? Or rather, didn't? <ekaitz>Hi! can i introduce a pointer in a foreign-object defined with define-foreign-object-type? <ekaitz>ERROR: In procedure struct-set!/unboxed: <ekaitz>Wrong type (expecting exact integer): #<pointer 0x583940> <mwette>ekaitz: I'm not sure, but reading the documentation it seems all the slots should be (foreign) pointers. <ekaitz>mwette: hmm but my g-variant-* functions are also foreign functions <ekaitz>maybe their return value is a wrapped pointer and that's not allowed? <mwette>Are you saying g-variant-new-int is not accepting an integer argument? <mwette>I'm guessing (g-variant-new-int 5) => pointer, right? <ekaitz>yes (g-variant-new-int 5) => pointer <ekaitz>but the pointer is a wrapped one <ekaitz>like the ones coming from a foreign-function <mwette>You'd need to call g-variant-get-int to fetch its value, I guess. <ekaitz>i mean, the variant should be the pointer i send <ekaitz>i need to send the variant to some function later <ekaitz>and it should get the internal value later <mwette>Ah, now I see what you are doing. Looks like it should work. <mwette>Are you generating foreign object types in the g-* functions? <ekaitz>mwette: let me upload all this somewhere so i can show you <ekaitz>make-g-variant is what doesn't work well <ekaitz>i tried to use pointer-address and that works there but other things explode <mwette>My guess is that using pointers is correct: could be a bug in Guile. <ekaitz>mwette: oh wait, i think I have something working! <ekaitz>mwette: i had to wrap and unwrap the pointers <mwette>Ah. OK. I found (something like) this in foreign-object.c: scm_foreign_object_ref(obj) { return scm_foreign_object_unsigned_ref(obj); } <ekaitz>i also found that (case ...) when being used with symbols always says cases are duplicated