Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] view types in ocaml?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-01-21 (14:42)
From: Yaron M. Minsky <yminsky@C...>
Subject: Re: [Caml-list] view types in ocaml?
On Tue, 2003-01-21 at 08:46, Oliver Bandel wrote:

> Well, I think that it is very good to have the values printed
> always.
> I like that.
> The toplevel is very good for testing code and doing
> experiments - and therefore it is very good to have
> the values printed always.

For the record, my suggestion is only that let-bound value printing
should be suppressed.  You could always see the result by just not
binding it (e.g., typing "foo x y z" instead of "let a = foo x y z".) 
And you can always get the contents of any variable printed by typing
it's name on the command line (e.g. "a;;" to see the contents of
variable a).

> If I don't need such helpers and code my code directly,
> I can write it into a file and let ocamlc or
> ocamlopt do its work.

But if you're doing interactive work with data of non-trivial size, the
constant printing is real pain.  I do an enormous amount of work
interactively at the command line, and more often than not, the data
structure print-outs are so long that I can't see the line I just typed
into the interpreter. 

> But maybe it makes sense to have options in the toplevel
> to disable such printings.

Making the suppression controllable by command-line options is
sensible.  But I do think that it should be the default.  There's a
reason that most language interpreters have this suppression, and I
don't think there's anything special about ocaml that makes it different
in this regard.

Another useful extension to the ocaml toplevel which has been proposed
in the past is to have some kind of default "this" variable which stores
unbound variables.  That would make the supression of let-bound easier
to use, since if you wanted to see how something printed out, you could
refrain from let-binding it, and still get access to the result using
the "this" variable.

> But it is no good idea to disable it hardcoded.
> I prefer the possibility to have such printings,
> but think optionally turining it off would be ok.
> Ciao,
>    Oliver

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: