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))
newlisp 9.0.1 released
newlisp 9.0.1 released
-- (define? (Cornflakes))
Re: newlisp 9.0.1 released
I am suggesting to add functionality to 'mat':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))
(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
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)
Lutz