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] Dynamically evaluating OCaml code
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-04-07 (20:39)
From: John Goerzen <jgoerzen@c...>
Subject: Re: [Caml-list] Dynamically evaluating OCaml code
On Thu, Apr 08, 2004 at 01:32:41AM +0400, Vitaly Lugovsky wrote:
> On Wed, 7 Apr 2004, John Goerzen wrote:
> > Hello,
> >
> > I am moving from Python to OCaml and one of the things I miss
> > is Python's eval() call.  It takes a string representing a bit
> > of Python source code, evaluates it, and returns the result.
> > I would like to be able to do similar things with OCaml.
>  OCaml is a compiler, not interpreter. But, you'll find that this
> feature is obsoleted by the partial application - it's a much
> more powerfull device then lispish eval, and it can be even a
> replacement for a macros.

I don't think that will help me here; I'm looking at being able to let
people insert OCaml expressions directly into otherwise plain-text
config files.

And while I understand your general point about OCaml being a compiler,
I think you'd have to admit that this line is at least blurred by the
interactive toplevel *interpreter* /usr/bin/ocaml :-)  It is a subset of
that program's functionality that I seek to imitate.

-- 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