newLISP Fan Club

Forum => newLISP in the real world => Topic started by: kesha on October 06, 2016, 11:15:10 AM

Title: bug?
Post by: kesha on October 06, 2016, 11:15:10 AM

newLISP v.10.7.1 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h

> (= 'A 'A)
true
> (= 'A 'B)
nil                                               <--------------- !!!
> (define (Test A B C))
(lambda (A B C))
> (++ (find 'D (first Test)))
1
> (= 'A 'A)
true
> (= 'A 'B)
1                                                <---------------- ???
Title: Re: bug?
Post by: Lutz on October 06, 2016, 02:51:22 PM
Thanks for finding this. nil is only allowed in ++, --, inc and dec when contents of a variable, else it is seen as a wrong parameter.



fixed here: http://www.newlisp.org/downloads/development/inprogress/
Title: Re: bug?
Post by: rrq on October 06, 2016, 03:00:07 PM
I'd say Bug!



Apparently ++ manages to increment nil so now the value of nil is 1.

It also appears to require a compound set of circumstances for allowing ++ increment nil, so: Well done, for finding this problem.



EDIT: Lutz was already well ahead (of course?).
Title: Re: bug?
Post by: kesha on October 07, 2016, 01:19:45 AM
Thanks Lutz!