newLISP Fan Club

Forum => newLISP and the O.S. => Topic started by: newdep on April 02, 2011, 02:02:32 AM

Title: [BUG] ++ is TOO destructive ...
Post by: newdep on April 02, 2011, 02:02:32 AM
I think this is a bug Lutz...


Quote
newLISP v.10.3.0 on Linux IPv4/6, execute 'newlisp -h' for more info.



> (symbol? a)

nil

> (symbol? b)

nil

> (symbol? 1)

nil

> (symbol? '1)

nil

> (++)

1

> (symbol? a)

1

> (symbol? b)

1

> (symbol? 1)

1

> (symbol? '1)

1

>


ps: goes for (--) as well...
Title: Re: [BUG] ++ is TOO destructive ...
Post by: Lutz on April 02, 2011, 06:36:55 AM
This is fixed here: http://www.newlisp.org/downloads/development/inprogress/



There will be a maintenance release later. This bug stayed undetected since 10.2.
Title: Re: [BUG] ++ is TOO destructive ...
Post by: cormullion on April 02, 2011, 07:05:28 AM
> (dotimes (x 10) (++))
10
> (++)
11
>


must be useful somehow? :)
Title: Re: [BUG] ++ is TOO destructive ...
Post by: newdep on April 02, 2011, 07:32:32 AM
Hi Lutz,



It took some time to discover that my functions where all returning 'true ;-)

..to this (++) issue.. quite funny actualy but not consistant, thats how i discovered it. Thanks for the quick fix!



The main difference now between (++) and (inc) is integer and float handling, could then (++) and (--) be

handled like (inc) and (dec) too? Just to takeaway confusion on the function format ?



Example from 10.3.1 ->



> (++)

ERR: invalid parameter in function ++



> (inc)

1
Title: Re: [BUG] ++ is TOO destructive ...
Post by: Lutz on April 02, 2011, 07:36:26 AM
'inc' and 'dec' are fixed too now: http://www.newlisp.org/downloads/development/inprogress/