Search found 13 matches

by steloflute
Tue Jan 17, 2017 5:49 pm
Forum: newLISP in the real world
Topic: stderr device number in the manual
Replies: 1
Views: 1133

stderr device number in the manual

In the manual ( http://www.newlisp.org/downloads/newlisp_manual.html#device ), stderr is not mentioned. I think 2 is the stderr. Test code (test.lsp): (write-line 2 "stderr") (println "stdout") (exit) newlisp test.lsp > out.txt Then, "stderr" is printed to the screen. "stdout" is printed to the file...
by steloflute
Wed Oct 19, 2016 4:13 am
Forum: newLISP in the real world
Topic: string function returns literal list
Replies: 3
Views: 4294

Re: string function returns literal list

It is intended. See http://www.newlisp.org/downloads/newlisp_manual.html#string Translates into a string anything that results from evaluating exp-1—. If more than one expression is specified, the resulting strings are concatenated. (string 'hello) → "hello" (string 1234) → "1234" (string '(+ 3 4)) ...
by steloflute
Wed Aug 31, 2016 8:50 am
Forum: Anything else we might add?
Topic: Strange reader
Replies: 5
Views: 6729

Re: Strange reader

Hi, Lutz.

Speed efficiency for read? or for eval? If it is for read, then I agree. But if it it not, I suggest putting preprocessing stage between read and eval stages. Then the symbols lambda, lambda-macro, fn and fn-macro can be used in a user land.
by steloflute
Mon Jan 11, 2016 4:56 am
Forum: Anything else we might add?
Topic: Strange reader
Replies: 5
Views: 6729

Strange reader

I think special processing for lambda and fn is done too early. The reader should preserve the symbols as is. > 'lambda ERR: invalid lambda expression : "lambda" > 'fn ERR: invalid lambda expression : "fn" > 'a a > (quote lambda) ERR: invalid lambda expression : " lambda)" > (fn (x) x) (lambda (x) x...
by steloflute
Tue Aug 19, 2014 1:44 am
Forum: Anything else we might add?
Topic: Typo in manual
Replies: 0
Views: 4283

Typo in manual

define-macro | http://www.newlisp.org/downloads/newlis ... fine-macro

Since v.10.5.8, newLISP also as expansion macros using macro.

->

Since v.10.5.8, newLISP also has expansion macros using macro.

I find expansion macros very useful. ^^
by steloflute
Sun Jan 12, 2014 3:37 pm
Forum: Anything else we might add?
Topic: Typo in modules documentation
Replies: 0
Views: 1323

Typo in modules documentation

In http://www.newlisp.org/code/modules/

Module: zlisp.lsp
-> Module: zlib.lsp

In http://www.newlisp.org/code/modules/zlib.lsp.html

Module: zlisp.lsp
-> Module: zlib.lsp

sepcific
-> specific
by steloflute
Fri Nov 08, 2013 9:06 am
Forum: newLISP in the real world
Topic: Thousand's separator
Replies: 9
Views: 1873

Re: Thousand's separator

One-liner:

Code: Select all

(define (format1000 n)
	(append (sgn n "-" "" "") (reverse (join (explode (reverse (string (abs n))) 3) ","))))
(format1000 123456789)
(format1000 -123456789)
by steloflute
Tue Nov 05, 2013 3:26 am
Forum: newLISP in the real world
Topic: Thousand's separator
Replies: 9
Views: 1873

Re: Thousand's separator

My attempt: > (define (format1000 n) (setq s (reverse (string n))) (setq acc "") (for (i 0 (dec (length s))) (when (and (> i 0) (zero? (% i 3)) (number? (int (s i)))) (setq acc (append acc ","))) (setq acc (append acc (s i)))) (reverse acc)) > (format1000 123456789) "123,456,789" > (format1000 -1234...
by steloflute
Thu Oct 31, 2013 1:27 am
Forum: newLISP and the O.S.
Topic: make on AIX 5.3
Replies: 3
Views: 3715

Re: make on AIX 5.3

Code: Select all

make -f makefile_aixLP64_utf8_gcc

./newlisp
newLISP v.10.5.4 64-bit on AIX IPv4/6 UTF-8, options: newlisp -h

> (+ 1 2)
3
by steloflute
Sun Oct 27, 2013 9:44 am
Forum: Anything else we might add?
Topic: bigint arithmetic + - * / bug?
Replies: 3
Views: 1734

Re: bigint arithmetic + - * / bug?

Thank you for your reply! Oh, the documentation.. It is in the examples. I think it should go to the main description. ^_^ ; only 2 arguments are allowed in big integer operations ; apply with reduce parameter 2 guarantees 2 args at a time ; sequence itself does not take big integers, before using ;...
by steloflute
Sun Oct 27, 2013 9:07 am
Forum: Anything else we might add?
Topic: bigint arithmetic + - * / bug?
Replies: 3
Views: 1734

bigint arithmetic + - * / bug?

arithmetic operators + - * / accept only 2 bigint arguments?

> (apply * (dup 2 10))
1024
> (* 2L 2L 2L)
4L
> (apply * (dup 2L 10))
4L
> (apply * (dup 2L 10) 2)
1024L

I think it is not consistent. cf.
> (* 2 2 2)
8
by steloflute
Sun Apr 21, 2013 5:05 am
Forum: Anything else we might add?
Topic: wish i could enter multiline expressions by default
Replies: 10
Views: 2907

Re: wish i could enter multiline expressions by default

I find it hard to use in the current requirement (Multiline expressions can be entered by entering an empty line first. http://www.newlisp.org/downloads/newlisp_manual.html#multiline). I suggest a new method: Wait evaluation until all parentheses and quotes are matched. Almost all modern Lisps (Rack...
by steloflute
Tue Nov 06, 2012 4:12 pm
Forum: newLISP Graphics & Sound
Topic: Sweep second clock in newLISP
Replies: 1
Views: 4187

Sweep second clock in newLISP

Hello,

I have made a clock program in newLISP.

http://steloflute.tistory.com/entry/newLISP-SweepSecond

How do you remove flickering?