Re: In Detail: Native C Calls

2012-05-13 Thread Alexander Burger
Hi Henrik, Worked, thanks! So I'm now using this line: gcc -o main.so -m64 -std=gnu99 -fPIC -shared -export-dynamic main.c -lm -lpcre OK, thanks. I haven't scrutinized it in detail, just a minor hint: (while (let? R (line T) (link R)) ) ) ) ) The

Re: In Detail: Native C Calls

2012-05-12 Thread Henrik Sarvell
Worked, thanks! So I'm now using this line: gcc -o main.so -m64 -std=gnu99 -fPIC -shared -export-dynamic main.c -lm -lpcre It seems the version 3 number was not needed after all. I've attached the C code for reference and this is what I use in PL: (println (pipe (native pcre/main.so

Re: In Detail: Native C Calls

2012-05-11 Thread Henrik Sarvell
I've been looking into using this in conjunction with the pcre library. However I have problems with both returning results and capturing them in PL. The result should be an array of strings or if it's more convenient stored by reference in a variable. ATM I'm trying with the following: void

Re: In Detail: Native C Calls

2012-05-11 Thread Alexander Burger
Hi Henrik, ATM I'm trying with the following: void tst(char *strs[2]){ strs[0] = foo; strs[1] = bar; } (native pcre/main.so tst NIL '(X (8 . S))) X contains foo but I can't seem to get at bar. Right. (8 . S) is a structure of size 8, consisting of a single string

Re: In Detail: Native C Calls

2012-05-11 Thread Alexander Burger
Oops, forgot one answer. On Fri, May 11, 2012 at 08:48:15PM +0700, Henrik Sarvell wrote: Maybe it's just easier to print the results and capture that? If so then maybe it's even easier/more efficient to skip this completely and simply call an executable or does native have lower overhead? I

Re: In Detail: Native C Calls

2012-05-09 Thread Jakob Eriksson
On May 9, 2012 at 3:33 PM Alexander Burger a...@software-lab.de wrote: Does anybody know of a programming language with an equally powerful -- yet as simple -- C function interface? Except C/C++ of course ;-) I think D has it. (D is pretty nice, it looks like C++ except the evil.) best

Re: In Detail: Native C Calls

2012-05-09 Thread Rand Dow
Alex, That looks great! I'm very impressed with native and now he doc! Cheers! Rand On May 9, 2012, at 3:33 PM, Alexander Burger a...@software-lab.de wrote: Hi all, at last, I have found the time to write an in-detail description of the 'native' function:

Re: In Detail: Native C Calls

2012-05-09 Thread Thorsten Jolitz
Alexander Burger a...@software-lab.de writes: Hi Alex, at last, I have found the time to write an in-detail description of the 'native' function: http://software-lab.de/doc/native.html Any comments welcome! It became quite long, not because 'native' is so complicated, but because

Re: In Detail: Native C Calls

2012-05-09 Thread Alexander Burger
Hi Jakob, Does anybody know of a programming language with an equally powerful -- yet as simple -- C function interface? Except C/C++ of course ;-) I think D has it. (D is pretty nice, it looks like C++ except the evil.) OK, but, well, if I understand it right, D is an extension of C (a