3 ms·
> the solution given seems overly complicated for the problem at hand The Hello, world program also seems kind of complicated for what it does. Who wants a pr
by EdwardCoffin 11y ago
> the solution given seems overly complicated for the problem at hand
The Hello, world program also seems kind of complicated for what it does. Who wants a program that prints a greeting on stdout and exits? Best to regard this problem as the simplest possible one to demonstrate the mechanism. A problem that really warrants it would be far too complicated to present without going into a lot of irrelevancies.
> redefining classes at runtime seems like a really bad idea
My experience with class redefinition comes from Smalltalk, not Common Lisp, but I am pretty sure they are somewhat similar. You really need to have experience working with an image-based language as an image-based language [1] to understand why such functionality can be useful. Additionally, I think you'll find that class redefinition is not intended to be something that would ever make it into production. Regard it the same way you might regard a debugger's feature that lets you change the value of a variable when at a breakpoint then resume execution: something that lets you continue with the invocation of a program you have a lot time and effort invested in, say hours worth of computation building up internal data structures, which you would lose if you had to make a one-line change, recompile, and start the execution again from scratch. It's a powerful piece of functionality that should probably be used sparingly, but when you want it, you really want it.
[1] I.e. not frequently recompiling from scratch and invoking afresh each time, but just updating those bits of code you've changed, and keeping the data already built.