Search found 72 matches

by kosh
Tue Apr 05, 2011 3:44 pm
Forum: newLISP in the real world
Topic: Windows Exe (made by link.lsp) could not read self exe-file.
Replies: 3
Views: 2024

Re: Windows Exe (made by link.lsp) could not read self exe-f

Hi Lutz. A ifdef macro syntax errors found. [CentOS 5.5 x86_64] (It is necessary to be likely to contact Ted Walther, because configure-alt is used..) $ ./configure-alt && make ... make -f makefile_build make[1]: Entering directory `/home/kosh/src/newlisp-10.3.1' gcc -m64 -Wall -pedantic -Wno-long-l...
by kosh
Wed Mar 16, 2011 3:54 am
Forum: newLISP in the real world
Topic: for loop weiredness
Replies: 2
Views: 1535

Re: for loop weiredness

The variable type of i is maybe `double' (newlisp's float type). printf %i (dll or libc.so) requires a `int' argument. Therefore, the output will be broken because of type mismatches. (for (i 1 10 1) (println (float? i))) ;-> true ... The solution is use "int" function, or %f, %g format. (printf "%i...
by kosh
Mon Feb 28, 2011 6:16 am
Forum: newLISP in the real world
Topic: This week's challenge
Replies: 15
Views: 4904

Re: This week's challenge

It works :) (define (func lst) (map (lambda (c) (filter (lambda (elem) (starts-with elem c)) (sort lst))) (unique (map first lst)))) (func l) ;=> (("a12" "aa" "aa1112" "aaa12" "aaaa123") ; ("b" "b12" "ba" "ba1112" "baa12" "bbaa123") ; ("c1" "c1121aa" "c1313" "c2" "caababb"))
by kosh
Fri Feb 25, 2011 1:33 am
Forum: newLISP in the real world
Topic: Buffer overflow in multiline-mode
Replies: 1
Views: 1128

Buffer overflow in multiline-mode

$ ./newlisp newLISP v.10.3.0 on Linux IPv4/6 UTF-8, execute 'newlisp -h' for more info. > @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ... (Large strings MAX_COMMAND_LINE or more) *** buffer overflow detected ***: ./newlisp terminated ======= Backtrace: ========= /lib/tls/i686/cmov/libc.so.6(__fortify_f...
by kosh
Fri Feb 18, 2011 7:55 am
Forum: newLISP in the real world
Topic: (int (exp (gammaln 6))) ;=> 119
Replies: 2
Views: 1224

Re: (int (exp (gammaln 6))) ;=> 119

I've understood this problem.
Thanks, Lutz.
by kosh
Fri Feb 18, 2011 1:48 am
Forum: newLISP in the real world
Topic: (int (exp (gammaln 6))) ;=> 119
Replies: 2
Views: 1224

(int (exp (gammaln 6))) ;=> 119

Hello, Lutz. The problem that does not correctly convert float to integer was found. newLISP v.10.3.0 on Linux IPv4/6 UTF-8, execute 'newlisp -h' for more info. > (setq x (exp (gammaln 6))) 120 > (float? x) true > (int x) 119 > (bits x) "1110111" ; (int "1110111" 0 2) is 119 > (bits 120.0) "1111000"...
by kosh
Wed Nov 24, 2010 7:04 pm
Forum: newLISP and the O.S.
Topic: PCRE_UTF8 unavailable when using configure-alt
Replies: 2
Views: 2849

PCRE_UTF8 unavailable when using configure-alt

Hello, Lutz Is the bug report good here? $ ./configure && make gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX pcre.c ... $ ./newlisp -n -e '(regex-comp "ほげほげ" 0x800)' # PCRE_UTF8 = 0x800 "ERCP7\000..." $ ./configure-alt && make gcc -m32 -Wall...
by kosh
Sun May 30, 2010 3:17 pm
Forum: newLISP in the real world
Topic: [patch] "exec" to enable a binary string in pipe
Replies: 2
Views: 1175

[patch] "exec" to enable a binary string in pipe

syntax: (exec str-process) syntax: (exec str-process [str-stdin]) Current exec function second syntax (p_exec:nl-filesys.c) is unable use a binary string. There is caused by strlen function which treat as a NULL terminator character. newLISP's cell string has own length. I think this problem can be...
by kosh
Fri Apr 30, 2010 1:41 pm
Forum: newLISP and the O.S.
Topic: get-url with "list debug" option is buggy
Replies: 1
Views: 2125

get-url with "list debug" option is buggy

newLISP v.10.2.4 on Linux IPv4 UTF-8, execute 'newlisp -h' for more info. > ; "list" option works well. > (read-file "[url]http://www.newlisp.org/example.lsp[/url]" "list") ("Last-Modified: Tue, 01 Jul 2008 13:54:24 GMT\r\nAccept-Ranges: bytes\r\nContent-Length: 58\r\nContent-Type: text/plain\r\nDa...
by kosh
Sun Apr 25, 2010 4:37 pm
Forum: newLISP and the O.S.
Topic: reading /proc files returns null
Replies: 2
Views: 2478

Re: reading /proc files returns null

Yes, 'read-file' uses the file size and should only be used for real files. But you could open it as a device, then 'read' it into a buffer: Hmmm... I like to get file contents with read-file function. Though I hope that the read-file to available a virtual file too, now I use a open or exec functi...
by kosh
Fri Apr 23, 2010 7:38 pm
Forum: newLISP and the O.S.
Topic: reading /proc files returns null
Replies: 2
Views: 2478

reading /proc files returns null

Hi, Lutz. I want to read a file in the "/proc" directory. however `read-file' function returns empty string... newLISP v.10.1.12 on Linux IPv4 UTF-8, execute 'newlisp -h' for more info. > (read-file "/proc/cpuinfo") "" > !cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model ...
by kosh
Sat Apr 10, 2010 9:54 pm
Forum: newLISP and the O.S.
Topic: some HTTP functions error
Replies: 2
Views: 2643

