Page 1 of 1

development version newLISP 8.8.8

Posted: Mon May 29, 2006 5:21 am
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

Posted: Mon May 29, 2006 5:23 am
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.

Posted: Mon May 29, 2006 5:28 am
by newdep
Btw..can dotimes use the $idx too ?

Posted: Mon May 29, 2006 11:38 am
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...

Posted: Mon May 29, 2006 8:09 pm
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

Posted: Mon May 29, 2006 8:48 pm
by Dmi
"cons" is from "construct", so call it "coup" from "couple" ;-)
In fact I don't bother with name - only with (append ... (list ...))

Posted: Mon May 29, 2006 9:50 pm
by cormullion
"attach"?

Manual Correction

Posted: Tue May 30, 2006 7:45 pm
by Jeremy Dunn
Lutz,

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

Posted: Wed May 31, 2006 1:33 am
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

Posted: Wed May 31, 2006 7:51 pm
by Jeremy Dunn
Found some more.

Under the entry for DOLIST

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

Posted: Wed May 31, 2006 8:00 pm
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

Posted: Wed May 31, 2006 9:02 pm
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

Posted: Wed May 31, 2006 9:06 pm
by Lutz
Thanks for the good news. I changed to -O3 in makefile_true64

Lutz

Posted: Thu Jun 01, 2006 9:33 pm
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

Posted: Thu Jun 01, 2006 11:35 pm
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

Posted: Mon Jun 05, 2006 8:14 pm
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.

Posted: Mon Jun 05, 2006 11:39 pm
by Lutz
Yes, I also thought about 'snoc', but somehow it feels weird, perhaps we should just hijack 'acons' ;)

Lutz