Skip to main content

Lisp.Interpreter

Core of the Lisp interpreter

Assembly: ServiceStack.Common.dll​
View Source​
Declaration
public class Interpreter

Properties​

TotalEvaluations​

View Source​
Declaration
public static int TotalEvaluations { get; }

Evaluations​

View Source​
Declaration
public int Evaluations { get; set; }

COut​

Standard out

View Source​
Declaration
public TextWriter COut { get; set; }

Scope​

View Source​
Declaration
public ScriptScopeContext? Scope { get; set; }

Methods​

GetSymbolValue(String)​

View Source​
Declaration
public object GetSymbolValue(string name)
Returns​

System.Object

Parameters​
TypeName
System.Stringname

SetSymbolValue(String, Object)​

View Source​
Declaration
public void SetSymbolValue(string name, object value)
Parameters​
TypeName
System.Stringname
System.Objectvalue

ReplEval(ScriptContext, Stream, String, Dictionary<String, Object>)​

View Source​
Declaration
public string ReplEval(ScriptContext context, Stream outputStream, string lisp, Dictionary<string, object> args = null)
Returns​

System.String

Parameters​
TypeName
ServiceStack.Script.ScriptContextcontext
System.IO.StreamoutputStream
System.Stringlisp
System.Collections.Generic.Dictionary<System.String,System.Object>args

InitGlobals()​

View Source​
Declaration
public void InitGlobals()

Def(String, Int32, Lisp.BuiltInFuncBody)​

Define a built-in function by a name, an arity, and a body.

View Source​
Declaration
public void Def(string name, int carity, Lisp.BuiltInFuncBody body)
Parameters​
TypeName
System.Stringname
System.Int32carity
ServiceStack.Script.Lisp.BuiltInFuncBodybody

Def(String, Int32, Func<Object[], Object>)​

View Source​
Declaration
public void Def(string name, int carity, Func<object[], object> body)
Parameters​
TypeName
System.Stringname
System.Int32carity
System.Func<System.Object[],System.Object>body

Eval(IEnumerable<Object>)​

View Source​
Declaration
public object Eval(IEnumerable<object> sExpressions)
Returns​

System.Object

Parameters​
TypeName
System.Collections.Generic.IEnumerable<System.Object>sExpressions

Eval(IEnumerable<Object>, Lisp.Cell)​

View Source​
Declaration
public object Eval(IEnumerable<object> sExpressions, Lisp.Cell env)
Returns​

System.Object

Parameters​
TypeName
System.Collections.Generic.IEnumerable<System.Object>sExpressions
ServiceStack.Script.Lisp.Cellenv

AssertScope()​

View Source​
Declaration
public ScriptScopeContext AssertScope()
Returns​

ServiceStack.Script.ScriptScopeContext

Eval(Object)​

View Source​
Declaration
public object Eval(object x)
Returns​

System.Object

Parameters​
TypeName
System.Objectx

Eval(Object, Lisp.Cell)​

Evaluate a Lisp expression in an environment.

View Source​
Declaration
public object Eval(object x, Lisp.Cell env)
Returns​

System.Object

Parameters​
TypeName
System.Objectx
ServiceStack.Script.Lisp.Cellenv

EvalArgs(Lisp.Cell, Lisp.Interpreter, Lisp.Cell)​

View Source​
Declaration
public static object[] EvalArgs(Lisp.Cell arg, Lisp.Interpreter interp, Lisp.Cell env = null)
Returns​

System.Object[]

Parameters​
TypeName
ServiceStack.Script.Lisp.Cellarg
ServiceStack.Script.Lisp.Interpreterinterp
ServiceStack.Script.Lisp.Cellenv

EvalMapArgs(Lisp.Cell, Lisp.Interpreter, Lisp.Cell)​

View Source​
Declaration
public static Dictionary<string, object> EvalMapArgs(Lisp.Cell arg, Lisp.Interpreter interp, Lisp.Cell env = null)
Returns​

System.Collections.Generic.Dictionary<System.String,System.Object>

Parameters​
TypeName
ServiceStack.Script.Lisp.Cellarg
ServiceStack.Script.Lisp.Interpreterinterp
ServiceStack.Script.Lisp.Cellenv