Menu

Show posts

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

Topics - johu

#1
newLISP in the real world / about Japanese Manuals
September 03, 2011, 03:56:24 AM
Hello, Lutz.



I updated the manual translated to Japanese.


  • newlisp_manual-10302

    CodePatterns-20110810

    guiserver_manual-144


There are in https://skydrive.live.com/?cid=23a9a25e1aec3626&sc=documents&id=23A9A25E1AEC3626%211450">here.

In newlisp_manual-10302, rev is 3.



And in http://www.newlisp.org/guiserver/guiserver.lsp.html">guiserver.lsp,


  • wioth → with

maybe.



Thanks,
#2
Hello, Lutz.



I have translated "Code Patterns in newLISP" to Japanese and I'm reviewing it.

Now I have some suggestion.



Evaluating remotely

The parameter p is nil when no result was received during the last 100 micro seconds,

The parameter p is nil when no result was received during the last 1000 micro seconds,



maybe.





CGI processing in HTTP mode

extract or set cookies amd other useful routines

extract or set cookies and other useful routines





Unevenly aligned structures

    return(&data);

    return(&data);



There are two places.



Thanks,
#3
Hello,



In User Manual and Reference v.10.2.8 rev-20.





http://www.newlisp.org/downloads/newlisp_manual.html#term">Examples of term :
Quote(set 'ACTX:var 123)

(set 'sm 'ACTX:var)

(string sm)     → "ACTX:var"

(term 'sm)      → "var"

But, actually :


> (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"
>


I use newLISP v10.2.16.



Is it true ?



P.S.

; the code to be evaluated is given in a qoted expression

; the code to be evaluated is given in a quoted expression
#4
newLISP in the real world / About Users Manual v.10.2.8
September 19, 2010, 05:11:39 AM
QuoteOnly on Mac OS X and other Unixes will the Cilk API parallelize tasks.

Myabe, there is no verb ?




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.

Maybe, the last sentence is not necessary or there is after next example ?





If these are solved, I will complete the Japanese translation of "Users Manual and Reference v.10.2.8" except "GNU Free Documentation License" and "GNU GENERAL PUBLIC LICENSE".
#5
Quote;; pass data by context reference



(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"

According to Users Manual and Reference,


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.

Therefore(?), obj:data cause the following error message:


ERR: context expected in function match : obj
called from user defined function $reader-event

I think some alternative code.


Quote(define (change-db obj idx value)

    (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))

But these are not the disadvantage, sorry.



By the way,


QuoteUsing catch and throw



As an alternative to catch, the throw-error function can be used to catch errors caused by faulty code or user-initiated exceptions.

throw-error is error-event ?
#6
According to Users Manual and Reference,
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.

I think that it means the following:
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.

Then,
> (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) ())
>

but,
> (title-case "aBCDE")
"ABCDE"
> (title-case "aBCDE" true)
"Abcde"
> (title-case "aBCDE" '())
"ABCDE"
>

It might be not problem, maybe.
#7
I make newLISP Function Reference and GUI Fuction Reference Viewer.



ScreenShot is http://johu02.spaces.live.com/blog/cns!23A9A25E1AEC3626!2518.entry">here.(Japanese blog. 日本語の使い方もこちらで。)



Download URL is http://cid-23a9a25e1aec3626.skydrive.live.com/self.aspx/.Public/newLISP-help.zip">//http://cid-23a9a25e1aec3626.skydrive.live.com/self.aspx/.Public/newLISP-help.zip



 Usage: newlisp newLISP-help.lsp [directory | -URL | -URL=xxx.html] [yyy.ini] [zzz.hlp]

      directoy is the directory of newlisp_manual.html.

      xxx.html is the url or file for reading.

      yyy.ini is the initial file for Window's position and size with yyy.hlp.

      zzz.hlp is the function reference data file.



and examples:
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.


Thank you for reading to the last minute.



I welcome any advice, i.e. usage, code technique, mistake, etc.
#8
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
>

Maybe since the version of
QuoteIn the find function the regex option can now be specified as nil to do an offset-based search without regular expressions.
#9
In http://www.newlisp.org/guiserver/guiserver.lsp.html">GUI functions Manual, some parameters missing.



gs_color-dialog

parameter: <float-blue - The initial blue color component.


parameter: float-blue - The initial blue color component.




split-pane

parameter: <int-divider-size) - The optional size of the draggable divider in pixels.


parameter: int-divider-size - The optional size of the draggable divider in pixels.




undo-enable

syntax: (<font color=#CC0000>gs:undo-enable</font> sym-id <boolean-enabled)


syntax: (<font color=#CC0000>gs:undo-enable</font> sym-id boolean-enabled)
#10
newLISP in the real world / crit-chi2 and prob-chi2
February 08, 2010, 12:57:57 AM
I am newLISP user in Japan.

I am trying to translate the reference manual of newLISP into Japanese now.

http://cid-23a9a25e1aec3626.skydrive.live.com/self.aspx/%E5%85%AC%E9%96%8B/newlisp%5E_manual-C.html">//http://cid-23a9a25e1aec3626.skydrive.live.com/self.aspx/%e5%85%ac%e9%96%8b/newlisp%5E_manual-C.html

Then, I tried the function of crit-chi2 and prob-chi2.


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

>


The Chi-Squared Distribution Table

http://mips.stanford.edu/public/classes/stats_data_analysis/principles/chi_table.html">//http://mips.stanford.edu/public/classes/stats_data_analysis/principles/chi_table.html



I am not good at statistics.

Are these true or nil?

Please give advice to me.



And I'm sorry, if my English usage was wrong.