Artifact a764edb5f86efffa86841a9ab5b42d27a71c7e296dcd76c52da51a181421e19a:
- Executable file
r37/lisp/csl/jlisp/AutoLoad.java
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 2063) [annotate] [blame] [check-ins using] [more...]
// // This file is part of the Jlisp implementation of Standard Lisp // Copyright \u00a9 (C) Codemist Ltd, 1998-2000. // import java.io.*; class AutoLoad extends LispFunction { Symbol name; LispObject data; AutoLoad(Symbol name, LispObject data) { this.name = name; this.data = data; } public LispObject op0() throws Exception { name.fn = new Undefined(name.pname); Fasl.loadModule(data.car); return name.fn.op0(); } public LispObject op1(LispObject a1) throws Exception { name.fn = new Undefined(name.pname); Fasl.loadModule(data.car); return name.fn.op1(a1); } public LispObject op2(LispObject a1, LispObject a2) throws Exception { name.fn = new Undefined(name.pname); Fasl.loadModule(data.car); return name.fn.op2(a1, a2); } public LispObject opn(LispObject [] args) throws Exception { name.fn = new Undefined(name.pname); Fasl.loadModule(data.car); return name.fn.opn(args); } void print() { Jlisp.print("#Autoload<" + name.pname + ">"); } void print(int n) { Jlisp.print("#Autoload<" + name.pname + ">"); } void scan() { if (Jlisp.objects.contains(this)) // seen before? { if (!Jlisp.repeatedObjects.containsKey(this)) { Jlisp.repeatedObjects.put( this, Jlisp.nil); // value is junk at this stage } } else { Jlisp.objects.add(this); Jlisp.stack.push(name); Jlisp.stack.push(data); } } void dump() throws IOException { Object w = Jlisp.repeatedObjects.get(this); if (w != null && w instanceof Integer) putSharedRef(w); else { if (w != null) { Jlisp.repeatedObjects.put( this, new Integer(Jlisp.sharedIndex++)); Jlisp.odump.write(X_STORE); } Jlisp.odump.write(X_AUTOLOAD); Jlisp.stack.push(data); Jlisp.stack.push(name); } } } // End of LispFunction.java