package liquidsoap-lang

  1. Overview
  2. Docs

Values are untyped normal forms of terms.

module Methods = Runtime_term.Methods
type env = (string * t) list

We derive a hash of the environment to invalidate the cache when the builtin env change. We mostly keep name and methods.

and dynamic_methods = {
  1. hidden_methods : string list;
  2. methods : string -> t option;
}
and t =
  1. | Int of {
    1. pos : Pos.Option.t;
    2. value : int;
    3. methods : t Methods.t;
    4. mutable flags : Flags.flags;
    }
  2. | Float of {
    1. pos : Pos.Option.t;
    2. value : float;
    3. methods : t Methods.t;
    }
  3. | String of {
    1. pos : Pos.Option.t;
    2. value : string;
    3. methods : t Methods.t;
    }
  4. | Bool of {
    1. pos : Pos.Option.t;
    2. value : bool;
    3. methods : t Methods.t;
    }
  5. | Null of {
    1. pos : Pos.Option.t;
    2. methods : t Methods.t;
    }
  6. | Custom of {
    1. pos : Pos.Option.t;
    2. value : Custom.t;
    3. methods : t Methods.t;
    4. dynamic_methods : dynamic_methods option;
    5. mutable flags : Flags.flags;
    }
  7. | List of {
    1. pos : Pos.Option.t;
    2. value : t list;
    3. methods : t Methods.t;
    4. mutable flags : Flags.flags;
    }
  8. | Tuple of {
    1. pos : Pos.Option.t;
    2. value : t list;
    3. methods : t Methods.t;
    4. mutable flags : Flags.flags;
    }
  9. | Fun of {
    1. pos : Pos.Option.t;
    2. fun_args : (string * string * t option) list;
    3. fun_env : env;
    4. fun_body : Term.t;
    5. methods : t Methods.t;
    6. mutable flags : Flags.flags;
    }
  10. | FFI of {
    1. pos : Pos.Option.t;
    2. ffi_args : (string * string * t option) list;
    3. mutable ffi_fn : env -> t;
    4. methods : t Methods.t;
    5. mutable flags : Flags.flags;
    }
type fun_v = {
  1. fun_args : (string * string * t option) list;
  2. fun_env : env;
  3. fun_body : Term.t;
}
type ffi = {
  1. ffi_args : (string * string * t option) list;
  2. ffi_fn : env -> t;
}
type in_value = [
  1. | `Int of int
  2. | `Float of float
  3. | `String of string
  4. | `Bool of bool
  5. | `Null
  6. | `Custom of Custom.t
  7. | `List of t list
  8. | `Tuple of t list
  9. | `Fun of fun_v
  10. | `FFI of ffi
]
val methods : t -> t Methods.t
val map_methods : t -> (t Methods.t -> t Methods.t) -> t
val pos : t -> Pos.Option.t
val set_pos : t -> Pos.Option.t -> t
val has_flag : t -> Flags.flag -> bool
val add_flag : t -> Flags.flag -> unit
val unit : [> `Tuple of 'a list ]
val is_unit : t -> bool
val make : ?pos:Pos.Option.base -> ?methods:t Methods.t -> ?flags:Flags.flags -> in_value -> t
val string_of_int_value : flags:Flags.flags -> int -> string
val to_string : t -> string
val invoke : t -> string -> t

Find a method in a value.

val invokes : t -> string list -> t

Perform a sequence of invokes: invokes x l1;l2;l3;... is x.l1.l2.l3...

val demeth : t -> t
val remeth : t -> t -> t
val split_meths : t -> (string * t) list * t
val compare : t -> t -> int
module type Custom = sig ... end
module type CustomDef = Term.CustomDef
module MkCustomFromTerm (Term : Term.Custom) : sig ... end
module MkCustom (Def : CustomDef) : sig ... end
module RuntimeType : sig ... end
OCaml

Innovation. Community. Security.