revise lisp references - close umuro/squiggle#50

This commit is contained in:
Umur Ozkul 2022-04-12 16:26:43 +02:00
parent a95cdfabe3
commit 1b4422bb90
2 changed files with 5 additions and 5 deletions

View File

@ -58,7 +58,7 @@ let callInternal = (call: functionCall): result<'b, errorValue> => {
}
/*
Lisp engine uses Result monad while reducing expressions
Reducer uses Result monad while reducing expressions
*/
let dispatch = (call: functionCall): result<expressionValue, errorValue> =>
try {

View File

@ -11,7 +11,7 @@ type expressionValue = ExpressionValue.expressionValue
type t = expression
/*
Shows the Lisp Code as text lisp code
Shows the expression as text of expression
*/
let rec toString = expression =>
switch expression {
@ -31,7 +31,7 @@ let toStringResult = codeResult =>
}
/*
Converts a MathJs code to Lisp Code
Converts a MathJs code to expression
*/
let parse_ = (expr: string, parser, converter): result<t, errorValue> =>
expr->parser->Result.flatMap(node => converter(node))
@ -167,13 +167,13 @@ let evalWBindingsExpression = (aExpression, bindings): result<expressionValue, '
reduceExpression(aExpression, bindings)
/*
Evaluates MathJs code via Lisp using bindings and answers the result
Evaluates MathJs code via Reducer using bindings and answers the result
*/
let evalWBindings = (codeText: string, bindings: T.bindings) => {
parse(codeText)->Result.flatMap(code => code->evalWBindingsExpression(bindings))
}
/*
Evaluates MathJs code via Lisp and answers the result
Evaluates MathJs code via Reducer and answers the result
*/
let eval = (code: string) => evalWBindings(code, defaultBindings)