Liquidsoap_lang_values.ValueRuntime values: what a script evaluates to.
Runtime values: what a liquidsoap script evaluates to.
Every constructor carries its source position (for error messages), the methods attached to it, and for most of them a set of Flags.flags recording how it was written in the source. Values are compared and printed through compare and to_string rather than structurally, because functions and custom values need their own notion of both.
module Custom = Liquidsoap_lang_ast.Term.Custommodule Methods = Liquidsoap_lang_ast.Runtime_term.Methodstype env = (string * t) listMethods computed on demand rather than stored, used by sources whose method set depends on their content type.
and t = | Int of {pos : Liquidsoap_lang_prelude.Pos.Option.t;value : int;methods : t Methods.t;mutable flags : Liquidsoap_lang_data.Flags.flags;}| Float of {pos : Liquidsoap_lang_prelude.Pos.Option.t;value : float;methods : t Methods.t;}| String of {pos : Liquidsoap_lang_prelude.Pos.Option.t;value : string;methods : t Methods.t;}| Bool of {pos : Liquidsoap_lang_prelude.Pos.Option.t;value : bool;methods : t Methods.t;}| Null of {pos : Liquidsoap_lang_prelude.Pos.Option.t;methods : t Methods.t;}| Custom of {pos : Liquidsoap_lang_prelude.Pos.Option.t;value : Custom.t;methods : t Methods.t;dynamic_methods : dynamic_methods option;mutable flags : Liquidsoap_lang_data.Flags.flags;}| List of {pos : Liquidsoap_lang_prelude.Pos.Option.t;value : t list;methods : t Methods.t;mutable flags : Liquidsoap_lang_data.Flags.flags;}| Tuple of {pos : Liquidsoap_lang_prelude.Pos.Option.t;value : t list;methods : t Methods.t;mutable flags : Liquidsoap_lang_data.Flags.flags;}| Fun of {id : int;pos : Liquidsoap_lang_prelude.Pos.Option.t;fun_args : (string * string * t option) list;fun_env : env;fun_body : Liquidsoap_lang_ast.Term.t;methods : t Methods.t;mutable flags : Liquidsoap_lang_data.Flags.flags;}A function defined in a script.
*)| FFI of {id : int;pos : Liquidsoap_lang_prelude.Pos.Option.t;ffi_args : (string * string * t option) list;mutable ffi_fn : env -> t;methods : t Methods.t;mutable flags : Liquidsoap_lang_data.Flags.flags;}A builtin, i.e. a function implemented in OCaml.
*)val hash_fold_t :
Liquidsoap_lang_prelude.Term_hash.state ->
t ->
Liquidsoap_lang_prelude.Term_hash.statetype fun_v = {fun_args : (string * string * t option) list;fun_env : env;fun_body : Liquidsoap_lang_ast.Term.t;}type in_value = [ | `Bool of bool| `Custom of Custom.t| `FFI of ffi| `Float of float| `Fun of fun_v| `Int of int| `List of t list| `Null| `String of string| `Tuple of t list ]A value without its position, methods or flags: what make takes.
val make :
?pos:Liquidsoap_lang_prelude.Pos.t ->
?methods:t Methods.t ->
?flags:Liquidsoap_lang_data.Flags.flags ->
in_value ->
tval pos : t -> Liquidsoap_lang_prelude.Pos.Option.tval set_pos : t -> Liquidsoap_lang_prelude.Pos.Option.t -> tval has_flag : t -> Liquidsoap_lang_data.Flags.flag -> boolval add_flag : t -> Liquidsoap_lang_data.Flags.flag -> unitval remove_flag : t -> Liquidsoap_lang_data.Flags.flag -> unitval is_unit : t -> boolval string_of_int_value :
flags:Liquidsoap_lang_data.Flags.flags ->
int ->
stringRender an integer the way it was written, i.e. honouring the hexadecimal and octal flags.
val to_string : t -> stringComparison used by the language's `==` and by list and sort operations. Functions are compared by identity.
module type Custom = sig ... endAn OCaml type carried by liquidsoap values, e.g. a source or a request.
module type CustomDef = Liquidsoap_lang_ast.Term.CustomDefmodule MkCustomFromTerm
(Term : Liquidsoap_lang_ast.Term.Custom) :
Custom with type content = Term.contentmodule RuntimeType : Custom with type content = Liquidsoap_lang_types.Type.tA liquidsoap type, as a value. Used by the parsers (`json.parse` and friends) which need the expected type at runtime.