Search
Wednesday, 19th of July 2017, 21:37:42 UTC
22:00:31
knusbaum
How hard is the CLR to target?
22:01:53
Cthulhux
not much. several lisps did/do
22:02:35
Cthulhux
also, http://weitz.de/rdnzl/
23:17:06
ralt
I'm trying to build an executable with ECL, using asdf's :entry-point
23:17:28
ralt
but it fails with "No such file or directory", trying to look for .a files
23:17:36
ralt
(gcc errors out, that is.)
23:20:27
ralt
apparently, (asdf:perform 'asdf:program-op :mypackage) wasn't the way to go
23:20:37
ralt
but (asdf:make-build :mypackage :type :program) is.
23:26:19
rpg
ralt: you never call PERFORM directly.... (asdf:oos 'asdf:program-op :mypackage) might have worked (operate-on-system, not PERFORM).
23:26:41
rpg
It's ASDF's job to figure out which calls to PERFORM must be made, and in what order.
23:27:15
ralt
rpg: thanks, I didn't know.
2:28:09
beach
Good morning everyone!
6:27:24
reinuseslisp
is it there any common lisp for mac os 9.2.2 (pre os x)?
6:39:23
phoe
reinuseslisp: Macintosh Common Lisp?
6:40:29
beach
CCL was forked from MCL. Maybe CCL works.
6:40:55
reinuseslisp
hmm, ccl supports Darwin
6:40:58
phoe
CCL: Mac OS X 10.6 and later (x86, x86-64)
6:41:15
phoe
Nope, I can't find a version for Mac OS 9.
6:41:43
reinuseslisp
I hope asdf works on MCL
6:43:45
beach
reinuseslisp: You may want to check with pjb. He has worked on MCL for some projects as I recall.
6:45:32
reinuseslisp
does he connect here?
6:47:26
beach
He is sometimes ogamita, and sometimes pjb.
6:53:01
reinuseslisp
Thanks. I've found a (dated) MCL dmg file, I'll try it tomorrow
9:16:05
flip214
I'm trying to use CFFI. I need to allocate a pointer (done via (cffi:with-foreign-object (x :pointer))), and then need to pass the _address_ of that pointer to a function.
9:16:23
flip214
I can't find a function to get me the address of the SAP, though...
9:16:46
flip214
Do I need to check the foreign function declaration to make it pass the address of the SAP on?
9:17:19
phoe
you just pass x to the function
9:17:36
phoe
if foreign function FOO expects a pointer, then you go (foo x)
9:18:07
flip214
well, it's about gphoto2 and (cffi:defcfun ("gp_list_new" gp_list_new) :int (list :pointer))
9:18:35
flip214
this actually needs to get the address of a pointer, so that it can allocate some memory and "return" the address
9:18:55
phoe
a pointer *is* an address
9:19:23
phoe
you need the memory location at which the pointer is stored?
9:19:53
phoe
so basically a pointer pointer?
9:20:19
flip214
CameraList *list; gp_list_new(&list);
9:20:41
flip214
int gp_list_new (CameraList **list);
9:20:46
flip214
is the C header file line
9:22:38
phoe
Let's go a level below
9:23:08
phoe
You have a function, it expects to get some memory address as its argument.
9:24:33
phoe
You give it an address of a size_t, it does some magic and destructively modifies the size_t at that address. Do I get it right?
9:25:10
flip214
well, I give it the address of a (void *), and the _destination_ of that pointer is modified, yeah.
9:25:35
flip214
not sure whether size_t is always the same size.... but I guess at least same size.
9:26:04
phoe
size_t is size of a pointer, 4 bytes on 32-bit machines, 8 bytes on 64-bit machines.
9:26:28
phoe
also, in CFFI, pointers are untyped. you only type them when you dereference them.
9:26:46
phoe
so you can just allocate size_t bytes of memory and pass that address to that function.
9:27:11
phoe
when that function returns, that address will now contain what you want.
9:27:55
flip214
yeah, but how do I pass the address? That's what I'm trying to do in these wrapper functions...
9:28:12
phoe
in case of pointers - just pass the object.
9:29:03
phoe
CFFI will notice that you passed it a SAP object, and it will unwrap it and pass the pointer itself to the C function.
9:30:24
flip214
yeah, but to _initialize_ the pointer I need to pass the _address_ of that pointer to a function!
9:30:36
flip214
Ie. "gp_list_new(CameraList **list)"
9:31:05
flip214
one sec, paste incoming.
9:32:22
phoe
flip214: you don't get it yet. a pointer to a pointer *is* a pointer.
9:32:55
phoe
*that* is the pointer that you want to create and pass. the "outer" one.
9:33:56
phoe
forget about C types for a moment. all in all, you are not allocating "pointers to pointers". you're allocatiing size_t bytes of raw memory, and that's what your function actually expects.
9:37:23
flip214
http://paste.lisp.org/display/351275
Thursday, 20th of July 2017, 9:37:42 UTC