Details
-
Type:
Enhancement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: Release 1.6
-
Component/s: None
-
Labels:None
-
Patch:Code
-
Approval:Ok
Description
Design discussion here.
This patch improves Clojure's error message for a single common error: passing a non-seq where a seq is neede. More importantly, it is intended as a prototype for other similar improvements in the future.
Error message before:
(cons 1 2) => IllegalArgumentException Don't know how to create ISeq from: java.lang.Long
Error message after:
user=> (cons 1 2)
ExceptionInfo Don't know how to create ISeq from: java.lang.Long
user=> (ex-data *e)
{:instance 2}
Attachments
Activity
Stuart Halloway
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Description |
This patch improves Clojure's error message for a single common error: passing a non-seq where a seq is neede. More importantly, it is intended as a prototype for other similar improvements in the future.
Error message before: {noformat} (cons 1 2) => IllegalArgumentException Don't know how to create ISeq from: java.lang.Long {noformat} Error message after: {noformat} user=> (cons 1 2) ExceptionInfo Don't know how to create ISeq from: java.lang.Long user=> (ex-data *e) {:instance 2} {noformat} |
Design discussion [here|http://dev.clojure.org/display/design/Better+Error+Messages].
This patch improves Clojure's error message for a single common error: passing a non-seq where a seq is neede. More importantly, it is intended as a prototype for other similar improvements in the future. Error message before: {noformat} (cons 1 2) => IllegalArgumentException Don't know how to create ISeq from: java.lang.Long {noformat} Error message after: {noformat} user=> (cons 1 2) ExceptionInfo Don't know how to create ISeq from: java.lang.Long user=> (ex-data *e) {:instance 2} {noformat} |
Stuart Halloway
made changes -
| Approval | Vetted [ 10003 ] | Screened [ 10004 ] |
Rich Hickey
made changes -
| Fix Version/s | Release 1.5 [ 10150 ] |
Rich Hickey
made changes -
| Approval | Screened [ 10004 ] | Ok [ 10007 ] |
| Fix Version/s | Release 1.6 [ 10157 ] |
Wouldn't it be better to make it read "Don't know how to create ISeq from: 2 (java.lang.Long)"? How many beginners will figure
out ex-data exists and how to use it?