Clojure

clojure.repl/source does not work with deftype

Details

  • Type: Enhancement Enhancement
  • Status: In Progress In Progress
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:

Description

clojure.repl/source does not work on a deftype

user> (deftype Foo [a b])
user.Foo
user> (source Foo)
Source not found

Cause: deftype creates a class but not a var so no file/line info is attached anywhere.

Approach:

Patch:

Screened by:

Activity

Stuart Halloway made changes -
Field Original Value New Value
Assignee Stuart Halloway [ stu ]
Reporter Assembla Importer [ importer ]
Priority Minor [ 4 ]
Alex Miller made changes -
Fix Version/s Backlog [ 10035 ]
Alex Miller made changes -
Labels repl
Alex Miller made changes -
Description Now that deftype creates a class (but not a var), you can't use c.c.repl-utils/get-source on a deftype. Is there something we can do on the Clojure side to help this work again? clojure.repl/source does not work on a deftype

{code}
user> (deftype Foo [a b])
user.Foo
user> (source Foo)
Source not found
{code}

*Cause:* deftype creates a class but not a var so no file/line info is attached anywhere.

*Approach:*

*Patch:*

*Screened by:*
Alex Miller made changes -
Summary contrib get-source no longer works with deftype clojure.repl/source does not work with deftype

People

Vote (5)
Watch (2)

Dates

  • Created:
    Updated: