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
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.
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 -

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.
Aaron Bedra made changes -
Field Original Value New Value
Assignee Rich Hickey [ richhickey ]
Fix Version/s Approved Backlog [ 10034 ]
Fix Version/s Release.Next [ 10038 ]
Reporter Assembla Importer [ importer ]
Affects Version/s Approved Backlog [ 10034 ]
Priority Minor [ 4 ]
Rich Hickey made changes -
Fix Version/s Release.Next [ 10038 ]
Fix Version/s Approved Backlog [ 10034 ]
Approval Vetted
Waiting On stu
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.
Christopher Redinger made changes -
Assignee Stuart Halloway [ stu ]
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.
Stuart Halloway made changes -
Status Open [ 1 ] Closed [ 6 ]
Approval Vetted
Resolution Declined [ 2 ]
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.
Christopher Redinger made changes -
Resolution Declined [ 2 ]
Status Closed [ 6 ] Reopened [ 4 ]
Approval Vetted
Christopher Redinger made changes -
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
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
Christopher Redinger made changes -
Assignee Stuart Halloway [ stu ]
Christopher Redinger made changes -
Fix Version/s Approved Backlog [ 10034 ]
Fix Version/s Release.Next [ 10038 ]
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.
Stuart Halloway made changes -
Waiting On stu
Hide
Stuart Halloway added a comment -

no, really, declined

Show
Stuart Halloway added a comment - no, really, declined
Stuart Halloway made changes -
Resolution Declined [ 2 ]
Status Reopened [ 4 ] Closed [ 6 ]
Alex Miller made changes -
Fix Version/s Approved Backlog [ 10034 ]
Fix Version/s Backlog [ 10035 ]
Affects Version/s Approved Backlog [ 10034 ]
Affects Version/s Backlog [ 10035 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: