development version newLISP 8.8.8
development version newLISP 8.8.8
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
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))
Fine changes!
Can I suggest a function that will do nondestructive append to a list?
I.e. something like this:
In my practice it is used too frequent...
...moreover we already have (cons) that do similar, but in different order...
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)))
...moreover we already have (cons) that do similar, but in different order...
WBR, Dmi
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?
My first pick was 'acons' (like acos, asin, atan), but unfortunately older LISPs defines 'acons' already as an operation on association lists:
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
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))
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))
>
Lutz
-
- Posts: 2038
- Joined: Tue Nov 29, 2005 8:28 pm
- Location: latiitude 50N longitude 3W
- Contact:
-
- Posts: 95
- Joined: Wed Oct 13, 2004 8:02 pm
- Location: Bellingham WA
Manual Correction
Lutz,
In the manual in the entry for the Unify function you need to change the word "physist" to "physicist".
In the manual in the entry for the Unify function you need to change the word "physist" to "physicist".
-
- Posts: 394
- Joined: Wed Apr 26, 2006 3:37 am
- Location: Oregon, USA
- Contact:
-
- Posts: 95
- Joined: Wed Oct 13, 2004 8:02 pm
- Location: Bellingham WA
-
- Posts: 394
- Joined: Wed Apr 26, 2006 3:37 am
- Location: Oregon, USA
- Contact:
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
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
The changes to 'nth-set' deliver an interesting observation:
It seems that the second argument to 'nth-set' cannot be a function...? This used to work in previous versions of newLisp.
Peter
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 : +
>
Peter
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.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?
(λx. x x) (λx. x x)