package ecaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=89f2806dd37012b07ddbaf40c2d9cfb9de29289944d921d23f4fd9b93d5c7cba
doc/ecaml/Ecaml/Position/index.html
Module Ecaml.Position
A "position" is the index of a character in the text of a buffer. More precisely, a position identifies the place between two characters (or before the first character, or after the last character), so we can speak of the character before or after a given position. However, we often speak of the character "at" a position, meaning the character after that position.
Positions are usually represented as integers starting from 1, but can also be represented as "markers"--special objects that relocate automatically when text is inserted or deleted so they stay with the surrounding characters.
(Info-goto-node "(elisp)Positions").
include Ecaml_value.Value.Subtype
type t = private Ecaml_value.Value.tWe expose private value for free identity conversions when the value is nested in some covariant type, e.g. (symbols : Symbol.t list :> Value.t list) rather than List.map symbols ~f:Symbol.to_value.
val sexp_of_t : t -> Sexplib0.Sexp.teq t1 t2 = Value.eq (to_value t1) (to_value t2), i.e. eq checks whether the Emacs values underlying t1 and t2 are physically equal. This is different than phys_equal t1 t2, because we don't always wrap eq Emacs values in phys_equal OCaml values. I.e. phys_equal t1 t2 implies eq t1 t2, but not the converse.
val is_in_subtype : Ecaml_value.Value.t -> boolval of_value_exn : Ecaml_value__.Value0.t -> tval to_value : t -> Ecaml_value__.Value0.tval type_ : t Ecaml_value.Value.Type.tval t : t Ecaml_value.Value.Type.tinclude Core.Comparable.S_plain with type t := t
include Base.Comparable.S with type t := t
compare t1 t2 returns 0 if t1 is equal to t2, a negative integer if t1 is less than t2, and a positive integer if t1 is greater than t2.
ascending is identical to compare. descending x y = ascending y x. These are intended to be mnemonic when used like List.sort ~compare:ascending and List.sort ~cmp:descending, since they cause the list to be sorted in ascending or descending order, respectively.
clamp_exn t ~min ~max returns t', the closest value to t such that between t' ~low:min ~high:max is true.
Raises if not (min <= max).
val comparator : (t, comparator_witness) Base__.Comparator.comparatorval validate_lbound : min:t Core.Maybe_bound.t -> t Validate.checkval validate_ubound : max:t Core.Maybe_bound.t -> t Validate.checkval validate_bound :
min:t Core.Maybe_bound.t ->
max:t Core.Maybe_bound.t ->
t Validate.checkmodule Replace_polymorphic_compare :
Base.Comparable.Polymorphic_compare with type t := tmodule Map :
Core.Map.S_plain
with type Key.t = t
with type Key.comparator_witness = comparator_witnessmodule Set :
Core.Set.S_plain
with type Elt.t = t
with type Elt.comparator_witness = comparator_witnessval of_int_exn : int -> tval to_int : t -> intval to_byte_position : t -> int(describe-function 'position-bytes). (Info-goto-node "(elisp)Text Representations")
val of_byte_position : int -> t(describe-function 'byte-to-position). (Info-goto-node "(elisp)Text Representations")