gnu.kawa.functions
Class AddOp
java.lang.Object
gnu.mapping.PropertySet
gnu.mapping.Procedure
gnu.mapping.ProcedureN
gnu.kawa.functions.AddOp
- All Implemented Interfaces:
- CanInline, Inlineable, Named
public class AddOp
- extends ProcedureN
- implements CanInline, Inlineable
Implement the Scheme standard functions "+" and "-".
Constructor Summary |
AddOp(java.lang.String name,
int plusOrMinus)
|
Method Summary |
static java.lang.Object |
$Mn(java.lang.Object arg1)
|
static java.lang.Object |
$Mn(java.lang.Object arg1,
java.lang.Object arg2)
|
static java.lang.Object |
$Mn$V(java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object[] rest)
|
static java.lang.Object |
$Pl(java.lang.Object arg1,
java.lang.Object arg2)
|
static java.lang.Object |
$Pl$V(java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object[] rest)
|
static java.lang.Object |
apply2(int plusOrMinus,
java.lang.Object arg1,
java.lang.Object arg2)
|
static java.lang.Object |
applyN(int plusOrMinus,
java.lang.Object[] args)
|
static java.lang.Object |
applyN(int plusOrMinus,
java.lang.Object init,
java.lang.Object[] args)
|
java.lang.Object |
applyN(java.lang.Object[] args)
|
static int |
classify(Type type)
Classify an expression according to its numeric type. |
void |
compile(ApplyExp exp,
Compilation comp,
Target target)
|
Type |
getReturnType(Expression[] args)
|
Expression |
inline(ApplyExp exp,
ExpWalker walker)
Inline an application of this Procedure and return result. |
static Expression |
pairwise(Procedure proc,
Expression rproc,
Expression[] args,
ExpWalker walker)
Convert (PROC A B C) to (PROC (PROC A B) C) etc. |
static Expression |
primInline(int opcode,
ApplyExp exp)
|
Methods inherited from class gnu.mapping.Procedure |
apply, apply, check0, check1, check2, check3, check4, checkArgCount, checkN, getSetter, getSourceLocation, match0, match1, match2, match3, match4, matchN, maxArgs, minArgs, numArgs, set0, set1, setN, setSetter, setSourceLocation, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
$Pl
public static final AddOp $Pl
$Mn
public static final AddOp $Mn
AddOp
public AddOp(java.lang.String name,
int plusOrMinus)
apply2
public static java.lang.Object apply2(int plusOrMinus,
java.lang.Object arg1,
java.lang.Object arg2)
$Pl
public static java.lang.Object $Pl(java.lang.Object arg1,
java.lang.Object arg2)
$Mn
public static java.lang.Object $Mn(java.lang.Object arg1,
java.lang.Object arg2)
$Mn
public static java.lang.Object $Mn(java.lang.Object arg1)
$Pl$V
public static java.lang.Object $Pl$V(java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object[] rest)
$Mn$V
public static java.lang.Object $Mn$V(java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object[] rest)
applyN
public static java.lang.Object applyN(int plusOrMinus,
java.lang.Object[] args)
applyN
public static java.lang.Object applyN(int plusOrMinus,
java.lang.Object init,
java.lang.Object[] args)
applyN
public java.lang.Object applyN(java.lang.Object[] args)
- Specified by:
applyN
in class ProcedureN
pairwise
public static Expression pairwise(Procedure proc,
Expression rproc,
Expression[] args,
ExpWalker walker)
- Convert (PROC A B C) to (PROC (PROC A B) C) etc.
inline
public Expression inline(ApplyExp exp,
ExpWalker walker)
- Description copied from interface:
CanInline
- Inline an application of this Procedure and return result.
Can return original expression.
- Specified by:
inline
in interface CanInline
primInline
public static Expression primInline(int opcode,
ApplyExp exp)
compile
public void compile(ApplyExp exp,
Compilation comp,
Target target)
- Specified by:
compile
in interface Inlineable
classify
public static int classify(Type type)
- Classify an expression according to its numeric type.
kind==0: not a number.
kind==1: a non-real number
kind==2: real number
kind==3: floating-point
kind==4: exact integer
getReturnType
public Type getReturnType(Expression[] args)
- Specified by:
getReturnType
in interface Inlineable