newLISP Fan Club

Forum => newLISP newS => Topic started by: Lutz on December 06, 2006, 03:58:14 PM

Title: development release version 9.0.7
Post by: Lutz on December 06, 2006, 03:58:14 PM
- fixes a problem with 'nth' in 9.0.6 and a crash of the HTTP server mode on Linux



for files and change notes see here: http://newlisp.org/downloads/



Lutz



ps: the previous 9.0.6 was posted earlier today but retracted shortly after
Title:
Post by: cormullion on December 08, 2006, 09:12:44 AM
I don't know anything about matrices, so this might be a stupid thing to try:


newLISP v.9.0.7 on OSX UTF-8, execute 'newlisp -h' for more info.

> (set 'mat1 '((0 1 0) (1 0 1) (0 0 0)))
((0 1 0) (1 0 1) (0 0 0))
>
> (invert mat1)
Segmentation fault

>


but it probably shouldn't do that...!
Title:
Post by: Lutz on December 08, 2006, 09:45:14 AM
This bug was introduced in 9.0.2, it should return 'nil' on non-invertible matrices. This will be corrected in 9.0.8.



Lutz
Title:
Post by: newdep on December 10, 2006, 01:30:09 PM
Hello Lutz,



Is the new set-nth / nth-set also in 9.0.7 officialy?



because im getting a "Segmenation fault" when the <aref> is a very big list

of indexes like ->



(set-nth ( '( a c b d  ) '( ...arround 2000... )) "@")



Ofcause the above is not realistic but somewhere in the line of 2000 it pops out..





Norman.





PS:



 'nth' now with similar syntax options as 'net-set/set-nth'

     new in 'nth':

        (nth (L <idx1> <idx2> ...))

        (nth (L <aref>)) ; where <aref> is a list of indices

     new in 'set=nth', 'nth-set'

        (set-nth (L <aref>) <newval>)

        (nth-set (L <aref>) <newval>)





That mean that (set-nth ( '(a b c d) '( 0 1 2 )) "@") should return -> ("@" "@" "@" d)



because thats not working...?
Title:
Post by: Lutz on December 10, 2006, 02:52:43 PM
Quote(set-nth ( '( a c b d ) '( ...arround 2000... )) "@")


The maximum is 16 and the new nth-set/set-nth wasn't checking that maximum correctly. This is fixed in 9.0.8 and does not occur in release 9.0.



Note that these are not 16 different positions, but nesting levels. So your example:


QuoteThat mean that (set-nth ( '(a b c d) '( 0 1 2 )) "@") should return -> ("@" "@" "@" d)


should not return ("@" "@" "@" d) but:


(set-nth ( '(a b c d) '( 0 1 2 )) "@")
=> ("@" b c d)

only the index 0 is used because 'a' is not a list and the additional indices of 1 and 2 do not apply. Consider this:


(set-nth ( '((a (x y z)) b c d) '( 0 1 2 )) "@")
=> ((a (x y "@")) b c d)


each index in the list is for an additional nesting level of the list.



Lutz
Title:
Post by: newdep on December 10, 2006, 03:20:59 PM
thanks lutz..for clearing that up...



i was confused by (nth (L <aref>)) ; where <aref> is a list of indices... but its clear now...



Norman.
Title:
Post by: Lutz on December 10, 2006, 03:55:33 PM
Quotei was confused by (nth (L <aref>)) ; where <aref> is a list of indices... but its clear now...


in both cases: (nth (L <aref>)) and (set-nth (L <aref>) <val>) the meaning of the index list <aref> is the same. In both cases you index into a nested list.



Lutz