Artifact dad128d27bebf5d8f57a35184c394b6856af1b7146f129c6dc6b1b31a977e940:
- Executable file
r37/lisp/csl/jlisp/LispFunction.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: 1961) [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.*; public abstract class LispFunction extends LispObject { String name = "unknown-function"; public LispObject op0() throws Exception { return error("undefined " + name + " with 0 args"); } public LispObject op1(LispObject a1) throws Exception { return error("undefined " + name + " with 1 arg"); } public LispObject op2(LispObject a1, LispObject a2) throws Exception { return error("undefined " + name + " with 2 args"); } public LispObject opn(LispObject [] args) throws Exception { return error("undefined " + name + " with " + args.length + " args"); } LispObject error(String s) throws Exception { return Jlisp.error(s); } LispObject error(String s, LispObject a) throws Exception { return Jlisp.error(s, a); } void iprint() { String s = "#Fn<" + name + ">"; if ((currentFlags & noLineBreak) == 0 && currentOutput.column + s.length() > currentOutput.lineLength) currentOutput.println(); currentOutput.print(s); } void blankprint() { String s = "#Fn<" + name + ">"; if ((currentFlags & noLineBreak) == 0 && currentOutput.column + s.length() >= currentOutput.lineLength) currentOutput.println(); else currentOutput.print(" "); currentOutput.print(s); } 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); } } // End of LispFunction.java