4 ms·
That's why Common Lisp / CLOS has functionality like * CHANGE-CLASS (change the class of an object to a different class), * update-instance-for-different-c
by lispm 11y ago
That's why Common Lisp / CLOS has functionality like
* CHANGE-CLASS (change the class of an object to a different class),
* update-instance-for-different-class (updating the object after a class change, one can provide methods which will be lazily called when needed),
* update-instance-for-redefined-class (updating the object after redefining a class, one can provide methods which will be lazily called when needed),
* LOAD (load source or machine code),
* EVAL (eval expressions)
* COMPILE (compile code in memory to memory), ...
One then always develops with a live application. Classes and objects can be updated in-place...
- ufmace 11y agoWhich can be really cool, but has its downsides: Hey cool, I can change these classes live! Let's solve this tricky problem by changing the class at runtime. Cool, it works, now on to the next problem. 2 years later... What's causing this super-weird bug? It's like the code isn't doing what it says at all. 1 week of debugging and head-banging later... Oooh, something got screwed up in that runtime class change code. Fixed. 2 years later, repeat...
- lispm 11y agoIs that something you've experienced?
- ufmace 11y agoNot directly, mostly because I haven't done that much work in any language where you can do that. But I have had that kind of experience when trying to figure out what Ruby code is actually being run somewhere. I may be heading that way with C#, with the occasional overuse of dynamic and reflection.