The 9.4.0 newLISP manual

Notices and updates
DrDave
Posts: 126
Joined: Wed May 21, 2008 2:47 pm

Post by DrDave »

Thanks.

This works as you wrote it

Code: Select all

> (exec {(newlisp -e "(+ 3 4)")})
("7")
>
This also works with one set of parentheses eliminated

Code: Select all

> (exec {newlisp -e "(+ 3 4)"})
("7")
>
Also this variation

Code: Select all

> (exec "newlisp -e \"(+ 3 4)\"")
("7")
>
...it is better to first strive for clarity and correctness and to make programs efficient only if really needed.
"Getting Started with Erlang" version 5.6.2

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

Post by newdep »

regarding 'inc and 'dec.. I think the manual needs an addon..

when using 'inc excluding place and num
'inc will increase by itself. like in (inc)

Any increment of a value afterwards using place will
start from that value on..Except when place was initialized first.

i.e.

If X is a list then (X (inc)) will run until 'ERR:..out bound of bound" occeurs
the following (inc Z) will continue where (inc) left off..




PS:
if (inc) is a feature? then ->
* how do i reset (inc) ?
* could (inc) always start at 0 <-initialy at newlisp startup ? and (inc place) at 1 ?
-- (define? (Cornflakes))

DrDave
Posts: 126
Joined: Wed May 21, 2008 2:47 pm

Post by DrDave »

newdep wrote:... I think the manual needs an addon..

when using 'inc excluding place and num
'inc will increase by itself. like in (inc)
Are you saying that you want (inc) to be pointing to a variable such as 'inc-value that will be incremented by 1 (integer only) with every call of (inc) ? In other words, it would be doing this behind the scenes:

Code: Select all

(inc 'inc-value)
And the user can both query and change 'inc-value at will?

If so, I don't see the point of it.
...it is better to first strive for clarity and correctness and to make programs efficient only if really needed.
"Getting Started with Erlang" version 5.6.2

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

Post by newdep »

when starting newlisp and running (inc) it will show 1

if (inc) is a feature you could use (inc) as an implicit index counter
but because at the first (inc) it starts at a 1 its of no use ;-)
(this is my request for (inc) starting at 0 initialy at newlisp startup)

Im just wondering if (inc) is a feature, which is usefull, but how to
reset it then back to 0 ?

(inc) will only increase

(inc a) will take value of (inc)

(setq b 0)

(inc b) is always 1

(X (inc)) can't be used as an index because (inc) is always +


the use of (inc) is not documented so im just wondering about its use..
-- (define? (Cornflakes))

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

Post by Lutz »

(inc) -> should throw an error. Its a bug!

DrDave
Posts: 126
Joined: Wed May 21, 2008 2:47 pm

Post by DrDave »

Lutz wrote:(inc) -> should throw an error. Its a bug!
throws error in v 9.3.0 on Win32
...it is better to first strive for clarity and correctness and to make programs efficient only if really needed.
"Getting Started with Erlang" version 5.6.2

m35
Posts: 171
Joined: Wed Feb 14, 2007 12:54 pm
Location: Carifornia

Post by m35 »

In bind for Manual v.9.4.5 rev-12

The line
"The return value of bind is the value of the last association."
is written twice.

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

Post by newdep »

manual 10.0

missing parenthesis in -> when <-

