Wanted: signal at least a STYLE-WARNING for #1()

Bug #1252100 reported by Jean-Philippe Paradis on 2013-11-17
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Undecided
Unassigned

Bug Description

What I do:
#1()

What happens:
#(NIL) is returned.

What I expected to happen:
At least a STYLE-WARNING, if not a WARNING or ERROR.

Analysis:

CLHS 2.4.8.3 Sharpsign Left-Parenthesis (http://www.lispworks.com/documentation/HyperSpec/Body/02_dhc.htm) states:

"The consequences are undefined if the unsigned decimal integer is non-zero and number of objects supplied before the closing ) is zero."

SBCL is not necessarily wrong in returning the above result, however code that relies on this behavior is not portable and thus I think at least a STYLE-WARNING should be signaled as a portability aid.

SBCL version:
1.0.56

uname -a:
Linux dynamorph 3.2.0-56-generic-pae #86-Ubuntu SMP Wed Oct 23 17:51:27 UTC 2013 i686 i686 i386 GNU/Linux

*features*:
(:SWANK :QUICKLISP :SB-BSD-SOCKETS-ADDRINFO :ASDF-UNICODE :ASDF2 :ASDF :ANSI-CL
 :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE
 :SB-EVAL :SB-SOURCE-LOCATIONS :IEEE-FLOATING-POINT :OS-PROVIDES-POLL
 :OS-PROVIDES-GETPROTOBY-R :OS-PROVIDES-SUSECONDS-T :OS-PROVIDES-PUTWC
 :OS-PROVIDES-DLADDR :OS-PROVIDES-DLOPEN :LITTLE-ENDIAN :LINKAGE-TABLE
 :MULTIPLY-HIGH-VOPS :MEMORY-BARRIER-VOPS :INLINE-CONSTANTS :CYCLE-COUNTER
 :ALIEN-CALLBACKS :STACK-ALLOCATABLE-FIXED-OBJECTS :STACK-ALLOCATABLE-LISTS
 :STACK-ALLOCATABLE-VECTORS :STACK-ALLOCATABLE-CLOSURES :RAW-INSTANCE-INIT-VOPS
 :UNWIND-TO-FRAME-AND-CALL-VOP :COMPARE-AND-SWAP-VOPS :C-STACK-IS-CONTROL-STACK
 :STACK-GROWS-DOWNWARD-NOT-UPWARD :GENCGC :LARGEFILE :SB-FUTEX :SB-THREAD
 :LINUX :ELF :UNIX :X86)

Douglas Katzman (dougk) wrote :

ABCL and ECL implement SBCL's current behavior, but it definitely seems an improvement to signal a reader-error.
CLISP does, and CCL gets itself into an error more-or-less by accident, speaking of the unportability of the syntax.

Plus I think we need more reasons to use Latin -

* (read-from-string "#9()")
debugger invoked on a SB-INT:SIMPLE-READER-ERROR in thread
#<THREAD "main thread" RUNNING {1002C052B3}>:
  Ex Nihilo Nihil - can't initialize length 9 vector from NIL.

How's that?

Douglas Katzman (dougk) wrote :

commit 1387a7fce24788d85bfcdced9321d8a22de5d4e2

Changed in sbcl:
status: New → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers