Skip Menu | will be shut down on March 1st, 2021.

This queue is for tickets about the LISP CPAN distribution.

Report information
The Basics
Id: 21248
Status: new
Priority: 0/
Queue: LISP

Owner: Nobody in particular
Requestors: murawaki [...]

Bug Information
Severity: (no value)
Broken in: 0.01
Fixed in: (no value)

Subject: zero, the empty string, and "0" are erroneously interpreted as NIL
Download (untitled) / with headers
text/plain 519b
Those which are false in a boolean test (zero, the empty string and "0") are erroneously interpreted as NIL. * Steps to reproduce: $list = LISP->new([2, 0, 1]); # (2 0 1) printf "%s\n", $list->string; # (2 NIL 1)!!! * The cause of the bug The subroutine "new" of LISP::List is buggy. Lines 52-54: my $car = ref eq 'ARRAY' && $class->new($_) || defined && $_ || $NIL; The fourth conditional expression is evaluated as false because $_ is 0, and $NIL is assigned to $car.
From: murawaki [...]
Download (untitled) / with headers
text/plain 198b
The subroutine 'string' is also buggy: while (listp($list) and !nilp($list) and my $elem = $list->pop) { The third test is erroneously evaluated as false if $elem is zero, the empty string or "0".

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to