OCaml: Add separate logging channels and a dedicated 'command' type
This commit is contained in:
parent
fab7e2425a
commit
ac3dbe4d30
9 changed files with 72 additions and 36 deletions
|
|
@ -1,9 +1,9 @@
|
|||
let interpret (past: Schema.schema) (input: string list): Schema.schema =
|
||||
|
||||
let future = { past with output = { message = "" } } in
|
||||
let future: Schema.schema = { past with output = { past.output with main = "" } } in
|
||||
|
||||
let say (message: string) =
|
||||
{ future with output = { message = message } } in
|
||||
let say (message: string): Schema.schema =
|
||||
{ future with output = { future.output with main = message }} in
|
||||
|
||||
(*
|
||||
TODO: return a schema with orders, instead of calling side-effects
|
||||
|
|
@ -20,7 +20,7 @@ let interpret (past: Schema.schema) (input: string list): Schema.schema =
|
|||
| head :: _ ->
|
||||
{ future with
|
||||
output = {
|
||||
message =
|
||||
future.output with main =
|
||||
("Unrecognized command: " ^ head ^ "\n"
|
||||
^ future.meta.help.short)
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue