gnu.kawa.functions

Class AddOp

Implemented Interfaces:
CanInline, Inlineable, Named

public class AddOp
extends ProcedureN
implements CanInline, Inlineable

Implement the Scheme standard functions "+" and "-".

Field Summary

static AddOp
$Mn
static AddOp
$Pl

Fields inherited from class gnu.mapping.ProcedureN

noArgs

Constructor Summary

AddOp(String name, int plusOrMinus)

Method Summary

static Object
$Mn(Object arg1)
static Object
$Mn(Object arg1, Object arg2)
static Object
$Mn$V(Object arg1, Object arg2, Object arg3, Object[] rest)
static Object
$Pl(Object arg1, Object arg2)
static Object
$Pl$V(Object arg1, Object arg2, Object arg3, Object[] rest)
static Object
apply2(int plusOrMinus, Object arg1, Object arg2)
Object
applyN(Object[] args)
static Object
applyN(int plusOrMinus, Object init, Object[] args)
static Object
applyN(int plusOrMinus, 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)
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.ProcedureN

apply0, apply1, apply2, apply3, apply4, applyN

Methods inherited from class gnu.mapping.Procedure

apply, apply, apply0, apply1, apply2, apply3, apply4, applyN, check0, check1, check2, check3, check4, checkArgCount, checkN, getName, getProperty, getSetter, getSymbol, match0, match1, match2, match3, match4, matchN, maxArgs, minArgs, name, numArgs, removeProperty, set0, set1, setN, setName, setProperty, setProperty, setSetter, setSymbol, toString

Field Details

$Mn

public static final AddOp $Mn

$Pl

public static final AddOp $Pl

Constructor Details

AddOp

public AddOp(String name,
             int plusOrMinus)

Method Details

$Mn

public static Object $Mn(Object arg1)

$Mn

public static Object $Mn(Object arg1,
                         Object arg2)

$Mn$V

public static Object $Mn$V(Object arg1,
                           Object arg2,
                           Object arg3,
                           Object[] rest)

$Pl

public static Object $Pl(Object arg1,
                         Object arg2)

$Pl$V

public static Object $Pl$V(Object arg1,
                           Object arg2,
                           Object arg3,
                           Object[] rest)

apply2

public static Object apply2(int plusOrMinus,
                            Object arg1,
                            Object arg2)

applyN

public Object applyN(Object[] args)
Overrides:
applyN in interface ProcedureN

applyN

public static Object applyN(int plusOrMinus,
                            Object init,
                            Object[] args)

applyN

public static Object applyN(int plusOrMinus,
                            Object[] args)

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

compile

public void compile(ApplyExp exp,
                    Compilation comp,
                    Target target)
Specified by:
compile in interface Inlineable

getReturnType

public Type getReturnType(Expression[] args)
Specified by:
getReturnType in interface Inlineable

inline

public Expression inline(ApplyExp exp,
                         ExpWalker walker)
Specified by:
inline in interface CanInline

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.

primInline

public static Expression primInline(int opcode,
                                    ApplyExp exp)