RFC open on newLISP documentation

Started by kazemori, November 28, 2003, 02:34:32 PM

Previous topic - Next topic

Lutz

#120
The way the code works is, taking each option one by one, so you could have lisp files before and after the options. The -p -d options are special in the sense that they hang in the first connection.



Lutz

nigelbrown

#121
If options are taken in order could we have one like -e but that doesn't exit on completion but is like a file in that position so you could do (if it was say -l for lisp)

newlisp -l "(println {doing file 1})" file1.lsp -l "(println {doing file 2})" file2.lsp -e "(println {completed, exiting})"

Lutz

#122
Too much code to for a little feature, which can easily be achieved otherwise, i.e. putting those message in the files themselves or writing a shell script.



Lutz

nigelbrown

#123
Fair enough

Lutz

#124
BTW you can also put several expressions in to the -e :



newlisp -e "(dothis) (load {somefile.lsp}) (dothat) (etc)"



of course 'somefile.lsp' should not and with (exit)



Lutz

nigelbrown

#125
Yes, that achieves the same, thanks for pointing it out.

Sammo

#126
Documentation for the 'normal' function is unusually sparse. That is, I can't find it.

Lutz

#127
Oops, it is out of the sort order after 'net-sessions' before 'new' ;-), will correct this in 8.0 final, meanwhile:



http://newlisp.org/download/newlisp_manual.html#normal">http://newlisp.org/download/newlisp_manual.html#normal



you can also get it from the index "Floating point math and special functions"





Lutz

nigelbrown

#128
looking at the docs of replace shows inconsistencies viz

replace

syntax: (replace exp-key list exp-replacement)

syntax: (replace str-key str-data exp-replacement)

syntax: (replace str-pattern str-text exp-replacement int-option)

syntax: (replace exp list)

...



String replacement without regular expression



If all arguments are strings, replace replaces all occurrences of key-str in str-text with str-replacement and returns the changed string (previous to v.7.2.4 the number of changes). The expression in exp-replacement is evaluated for every replacement.



could be



replace

syntax: (replace exp-key list exp-replacement)

syntax: (replace str-key str-text exp-replacement)

___________________^^^^^^  

syntax: (replace str-pattern str-text exp-replacement int-option)

syntax: (replace exp list)

...



String replacement without regular expression



If all arguments are strings, replace replaces all occurrences of str-key in str-text with

_______________________________________________^^^^^^

evaluated exp-replacement and returns the changed string (previous to v.7.2.4 the number

^^^^^^^

of changes).  The expression in exp-replacement is evaluated for every replacement.



eg



> (setq n 1)

1

> (replace  "aa" "ssaaggaahh" (append "aa" (string (inc 'n))))

"ssaa2ggaa3hh"

>

Lutz

#129
thanks Nigel, this will be corrected



Lutz

HPW

#130
command now in 8.0.2:



(apply date-value '(now)) => 1014834090



should be:



(apply date-value (now)) => 1014834090
Hans-Peter

Lutz

#131
Thanks for the correction,  rev1 of the docs in HTML and PDF format is online:



http://www.newlisp.org/index.cgi?page=Documentation">http://www.newlisp.org/index.cgi?page=Documentation



Lutz

newdep

#132
**

net-listen is a blocking function call and does not return until somebody tries to connect to the listening port.

**



I think ment here is that net-accept is blocking.





**

Shared library module for Linux/BSD versions -->



(import "/usr/lib/newlisp.so" "newlispEvalStr")

(get-string (dllEvalStr "(+ 3 4)"))    => "7"



must be



(import "/usr/lib/newlisp.so" "newlispEvalStr")

(get-string (newlispEvalStr "(+ 3 4)"))    => "7"

***
-- (define? (Cornflakes))

Lutz

#133
thanks for the corrections - lutz

newdep

#134
** net select **

little typo ->

In the second syntax net-selectM can check for a list of sockets in list-sockets.



the "M" is too much...
-- (define? (Cornflakes))