Home | Up |
|
Impressum |
Inflisp is a Lisp interpreter written in Borland Pascal / Delphi. Its main purpose is to enhance Delphi applications with Artificial Intelligence, but you could also use it for scripting / automation. The name Inflisp was chosen because it's the successor of an OPS5-like inference engine Infmod. Inflisp is the AI motor of Augos 4, a Go playing program.
Status: Freeware; modify and use it at your own risk. I'd be glad if you left a comment in the source files about the original author, Joachim Pimiskern.
(+ ?a (* ?b ?c))Delphi code to set these parameters would look this like:
LispExpression.Prepare; // Must be called once ... LispExpression.SetIntegerParam('?A',5); LispExpression.SetIntegerParam('?B',6); LispExpression.SetIntegerParam('?C',7); LispExpression.Execute; ShowMessage(IntToStr(LispExpression.AsInteger));You can see that after executing the Lisp expression, the result, which is hidden in an internal variable of TLispExpression, is retrieved by the function AsInteger. In the following table the complete list of Set... and As... functions is shown.
procedure SetIntegerParam(s: string; value: longint); |
Set the parameter given by s to an integer value. |
procedure SetFloatParam(s: string; value: double); |
Set the parameter given by s to a float value. |
procedure SetStringParam(s: string; value: string); |
Set the parameter given by s to a string value. |
procedure SetSymbolParam(s: string; value: string); |
Set the parameter given by s to the lisp symbol given by a string. |
procedure SetBooleanParam(s: string; value: boolean); |
Set the parameter given by s to a Lisp boolean value, T or NIL. |
procedure SetNodeParam(s: string; value: pNode); |
Set the parameter given by s to a Lisp node, created before e.g. by LspNew(). |
function AsNode : pNode; |
Returns the result of TLispExpression in native Lisp format. |
function AsInteger: longint; |
Returns the result of TLispExpression as integer number. |
function AsFloat : double; |
Returns the result of TLispExpression as float number. |
function AsString : string; |
Returns the result of TLispExpression as a string. |
function AsSymbol : string; |
Returns the result of TLispExpression as the name of a symbol. |
function AsBoolean: boolean; |
Returns the result of TLispExpression as a Delphi boolean. |
Home | Up |
|
Impressum |