public void Call(IList<IValue> args, VM vm, SourceInfo info) { if (args.Count != 1) { throw new RheaException( this.WrongNumberOfArguments(1, args.Count), info ); } vm.SetCont(args[0], this, info); }
private IValue Run(ISList<IInsn> insns) { VM vm = new VM( insns, SList.Nil<IValue>(), mEnv, SList.Nil<KeyValuePair<IValue, IValue>>() ); while (true) { try { return vm.Run(); } catch (RheaException e) { Console.WriteLine("{0}: {1}", e.Info, e.Message); ValueCont cont = new ValueCont( SList.Nil<IInsn>(), SList.Nil<IValue>(), vm.Env, SList.Nil<KeyValuePair<IValue, IValue>>() ); vm.SetCont(null, cont, e.Info); } } }