2014-06-18 27 views

回答

3

從ChaiScript中可以得到use函數,但eval_file不是。 use只加載文件,如果它尚未加載。無論如何加載文件eval_file

use("use.inc") 

assert_equal("hello", greet()) 

// Include it a second time and see if there are any errors 
use("use.inc") 

assert_equal("hello", greet()) 

從這裏:https://github.com/ChaiScript/ChaiScript/blob/master/unittests/use.chai

的C++實現這一功能的文件是在這裏:http://chaiscript.com/docs/5/classchaiscript_1_1_chai_script.html#a9fc2eaf37274d09d1ee90ffd411e665c

我沒有看到任何文件,指定它也暴露在ChaiScript運行,但你可以看到許多在此處公開的功能:https://github.com/ChaiScript/ChaiScript/blob/master/include/chaiscript/language/chaiscript_engine.hpp#L318