development version newLISP 8.8.8

Notices and updates
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

development version newLISP 8.8.8

Post by newdep »

Version 8.8.8 was just released

http://www.newlisp.org/downloads/develo ... .8.1-8.txt

http://www.newlisp.org/downloads/development/




8.8.8
eliminates several cell leaks in unify

'pop' can be used on strings (pop str [pos] [len]) pos can be negative
'push' can be used on strings (push str [pos]) pos can be negative
'push' now will only do list mode when lst is list or nil:
(push new lst) lst has to be list or nil, previous to string mode of push
any existing datatype non-list was initializeed to () now only nil is allowed

system var $idx contains the offset in dolist:
(dolist (e '(a b c d e)) (println $idx "->" e))
0->a
1->b etc.

indexing mode of 'args' now works with multiple indices, i.e (args 3 -1)
and is much faster

implicit indexing syntax now allowed in 'nth-set' and 'set-nth':
(set 'd '(a b c d e f g))
(nth-set (d 3) 99) => d
d => (a b c 99 e f g)
or with default functor:
(set 'db:db '(a b c d e f g))
(nth-set (db -1) 99) => g
db:db => (a b c d e f 99)
This also works for strings and arrays

many fixes/changes/additions in the manual and reference
Last edited by newdep on Mon May 29, 2006 5:24 am, edited 1 time in total.
-- (define? (Cornflakes))

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

Post by newdep »

Sorry Lutz, I had to post it already, to quote on 8.8.8 ;-)

Looks like your reading my mind somehow.. I always missed the
option to count the index of a dolist, so the $idx is a great introduction! ;-)

Push and pop on strings, very nice..

Thanks!, Norman.
-- (define? (Cornflakes))

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

Post by newdep »

Btw..can dotimes use the $idx too ?
-- (define? (Cornflakes))

Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

Post by Dmi »

Fine changes!

Can I suggest a function that will do nondestructive append to a list?
I.e. something like this:

Code: Select all

(define (append-one lst i) (append lst (list i)))
In my practice it is used too frequent...
...moreover we already have (cons) that do similar, but in different order...
WBR, Dmi

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

Post by Lutz »

It would work like 'cons' but from right to left, and we could call it 'tcons' like tail cons or 'rcons' like reverse cons or 'apcons' like append-cons or something entirely different?

Code: Select all

(tcons) => ()
(tcons 'a 'b) => (a b)
(tcons '(a b c) 'd) => (a b c d)
(tcons '(a b c) '(d e) => (a b c (d e))
My first pick was 'acons' (like acos, asin, atan), but unfortunately older LISPs defines 'acons' already as an operation on association lists:

Code: Select all

(define (acons key value alist) (cons (cons key value) alist))

> (acons 'a 'b '())
((a b))
> (acons 'x 'y '((a b)))
((x y) (a b))
> 
So it would have to be another name, 'append-one' is very descriptive but seems too long to me, any body else with any suggestions, and is this really needed at all?

Lutz

Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

Post by Dmi »

"cons" is from "construct", so call it "coup" from "couple" ;-)
In fact I don't bother with name - only with (append ... (list ...))
WBR, Dmi

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

Post by cormullion »

"attach"?

Jeremy Dunn
Posts: 95
Joined: Wed Oct 13, 2004 8:02 pm
Location: Bellingham WA

Manual Correction

Post by Jeremy Dunn »

Lutz,

In the manual in the entry for the Unify function you need to change the word "physist" to "physicist".

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 »

Jeremy wrote:In the manual in the entry for the Unify function you need to change the word "physist" to "physicist".
Done :-) Thanks, Jeremy!


m i c h a e l

Jeremy Dunn
Posts: 95
Joined: Wed Oct 13, 2004 8:02 pm
Location: Bellingham WA

Post by Jeremy Dunn »

Found some more.

Under the entry for DOLIST

change "duwing" to during"
change "bold fgace" to "bold face"

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 »

Jeremy wrote:change "duwing" to during"
change "bold fgace" to "bold face"
Done and done. Thanks again!

m i c h a e l

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post by pjot »

Some good news from the Tru64Unix world regarding this release. :-)

1) newLisp compiles both on Tru64Unix 4.0f and 5.1B without problems.
2) newLisp survives all tests both on Tru64Unix 4.0f and 5.1B.

One remark about the Makefile though. It appears that the '-O2' optimization has a different meaning for the Compaq C-compiler. The binary becomes pretty large and newLisp runs slow.

Compiled with '-O3' however, the binary is smaller and runs the fastest of all optimizations. So Lutz, could you change the optimization flag in the 'makefile_tru64' from -O2 to -O3 in the 8.9 release??

Thanks,
Peter

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

Post by Lutz »

Thanks for the good news. I changed to -O3 in makefile_true64

Lutz

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post by pjot »

The changes to 'nth-set' deliver an interesting observation:

Code: Select all

newLISP v.8.8.8 on linux, execute 'newlisp -h' for more info.

> (set 'a "text")
"text"
> (nth-set (+ 1 2) a " ")

symbol is protected in function nth-set : +
> 
It seems that the second argument to 'nth-set' cannot be a function...? This used to work in previous versions of newLisp.

Peter

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

Post by Lutz »

It is assuming the new alternative implicit indexing syntax in 'nth-set/set-nth'. This will be fixed in 8.8.9 by reverting to old syntax when the list expression starts with a function/operator.

Lutz

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Post by rickyboy »

Lutz wrote:It would work like 'cons' but from right to left, and we could call it 'tcons' like tail cons or 'rcons' like reverse cons or 'apcons' like append-cons or something entirely different?
...
So it would have to be another name, 'append-one' is very descriptive but seems too long to me, any body else with any suggestions, and is this really needed at all?
I saw it called 'snoc' in some Haskell paper I read a few years back. Get it? snoc? Har-dee har-har. :-) It's also pronouncable.
(λx. x x) (λx. x x)

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

Post by Lutz »

Yes, I also thought about 'snoc', but somehow it feels weird, perhaps we should just hijack 'acons' ;)

Lutz

Locked