Evaluate() публичный Метод

public Evaluate ( InputSource source, Context context ) : STObject
source InputSource
context Context
Результат STObject
Пример #1
0
        public static void Evaluate(Compiler interp, string input, Context ctx)
        {
            input = input.Trim(' ', '\n', '\t');
            if (input == "") return;

            STClass stringClass = STClass.GetForCLR(typeof(string), "String");
            STObject obj = interp.Evaluate (input, ctx);

            if (obj == null) {
                Console.WriteLine(" x> null");
                return;
            }

            STObject display = obj;

            if (display.Class != stringClass) {
                try {
                    display = display.Send(STSymbol.Get("asString"));
                } catch (Exception e) {
                    Console.Error.WriteLine("*** Caught {0} while sending #toString to result", e.GetType().FullName);
                    Console.Error.WriteLine(e);
                }
            }

            Console.WriteLine(" => " + display.Native.ToString());
        }