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.
1:04:33
nij_
One thing I find weird about CL type system is the SATISFIES keyword. It doesn't seem to support sane interface. Can I safely assume that the "types" mentioned in CL is not as what other people mean usually?
1:05:50
nij-
Ooops my first message didn't send through: > I've always been confused with the difference between classes and types. Until today, I read [1] which seems to make it click. My summary is that classes are moer about implementation details, while types are more about their interfaces. That's maybe why types support polymorphisms with more sanity. [1]
1:05:51
nij-
https://www.cs.princeton.edu/courses/archive/fall98/cs441/mainus/node12.html#SECTION00043000000000000000
1:08:53
pjb
nij-: first thing to note, is that there's no first class types in Common Lisp (there's no type type). What we have are type DESIGNATORS, mere sexps denoting types.
1:09:51
pjb
nij-: there's a little exception, for classes, since classes are type designators for the set of their instances, so in a way, class objects are first class types, but it's an exceptionnal situation, and #<class foo> is equivalent to foo as type designators.