package require java
java::import javax.script.ScriptEngine
java::import javax.script.ScriptEngineManager
java::import javax.script.ScriptException
set manager [java::new ScriptEngineManager]
set nashorn [$manager getEngineByName "nashorn"]
set value [$nashorn eval "10 + 20"]
puts "Result: [$value toString]"
沒有留言:
張貼留言