Page 1 of 1

newlisp 9.0.1 released

Posted: Tue Nov 14, 2006 10:44 pm
by newdep
Just released (in silent secret, wasnt it my update.lsp triggered me..)


newlisp 9.0.1

'read-file' did not read extended http:// mode parameters correctly

new 'doargs' works like 'dolist' iterates through (args)
(define (foo) (doargs (i) (println i)))
(foo 1 2 3) => prints 1 2 3
implemented on top of 'dolist' also does $idx and break-expressions

'explode' takes extra parameter for # of characters (works on UTF-8 too):
(explode "newlisp" 2) => ("ne" "wl" "is" "p")

new 'utf8len' length of a string in UTF-8 characters

new scalar matrix operations (matrix is a 2 dimensional list or array):
(set 'A '((1 2 3) (4 5 6))
(set 'B A)
(mat + A B) => ((2 4 6) (8 10 12))
(mat - A B) => ((0 0 0) (0 0 0))
(mat * A B) => ((1 4 9) (16 25 36))
(mat / A B) => ((1 1 1) (1 1 1))

Posted: Thu Nov 16, 2006 12:46 am
by Sammo
Not yet for Windows?

Posted: Thu Nov 16, 2006 2:49 am
by Lutz
The next development version 9.0.2 will come with installers for the Mac and Win32 around the coming weekend.

Lutz

Re: newlisp 9.0.1 released

Posted: Thu Nov 16, 2006 8:32 pm
by Fanda
newdep wrote:new scalar matrix operations (matrix is a 2 dimensional list or array):
(set 'A '((1 2 3) (4 5 6))
(set 'B A)
(mat + A B) => ((2 4 6) (8 10 12))
(mat - A B) => ((0 0 0) (0 0 0))
(mat * A B) => ((1 4 9) (16 25 36))
(mat / A B) => ((1 1 1) (1 1 1))
I am suggesting to add functionality to 'mat':
(mat + A 1) => ((2 3 4) (5 6 7))
(mat * 2 A) => ((2 4 6) (8 10 12))

Also, I usually work with vectors, so it would be great to have a 'vec' :-)
(vec + '(1 2) '(3 4)) => (4 6)
....

This way 'mat' could be implemented using 'vec' - matrix is a list of vectors.

Fanda

Posted: Thu Nov 16, 2006 10:44 pm
by Lutz

Code: Select all

(set 'A '(1 2 3) (4 5 6)))
(mat + A 1) => ((2 3 4) (5 6 7))

... is a nice idea and can be implemented with a minimum of code on top of the current 9.0.1 'mat' implementation, which leverages the auxiliary matrix routines used in 'multiply' and 'invert'. This means that 'mat' like 'multiply' and 'invert' can take both, lists or arrays or a mixture of both.

Note that all matrix operations are always double floating point, although the +,-,*,/ in (mat <op> A B) may suggest otherwise. Allowing both would add a lot of code. May be be it should be (mat add ...) etc.? but (mat + ...) reads so much better. And all matrix operations in newLISP are consistently double floating point only.

vec is already done easily using 'map':

Code: Select all

(map + '(1 2) '(3 4)) => (4 6)
But in a context of matrix equations/calculations I suggests not using this type of vectors but '((1 2 3 4)) as a row vector or '((1) (2) (3) (4)) as a column vector. Both can easlily be constructed using 'list and 'transpose or 'array. Using this type of vectors results can easily be fed into other matrix calculations using 'muliply' and 'invert'.

Lutz