• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

dynamic update

 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 22
VI Editor Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
To do a great right, do a little wrong - shakepeare. twisted little ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic