freenode/#lisp - IRC Chatlog
Search
22:13:22
splittist
OK. After a few hours work I'm back where I started, with something that almost works, but now with a myriad layers of indirection. Time to declare victory and leave it for the evening. :P
22:18:23
splittist
the indirection/protocol thing actually works fine, now. It's just that I started the day with a slightly-broken thing and I'm ending it with exactly the same brokenness. But there is a slightly sleeker yak, so that's something.
22:26:14
splittist
It started yesterday as a bit of a distraction from something else docx-related. (Which itself is ...) Basically, it 's squirrels all the way down.
22:27:22
phoe
depends on your CPU architecture I guess, same question as "which direction does the stack grow"
23:12:36
no-defun-allowed
(defun lousy-or (value &rest values) (let ((next (apply #'lousy-or values))) (if (null value) next value))) ; but this has non-tail recursion and is slightly cursed
23:14:23
White_Flame
some of the cyc code very, very manually performs a non-shortcutting OR on 2 cleanup items for a "success" return, and I'm wondering if there's some little trick
23:15:45
Xach
White_Flame: so it evaluates everything (unlike OR) and still gives the semantics of only being true if something is true.
23:16:07
White_Flame
ah true, I didn't explore SOME because of that, although I know it's been used for such things
23:32:10
gabc
Is there any external requirement to use Qtools? Or this should be enough? (ql:quickload '(qtools qtcore qtgui))
3:54:11
reepca
I find myself needing to use native namestrings for passing arguments to another program, and it seems that calling (namestring (make-pathname :name "a.b.c")) produces "a\\.b\\.c". I'm quite confused why this is. Does SBCL think that "canonical form" means "shell-special-characters escaped"?
3:59:54
reepca
seems native-namestring is what I want... I vaguely remember running into this problem before
4:23:22
pjb
reepca: if you pass the argument to another program that is NOT written in SBCL, then you want to pass NOT a PATHNAME or a NAMESTRING, but a POSIX path!
4:26:52
White_Flame
reepca: the period is often used to separate name from type (extension), so that's probably the root of the backslashing
4:58:15
emaczen
What can I expect with regards to this $365 bounty: https://www.bountysource.com/issues/75202399-wanted-by-value-structures-in-sb-alien
4:58:15
minion
emaczen, memo from pjb: lisp itself is just an assembler. Just avoid the most sophisticated macros (or consider lisp as a macro assembler and use them!). See for example: https://groups.google.com/forum/#!msg/comp.lang.lisp/T3UZwLoN0lw/4r9q_8cwKoQJ THIS IS YOUR STABLE ASSEMBLER!
7:35:11
Nilby
Some very rare person already familiar with it might be able to do it in a few days, but I spent more than that just educating myself and doing background research.
7:37:43
_death
cffi can do that with libffi, though I had to patch things a bit to make things work for my use case
7:39:18
Nilby
Yes, but it isn't an ideal solution. It is hard to compile and find for some platforms, and then it dynamically creates a function call, which could "easily" just be compiled in.
7:46:16
Nilby
It's extra maddening because passing C structs by value is usually stupid anyway, and C struct layout can have a lot of edge cases.
7:48:08
emaczen
Nilby: Will you look at this and give me a few suggestions? I am stumped: https://plaster.tymoon.eu/view/1646#1648
7:51:53
emaczen
Nilby: Thanks, I think the biggest not is that test4 is the same as test3 (test3 works!) except test4 is using a C struct, which should rule out my other code from being problematic
7:52:35
emaczen
Nilby: Which to me would mean the most likely error is in the definition of the C struct for libffi
7:59:20
emaczen
Yeah, the error I get is an Unhandled memory fault at #x0 to during the ffi:ffi-call
8:03:18
Nilby
My recommendation would be to start with an easier struct. Like something with only a couple members. If there's one little thing out of place, you'll have trouble.
8:06:15
Nilby
For the x86_64 abi sometimes struct member values that can fit in 64 bit words are just put in registers, but sometimes it points to the stack, so for anything complex it usually involves doing some stack allocating.
8:09:16
Nilby
But one approach might be to get CCL to successfully make the call, and observe it very carefully. Or you could carefully observe objective C in the debugger.
8:10:35
emaczen
Or what exactly makes this struct not simple? I would think of it as just a 16 byte block -- pretty simple
8:18:44
galdor
emaczen: at less than 4 digits, I fail to see anyone investing real time and energy on it, given the fact that if it was trivial, it would already be done
8:19:32
galdor
and since some CL implementations need patching (+ cffi to use it instead of libffi, good luck to have cffi updated), you're looking at significant work