caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: [Caml-list] inspecting abstract values in the debugger
       [not found] <20070220094543.EE684BC76@yquem.inria.fr>
@ 2007-02-20 10:04 ` David Allsopp
  0 siblings, 0 replies; 2+ messages in thread
From: David Allsopp @ 2007-02-20 10:04 UTC (permalink / raw)
  To: caml-list

Christian Lindig wrote:
> In the debugger, abstract values cannot be inspected.

I can't experiment in the debugger as I develop under native Windows and so
use the toplevel for debugging, but won't inserting temporary Obj.magic
calls into your code to "cast" abstract values to their actual
representations help as it does in the toplevel?

e.g.

*S.mli*
type t
val make : int -> int -> t

*S.ml*
type t = int * int
let make x y = (x, y)

*Toplevel*
#load "t.cmo";;
let (t : int * int) = Obj.magic (T.make 1 2);;


David


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] inspecting abstract values in the debugger
  2007-02-20  9:43 ` Christian Lindig
@ 2007-03-07  8:33   ` Hendrik Tews
  0 siblings, 0 replies; 2+ messages in thread
From: Hendrik Tews @ 2007-03-07  8:33 UTC (permalink / raw)
  To: Caml List

Christian Lindig <lindig@cs.uni-sb.de> writes:

   In the debugger, abstract values cannot be inspected. This can be

Yes, and the same applies for values inside polymorphic
functions. For instance, inside a List.iter you cannot inspect
the list.

   Therefore I'd like to discuss a feature wish: a compiler flag that
   makes all type declarations manifest. When compiling a signature

This doesn't solve the problem with polymorphic functions.

I would rather like to see a debugger feature "print value with
this type", where it is the responsibility of the user to supply
the right type. For instance, inside List.iter, you could do

  print a : int option

to see the current element of an int option list.

Bye,

Hendrik


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-07  8:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20070220094543.EE684BC76@yquem.inria.fr>
2007-02-20 10:04 ` [Caml-list] inspecting abstract values in the debugger David Allsopp
     [not found] <A6296BA9-6068-4445-8CD6-94BF835F2814@cs.uni-sb.de>
2007-02-20  9:43 ` Christian Lindig
2007-03-07  8:33   ` [Caml-list] " Hendrik Tews

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).