Index: CreateFnFunction.java
===================================================================
--- CreateFnFunction.java	(revision 44737)
+++ CreateFnFunction.java	(revision 44738)
@@ -4,7 +4,6 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import java.util.Objects;
 import org.apache.commons.lang3.Range;
 import org.apache.commons.lang3.StringUtils;
 import org.gvsig.expressionevaluator.Code;
@@ -39,6 +38,11 @@
     }
 
     @Override
+    public boolean isHidden() {
+      return true;
+    }
+    
+    @Override
     public boolean useArgumentsInsteadObjects() {
         return true;
     }
@@ -47,6 +51,11 @@
     public boolean allowConstantFolding() {
         return false;
     }
+
+    @Override
+    public boolean allowArgNames() {
+      return true;
+    }
     
     @Override
     public Object call(Interpreter interpreter, Object[] args) throws Exception {
@@ -55,52 +64,17 @@
     
     @Override
     public Object call(Interpreter interpreter, Codes args) throws Exception {
-        // FNAME, PARAM-NAMES, BODY
         if( !(interpreter.getSymbolTable() instanceof MutableSymbolTable) ) {
             throw new ExpressionRuntimeException("The use of user functions require a mutable symbol table.");
         }
         MutableSymbolTable symbolTable = (MutableSymbolTable) interpreter.getSymbolTable();
         
-        String name;
-        List<String> argNames;
-        Code body = null;
-        String script_path = null;
-        String script_function = null;
-        String language = null;
-        // name, body
-        // name, args, body
-        // name, script_name, script_func, lang
-        // name, args, script_name, script_func, lang
-        switch(args.size()) {
-            case 2:
-                name = (String) getObject(interpreter, args, 0);
-                argNames = null;
-                body = args.get(1);
-                break;
-            case 3:
-                name = (String) getObject(interpreter, args, 0);
-                if( args.get(1)==null ) {
-                    argNames = null;
-                } else {
-                    argNames = (List<String>) getObject(interpreter, args, 1);
-                }
-                body = args.get(2);
-                break;
-            case 6:
-                name = (String) getObject(interpreter, args, 0);
-                if( args.get(1)==null ) {
-                    argNames = null;
-                } else {
-                    argNames = (List<String>) getObject(interpreter, args, 1);
-                }
-                body = args.get(2);
-                script_path = (args.get(3)==null)? null:((String)((Code.Constant)args.get(3)).value());
-                script_function = (args.get(4)==null)? null:((String)((Code.Constant)args.get(4)).value());
-                language = (args.get(5)==null)? null:((String)((Code.Constant)args.get(5)).value()).toLowerCase();
-                break;
-            default:
-                throw new ExpressionRuntimeException("Incorrect number of arguments");
-        }
+        String name = (String) getObject(interpreter, args, "FUNCTION_NAME");
+        List<String> argNames = (List<String>) getObject(interpreter, args, "PARAMETERS");
+        Code body = args.get("BODY");
+        String script_path = (String) getObject(interpreter, args, "SCRIPT_PATH");
+        String script_function = (String) getObject(interpreter, args, "SCRIPT_FUNCTION");
+        String language = (String) getObject(interpreter, args, "LANGUAGE");
         Function fn;
         if( body!=null ) {
             fn = new UserFunction(name, argNames, body);
@@ -136,8 +110,13 @@
             this.argNames = argNames;
             this.body = body;
         }
-        
+
         @Override
+        public boolean allowArgNames() {
+          return true;
+        }
+
+        @Override
         public Object call(Interpreter interpreter, Object[] args) throws Exception {
             Object value;
             ExpressionEvaluatorManager manager = ExpressionEvaluatorLocator.getManager();
