Clojure

cl-format: ~( thows an exception with an empty string

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: Release 1.2, Release 1.3
  • Fix Version/s: Release 1.3
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test
  • Approval:
    Ok

Activity

Hide
Tom Faulhaber added a comment - - edited

The following block of code throws an index out of range exception:

(cl-format nil "~:(~a~)" "")
Show
Tom Faulhaber added a comment - - edited The following block of code throws an index out of range exception:
(cl-format nil "~:(~a~)" "")
Hide
Tom Faulhaber added a comment -

Patch that fixes the issue and adds tests

Show
Tom Faulhaber added a comment - Patch that fixes the issue and adds tests
Tom Faulhaber made changes -
Field Original Value New Value
Attachment clj-751.diff [ 10139 ]
Tom Faulhaber made changes -
Approval Test
Patch Fixed
Hide
Stuart Halloway added a comment -

Patch works. One question: Why does cl-format print "nil" as "Nil"? Is this a CL-ism? Do we want it?

Show
Stuart Halloway added a comment - Patch works. One question: Why does cl-format print "nil" as "Nil"? Is this a CL-ism? Do we want it?
Stuart Halloway made changes -
Approval Test Screened
Patch Fixed Code and Test
Hide
Tom Faulhaber added a comment -

Answer: cl-format doesn't print nil as "Nil". The () construction is a case control operator. In this case, it capitalizes the each word in the expression: http://www.lispworks.com/documentation/HyperSpec/Body/22_cha.htm.

In general, I've suppressed the obvious "CL-only" stuff like upper case symbols and such and replaced them with the corresponding Clojure conventions.

Show
Tom Faulhaber added a comment - Answer: cl-format doesn't print nil as "Nil". The () construction is a case control operator. In this case, it capitalizes the each word in the expression: http://www.lispworks.com/documentation/HyperSpec/Body/22_cha.htm. In general, I've suppressed the obvious "CL-only" stuff like upper case symbols and such and replaced them with the corresponding Clojure conventions.
Rich Hickey made changes -
Approval Screened Ok
Stuart Halloway made changes -
Status Open [ 1 ] Resolved [ 5 ]
Resolution Completed [ 1 ]
Stuart Halloway made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: