| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Refactor the ScriptEngine support to an adaptor atop the
IMain API.
Allow references to resolve to context attributes. (The
attributes must be defined at compilation time, though
they may resolve to updated values at evaluation time.)
This means that attributes are not bound statically in
REPL history. In particular, we forgo the trick of binding
attributes named "name: Type" as typed values.
Instead, an `x` bound in dynamic context is injected into
the script as a dynamic selection `$ctx.x` where `ctx`
performs the look-up in the script context.
When a compiled script is re-evaluated, a new instance of
the script class is created and defined symbols are
rebound.
The context stdout writer is handled with `Console.withOut`,
with bytes decoded using the default charset.
Compilation errors are thrown as ScriptException with the
first reported error.
This commit doesn't attempt dynamic selection from objects
in context. Currently, script must cast.
|
|
|
|
|
|
|
| |
The problem is that the repl underneath the script engine evaluates input to
val res0..resN, so it is a one shot operation. To allow repetition,
compile(script) now returns a CompiledScript object whose eval method can be
called any number of times.
|
|
|
|
|
|
|
|
|
|
|
|
| |
For Paul, it steals focus when it runs.
For me, it fails with some platform specific extra output:
-ScriptEngineManager providers.next(): javax.script.ScriptEngineFactory: Provider apple.applescript.AppleScriptEngineFactory could not be instantiated: java.lang.UnsatisfiedLinkError: no AppleScriptEngine in java.library.path
n: Object = 10
12345678910
So off to the holding pen for now.
|
|
The 2.10 fix to remove the ScriptEngine service entry
was inadvertently forwarded to 2.11.
This commit reverts and adds a test.
This situation was entirely foreseen by retronym,
proving beyond doubt that he is in fact a time traveler,
as hinted by his name. He brings bugs forward into the
future and returns into the past with fixes and other
alien technology like scalaz.
|