newlisp 9.0.1 released

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

newlisp 9.0.1 released

Post 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))
-- (define? (Cornflakes))

Sammo
Posts: 180
Joined: Sat Dec 06, 2003 6:11 pm
Location: Loveland, Colorado USA

Post by Sammo »

Not yet for Windows?

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

Post by Lutz »

The next development version 9.0.2 will come with installers for the Mac and Win32 around the coming weekend.

Lutz

Fanda
Posts: 253
Joined: Tue Aug 02, 2005 6:40 am
Contact:

Re: newlisp 9.0.1 released

Post 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

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

Post 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

Locked