filter or find-all different results w/ diff nL versions

Started by joejoe, June 26, 2012, 11:35:48 PM

Previous topic - Next topic

joejoe

Hi -



When I try this on my computer, it works fine:



newLISP v.10.3.3 on Linux IPv4/6 UTF-8


(set 'a '("oneone" "two" "twotwotwo" "three" "threethree"))
(println (filter (fn (x) (find-all {w{6,12}} x)) a))

;-> ("oneone" "twotwotwo" "threethree")



but when I try on NearlyFreeSpeech.net



newLISP v.10.2.8 on BSD IPv4 UTF-8


(set 'a '("oneone" "two" "twotwotwo" "three" "threethree"))
(println (filter (fn (x) (find-all {w{6,12}} x)) a))

;-> ("oneone" "two" "twotwotwo" "three" "threethree")



As the code shows, Im after strings 6-12 characters long.



Am I missing something or is there a slight difference causing this from nL 10.2.8 to 10.3.3?



Thanks very much in advance! :)

Lutz

Empty lists () are treated differently by all filtering functions starting in 10.3.2. The following code gives the same result on all versions.


(set 'a '("oneone" "two" "twotwotwo" "three" "threethree"))

(filter (fn (x) (regex {w{6,12}} x)) a) ;=> ("oneone" "twotwotwo" "threethree")

; or shorter

(filter (curry regex {w{6,12}}) a) ;=>  ("oneone" "twotwotwo" "threethree")

joejoe

Thanks Lutz!



I grazed through the release notes but perhaps a little too fast.



Thanks for the cross version examples and explanation!



Ive been looking for a way to try out the curry. ;0)

winger

Very strange!

NewLISP v.9.2.0 is no problem!



Many problems are caused by the return value.

Does not detect the type or null '() null ...

And the manual did not specifically label the return value.
Welcome to a newlisper home:)

http://www.cngrayhat.org\">//http://www.cngrayhat.org