I updated the manual translated to Japanese.
CodePatterns-20110810
guiserver_manual-144
There are in
In newlisp_manual-10302, rev is 3.
And in
maybe.
Thanks,
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu(set 'ACTX:var 123)Quote
(set 'sm 'ACTX:var)
(string sm) → "ACTX:var"
(term 'sm) → "var"
> (set 'ACTX:var 123)
123
> (set 'sm 'ACTX:var)
ACTX:var
> (string sm)
"ACTX:var"
> (term 'sm)
"sm"
> (term sm)
"var"
> (term 'ACTX:var)
"var"
>
Only on Mac OS X and other Unixes will the Cilk API parallelize tasks.Quote
Quote
All built-in primitives in newLISP can be easily renamed:
(constant 'plus +)
Now, plus is functionally equivalent to + and runs at the same speed.
As with many scripting languages, this allows for double precision floating point arithmetic to be used throughout newLISP.
;; pass data by context referenceQuote
(set 'Mydb:data (sequence 1 100000))
(define (change-db obj idx value)
(setf (obj:data idx) value))
(change-db Mydb 1234 "abcdefg")
(nth (Mydb:data 1234)) → "abcdefg"
QuoteSymbol creation in contexts
3.When an unknown symbol is encountered during code translation, a search for its definition begins inside the current context. Failing that, the search continues inside MAIN for a built-in function, context, or global symbol. If no definition is found, the symbol is created locally inside the current context.
ERR: context expected in function match : obj
called from user defined function $reader-event
(define (change-db obj idx value)Quote
(setf ((eval (sym 'data obj)) idx) value))
(define (change-dbx obj name idx value)
(setf ((eval (sym name obj)) idx) value))
(Mydb "data" (sequence 11 20))
(define (change-dby obj idx value)
(setf ((obj "data") idx) value))
(define (change-dbz obj name idx value)
(setf ((obj (string name)) idx) value))
QuoteUsing catch and throw
As an alternative to catch, thethrow-errorfunction can be used to catch errors caused by faulty code or user-initiated exceptions.
Quote
In newLISP, nil and the empty list () are not the same as in some other Lisps. Only in conditional expressions are they treated as a Boolean false, as in and, or, if, while, unless, until, and cond.
Quote
1.The empty list () is treated as the Boolen false in the following functions :
and, cond,do-until, do-while, if, if-not, or, unlrss, when, while
2.The empty list () is treated as the Boolen true excluding the above primitive functions.
> (map rest '((a b) (a) ()))
((b) () ())
> (filter rest '((a b) (a) ()))
((a b) (a) ())
> (clean rest '((a b) (a) ()))
()
> (map (fn (x) (or (rest x) nil)) '((a b) (a) ()))
((b) nil nil)
> (filter (fn (x) (or (rest x) nil)) '((a b) (a) ()))
((a b))
> (clean (fn (x) (or (rest x) nil)) '((a b) (a) ()))
((a) ())
>
> (title-case "aBCDE")
"ABCDE"
> (title-case "aBCDE" true)
"Abcde"
> (title-case "aBCDE" '())
"ABCDE"
>
newlips newLISP-help.lsp
newlips newLISP-help.lsp /usr/share/newlisp
newlips newLISP-help.lsp -URL=/usr/share/newlisp/newlisp_manual.html <- same as the usage above.
newlips newLISP-help.lsp -URL <- The latest reference is always shown.
newlips newLISP-help.lsp -URL=http://www.newlisp.org/downloads/newlisp_manual.html <- same as the usage above.
newlips newLISP-help.lsp guiserver.hlp <- GUI Funcion Reference showing.
newlips newLISP-help.lsp newlisp.ini <- Firstly, newlisp.ini and newlisp.hlp are created. At next time, Function Reference and Window's position and size are recoverd.
newLISP v.10.2.1 on Win32 IPv4, execute 'newlisp -h' for more info.
> (regex "b+" "AAAABBBAAAA" 1)
("BBB" 4 3)
> (find "b+" "AAAABBBAAAA" 1)
4
> (let (op 1) (regex "b+" "AAAABBBAAAA" op))
("BBB" 4 3)
> (let (op 1) (find "b+" "AAAABBBAAAA" op))
ERR: value expected in function find : op
>
In the find function the regex option can now be specified as nil to do an offset-based search without regular expressions.Quote
Quote
> (crit-chi2 0.99 1)
ERR: invalid parameter: 0.0 in function crit-chi2
> (crit-chi2 0.99 2)
9.21034045
> (gammai 1 (div (crit-chi2 0.99 2) 2))
0.9900000004
> (prob-chi2 (crit-chi2 0.99 2) 2)
0.009999999611
> (crit-chi2 0.99 3)
9.210340052
> (gammai 1.5 (div (crit-chi2 0.99 3) 2))
0.9733788431
> (gammai 1.5 (div 11.345 2))
0.9900006159
> (prob-chi2 (crit-chi2 0.99 3) 3)
0.0100000016
> (sub 1.0 (gammai 1 (div (crit-chi2 0.99 3) 2)))
0.0100000016
> (crit-chi2 0.99 4)
13.27670443
> (gammai 2 (div (crit-chi2 0.99 4) 2))
0.9900000013
> (prob-chi2 (crit-chi2 0.99 4) 4)
0.009999998736
> (prob-chi2 (crit-chi2 0.99 4) 5)
0.009999998736
>