Exemplo n.º 1
0
        protected override EvalResult EvalImpl(ScmEnvironment env)
        {
            ScmExpression result = null;

            foreach (var scmExpression in _exprs)
            {
                result = scmExpression.Eval(env).Value;
            }
            return(result.ToResult());
        }
Exemplo n.º 2
0
        private bool True(ScmExpression exp)
        {
            var selfExp = exp as SelfEvaluatingExpression;

            return(selfExp != null && selfExp.Value is bool && (bool)selfExp.Value);
        }
Exemplo n.º 3
0
 private void DefineVariable(string var, ScmExpression val, ScmEnvironment env)
 {
     env.Dict[var] = val;
 }
Exemplo n.º 4
0
 public IfExpression(ScmExpression predicate, ScmExpression then, ScmExpression @else)
 {
     _else      = @else;
     _then      = then;
     _predicate = predicate;
 }
Exemplo n.º 5
0
 public ApplicationExpression(ScmExpression @operator, ScmExpression[] arguments)
 {
     Operator  = @operator;
     Arguments = arguments;
 }
Exemplo n.º 6
0
 private void SetVariable(object variable, ScmExpression eval, ScmEnvironment env)
 {
 }
Exemplo n.º 7
0
 public AssignmentExpression(object variable, ScmExpression value)
 {
     _variable = variable;
     _value    = value;
 }
Exemplo n.º 8
0
 public LambdaExpression(ScmExpression body, string[] parameters, ScmEnvironment env) : base(null)
 {
     _env        = env;
     _body       = body;
     _parameters = parameters;
 }