Class Map

  • All Implemented Interfaces:
    Named

    public class Map
    extends ProcedureN
    Implement the Scheme standard functions "map" and "for-each".
    • Constructor Detail

      • Map

        public Map​(boolean collect,
                   ApplyToArgs applyToArgs,
                   IsEq isEq)
    • Method Detail

      • map1

        public static java.lang.Object map1​(Procedure proc,
                                            LList list)
                                     throws java.lang.Throwable
        An optimized single-list version of map.
        Throws:
        java.lang.Throwable
      • map1

        public static java.lang.Object map1​(Procedure proc,
                                            java.lang.Object list)
                                     throws java.lang.Throwable
        Throws:
        java.lang.Throwable
      • forEach1

        public static void forEach1​(Procedure proc,
                                    LList list)
                             throws java.lang.Throwable
        An optimized single-list version of for-each.
        Throws:
        java.lang.Throwable
      • forEach1

        public static void forEach1​(Procedure proc,
                                    java.lang.Object list)
                             throws java.lang.Throwable
        An optimized single-list version of for-each.
        Throws:
        java.lang.Throwable
      • apply2

        public java.lang.Object apply2​(java.lang.Object arg1,
                                       java.lang.Object arg2)
                                throws java.lang.Throwable
        Overrides:
        apply2 in class Procedure
        Throws:
        java.lang.Throwable
      • applyN

        public java.lang.Object applyN​(java.lang.Object[] args)
                                throws java.lang.Throwable
        Overrides:
        applyN in class Procedure
        Throws:
        java.lang.Throwable
      • 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