Class silk.Primitive
java.lang.Object
|
+----silk.SchemeUtils
|
+----silk.Procedure
|
+----silk.Primitive
- public class Primitive
- extends Procedure
A primitive is a procedure that is defined as part of the Scheme report,
and is implemented in Java code.
|
Constructor Summary
|
Primitive(int id,
int minArgs,
int maxArgs)
|
|
Method Summary
|
|
java.lang.Object
|
apply(Scheme interp,
java.lang.Object args)
Apply a primitive to a list of arguments.
|
|
static int
|
charCompare(java.lang.Object x,
java.lang.Object y,
boolean ci)
Return <0 if x is alphabetically first, >0 if y is first,
0 if same.
|
|
static Environment
|
installPrimitives(Environment env)
|
|
static java.lang.Object
|
memberAssoc(java.lang.Object obj,
java.lang.Object list,
char m,
char eq)
|
|
static java.lang.Object
|
numCompare(java.lang.Object args,
char op)
|
|
static java.lang.Object
|
numCompute(java.lang.Object args,
char op,
double result)
|
|
static char[]
|
stringAppend(java.lang.Object args)
|
|
static int
|
stringCompare(java.lang.Object x,
java.lang.Object y,
boolean ci)
Return <0 if x is alphabetically first, >0 if y is first,
0 if same.
|
| Methods inherited from class silk.SchemeUtils
|
| chr, chr, cons, equal, eqv, error, first, inPort, length, list, list, listStar, listToString, listToVector, num, num, outPort, rest, reverse, second, setFirst, setRest, str, sym, third, truth, truth, vec, vectorToList, warn, write |
| Methods inherited from class java.lang.Object
|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Primitive
public Primitive(int id,
int minArgs,
int maxArgs)
installPrimitives
public static Environment installPrimitives(Environment env)
apply
public java.lang.Object apply(Scheme interp,
java.lang.Object args)
- Apply a primitive to a list of arguments.
- Overrides:
- apply in class Procedure
stringAppend
public static char[] stringAppend(java.lang.Object args)
memberAssoc
public static java.lang.Object memberAssoc(java.lang.Object obj,
java.lang.Object list,
char m,
char eq)
numCompare
public static java.lang.Object numCompare(java.lang.Object args,
char op)
numCompute
public static java.lang.Object numCompute(java.lang.Object args,
char op,
double result)
charCompare
public static int charCompare(java.lang.Object x,
java.lang.Object y,
boolean ci)
- Return <0 if x is alphabetically first, >0 if y is first,
0 if same. Case insensitive iff ci is true. Error if not both chars.
stringCompare
public static int stringCompare(java.lang.Object x,
java.lang.Object y,
boolean ci)
- Return <0 if x is alphabetically first, >0 if y is first,
0 if same. Case insensitive iff ci is true. Error if not strings.