Clojure

dynamic defrecord definitions trumped by AOT versions in classpath

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: Backlog
  • Fix Version/s: Backlog
  • Component/s: None
  • Labels:
    None
  • Approval:
    Vetted

Description

Symptom: Define a defrecord at the repl and you still see the old (AOT'd) defrecord.

In the attached project:
lein compile
lein repl

and enter the commands in the comment in src/defrecordissue/core.clj

Design Discussion here: http://dev.clojure.org/display/design/Dynamic+defrecord+definitions+trumped+by+AOT+versions+in+classpath

Activity

Hide
Stuart Halloway added a comment -

no, really, declined

Show
Stuart Halloway added a comment - no, really, declined
Hide
Stuart Halloway added a comment -

I don't know of any appropriate action to take, other than to change tools.

Show
Stuart Halloway added a comment - I don't know of any appropriate action to take, other than to change tools.
Hide
Christopher Redinger added a comment -

Re-opening - we closed this thinking it would be handled via tooling. It seems we should fix this though.

Show
Christopher Redinger added a comment - Re-opening - we closed this thinking it would be handled via tooling. It seems we should fix this though.
Hide
Stuart Halloway added a comment -

This behavior is to be expected, given Java's class loaders. If you want static classes, compile them onto your classpath. If you want reloadable classes, load them at runtime (preferable) from source.

The real place to fix this problem is in build tools and IDEs. When you are developing interactively, these tools should default to non-compilation of Clojure files. The Clojure/core team will fix this in a future version of the Clojure maven build tools.

Show
Stuart Halloway added a comment - This behavior is to be expected, given Java's class loaders. If you want static classes, compile them onto your classpath. If you want reloadable classes, load them at runtime (preferable) from source. The real place to fix this problem is in build tools and IDEs. When you are developing interactively, these tools should default to non-compilation of Clojure files. The Clojure/core team will fix this in a future version of the Clojure maven build tools.
Hide
Christopher Redinger added a comment -

You said you'd make a patch if Rich said it needed on. Your move.

Show
Christopher Redinger added a comment - You said you'd make a patch if Rich said it needed on. Your move.
Hide
Assembla Importer added a comment -

cemerick said: AFAICT, this also affects protocol definitions, where the associated interface classfile is available on the classpath.

Show
Assembla Importer added a comment - cemerick said: AFAICT, this also affects protocol definitions, where the associated interface classfile is available on the classpath.
Hide
Assembla Importer added a comment -

stu said: Updating tickets (#389, #371)

Show
Assembla Importer added a comment - stu said: Updating tickets (#389, #371)
Hide
Assembla Importer added a comment -

stu said: Rich: I understand the classloader situation that causes this. If you tell me what you think should happen instead I will make a patch.

Show
Assembla Importer added a comment - stu said: Rich: I understand the classloader situation that causes this. If you tell me what you think should happen instead I will make a patch.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: