RFC open on newLISP documentation

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

Previous topic - Next topic

Lutz

#255
The example was written before the introductin of sym as a shorter form of symbol. This is how it works using sm as variable name instead od the protected sym:



(set 'ACTX:var 123)
(set 'sm 'ACTX:var)
(string sm)         => "ACTX:var"
(name sm)           => "var"
(name sm true)      => "ACTX"


Lutz

m i c h a e l

#256
I changed the manual to match what Lutz has written here. Also, I think the use of 'sym in net-receive's example -- the call to net-receive-line's second argument -- should be changed, as well. Is this correct? Otherwise, the rest of the manual checks out.



m i c h a e l

Lutz

#257
Yes Michael, that is corrrect, thanks



Lutz

newdep

#258
Adding a missing intruction for the manual ;-)



Old ->

To exit the newLISP shell on Linux/UNIX, press Ctrl-D; on Win32, type (exit) or Ctrl-C, then the x key.



New ->

To exit the newLISP shell on Linux/UNIX, press Ctrl-D; on Win32, press Ctrl-Z and then Enter or type (exit) or Ctrl-C, then the x key.





Ctrl-Z + enter work to quit the EOF on OS/2 and Windows ;-)
-- (define? (Cornflakes))

m i c h a e l

#259
Hi Norman,



Thanks for the change. It now reads:


QuoteTo exit the newLISP shell on Linux/UNIX, press Ctrl-D. On Win32, press Ctrl-Z     or type (exit), then Enter; or press Ctrl-C, then the x key.


m i c h a e l

newdep

#260
Perhpas the manual should also have a summerised overview on

what a certain OS has or not has on functionality compaired to another

OS.



Like ->



(fork)              This mode is not available on Win32.

(reset true)        This mode is not available on Win32.

(semaphore int-id)  This form is not available on Win32.

...

...

...







Norman.
-- (define? (Cornflakes))

Lutz

#261
We will put a small chapter in the first part of the manual. Perhaps a table showing the differences.



Lutz

nigelbrown

#262
The Manual 8.9.3 section on format doesn't display some text properly in IExplorer 6.0 (WinXP). It gives tiny text. It seems to be choking on the 'plus1'

Firefox 1.5 handles it OK



problem area is

a href="#string">string</a>

can be used to insure correct data types and avoid error messages.</p>



<p>The format string has the following general format:</p>







<span class='plus1'>"%w.pf"</span>






<p>The percent <tt>%</tt> sign starts a format specification. To display a

percent sign <tt>%</tt> inside a format string double it: <tt>%%</tt></p>





<span class="plus1">w</span>






<p>Width of field. Data is right aligned, else whe...



I don't know anything about span class to suggest a fix. Trying "plus1" and plus1 (no quotes) doesn't help.



Nigel

m i c h a e l

#263
Hi Nigel,



Thanks for pointing this out. I'm only just now learning the ins and outs of html and css, so this suggestion may not work (also, I don't have IE). I noticed in the style section at the top, the style span.plus1 has double quotes around the +1. I removed the quotes to see if effected the browser I'm using, and it seems fine. If this does not work, maybe another way of saying +1 is possible that would make IE happy.



m i c h a e l

Lutz

#264
I am puzzled that both Nigel and Michael report the opposite of what I am seeing, for me on the Mac OS X PowerBook its fine with the quotes on the latest FireFox and Safari browsers. Perhaps we should switch back to put the font spec explicitely. The CSS span.plus1 definition is only used once in the manual anyway. All other span tags seem to work fine (most of them for colors).



Lutz

m i c h a e l

#265
Agreed :-)



m i c h a e l

newdep

#266
·

Hi Lutz,·

·

·

Here some remark on the manual, I just pointed them out to make perhpas the difference ·

a lillte bit more clear, not that I have heard anyone complaining so far ;-) But some points·

below might be confusing and can only be discovered when digging into the C code. ·

·

·

·

*** here is what they actualy do, but what is not realy read from the manual ***·

·

(! "argument")·

The '! command determines whether or not a command-processor ("command.com","cmd.exe","sh") is present ·

and executes the argument directly on the command-processor.·

·

(exec "argument" [stdout] )·

The 'exec command pipes the command towards the command-processor and returns the stdout of the executed argument.·

·

·

(process "argument" [in] [out] )·

The 'process command executes an argument and returns directly towards newlisp without waiting, ·

the IO of the executed argument goes through the current defined stdin and stdout or if defined differently through those.·

·

***·

·

·

** Also a small remark on ->·

·

The current description of 'Exec uses the word "process" this could be confusing and intepreted as a C-Process behaviour.·

·

The current 'process function is compaired with '!, thought it is not the same.·

·

·
-- (define? (Cornflakes))

newdep

#267
And perhpas the whole process header should be re-thought?



syntax: (process str-command)

syntax: (process str-command int-pipe-in int-pipe-out [int-win32-option])

syntax: (process str-command int-pipe-in int-pipe-out [int-pipe-error])





You are talking about pipes, but that not true  (based on the manual inteprettion that is ;-) it should be device! like this ->





syntax: (process str-command)

syntax: (process str-command device-in device-out [int-win32-option])

syntax: (process str-command device-in device-out [device-error])





Because interaction trough opened files is also possible i.e. with (device .....)



like ->



>(device (open "myfile" "write"))

3

>(process "cmd" 0 3)







Norman.
-- (define? (Cornflakes))

Lutz

#268
Actually both 'exec' and 'process' start processes doing a fork() internally. 'exec' uses popen(), which internally uses fork() and 'process' uses fork() explicitly and doing a dup() for the optional pipes specified and stdin and stdout. The difference is that 'exec' also invokes a shell process to handle the comman specified in the 'exec' parameter.



On UNIX you may use file handles instead of pipe handles and sockets will probably work too, but on Win32 I have my doubts, that file handles will work for the pipe parameters in 'process', but I have not tried it. If this really works on Win32, I can include this in the manual.



Lutz

newdep

#269
Hi Lutz,



On the semaphore part..



I think the function explenation of "semaphore" could be a little

shorter... Its now quiet a long text to read where its not realy needed.



... explenation on what a semaphore is

... actions and result

... example



And something like this inside the function-text ->



;; init  semaphores

(semaphore)  



;; assign a semaphore to sid

(set 'sid (semaphore))



;; put sid semaphore in wait state (always -1)

(semaphore sid -1)



;; run sid semaphore previously put in wait (always 1)

(semaphore sid 1)



;; run sid semaphore with X times a skip (backward or forward) on the function

(semaphore sid X)



;; release sid semaphore system wide (always 0)

(semaphore sid 0)







Norman.
-- (define? (Cornflakes))