Style more consistent, replace capitalization with camel case
This commit is contained in:
@ -6,7 +6,7 @@ Random.self_init ()
|
||||
let (let*) = Result.bind
|
||||
|
||||
let rec evaluate (mem: memory) (command: t_exp) :
|
||||
(permittedValues, [> error]) result =
|
||||
(permitted_values, [> error]) result =
|
||||
match command with
|
||||
Integer n -> Ok (IntegerPermitted n)
|
||||
| Boolean b -> Ok (BooleanPermitted b)
|
||||
@ -31,7 +31,7 @@ let rec evaluate (mem: memory) (command: t_exp) :
|
||||
)
|
||||
| Application (f, x) -> (
|
||||
let* evalf = evaluate mem f in
|
||||
let* funcClosure = (
|
||||
let* func_closure = (
|
||||
match evalf with
|
||||
FunctionPermitted ff -> Ok ff
|
||||
| IntegerPermitted _ -> Error (`WrongType ("Function is not a function,"
|
||||
@ -43,15 +43,15 @@ let rec evaluate (mem: memory) (command: t_exp) :
|
||||
) in
|
||||
let* param = evaluate mem x in
|
||||
let mem2 =
|
||||
match funcClosure.recursiveness with
|
||||
match func_closure.recursiveness with
|
||||
None -> {assignments = (
|
||||
VariableMap.add funcClosure.input param funcClosure.assignments)}
|
||||
VariableMap.add func_closure.input param func_closure.assignments)}
|
||||
| Some nameF -> {assignments = (
|
||||
VariableMap.add funcClosure.input param funcClosure.assignments |>
|
||||
VariableMap.add nameF (FunctionPermitted funcClosure)
|
||||
VariableMap.add func_closure.input param func_closure.assignments |>
|
||||
VariableMap.add nameF (FunctionPermitted func_closure)
|
||||
)}
|
||||
in
|
||||
evaluate mem2 funcClosure.body
|
||||
evaluate mem2 func_closure.body
|
||||
)
|
||||
| Plus (a, b) ->
|
||||
let* aval = (
|
||||
|
||||
Reference in New Issue
Block a user