English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Does this function exist?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-09-09 (19:33)
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.


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