Clojure

contrib get-source no longer works with deftype

Details

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

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?

Activity

Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - Converted from http://www.assembla.com/spaces/clojure/tickets/304
Hide
Assembla Importer added a comment -

chouser@n01se.net said: That's a great question. get-source just needs a file name and line number.

If IMeta were a protocol, it could be extended to Class. That implementation could look for a "well-known" static field, perhaps? __clojure_meta or something? Then deftype would just have to populate that field, and get-source would be all set.

Does that plan have any merit? Is there a better place to store a file name and line number?

Show
Assembla Importer added a comment - chouser@n01se.net said: That's a great question. get-source just needs a file name and line number. If IMeta were a protocol, it could be extended to Class. That implementation could look for a "well-known" static field, perhaps? __clojure_meta or something? Then deftype would just have to populate that field, and get-source would be all set. Does that plan have any merit? Is there a better place to store a file name and line number?
Hide
Assembla Importer added a comment -

stu said: Seems like a reasonable idea, but this is going to get back-burnered for now, unless there is a dire use case we have missed.

Show
Assembla Importer added a comment - stu said: Seems like a reasonable idea, but this is going to get back-burnered for now, unless there is a dire use case we have missed.

People

Vote (2)
Watch (1)

Dates

  • Created:
    Updated: