How well does it work with class redefinition? Do your instances created with the old definition automatically update to become instances of the new definition, or do you need to recreate them?
Common Lisp goes to a lot of trouble to ensure old instances automatically become new instances - given the repl is a first class feature, the whole language is built around this concept. But with C++ I can't quite picture how it would work.
Re:Inspector – A drop-anywhere C++ REPL
by Dangeranger on Tuesday February 13, 2018 @12:55PM
(#16369153)
The variables and references need to be re-initialized. It would be absolutely amazing if instances updated themselves but I think only Lisps and Smalltalk are capable of what you are saying. Correct me if I am wrong.
It is not supported. You can only define each type once.
Re:Inspector – A drop-anywhere C++ REPL
by zitterbewegung on Monday February 12, 2018 @02:46PM
(#16361411)
Even just knowing the variables in the Stack frame is useful also. The error pages for Django and pyramid have this. Also, at a previous job someone created a toolbar that had all of the relevant server variables in your session.
Re:Inspector – A drop-anywhere C++ REPL
by majewsky on Monday February 12, 2018 @03:26PM
(#16361755)
At a previous job, I built a server-side debugging tool which would record the requests that you made. For each request, you could see the HTTP request, the HTTP response, and events like SQL statements and log messages. (Sort of like Sentry.) There was also a button that re-ran the same request under a profiler.
Sadly the tool was never merged into mainline, so the feature branch has probaly rotten away by now.
Shlightly off-topic:
Maybe it's just me, but this is exactly why I'm not a fan of feature branches.
I do like to have local branches which sometimes serve as feature branches. But those are short-lived, so these either make it into mainline within a few days, or are deliberately marked as dead ends. (Or developed into a separate project, but this is very seldom and even then quickly moved into a new repository.)
Re:Inspector – A drop-anywhere C++ REPL
by Ono-Sendai on Monday February 12, 2018 @09:53PM
(#16364371)
A decent debugger will show all the local variables and their values.
It feels a bit like test driven development, but much more concrete. When I don't really know what I want to build, or what is possible, it's a fun way to spike out some functionality.
Then after you see what sort of path could exist from your interactive session you can use the code as a scaffold and re-implement the functionality by writing a test and implementing the code to satisfy it.