[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Chris Hecker <checker@d...> |
| Subject: | Re: [Caml-list] # eval line; (?) |
> Try:
>let eval str =
> Toploop.execute_phrase true Format.std_formatter
> (!Toploop.parse_toplevel_phrase (Lexing.from_string str));;
I think he wants the variable to be bound into the current toplevel
environment, which this doesn't do:
# b;;
Characters 0-1:
Unbound value b
# let eval str =
Toploop.execute_phrase true Format.std_formatter
(!Toploop.parse_toplevel_phrase (Lexing.from_string str));;
val eval : string -> bool = <fun>
# eval "let b = 1;;";;
val b : int = 1
- : bool = true
# b;;
Characters 0-1:
Unbound value b
# eval "b;;";;
Uncaught exception: Typecore.Error(_, _).
Unless I made a mistaken assumption?
I don't think there's any way to bind it into the current toplevel, but
maybe you could dynamically load a module or hack something with #use or
something. I'm using 3.01 still, so maybe this is different on 3.04.
Chris
-------------------
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