4 ms·
I don’t know about MATLAB, but everything you describe is trivial to do in R. Being dropped into the debugger is standard on most R installs (it’s an option you
by tylermw 6y ago
I don’t know about MATLAB, but everything you describe is trivial to do in R. Being dropped into the debugger is standard on most R installs (it’s an option you can turn off) and everything you mentioned can be done in the REPL.
- mikelevins 6y agoThat's good to know; thanks!
- mikelevins 6y agoSo I tried this with R: 1. Define an S4 class. 2. Create an instance of the S4 class (let's call it A). 3. Redefine the S4 class. 4. Examine A. R complains that there's an error in slot(object, what), because A is missing a slot from the (re)definition of the S4 class. This is promising, in that R realizes that A is supposed to be an instance of the redefined class. So far, so good. What I would expect to see next is that either R automatically reinitializes A with the new slot (it has exactly as much information about the new slot as it had about the old ones when I created A), or, if it wants intervention from me, it presents an interactive session I can use to tell it how to initialize the new slots. It didn't do that, but maybe I just don't have the options configured properly to make it happen. Smalltalk and Common Lisp meet my expectations: they notice that A is an instance of a redefined class and they either reinitialize the instance automatically, or they present an interactive session that I can use to tell them how to do it. It's entirely possible that R has this feature and I'm just missing it because I'm a noob.