newLISP Fan Club

Forum => newLISP in the real world => Topic started by: denis on November 07, 2012, 07:25:41 AM

Title: (float) with elements of the list
Post by: denis on November 07, 2012, 07:25:41 AM
Some strange behavior:



(set 'lst '("23" "hello" "3.14"))
(float (lst 1))
; -> "3.14" instead of nil


Why so?
Title: Re: (float) with elements of the list
Post by: cormullion on November 07, 2012, 07:53:55 AM
newLISP v.10.3.2 64-bit on OSX IPv4/6 UTF-8, execute 'newlisp -h' for more info.

> (set 'lst '("23" "hello" "3.14"))
("23" "hello" "3.14")
> (float (lst 1))
nil
>


and


newLISP v.10.4.4 on OSX IPv4/6 UTF-8 libffi, execute 'newlisp -h' for more info.

> (set 'lst '("23" "hello" "3.14"))
("23" "hello" "3.14")
> (float (lst 1))
"3.14"
>


indicate some kind of regression over the last year. I haven't got the intermediate versions here to test when this happened...
Title: Re: (float) with elements of the list
Post by: rickyboy on November 07, 2012, 10:44:13 AM
I get the same thing on 10.4.1.  But note that (lst 1) returns  "hello", as expected.


newLISP v.10.4.1 on Win32 IPv4/6 libffi, execute 'newlisp -h' for more info.

> (set 'lst '("23" "hello" "3.14"))
("23" "hello" "3.14")
> (float (lst 1))
"3.14"
> (lst 1)
"hello"

Good catch, denis.
Title: Re: (float) with elements of the list
Post by: jopython on November 07, 2012, 12:11:13 PM
Same issue on my Linux desktop.



newLISP v.10.4.3 on Linux IPv4/6 UTF-8 libffi, execute 'newlisp -h' for more info.
> (set 'lst '("23" "hello" "3.14"))
("23" "hello" "3.14")
> (float (lst 1))
"3.14"
Title: Re: (float) with elements of the list
Post by: Lutz on November 07, 2012, 12:47:19 PM
This is a bug in the 'float' function when using it on list elements, introduced in a development release before 10.4.0 and is fixed now in 10.4.5 in progress:



http://www.newlisp.org/downloads/development/inprogress/



I will do a maintenance release as soon as I am back in the US next week, probably on the 15th of November.