Changes between Version 11 and Version 12 of JavaScriptingAPI


Ignore:
Timestamp:
05/12/09 20:31:10 (14 years ago)
Author:
astalla
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • JavaScriptingAPI

    v11 v12  
    1313The main interface defined by JSR-223, {{{javax.script.ScriptEngine}}}, is implemented by the class [http://trac.common-lisp.net/armedbear/browser/trunk/abcl/src/org/armedbear/lisp/scripting/AbclScriptEngine.java org.armedbear.lisp.scripting.AbclScriptEngine]. !AbclScriptEngine is intended to be a singleton, and as such it has a protected constructor. You can obtain an instance of !AbclScriptEngine using the [http://trac.common-lisp.net/armedbear/browser/trunk/abcl/src/org/armedbear/lisp/scripting/AbclScriptEngineFactory.java AbclScriptEngineFactory] or by using the service provider mechanism through !ScriptEngineManager (refer to the javax.script documentation).
    1414
    15 === Configuration file ===
     15=== Startup and configuration file ===
    1616
    1717At startup (i.e. when its constructor is invoked, as part of the static initialization phase of !AbclScriptEngineFactory) the ABCL script engine attempts to load an "init file" from the classpath (/abcl-script-config.lisp). If present, this file can be used to customize the behaviour of the engine, by setting a number of variables in the ABCL-SCRIPT package. Here is a list of the available variables:
     
    2727   * Default value: 4005
    2828
     29Additionally, at startup the !AbclScriptEngine will (require 'asdf) - in fact, it uses asdf to load Swank.
     30
    2931=== Evaluation ===
    3032
    31 Code is read and evaluated in the package ABCL-SCRIPT-USER. This packages USEs the COMMON-LISP, JAVA and ABCL-SCRIPT packages. Future versions of the script engine might make this default package configurable. The load function is used under the hood for evaluating code, and thus the same behavior of load is guaranteed. This allows, among other things, in-package forms change the package in which the loaded code is read.
     33Code is read and evaluated in the package ABCL-SCRIPT-USER. This packages USEs the COMMON-LISP, JAVA and ABCL-SCRIPT packages. Future versions of the script engine might make this default package configurable. The load function is used under the hood for evaluating code, and thus the same behavior of load is guaranteed. This allows, among other things, in-package forms to change the package in which the loaded code is read.
    3234
    3335It is possible to evaluate code in what JSR-223 calls a "!ScriptContext" (basically a flat environment of name->value pairs). This context is used to establish special bindings for all the variables defined in it; since variable names are strings from Java's point of view, they are first interned using READ-FROM-STRING with, as usual, ABCL-SCRIPT-USER as the default package. Variables are declared special because CL's load, eval and compile functions work in a null lexical environment and would ignore non-special bindings.
    3436
    35 Contrary to what the function load does, evaluation of multiple forms returns the value of the last form.
     37Contrary to what the function load does, evaluation of a series of forms returns the value of the last form instead of T.
    3638
    3739=== Compilation ===