Class AddOp

  • All Implemented Interfaces:
    Named

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

      • PLUS

        public static final AddOp PLUS
      • MINUS

        public static final AddOp MINUS
    • Constructor Detail

      • AddOp

        public AddOp​(String name,
                     int plusOrMinus)
    • Method Detail

      • applyN

        public static Object applyN​(int plusOrMinus,
                                    Object[] args)
      • 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