libera/#commonlisp - IRC Chatlog
Search
13:41:19
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))
13:44:08
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))
17:49:48
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).
17:53:29
yitzi
iterate uses code walking, does it even have to ability to report source code references like that?
18:02:32
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.
18:03:43
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.
18:05:25
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
18:07:40
char[m]
Bike: Exactly I'm talking about problems reported by the implementation; nothing to do with wcsf.
18:24:37
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
18:52:17
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.