bug?

Q&A's, tips, howto's
Locked
kesha
Posts: 7
Joined: Tue Dec 04, 2012 9:11 pm

bug?

Post by kesha »

Code: Select all

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                                                <---------------- ???

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: bug?

Post by Lutz »

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/develo ... nprogress/

ralph.ronnquist
Posts: 228
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: bug?

Post by ralph.ronnquist »

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?).

kesha
Posts: 7
Joined: Tue Dec 04, 2012 9:11 pm

Re: bug?

Post by kesha »

Thanks Lutz!

Locked