some HTTP functions error

## 1. Cannot restore context in (load "http://...") for example... newLISP v.10.2.1 on Win32 IPv4 UTF-8, execute 'newlisp -h' for more info. > (print (get-url "http://gist.github.com/362201.txt")) ;; ... (context 'MAIN) > (context 'Foo) Foo> (load "http://gist.github.com/362201.txt") > (println "Con...
by kosh
Sat Apr 03, 2010 1:41 pm
Forum: newLISP and the O.S.
Topic: Call of (process ...) + from CGI problem under Win32
Replies: 3
Views: 3077

Re: Call of (process ...) + from CGI problem under Win32

I've tried to create new process with the code below: Code: (process "newlisp.exe my-proc.lsp") Prease try the following code: (import "shell32.dll" "ShellExecuteA") ;; Open notepad.exe ;(ShellExecuteA 0 "open" "notepad.exe" "" 0 1) (ShellExecuteA 0 "open" "newlisp.exe" "my-proc.lsp" 0 1) ;(ShellEx...
by kosh
Mon Mar 29, 2010 10:52 pm
Forum: newLISP newS
Topic: Manual and release notes for upcoming 10.2.0
Replies: 31
Views: 16038

Re: Manual and release notes for upcoming 10.2.0

In newlisp_manual.html, some lines that have a unbalanced double quotes(") are found. Please see diff file below: --- newlisp_manual-10.2.1-rev2.orig.html Tue Mar 30 02:59:58 2010 +++ newlisp_manual-10.2.1-rev2.html Tue Mar 30 03:12:13 2010 @@ -2099,7 +2099,7 @@ ; strings -(set 's "NewLISP) +(set 's...
by kosh
Tue Mar 16, 2010 3:47 pm
Forum: newLISP in the real world
Topic: Illegal symbols cannot restore
Replies: 3
Views: 1236

Re: Illegal symbols cannot restore

Thanks Lutz. I'm looking forward to next version release. On another note the report added about illegal symbol. > (legal? (uuid)) nil > (define (gensym) (sym (uuid))) ; make unique symbol use `uuid' > (letex (s (gensym) v (gensym)) (define-macro (my-setq s v) (set s (eval v)))) > (print (source 'my...
by kosh
Mon Mar 15, 2010 12:09 pm
Forum: newLISP in the real world
Topic: Illegal symbols cannot restore
Replies: 3
Views: 1236

Illegal symbols cannot restore

newLISP v.10.1.12 on Linux IPv4 UTF-8, execute 'newlisp -h' for more info. > (legal? "#") nil > (new Tree (sym "#")) ; make context `#' > (set (sym "one" (sym "#")) 1) ; `#:one' = 1 > (set (sym "two" (sym "#")) 2) ; `#:two' = 2 > (source (sym "#")) "\n(context '#)\n\n(set 'one 1)\n\n(set 'two 2)\n\...
by kosh
Sun Jan 10, 2010 12:17 pm
Forum: newLISP in the real world
Topic: suggesting the newLISP manual as CHM
Replies: 5
Views: 2407

Re: suggesting the newLISP manual as CHM

hello kukma.
I tried to make the newLISP.chm, and this is it.

http://cloud.github.com/downloads/kosh0 ... ewLISP.chm

But its simply comvert *.html to chm file,
so cannot use keyword-search and so on...

---
kosh
by kosh
Sat Dec 12, 2009 11:12 pm
Forum: newLISP and the O.S.
Topic: format bugs, etc.
Replies: 3
Views: 3010

Re: format bugs, etc.

(rand 0)'s different behaviour is well-documented...
mmm... I should check the documents.
sorry for misread the situation.
by kosh
Sat Dec 12, 2009 9:40 pm
Forum: newLISP and the O.S.
Topic: format bugs, etc.
Replies: 3
Views: 3010

format bugs, etc.

## 1. `format' function returns a value different from `printf()' (format "%#05x" 10) ;-> ERR: problem in format string in function format : "%#05x" (import "libc.so.6" "printf") (printf "%#05x" 10) ;-> 0x00a ;=> 5 (format "%c" 0) ; => "" (empty string) (printf "%c" 0) ;-> ^@ ("\000") ;=> 1 ## 2. `(...
by kosh
Wed Nov 04, 2009 6:20 am
Forum: Whither newLISP?
Topic: defining functions inside functions
Replies: 5
Views: 4261

Re: defining functions inside functions

You mean like this? (define (mapflat f lst) (let ((visitor (lambda (x) ; define internal function (cond ((atom? x) x) ("else" (apply f (map visitor x))))))) (visitor lst))) (mapflat + '(1 2 3 (4 5 6 (7 8 9) 10))) ;=> 55 visitor ;=> nil --- kosh
by kosh
Thu Oct 29, 2009 1:03 pm
Forum: newLISP in the real world
Topic: for, positive?, negative?, divisible?
Replies: 6
Views: 1661

Re: for, positive?, negative?, divisible?

Current for macro does same behavior (for (i 3 0 +1) (println i)) ; print 3,2,1,0 (for (i 3 0 -1) (println i)) ; print 3,2,1,0 I think it will be work more better like this, ;; If `for' argument [num-step] no given, variable will increase by default. (for (i 3 0) (println i)) ; <no output> (for (i 3...
by kosh
Wed Sep 16, 2009 11:30 am
Forum: Anything else we might add?
Topic: net-error/sys-error returns strange value
Replies: 1
Views: 2147

net-error/sys-error returns strange value

Hello, Lutz. This is bug reports. (and first post) `net-error' function occasionally returns a strange value when the function given a number outside the range. (net-error 12) ;=> (12 "Listen failed") (net-error -1) ;=> (-1 "(null)") (net-error 75) ;=> (75 "application/pdf") (net-error 100) ;-> Segm...