Clojure

Passing a non-sequence to refer :only results in uninformative exception

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: Release 1.3, Release 1.4
  • Fix Version/s: Release 1.5
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code
  • Approval:
    Ok

Description

Compiling the following code results in a Don't know how to create ISeq from: clojure.lang.Symbol exception

code
(ns clj14.myns
(:use
[clojure.core :only seq]))
code

Activity

Hide
Andy Fingerhut added a comment -

Hugo, your patch doesn't apply cleanly to latest master due to some changed lines of context around it that are from before Nov 2011, which confuses me given that your patch was created recently. I could mechanically update it, but if you could take a look and create an updated patch yourself it would be safer.

Show
Andy Fingerhut added a comment - Hugo, your patch doesn't apply cleanly to latest master due to some changed lines of context around it that are from before Nov 2011, which confuses me given that your patch was created recently. I could mechanically update it, but if you could take a look and create an updated patch yourself it would be safer.
Hide
Andy Fingerhut added a comment -

Patch clj-940-add-exception-for-non-sequence-in-refer-only-patch.txt dated Apr 26 2012 is same as Hugo Duncan's, except it applies cleanly to latest master as of today.

Show
Andy Fingerhut added a comment - Patch clj-940-add-exception-for-non-sequence-in-refer-only-patch.txt dated Apr 26 2012 is same as Hugo Duncan's, except it applies cleanly to latest master as of today.
Hide
Stuart Sierra added a comment - - edited

Previous patch does not accurately reflect new :refer syntax in ns:

(:require [... :refer ...])

I offer a new patch, 0003-CLJ-940-check-for-sequential.patch, as an alternative.

This patch also checks for the more specific clojure.lang.Sequential instead of IPersistentCollection (which includes sets and maps).

If I had my druthers, I'd check for IPersistentList, but I can't face the screaming that would result.

Neither patch provides file/line information in the error, but there isn't much affordance for that in core.clj right now.

Show
Stuart Sierra added a comment - - edited Previous patch does not accurately reflect new :refer syntax in ns:
(:require [... :refer ...])
I offer a new patch, 0003-CLJ-940-check-for-sequential.patch, as an alternative. This patch also checks for the more specific clojure.lang.Sequential instead of IPersistentCollection (which includes sets and maps). If I had my druthers, I'd check for IPersistentList, but I can't face the screaming that would result. Neither patch provides file/line information in the error, but there isn't much affordance for that in core.clj right now.
Hide
Aaron Bedra added a comment -

Applies cleanly against d4170e65d001c8c2976f1bd7159484056b9a9d6d. This looks good to me. We should at some point talk more about the implications of checking IPersistenList, but I think there is enough value here to push it forward.

Show
Aaron Bedra added a comment - Applies cleanly against d4170e65d001c8c2976f1bd7159484056b9a9d6d. This looks good to me. We should at some point talk more about the implications of checking IPersistenList, but I think there is enough value here to push it forward.

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: