Logical block prefix non-constantness false-positive in FORMAT.

Bug #494761 reported by Samium Gromoff
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Confirmed
Low
Unassigned

Bug Description

deepfire@auriga:~$ sbcl --no-userinit --eval '(format nil "~@<~@< ~;~A~:@>~:@>" nil)'
This is SBCL 1.0.33.2, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.

debugger invoked on a SB-FORMAT:FORMAT-ERROR in thread #<THREAD "initial thread" RUNNING {1002A6E041}>:
  error in FORMAT: cannot include format directives inside the prefix segment of ~<...~:>
  ~@<~@< ~;~A~:@>~:@>
        ^
See also:
  The ANSI Standard, Section 22.3.5.2

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE] Ignore runtime option --eval "(format nil \"~@<~@< ~;~A~:@>~:@>\" nil)".
  1: [ABORT ] Skip rest of --eval and --load options.
  2: Skip to toplevel READ/EVAL/PRINT loop.
  3: [QUIT ] Quit SBCL (calling #'QUIT, killing the process).

((FLET SB-FORMAT::EXTRACT-STRING) (" " #<>) T)
0] * deepfire@auriga:~$ sbcl --no-userinit --eval '(format nil "~@<~@<~;~A~:@>~:@>" nil)'
This is SBCL 1.0.33.2, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
*

Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

I'm slow, so please clarify: the second case should complain as well, instead of printing "NIL"?

Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

For those at the back of the class:

(format nil "~@<~A~@<~;~A~:@>~:@>" "<outer-block-prefix>" "<inner-block-body>")

 => "<outer-block-prefix><inner-block-body>"
 SHOULD be an error

...add a space at the start of the inner block prefix, and:

(format nil "~@<~A~@< ~;~A~:@>~:@>" "<outer-block-prefix>" "<inner-block-body>")

=| ERROR, which is right

Changed in sbcl:
status: New → Confirmed
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.