Changeset 14570 for trunk/abcl/examples


Ignore:
Timestamp:
07/22/13 13:21:06 (4 years ago)
Author:
mevenson
Message:

Restore Packages.findPackage() API for obtaining the current package in Java.

Restore examples/java-to-lisp-1/MainAlternative.java to this use of
the API.

Fixes #324.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/examples/java-to-lisp-1/MainAlternative.java

    r14569 r14570  
    2020 */
    2121
    22 import org.armedbear.lisp.*;
     22import org.armedbear.lisp.Function;
     23import org.armedbear.lisp.Interpreter;
     24import org.armedbear.lisp.Package;
     25import org.armedbear.lisp.Packages;
     26import org.armedbear.lisp.Symbol;
    2327
    2428public class MainAlternative
     
    3741    // the function is not in a separate package, thus the
    3842    // correct package is CL-USER. Symbol names are
    39     // upper case. Package needs the prefix, because java
    40     // also has a class named Package.
    41     org.armedbear.lisp.Package defaultPackage =
    42         org.armedbear.lisp.Package.findPackage("CL-USER");
    43     Symbol sym =
    44         defaultPackage.findAccessibleSymbol("LISPFUNCTION");
     43    // (usually) upper case.
     44    Package defaultPackage
     45                  = Packages.findPackage("CL-USER");
     46    Symbol sym
     47                  = defaultPackage.findAccessibleSymbol("LISPFUNCTION");
    4548    Function function = (Function) sym.getSymbolFunction();
    4649    function.execute();
Note: See TracChangeset for help on using the changeset viewer.