Beispiel #1
0
        public static SteExpression ResetAsFunction(this SteExpression expr, string funcName, IEnumerable <SteExpression> args)
        {
            var headSpecs = new SteFunctionHeadSpecs(funcName);

            expr.Reset(headSpecs, args);

            return(expr);
        }
Beispiel #2
0
        /// <summary>
        /// Create a function expression with some arguments
        /// </summary>
        /// <param name="funcName"></param>
        /// <param name="args"></param>
        /// <returns></returns>
        public static SteExpression CreateFunction(string funcName, IEnumerable <SteExpression> args)
        {
            if (String.IsNullOrEmpty(funcName))
            {
                throw new ArgumentNullException(nameof(funcName), @"Function name not initialized");
            }

            var funcHeadSpecs = new SteFunctionHeadSpecs(funcName);

            return(args == null
                ? new SteExpression(funcHeadSpecs, Enumerable.Empty <SteExpression>())
                : new SteExpression(funcHeadSpecs, args));
        }
Beispiel #3
0
        public static SteExpression ResetAsFunction(this SteExpression expr, string funcName, bool clearArgs = true)
        {
            var headSpecs = new SteFunctionHeadSpecs(funcName);

            if (clearArgs)
            {
                expr.Reset(headSpecs);
            }
            else
            {
                expr.ResetHead(headSpecs);
            }

            return(expr);
        }