Browse thread
[Caml-list] Does this function exist?
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | John Prevost <j.prevost@c...> |
| Subject: | Re: [Caml-list] Does this function exist? |
>>>>> "ll" == Lukasz Lew <ll189417@zodiac.mimuw.edu.pl> writes:
ll> Hello Is there in OCaml a function ['a -> ()] which would
ll> print striong representation of first arument on stdout, just
ll> like OcamlTop does?
ll> print [3; 3];;
ll> should print: "- : int list = [3; 3]"
ll> It would be very usefull for debugging. Lukasz Lew
It would be, but I don't believe that it's really possible--you need
type information in order to determine what to display, and that
information is not available at runtime. If you know the type of what
you're printing, you can always use printf.
John.
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners