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
Type | Name |
---|---|
System.String | name |
SetSymbolValue(String, Object)
View Source
Declaration
public void SetSymbolValue(string name, object value)
Parameters
Type | Name |
---|---|
System.String | name |
System.Object | value |
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
Type | Name |
---|---|
ServiceStack.Script.ScriptContext | context |
System.IO.Stream | outputStream |
System.String | lisp |
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
Type | Name |
---|---|
System.String | name |
System.Int32 | carity |
ServiceStack.Script.Lisp.BuiltInFuncBody | body |
Def(String, Int32, Func<Object[], Object>)
View Source
Declaration
public void Def(string name, int carity, Func<object[], object> body)
Parameters
Type | Name |
---|---|
System.String | name |
System.Int32 | carity |
System.Func<System.Object[],System.Object> | body |
Eval(IEnumerable<Object>)
View Source
Declaration
public object Eval(IEnumerable<object> sExpressions)
Returns
System.Object
Parameters
Type | Name |
---|---|
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
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<System.Object> | sExpressions |
ServiceStack.Script.Lisp.Cell | env |
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
Type | Name |
---|---|
System.Object | x |
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
Type | Name |
---|---|
System.Object | x |
ServiceStack.Script.Lisp.Cell | env |
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
Type | Name |
---|---|
ServiceStack.Script.Lisp.Cell | arg |
ServiceStack.Script.Lisp.Interpreter | interp |
ServiceStack.Script.Lisp.Cell | env |
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
Type | Name |
---|---|
ServiceStack.Script.Lisp.Cell | arg |
ServiceStack.Script.Lisp.Interpreter | interp |
ServiceStack.Script.Lisp.Cell | env |