Esempio n. 1
0
        public EvalResult Eval(String elfCode)
        {
            var wrapped = WrapInteractiveElf(elfCode);
            VM.Load(wrapped);

            var changeset = new ChangeSet(() => Ctx, v => { Ctx = v; }).StartRecording();
            Ctx = new PropertyBag(changeset.BaseLine);

            try
            {
                var className = wrapped.Substring(0, wrapped.NthIndexOf(" ", 2)).Substring(4);
                var retval = VM.CreateEntryPoint(className, "Main").RunTillEnd();
                return new EvalResult(retval, changeset.Capture());
            }
            finally
            {
                Ctx = new PropertyBag(changeset.BaseLine);
            }
        }
Esempio n. 2
0
 public EvalResult(object retval, ChangeSet sideEffects)
 {
     Retval = retval;
     SideEffects = sideEffects;
 }