Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Functions defined at runtime in OCAML?

1 view
Skip to first unread message

Tim Josling

unread,
Aug 13, 2002, 9:10:49 PM8/13/02
to
In lisp I can build a function at runtime (as a list) and then evaluate it. Is
such a thing possible in OCAML?

Tim Josling

Sbastien de Menten

unread,
Aug 14, 2002, 10:56:05 AM8/14/02
to
I saw some days ago (but where!!!) an add-on to OCaml that compiles function
defined in a quotation style to byte-code (but no to native code) at
runtime.
Are you interested in it ? If so, I can look for it a little bit more...

"Tim Josling" <t...@melbpc.org.au> wrote in message
news:ajcamp$jh5$1...@cantaloupe.srv.cs.cmu.edu...

Tim Josling

unread,
Aug 15, 2002, 8:16:32 AM8/15/02
to
Thanks. I gather the base language does not do that so that answers my
question.

Tim Josling

Alex

unread,
Aug 16, 2002, 5:11:43 PM8/16/02
to
In Lisp/Scheme you use (print (eval (read input))).

In CAML you could use:

Toploop.execute_phrase true Format.std_formatter
(!Toploop.parse_toplevel_phrase (Lexing.from_string "1 + 2;;"));;

returns:

- : int = 3


Alex

Tim Josling <t...@melbpc.org.au> wrote in message news:<ajg630$h7p$1...@cantaloupe.srv.cs.cmu.edu>...

Tim Josling

unread,
Aug 17, 2002, 6:26:49 PM8/17/02
to
Thanks.
Tim Josling

Cristiano Calcagno

unread,
Aug 27, 2002, 1:45:19 PM8/27/02
to
Maybe you're referring to MetaOCaml? MetaOCaml allows you to generate
and execute code at runtime. The implementation is reasonably robust,
but it is still under development.

The web page is at:

http://cs-www.cs.yale.edu/homes/taha/MetaOCaml/

Cristiano Calcagno

"Sbastien de Menten" <sdementen_at...@eu.uu.net> wrote in message news:<ajdr25$nj$1...@cantaloupe.srv.cs.cmu.edu>...

0 new messages