blob: 1a51da24be85282e339a3f55e60ca05e160ade2b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
(** programs as source. A program in any language travels the tree as a
handle carrying [EphemeralRelation.Stored], with its text as the code,
so whoever holds one can run it through the evaluator of its language
without linking that language. *)
(** a program in [language]. *)
val program : language:string -> string -> Protocols.Handle.t
(** the language and text a handle carries, if it is a program. *)
val text : Protocols.Handle.t -> (string * string) option
(** an evaluator for [language]: it runs the text of a program in that
language, and refuses anything else. *)
val evaluator :
language:string ->
(string -> (Protocols.Handle.t, Concepts.Condition.condition) result) ->
Protocols.Handle.t
(** look up the evaluator of [language] under [root]'s \evaluator and run
[text] with it. *)
val run :
Protocols.Handle.t ->
language:string ->
string ->
(Protocols.Handle.t, Concepts.Condition.condition) result
(** register [evaluator] as \evaluator\[language] under [root]. *)
val register :
Protocols.Handle.t ->
language:string ->
Protocols.Handle.t ->
(unit, Concepts.Condition.condition) result
|