building a toplevel

Quercia (querciam@l-carnot1.ac-dijon.fr)
Tue, 10 Dec 1996 15:07:59 +0000

Date: Tue, 10 Dec 1996 15:07:59 +0000
From: Quercia <querciam@l-carnot1.ac-dijon.fr>
To: caml-list <caml-list@inria.fr>
Subject: building a toplevel

--------------------------- En francais

Bonjour,

Est-il possible d'installer un "pretty-printer" dans un "toplevel" ?

Mon probleme est le suivant :
J'ai defini une bibliotheque d'utilitaires sur les arbres comprenant
entre autres une fonction d'impression semi-graphique. Je peux inclure
cette bibliotheque dans un "toplevel" avec "camlmktop", mais je ne vois
pas comment activer la fonction d'impression autrement qu'en entrant la
commande :

"install_printer xxx"

manuellement a l'utilisation.
Ma solution provisoire est de regrouper les commandes d'initialisation
de ce genre dans un fichier "init.ml" et de demander aux etudiants
d'inclure ce fichier "init.ml" dans leur code.
Comme ils doivent aussi passer en option a "camllight" le nom du
"toplevel" a utiliser, cela fait *deux* manipulations pour avoir acces a
ma bibliotheque.
*deux* c'est supportable, mais y a-t-il un moyen d'obtenir le meme effet
en une seule operation.

------------------------------- English
Hi,

Is it possible to install a pretty-printer in a toplevel ?

Here is my problem :
I wrote a library about trees with, among other things, a function which
draws trees on the terminal. I can include that library in a toplevel
with camlmktop, but I can't figure how to install my tree-printer
*within* the toplevel. I can install it manually with the phrase :

"install_printer xxx"

but I may have to enter a lot of such phrases with a more complex
library. Of course, I can put all theese phrases in a "init.ml" source
file and tell the students to fire camllight with the name of the
library on the command line and then to include "init.ml" in their code.
That works but it requires *two* special manipulations from the
students.
Is there a way to get the same result without needing an init file ?

-- 
Michel Quercia
Lycee Carnot  16 bd Thiers  21000 Dijon
e-mail = querciam@l-carnot1.ac-dijon.fr