gnu.kawa.functions
Class ApplyToArgs

java.lang.Object
  extended by gnu.mapping.PropertySet
      extended by gnu.mapping.Procedure
          extended by gnu.mapping.ProcedureN
              extended by gnu.kawa.functions.ApplyToArgs
All Implemented Interfaces:
CanInline, Named

public class ApplyToArgs
extends ProcedureN
implements CanInline

Implement the standard Scheme function "apply". This has been generalized so that the last (list argument) can be any sequence, or any primitive array coercible to Object[].


Field Summary
 
Fields inherited from class gnu.mapping.ProcedureN
noArgs
 
Constructor Summary
ApplyToArgs(java.lang.String name, Language language)
           
 
Method Summary
 java.lang.Object applyN(java.lang.Object[] args)
           
 void check1(java.lang.Object arg1, CallContext ctx)
          Does match1, plus throws exception on argument mismatch.
 void check2(java.lang.Object arg1, java.lang.Object arg2, CallContext ctx)
          Does match, plus throws exception on argument mismatch.
 void check3(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, CallContext ctx)
          Does match3, plus throws exception on argument mismatch.
 void check4(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, CallContext ctx)
          Does match4, plus throws exception on argument mismatch.
 void checkN(java.lang.Object[] args, CallContext ctx)
          Does matchN, plus throws exception on argument mismatch.
 Expression inline(ApplyExp exp, ExpWalker walker)
          Inline an application of this Procedure and return result.
 int match1(java.lang.Object arg1, CallContext ctx)
          Pass one argument.
 int match2(java.lang.Object arg1, java.lang.Object arg2, CallContext ctx)
          Pass two arguments.
 int match3(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, CallContext ctx)
          Pass three arguments.
 int match4(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, CallContext ctx)
          Pass four arguments.
 int matchN(java.lang.Object[] args, CallContext ctx)
           
 
Methods inherited from class gnu.mapping.ProcedureN
apply0, apply1, apply2, apply3, apply4
 
Methods inherited from class gnu.mapping.Procedure
apply, apply, check0, checkArgCount, getSetter, getSourceLocation, match0, maxArgs, minArgs, numArgs, set0, set1, setN, setSetter, setSourceLocation, toString
 
Methods inherited from class gnu.mapping.PropertySet
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ApplyToArgs

public ApplyToArgs(java.lang.String name,
                   Language language)
Method Detail

match1

public int match1(java.lang.Object arg1,
                  CallContext ctx)
Description copied from class: Procedure
Pass one argument.

Overrides:
match1 in class Procedure
Returns:
non-negative if the match succeeded, else negative.

match2

public int match2(java.lang.Object arg1,
                  java.lang.Object arg2,
                  CallContext ctx)
Description copied from class: Procedure
Pass two arguments.

Overrides:
match2 in class Procedure
Returns:
non-negative if the match succeeded, else negative.

match3

public int match3(java.lang.Object arg1,
                  java.lang.Object arg2,
                  java.lang.Object arg3,
                  CallContext ctx)
Description copied from class: Procedure
Pass three arguments.

Overrides:
match3 in class Procedure
Returns:
non-negative if the match succeeded, else negative.

match4

public int match4(java.lang.Object arg1,
                  java.lang.Object arg2,
                  java.lang.Object arg3,
                  java.lang.Object arg4,
                  CallContext ctx)
Description copied from class: Procedure
Pass four arguments.

Overrides:
match4 in class Procedure
Returns:
non-negative if the match succeeded, else negative.

matchN

public int matchN(java.lang.Object[] args,
                  CallContext ctx)
Overrides:
matchN in class Procedure

check1

public void check1(java.lang.Object arg1,
                   CallContext ctx)
Description copied from class: Procedure
Does match1, plus throws exception on argument mismatch.

Overrides:
check1 in class Procedure

check2

public void check2(java.lang.Object arg1,
                   java.lang.Object arg2,
                   CallContext ctx)
Description copied from class: Procedure
Does match, plus throws exception on argument mismatch.

Overrides:
check2 in class Procedure

check3

public void check3(java.lang.Object arg1,
                   java.lang.Object arg2,
                   java.lang.Object arg3,
                   CallContext ctx)
Description copied from class: Procedure
Does match3, plus throws exception on argument mismatch.

Overrides:
check3 in class Procedure

check4

public void check4(java.lang.Object arg1,
                   java.lang.Object arg2,
                   java.lang.Object arg3,
                   java.lang.Object arg4,
                   CallContext ctx)
Description copied from class: Procedure
Does match4, plus throws exception on argument mismatch.

Overrides:
check4 in class Procedure

checkN

public void checkN(java.lang.Object[] args,
                   CallContext ctx)
Description copied from class: Procedure
Does matchN, plus throws exception on argument mismatch.

Overrides:
checkN in class Procedure

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

applyN

public java.lang.Object applyN(java.lang.Object[] args)
                        throws java.lang.Throwable
Specified by:
applyN in class ProcedureN
Throws:
java.lang.Throwable