newlisp 9.0.1 released

Started by newdep, November 14, 2006, 02:44:57 PM

Previous topic - Next topic

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

#1
Not yet for Windows?

Lutz

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



Lutz

Fanda

#3
Quote from: "newdep"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

#4
(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':


(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