RFC open on newLISP documentation

Notices and updates
Locked
Sammo
Posts: 180
Joined: Sat Dec 06, 2003 6:11 pm
Location: Loveland, Colorado USA

Post by Sammo »

In the v8.1.2 manual section on 'expand', the phrase "expand is when composing lambda expressions:" should be "expand is useful when composing lambda expressions:". Also, it appears that (expand list sym1 sym2) is equivalent to (expand (expand list sym1) sym2) instead of simultaneous expansion as the following illustrates:

> (set 'a 'b 'b 'a)
a
> a
b
> b
a
> (expand '(a b) 'a)
(b b)
> (expand '(a b) 'a 'b)
(a a)
> (expand '(a b) 'b 'a)
(b b)

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

thanks for the correction and your observation is correct: expand works incrementally:

(set 'a '(b c))
(set 'b 1)

you will get:

(expand '(a b c) 'a 'b) => ((1 c) 1 c)

I will mention this in the manual

Lutz

ps: expand 'reduces' like apply:

(apply expand '((a b c) a b) 2) => ((1 c) 1 c)

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

Hello Lutz,

In the manual "net-select" the example below is
confusing because net-listen is none-blocking by itself aleady..

==== net-select ====

set 'listen-socket (net-listen 1001))

; wait for connection
(while (not (net-select listen-socket "read" 1000))
(if (net-error) (print (net-error))))
(set 'connection (net-accept listen-socket))
(net-send connection "hello")
-- (define? (Cornflakes))

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Yes, but the 'net-select' checks the listen-socket for the blocking 'net-accept' call. The (net-listen ..) is before the net-select. So is waits in the (while ...) loop until something is ready to accept on the listen-socket.

Perhaps the naming of the socket as 'listen-socket' is confusing? perhaps I just should call it 'socket' ?

Also, just posted 8.1.3 with the Solaris 'get-url' fix

Lutz

nigelbrown
Posts: 429
Joined: Tue Nov 11, 2003 2:11 am
Location: Brisbane, Australia

Post by nigelbrown »

In Manual definition of define
"define
syntax: (define (sym-name [sym-param-1 ...]) [body-1])
syntax: (define sym-name exp )
Defines a new function sym-name with optional parameters sym-param-1 .... define is equivalent to assigning a lambda expression to sym-name. When calling a defined function, all arguments are evaluated and assigned to the variables in sym-param-1 ..., then the body-1 ... expression(s) are evaluated.
"
it probably should be
syntax: (define (sym-name [sym-param-1 ...]) [body-1 ...])

as this is consistent with "then the body-1 ... expression(s)"

and with how it works viz.
> (define (sayhello) (setq thehello "hi") "hello2")
(lambda () (setq thehello "hi") "hello2")
> thehello
nil
> (sayhello)
"hello2"
> thehello
"hi"
>

Maybe a comment along the lines that "the return value from a
function is the value of the last evaluated body-1 ... evaluation".

Nigel

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Thanks Nigel for the doc corrections.

There is a new Tutorial about importing libraries at: http://www.newlisp.org/index.cgi?page=C ... _Libraries

Lutz

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

(command-line nil)

Post by newdep »

Hello Lutz,

Just a reminder...

The feature request from sometime ago is not documented.
(It was that i remembered it :-)

Missing is in de manual ->

(command-line nil)

Under linux this will also disable signaling handling display:
user reset - (c)ontinue, e(x)it, (r)eset:
-- (define? (Cornflakes))

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Thanks Norman, I willl update the documentation

Lutz

ps: you know that 8.2.1 is online?

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Manual 8.2.1

Post by newdep »

Hi Lutz,

The Framed manual from 8.2.1 does not allow any "searching" anymore
in de newlisp_index.html..?

Norman.
-- (define? (Cornflakes))

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

... it never did, what do you mean? But you always can click in the frame and hit Ctrl-F, that still works at least in my Firefox browser. newlisp_index.html did not change except for the new functions added.

If you like to put #function-name into the URL don't use the framed version.

Lutz

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

Yes i thought it was strange too... Mmm also did not work in my "Links" browser.. Somehow i kicked my machine softly and it oke again... :-) probably the C64 Muzak im running currently via MP3 my machine doesnt like ;-)
-- (define? (Cornflakes))

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

File-info / file?

Post by newdep »

Hi lutz,

Minor issue...

Perhpas an enhancement for the folling two function in the manual wil
clarify a little bit more...

file-info

Returns a list of information about the file or directory in str_name. newLISP uses the POSIX system call stat() to get the following information:

-->
Returns a list of information about the file, directory, socket, pipe in str_name. newLISP uses the POSIX system call stat() to get the following information:



file?

Checks for the existence of a file in str-name. Returns true if the file exists and is readable else returns nil.

-->
Checks for the existence of a file, directory, socket, pipe in str-name. Returns true if the file exists and is readable else returns nil.
-- (define? (Cornflakes))

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

- sockets and pipes are numbers, file-info takes only a name.

- on file? I just realize the existence is enough, no permissions seem to be required, and I will change that in the docs

thanks

Lutz

lwix
Posts: 24
Joined: Tue Oct 26, 2004 3:14 am
Location: New Zealand

Corrections in spelling for the latest manual

Post by lwix »

Hi Lutz,

I've sent you an email with an attachment. There was a fair bit of context which enlarged the file thereby making it too large to post here.

Lucas.

lwix
Posts: 24
Joined: Tue Oct 26, 2004 3:14 am
Location: New Zealand

Post by lwix »

Hi Lutz ,
I got a PM from you to say that the mail might have been dropped.

So here is a link to the tarball.

http://homepages.paradise.net.nz/~j_gauss/wix/lucas.tgz

** since removed -- Lutz now has it **

This was just a first pass over the docs yielding about 80 possible errors/typos.
Reject or accept each as you deem appropriate.

Lucas.
Last edited by lwix on Wed Nov 17, 2004 10:20 pm, edited 1 time in total.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

thanks very much for all the corrections

Lutz

lwix
Posts: 24
Joined: Tue Oct 26, 2004 3:14 am
Location: New Zealand

Post by lwix »

A quick look at the latest manual (8.2.7) indicates that you've fixed the little typos. Thank you very much -- now I can read without tripping ;-)

But the first typo was hard to pick up: nuevatAc used instead of nuevatEc. It occurs as a hypertext link in the last line of the paragraph that comes just before the "Deprecated Functions" section. (I checked the link just in case the company registered both names :-)

I'll do another quick pass over the manual looking for more typos.
small's beautiful

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Thanks for catching nuevatAc.com ... that's a biggy ... and in the 'license' chapter! how could that happen? I need some kind of spelling support in VI, which is my HTML editor, any suggestions?

Lutz

lwix
Posts: 24
Joined: Tue Oct 26, 2004 3:14 am
Location: New Zealand

Post by lwix »

Only a few this time.

http://homepages.paradise.net.nz/~j_gauss/wix/7diff.txt

some slips may be hard to pick up: lib|d|emo vs lib|b|emo
and semaphore vs sempahore because lines are the same length.
small's beautiful

lwix
Posts: 24
Joined: Tue Oct 26, 2004 3:14 am
Location: New Zealand

Post by lwix »

Lutz wrote:... I need some kind of spelling support in VI, which is my HTML editor, any suggestions?Lutz
Maybe VI macros that can use [ai]spell on the current buffer? Or a macro that writes out a tmp file and runs [ai]spell on that and hooks back the result?
small's beautiful

lwix
Posts: 24
Joined: Tue Oct 26, 2004 3:14 am
Location: New Zealand

bugger - one more

Post by lwix »

2996c2996
< version 8.2.7 espressions in exp-1 ... where not evaluated.
Apart from the slip indicated in the diff, 'where' should be 'were'.
Sorry.
small's beautiful

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

... and still are not evaluated (changed it back) ...

thanks Lucas

Lutz

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Typo in manual 8.4.3

Post by newdep »

chapter ->
List processing, flow control and integer arithmetic

tells ->
and pick an argument at random and evaluate it

should be "amb"


Norman.
-- (define? (Cornflakes))

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Thanks, we will have a new development version, which fixes some localization issues, in a short time

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Oops, my mistake. Have not read all.

; on Linux - suppresses the leading 0
; suppressing leading 0 on Win32 using #

should be near together.
Hans-Peter

Locked