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
Listing toplevel bindings
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-09-25 (22:40)
From: John Harrison <John.Harrison@c...>
Subject: Listing toplevel bindings

When inside the OCaml toplevel, is there any way of getting a list
of all (top-level) bindings of names to objects of some specified 
type 'a? For example, given the type ":int" it might return an
association list:

 ["x",1; "y",2; ...] : (string * int)list

I'd be happy to compile more stuff into the toplevel if it's needed
to make this possible.