- I have found that debugging (rare, but it happens) in ocamldebug is very
difficult if I do not create many explicit temporary variables, such as in
the following code which pulls a structure out of a map, then does an
immediate array lookup:
let foo = (SomeMap.find "bob").somearray.(index) in
I am unable to inspect the structure/array returned from the map find.
Of course I could change the code to several lines with explicit variables:
let struct = SomeMap.find "bob" in
let foo = struct.somearray.(index) in
This however leads to a significant code expansion, which for many cases
is elegant enough to not warrant the expansion for clarity, not to meantion
the need to be careful to always make values visible in the event I would
need the value during debugging.
Is there any other way to inspect the implicit values of expressions
as they are being evaluated when stepping through the debugger?
Jeffrey J. Cook
Graduate Student, Electrical Engineering
University of Illinois at Urbana-Champaign
- Jeffrey J. Cook wrote:
> Is there any other way to inspect the implicit values of expressionsHi Jeff,
> as they are being evaluated when stepping through the debugger?
I've just been playing around with the debugger for the first time, and
I noticed this reference in the documentation:
* refers to the result just computed (typically, the value of a function
application), and is valid only if the selected event is an ``after''
event (typically, a function application).
I haven't really tried it myself.