freenode/lisp - IRC Chatlog
Search
16:41:03
jmercouris
jackdaniel: I merely corrected you from implying that I implied that you said something which you didn’t
17:13:00
dbotton
Is there documentation / some sort of tutorial on the best way today to handle foreign C code. Seems there are a few paths when last looked.
17:13:58
jackdaniel
cffi is a usual goto answer (it also superseded uffi and provides compatibility layer with it)
17:14:44
jackdaniel
there is also cffi-groveller to generate bindings automatically (cl-autowrap seems to have a similar purpose) - I've never used grovellers though
17:15:06
jackdaniel
cffi has a documentation; when unsure I usually look at tests in the source code
17:16:54
jackdaniel
on ecl there is a special flag to make things faster (by writing inlined calls) it is disabled by default because there is no good translation between pointer types between ecl and cffi (something possible to fix with extra effort)
17:17:29
jackdaniel
basically it boils down to the fact, that modern C compilers won't accept a declaration void*(*)() to a function int*(*)()
17:18:22
dbotton
Would be good to use but don't want for this project anything that is implementation specific
17:19:16
jackdaniel
#+ecl (setf cffi::*that-flag-I-don-t-rememmber-name-of* :static) or something in this spirit
17:20:26
jackdaniel
ecl can do it three ways: dynamic ffi, dlopen ffi and static ffi - cffi implements all three
20:02:52
npfaro
If I have an array with a fill pointer at a certain spot (with more room past the fill pointer) how do I copy another array into where the fill pointer is, advancing the fill pointer
20:05:09
Bike
i would manually increment the fill pointer and then use replace to do the copy, i think.
20:05:53
Bike
(let ((old-fp (fill-pointer dest))) (incf (fill-pointer dest) (length source)) (replace dest source :start1 old-fp))
20:50:52
pfdietz
I had to manually adjust the array; just increasing the fill-pointer doesn't extend the array.
20:51:57
npfaro`
pfdietz: if you were replying to me (i disconnected for a bit sorry) then I already allocated the array to be big enough from the start
20:56:14
VincentVega
kind of silly i haven't figured this one out yet, but in sly/slime how do you go to the line/function where an error occurs (when loading a project)? Looking at the backtrace every time is proving to be a bit of a hassle.
21:00:14
Xach
Oh, like, to skip irrelevant-to-you frames and get to something that might be more meaningful?
21:04:18
Xach
if it's really throwaway i try to work with */**/***, and i'm learning sly's #vN history syntax too.
0:15:10
travv0
you sure that's what's written to the stream and not just your repl printing the return value?
0:55:37
npfaro`
Of all the knobs here http://clhs.lisp.se/Body/f_wr_pr.htm i'm not sure which one to use to get that sort of thing
1:01:09
ralt
loke: I've seen in some logs that you managed to get signals from dbus, would you care to share some snippets to do this? I want to subscribe to a known signal but unclear what I'm supposed to do.
2:46:43
npfaro
i don't know if that's the best way haha. if anyone else has a better idea please chime in
3:00:27
Alfr_
martinjungblut, careful if list has a odd number of elements, then on the last iteration b will be nil; just keep that in mind that it won't error.
3:00:35
aeth
destructuring bind will force an error, unlike LOOP's destructuring, but it's not as elegant. (loop for sublist on '(1 2 3) by #'cddr collect (destructuring-bind (a b &rest rest) sublist (declare (ignore rest)) (cons a b)))
3:01:27
martinjungblut
as a newcomer, I have to say, Common LISP is a hell of an environment to write software in
3:04:03
aeth
Oh, and there's an in between route, which is to do the sublist thing, but then destructure it in the next LOOP variable instead of having local d-b variables.
3:16:21
npfaro
is there any way to convert a number into a list of bytes without manual bit shifting
3:25:21
npfaro
Is there any better idiom for an increasing counter in loop than (loop for i = 0 then (1+ i))
3:26:34
specbot
The for-as-arithmetic subclause: http://www.lispworks.com/reference/HyperSpec/Body/06_abaa.htm
3:54:13
emaczen
What is the the timezone in encode and decode universal-time? I don't see a description in the docs
4:01:49
Bike
"time zone n. a rational multiple of 1/3600 between -24 (inclusive) and 24 (inclusive) that represents a time zone as a number of hours offset from Greenwich Mean Time. Time zone values increase with motion to the west, so Massachusetts, U.S.A. is in time zone 5, California, U.S.A. is time zone 8, and Moscow, Russia is time zone -3."
4:08:34
Bike
if you look at the bottom menu on clhs pages, the glossary is there between "symbol index" and "x3j13 issues"