Search found 11 matches

by jef
Fri Sep 18, 2015 2:03 pm
Forum: newLISP in the real world
Topic: Documentation typo in CodePatterns
Replies: 1
Views: 2829

Documentation typo in CodePatterns

Hi, I realized that the code for the fibonacci functions in the codepatterns section is wrong: http://www.newlisp.org/CodePatterns.html#toc-5 The code is: ; classic recursion ; slow and resource hungry (define (fib n) (if (< n 2) 1 (+ (fib (- n 1)) (fib (- n 2))))) > (fib 12) 233 Should be: ; classi...
by jef
Tue Jan 20, 2015 9:27 pm
Forum: newLISP newS
Topic: newLISP stable release 10.6.2
Replies: 20
Views: 10202

Re: newLISP stable release 10.6.2

Thanks a lot for this new release Lutz!
by jef
Tue Oct 14, 2014 6:46 pm
Forum: newLISP in the real world
Topic: implicit indexing on empty string
Replies: 2
Views: 1528

Re: implicit indexing on empty string

Lutz wrote:When these conflicts occur in newLISP, they are normally decided by the occurrance of real world usage patterns and their practicality rather then trying to be consistent.
Perfect, I see the point. Thanks for your detailed explanation!
by jef
Mon Oct 13, 2014 7:51 pm
Forum: newLISP in the real world
Topic: implicit indexing on empty string
Replies: 2
Views: 1528

implicit indexing on empty string

I'm surprised that implicit indexing doesn't raise an error on an empty string (when called with 0 or -1), while it does on an empty list: > ("" 0) "" > ("" -1) "" With another index, we get an error as expected: > ("" 1) ERR: invalid string index If we compare to implicit indexing on an empty list,...
by jef
Sun Jun 15, 2014 5:52 pm
Forum: newLISP in the real world
Topic: I/O multiplexing on pipes
Replies: 7
Views: 2484

Re: I/O multiplexing on pipes

ralph.ronnquist wrote:How about net-select?.
Yes Ralph, you're totally right, it's exactly what I was looking for.
Works perfectly.
by jef
Mon Jun 02, 2014 5:44 pm
Forum: newLISP in the real world
Topic: Wanting stdout, stderr and return code of shell commands
Replies: 2
Views: 1380

Re: Wanting stdout, stderr and return code of shell commands

Old post but it's worth a reply as I was also looking for a solution. process and waitpid can be used. An example returning stdout/stderr combined and the return code of the command: (define (exec2 cmd) (let ((pid) (out_r) (out_w) (output) (data)) (map set '(out_r out_w) (pipe)) (setq pid (process c...
by jef
Sat May 31, 2014 9:58 am
Forum: newLISP in the real world
Topic: I/O multiplexing on pipes
Replies: 7
Views: 2484

Re: I/O multiplexing on pipes

Yes your code works for the ret_sint32 function, which takes an int as an argument and return an int as a result. My problems comes when I want to call a function taking no argument and returning a signed int: $ cat returnneg.c int returnneg() { return -1; } $ gcc -Wall -fPIC returnneg.c -shared -o ...
by jef
Sun May 25, 2014 7:00 pm
Forum: newLISP in the real world
Topic: I/O multiplexing on pipes
Replies: 7
Views: 2484

Re: I/O multiplexing on pipes

Thanks for the advice about named pipes and peek. Code has been tested on Debian/Squeeze and Debian/Jessie, on amd64. Newlisp is compiled with ffilib. $ gcc -m64 -fPIC ffitest.c -shared -o ffitest.dylib $ newlisp newLISP v.10.6.0 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h > (sys-info) ...
by jef
Sat May 24, 2014 3:09 pm
Forum: newLISP in the real world
Topic: I/O multiplexing on pipes
Replies: 7
Views: 2484

I/O multiplexing on pipes

Had to perform some I/O multiplexing on pipes (read multiple pipes in parallel until they're closed), and realized that newlisp does not provide a function like "select" in C to monitor file descriptors. I've looked in the documentation but didn't find any solution. I've ended doing a C implementati...
by jef
Sun May 18, 2014 7:52 pm
Forum: newLISP and the O.S.
Topic: newlisp with libreadline 6.3
Replies: 2
Views: 3010

Re: newlisp with libreadline 6.3

Your patch works Lutz, and dev version 10.6.1 compiles just fine.
Thanks a lot for your work on newlisp, that's an amazing piece of software.
by jef
Sun May 18, 2014 9:04 am
Forum: newLISP and the O.S.
Topic: newlisp with libreadline 6.3
Replies: 2
Views: 3010

newlisp with libreadline 6.3

Hi everyone, I'm a newcomer to newlisp, that's my first post on this forum. Had an issue compiling newlisp with readline on debian testing (error messages bellow). CPPFunction and the like are unavailable since readline 6.3. I provide here a quick diff to get it compiled properly: --- newlisp-10.6.0...