| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| > Now, a wholly interpreted language like Lisp or Python comes with an > "eval" function *Pedantry* Lisp is usually compiled, but of course it does have an eval function. I think it is possible to use the OCaml bytecode interpreter from within an application, although it's not as easy as using eval in Python or Lisp. The Efuns project seems to do this: http://pauillac.inria.fr/para/cdrom/.../efuns/eng.htm Alex Simon H. wrote: > Okay. I'm building a text-adventure engine in Ocaml, and basically, I > want certain features to be scriptable. Like, the game-writer can > write a function to trigger an event when certain criteria are met. > This, of course, means that it has to be able to load and /evaluate/ > text files, returning an Ocaml function. Of course I could write my > own interpreter and mini-scripting language, but that seems a little > like overkill since it's gonna have a total of maybe two dozen > functions. > > Now, a wholly interpreted language like Lisp or Python comes with an > "eval" function, which would do exactly what I want, but OCaml is > compiled and doesn't have an equivilant, as far as I can find. The > closest thing I can think of would be ocamlmktop, and using that would > just make things rather more complicated than I would like to deal > with, what with having to hack the new toplevel into acting like a > game engine instead of a toplevel. > > So is there some nice easy way to do this, or shall I start writing an > interpreter? |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.