protected override EvalResult EvalImpl(ScmEnvironment env) { ScmExpression result = null; foreach (var scmExpression in _exprs) { result = scmExpression.Eval(env).Value; } return(result.ToResult()); }
private bool True(ScmExpression exp) { var selfExp = exp as SelfEvaluatingExpression; return(selfExp != null && selfExp.Value is bool && (bool)selfExp.Value); }
private void DefineVariable(string var, ScmExpression val, ScmEnvironment env) { env.Dict[var] = val; }
public IfExpression(ScmExpression predicate, ScmExpression then, ScmExpression @else) { _else = @else; _then = then; _predicate = predicate; }
public ApplicationExpression(ScmExpression @operator, ScmExpression[] arguments) { Operator = @operator; Arguments = arguments; }
private void SetVariable(object variable, ScmExpression eval, ScmEnvironment env) { }
public AssignmentExpression(object variable, ScmExpression value) { _variable = variable; _value = value; }
public LambdaExpression(ScmExpression body, string[] parameters, ScmEnvironment env) : base(null) { _env = env; _body = body; _parameters = parameters; }