Module Ecaml_value.Funcall
A typeful interface for calling Elisp, as external
does for C. E.g.,
let not : bool -> bool = "not" <: bool @-> return bool
let about_emacs : unit -> unit = "about-emacs" <: nullary @-> return nil
val return : 'a Value.Type.t -> 'a t
val nil : unit Value.Type.t
val nullary : unit Value.Type.t
val (<:) : string -> 'a t -> 'a
"foo" <: ty
imports Elisp function whose name is "foo" and whose type isty
, like howfoo :> ty
types an OCaml value.
val (@->) : 'a Value.Type.t -> 'b t -> ('a -> 'b) t
include Value.Type.S
val create : Core_kernel.Sexp.t -> ('a -> Core_kernel.Sexp.t) -> (value -> 'a) -> ('a -> value) -> 'a t
val with_of_value_exn : 'a t -> (value -> 'a) -> 'a t
val to_sexp : 'a t -> 'a -> Core_kernel.Sexp.t
val bool : bool t
val float : float t
val ignored : unit t
val int : int t
val string : string t
val string_cached : string t
string_cached
is likestring
, except it usesof_utf8_bytes_cached
.
val unit : unit t
val value : value t
val list : 'a t -> 'a list t
val vector : 'a t -> 'a array t
val array_as_list : 'a t -> 'a array t
Represent an ocaml array as an elisp list, without creating an intermediate ocaml list.
val option : 'a t -> 'a option t
option
representsNone
asnil
andSome a
ascons v nil
, wherev
is the representation ofa
.
val nil_or : 'a t -> 'a option t
nil_or t_
representsNone
asnil
andSome a
asv
, wherev
is the representation ofa
. This is a common representation used by Elisp functions. But it is only correct ifnil
is not a representation of any value int
; in that situation useType.option_
.
val alist : 'a t -> 'b t -> ('a * 'b) list t
val tuple : 'a t -> 'b t -> ('a * 'b) t
Represent a tuple (a,b) as the elisp cons cell (a . b)
val sexpable : (module Core_kernel.Sexpable with type t = 'a) -> name:Core_kernel.Sexp.t -> 'a t
Embed a sexpable ocaml type, so we can save values of the type in emacs, e.g. as buffer local variables
val path_list : string list t
A list of directories. Each element is a string (directory name) or nil (try default directory). nil values are converted to ".", which has the same meaning.
module Private : sig ... end