Search found 11 matches
- Fri Sep 18, 2015 2:03 pm
- Forum: newLISP in the real world
- Topic: Documentation typo in CodePatterns
- Replies: 1
- Views: 4296
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...
- Tue Jan 20, 2015 9:27 pm
- Forum: newLISP newS
- Topic: newLISP stable release 10.6.2
- Replies: 20
- Views: 21396
Re: newLISP stable release 10.6.2
Thanks a lot for this new release Lutz!
- Tue Oct 14, 2014 6:46 pm
- Forum: newLISP in the real world
- Topic: implicit indexing on empty string
- Replies: 2
- Views: 2799
Re: implicit indexing on empty string
Perfect, I see the point. Thanks for your detailed explanation!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.
- Mon Oct 13, 2014 7:51 pm
- Forum: newLISP in the real world
- Topic: implicit indexing on empty string
- Replies: 2
- Views: 2799
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,...
- Sun Jun 15, 2014 5:52 pm
- Forum: newLISP in the real world
- Topic: I/O multiplexing on pipes
- Replies: 7
- Views: 5438
Re: I/O multiplexing on pipes
Yes Ralph, you're totally right, it's exactly what I was looking for.ralph.ronnquist wrote:How about net-select?.
Works perfectly.
- 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: 2963
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...
- Sat May 31, 2014 9:58 am
- Forum: newLISP in the real world
- Topic: I/O multiplexing on pipes
- Replies: 7
- Views: 5438
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 ...
- Sun May 25, 2014 7:00 pm
- Forum: newLISP in the real world
- Topic: I/O multiplexing on pipes
- Replies: 7
- Views: 5438
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) ...
- Sat May 24, 2014 3:09 pm
- Forum: newLISP in the real world
- Topic: I/O multiplexing on pipes
- Replies: 7
- Views: 5438
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...
- Sun May 18, 2014 7:52 pm
- Forum: newLISP and the O.S.
- Topic: newlisp with libreadline 6.3
- Replies: 2
- Views: 4709
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.
Thanks a lot for your work on newlisp, that's an amazing piece of software.
- Sun May 18, 2014 9:04 am
- Forum: newLISP and the O.S.
- Topic: newlisp with libreadline 6.3
- Replies: 2
- Views: 4709
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...