Class AddOp

All Implemented Interfaces:
Named

public class AddOp extends ArithOp
Implement the Scheme standard functions "+" and "-".
  • Field Details

    • PLUS

      public static final AddOp PLUS
    • MINUS

      public static final AddOp MINUS
  • Constructor Details

    • AddOp

      public AddOp(String name, int plusOrMinus)
  • Method Details

    • apply2

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

      public static Object PLUS(Object arg1, Object arg2)
    • MINUS

      public static Object MINUS(Object arg1, Object arg2)
    • MINUS

      public static Object MINUS(Object arg1)
    • PLUS$V

      public static Object PLUS$V(Object arg1, Object arg2, Object arg3, Object[] rest)
    • MINUS$V

      public static Object MINUS$V(Object arg1, Object arg2, Object arg3, Object[] rest)
    • applyN

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

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

      public Object applyN(Object[] args)
      Overrides:
      applyN in class Procedure
    • numArgs

      public int numArgs()
      Description copied from class: Procedure
      Return minArgs()|(maxArgs<<12). We use a single virtual function to reduce the number of methods in the system, as well as the number of virtual method table entries. We shift by 12 so the number can normally be represented using a sipush instruction, without requiring a constant pool entry.
      Overrides:
      numArgs in class Procedure