Пример #1
0
 public static void Add(EScope scope)
 {
     scope.SetFunction("log",
                       new EGlobalFunction(
                           "log",
                           EType.Void,
                           (EScope subScope, ESolvable[] args) => {
         EVariable[] variables = args.Select(arg => arg.Solve(subScope)).ToArray();
         string toLog          = variables.Aggregate("", (prev, next) => {
             if (prev.Length == 0)
             {
                 return(prev + next);
             }
             return(prev + " " + next);
         });
         Console.WriteLine(toLog);
         return(new EVVoid());
     }
                           )
                       );
 }
Пример #2
0
 public override EVariable Exec(EScope scope)
 {
     scope.SetFunction(name.ToString(), ToEFunction());
     return(new EVVoid());
 }