Package org.codehaus.groovy.runtime

Examples of org.codehaus.groovy.runtime.CurriedClosure


                    methodName = mc.getMethod();
                    final Class ownerClass = owner instanceof Class ? (Class) owner : owner.getClass();
                    final MetaClass ownerMetaClass = registry.getMetaClass(ownerClass);
                    return ownerMetaClass.invokeMethod(ownerClass, owner, methodName, arguments, false, false);
                } else if (objectClass == CurriedClosure.class) {
                    final CurriedClosure cc = (CurriedClosure) object;
                    // change the arguments for an uncurried call
                    final Object[] curriedArguments = cc.getUncurriedArguments(arguments);
                    final Class ownerClass = owner instanceof Class ? (Class) owner : owner.getClass();
                    final MetaClass ownerMetaClass = registry.getMetaClass(ownerClass);
                    return ownerMetaClass.invokeMethod(owner, methodName, curriedArguments);
                }
                if (method==null) invokeMissingMethod(object,methodName,arguments);
View Full Code Here


     *
     * @param arguments the arguments to bind
     * @return the new closure with its arguments bound
     */
    public Closure curry(final Object arguments[]) {
        return new CurriedClosure(this, arguments);
    }
View Full Code Here

     * @param arguments the arguments to bind
     * @return the new closure with its arguments bound
     * @see #curry(Object[])
     */
    public Closure rcurry(final Object arguments[]) {
        return new CurriedClosure(-arguments.length, this, arguments);
    }
View Full Code Here

     * @param arguments the arguments to bind
     * @return the new closure with its arguments bound
     * @see #curry(Object[])
     */
    public Closure ncurry(int n, final Object arguments[]) {
        return new CurriedClosure(n, this, arguments);
    }
View Full Code Here

            return writer.toString();
        }
       
        public Closure curry(final Object arguments[]) {
            return (new CurriedClosure(this,arguments)).asWritable();
        }
View Full Code Here

TOP

Related Classes of org.codehaus.groovy.runtime.CurriedClosure

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.