| Author |
dynamic update
|
Pradeep bhatt
Ranch Hand
Joined: Feb 27, 2002
Posts: 8876
|
|
From chp1
Almost everything defined in a Clojure program can be re-defined, even while the
program is running: functions, multimethods, type hierarchies, even Java method
implementations as provided via proxy and gen-class.
Can someone help me understand the internal working ? Is it same as class reloading ?
|
Groovy
|
 |
Hussein Baghdadi
clojure forum advocate
Bartender
Joined: Nov 08, 2003
Posts: 3359
|
|
|
While I'm not sure and of course waiting for the authors to confirm but I think basically they are talking about Macros in Clojure and the Meta-programming capabilities.
|
 |
Chris Houser
author
Greenhorn
Joined: Feb 07, 2011
Posts: 22
|
|
The exact mechanism used varies based on the kind of thing being reloaded.
Records and protocols (deftype, defrecord, and defprotocol) indeed do something like class reloading using a custom classloader provided by Clojure itself.
Most of the rest are built on top of Clojure Vars, which are a concurrency construct that allows for thread-safe mutation. Updating one of these amounts to making its Var point to the new definition.
|
 |
 |
|
|
subject: dynamic update
|
|
|