X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=lib%2Fint63.mli;h=69fbce1d01381b2c3763ef08a6240e8a198ed9cd;hb=70ecd5f92e887185fd3e09f603e4c5e1a06ef4f4;hp=3209d085e24cf049b85856d8ee61c24fc13a2bf0;hpb=8c2be1f021e65637f24b0ecd1907f7a069e347a2;p=virt-df.git diff --git a/lib/int63.mli b/lib/int63.mli index 3209d08..69fbce1 100644 --- a/lib/int63.mli +++ b/lib/int63.mli @@ -51,29 +51,52 @@ type t (** {2 Operators} - It is recommended to do [open Int63.Operators] in your code - so that you get the operators [+^], [-^] .. and the type [int63] - directly, and can still use the less frequent functions - as [Int63.logand] etc. + It is recommended to do: + +{[ +open Int63.Operators +]} + + in your code so that you get the operators [+^], [-^] .. and the + type [int63] directly, and can still use the less frequent + functions as {!Int63.logand} etc. *) module Operators : sig type int63 = t + (* For the gory details of the rules of operators, see: + * http://caml.inria.fr/pub/docs/manual-ocaml/lex.html + *) + val ( +^ ) : t -> t -> t val ( -^ ) : t -> t -> t val ( *^ ) : t -> t -> t val ( /^ ) : t -> t -> t - (** Arithmetic operators. *) + val ( %^ ) : t -> t -> t + (** Infix arithmetic operators. eg. [a +^ b -^ c] *) + + val ( <^< ) : t -> int -> t + val ( >^> ) : t -> int -> t + (** Infix shift left and logical shift right. + eg. [~^1 <^< 62] + + NB: We cannot use two less-than signs or two greater-than signs + in a row because that clashes with the symbols used for + camlp4 quotations. *) - val ( <<^ ) : t -> int -> t - val ( >>^ ) : t -> int -> t - (** Shift left and logical shift right. *) + val ( &&^ ) : t -> t -> t + val ( ||^ ) : t -> t -> t + val ( ^^^ ) : t -> t -> t + (** Infix logical and, or and xor operators. + eg. [bits &&^ mask] *) val ( ~^ ) : int -> t - (** Constant, eg. [~^0] is the constant zero. *) + (** Small integer constants, + eg. [~^0] is the constant zero and [~^1] is the constant one. *) val ( ~^~ ) : int -> t - (** Negative constant, eg. [~^~1] is the constant minus one. *) + (** Small negative integer constants, + eg. [~^~1] is the constant minus one. *) end (** {2 Functions} @@ -106,9 +129,9 @@ val abs : t -> t (** Absolute value. *) val max_int : t - (** The constant [2{^62}-1]. *) + (** The constant 2{^62}-1. *) val min_int : t - (** The constant [-2{^62}]. *) + (** The constant -2{^62}. *) val logand : t -> t -> t val logor : t -> t -> t