#580 hex format directive ignores upper/lower case distinction

closed-invalid
Sam Steingold
clisp (525)
5
2010-12-15
2010-12-01
No

(format nil "~x" 10) => "A"

when it should evaluate to "a".

Specs:

GNU CLISP 2.49 (2010-07-07) (built 3499977130) (memory 3499977680)
Software: GNU C 4.2.1 (Apple Inc. build 5646)

That's clisp x2.49 (via MacPorts) on Mac OS X 10.6.5 / MacBook Pro 5,1.

Discussion

  • You can use *load-pathname* to get the script name.

     
  • (Sorry for the previous comment it was intended for another bug report).

    First, CLHS is clear about directive characters:
    http://www.lispworks.com/documentation/HyperSpec/Body/22_c.htm

    The case of the directive character is ignored.

    If you want to force lowercase or upper case, use ~:( or ~:@(

     
  • This bug report is now marked as "pending"/"works for me".
    This means that we think that we cannot reproduce the problem
    and cannot do anything about it.
    Unless you - the reporter - act within 2 weeks
    (e.g., by submitting a self-contained test case
    or answering our other recent requests),
    the bug will be permanently closed.
    Sorry about the inconvenience -
    we hope your silence means that
    you are no longer observing the problem either.

     
  • Thank you. I got the impression from skimming Practical Common Lisp that ~X was uppercase and ~x was lowercase. Had I scrolled down, I would have seen the bit about ~(...~).

     
  • Sam Steingold
    Sam Steingold
    2010-12-01

    This bug report is now marked as "pending"/"invalid".
    This means that we think that the problem you report is not a problem with CLISP.
    Unless you - the reporter - act within 2 weeks, the bug will be permanently closed.
    Sorry about the inconvenience - we hope your silence means that you agree that this is not a bug in CLISP.

     
  • Sam Steingold
    Sam Steingold
    2010-12-01

    why do you expect "a" there?
    could you please quote the relevant part of the standard?

     
  • Sam Steingold
    Sam Steingold
    2010-12-01

    • assigned_to: haible --> sds
    • status: open --> pending-invalid
     
  • Bruno Haible
    Bruno Haible
    2010-12-11

    See CLHS 22.3.2.5 Tilde X: Hexadecimal <http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_22-3-2-5.html>:
    FORMAT ~X is like WRITE with *PRINT-BASE* being 16.
    In <http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/var_stprint-b_rint-radixst.html>
    you have a couple of examples where hexadecimal printing produces uppercase ASCII letters and none
    where it produces lowercase ASCII letters.

     
    • status: pending-invalid --> closed-invalid
     
  • This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).