(when (read-line)
(set 'result (analyze (current-line)))
(report result
(finish)
)
-- (define? (Cornflakes))

cormullion
Posts: 2037
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

syntax statements for cond and chop are missing final parentheses

(Don't ask why/how I spotted that - it's something I'm working on at the moment...!)

Also, "co" in contents jumps to copy - should jump to command-event...

xytroxon
Posts: 296
Joined: Tue Nov 06, 2007 3:59 pm
Contact:

Post by xytroxon »

Errata:

Code Patterms:

23. Extending newLISP
,,,
#include <stdio>
#include <stdlib>
#include <ctype>> <<<--- double ">"

-------------

newLISP manual:

dec !
syntax: (dec place [num])
...
example:
...
Places in a list structurei <<<--- extra "i" at the end of structure.

---------
"Many computers can print only capital letters, so we shall not use lowercase letters."
-- Let's Talk Lisp (c) 1976

xytroxon
Posts: 296
Joined: Tue Nov 06, 2007 3:59 pm
Contact:

Post by xytroxon »

========

newLISPdoc.html

Change: "exactly on space"
To: "exactly one space"

========

newlisp_manual.html

dostring
...
example:

; ASCII example
(set 'str "abcdefg")
(dostring (c str) (println c " - " (char c)))

97
98 - a
99 - b
100 - c
101 - d
102 - e
103 - f

Change to:

97 - a
98 - b
99 - c
100 - d
101 - e
102 - f
103 - g

----------

when
...
Change: "See also the function when"
To: "See also the function unless"

=========
"Many computers can print only capital letters, so we shall not use lowercase letters."
-- Let's Talk Lisp (c) 1976

Kazimir Majorinc
Posts: 388
Joined: Thu May 08, 2008 1:24 am
Location: Croatia
Contact:

Post by Kazimir Majorinc »

(lambda-macro (a b) (set (eval a) b)) → (lambda (x) (* x x))

Noted by Rainer Joswig in comp.lang.lisp.

cormullion
Posts: 2037
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

Kazimir Majorinc wrote:(lambda-macro (a b) (set (eval a) b)) → (lambda (x) (* x x))

Noted by Rainer Joswig in comp.lang.lisp.
Kind of them to help proofread the manual... :) Usually they have only insults and condescensions - perhaps they've decided to become better people!

m i c h a e l
Posts: 394
Joined: Wed Apr 26, 2006 3:37 am
Location: Oregon, USA
Contact:

Post by m i c h a e l »

Every time newLISP is mentioned on comp.lang.lisp, a hatestorm breaks out, causing every newLISPhobe to come out of the woodwork and vent their spleens. Good thing Kazimir is so flame-retardant!

They do this so often, I’m beginning to believe they like the smell of their own bullshit. They produce so much of it ;-)

m i c h a e l

xytroxon
Posts: 296
Joined: Tue Nov 06, 2007 3:59 pm
Contact:

Post by xytroxon »

m i c h a e l wrote:They do this so often, I’m beginning to believe they like the smell of their own bullshit. They produce so much of it ;-)

m i c h a e l
Fools... Don't they know they must fear Haskell as the true heir to the advanced purely functional programming language crown? ;)

Maybe someone could write a post explaining how modernizing the antiquated car cdr cons syntax with capsule rocket launchpad would help "launch" LISP to be "other worldly" and make it "universal" in scope ;)

-- xytroxon
"Many computers can print only capital letters, so we shall not use lowercase letters."
-- Let's Talk Lisp (c) 1976

DrDave
Posts: 126
Joined: Wed May 21, 2008 2:47 pm

Post by DrDave »

xytroxon wrote: Maybe someone could write a post explaining how modernizing the antiquated...
As I recall, they like to remind those that question the CL dogma that they have a "Standard". While standards usually have a positive aspect, it seems to me that the standard bearers are so afraid of breaking any existing code that their community cannot (will not?) modernize the standard. Hence, the standard they so proudly defend is probably their greatest impediment to progress
...it is better to first strive for clarity and correctness and to make programs efficient only if really needed.
"Getting Started with Erlang" version 5.6.2

Kazimir Majorinc
Posts: 388
Joined: Thu May 08, 2008 1:24 am
Location: Croatia
Contact:

Post by Kazimir Majorinc »

About map
  1. "Note that only functions with applicative order of evaluation can be mapped. Functions with conditional or delayed evaluation of their arguments (e.g., if or case) cannot be mapped. "
It appears that if can be mapped - and that it is even used in the example of map. Or I misunderstood something.

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

Post by Lutz »

It should probably say: Special forms which use parentheses as syntax cannot be mapped (e.g. case).

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

Post by HPW »

manual 10.0

Clicking on hyperlink Wr in left frame 'Functions in alphabetical order' jumps to 'write-file' instead of 'write-buffer'.
Hans-Peter

Post Reply