Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: ping_delay
Fetching contributors…

Cannot retrieve contributors at this time

100 lines (79 sloc) 2.818 kb
(*
Copyright © 2011 MLstate
This file is part of Opa.
Opa is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License, version 3, as published by
the Free Software Foundation.
Opa is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
more details.
You should have received a copy of the GNU Affero General Public License
along with Opa. If not, see <http://www.gnu.org/licenses/>.
*)
(**
Runtime library for qmlClosure in caml
Meant for QmlClosure, for backends (to allow the bsl to
manipulate directly the closure through the server lib)
and for the closure bsl
*)
module AnyArray : sig
type t = Obj.t array
val create : int -> t
val set : t -> int -> 'a -> unit
val get : t -> int -> 'a
val length : t -> int
val append_sub : t -> int -> t -> t
val sub : t -> int -> t
val sub2 : t -> int -> int -> t
val append : t -> t -> t
end
(**/**)
type t_extra
#<Ifstatic:CPS_WITH_ML_CLOSURE .*>
type t
#<Else>
(* this type is exposed for manipulation ONLY by the code generated by QmlClosure *)
type t = {
arity : int;
mutable identifier : Obj.t option;
args: AnyArray.t;
mutable func: Obj.t;
extra : t_extra;
}
#<End>
(**/**)
(** {6 Debug} *)
val check : 'a -> bool
val assert_ : 'a -> t
val show : 'a -> string
(** {6 Allocation} *)
val create : 'ml_closure -> int -> 'record -> t
val create_no_ident : 'ml_closure -> int -> t
val create_no_ident1 : 'ml_closure -> t
val create_no_ident2 : 'ml_closure -> t
val create_no_function : int -> 'record -> t
val create_anyarray : 'ml_closure -> int -> 'record -> t
val define_function : t -> 'ml_closure -> unit
(** {6 Application} *)
(** full application of a closure *)
val args_apply : t -> AnyArray.t -> 'result
val args_apply1 : t -> 'arg1 -> 'result
val args_apply2 : t -> 'arg1 -> 'arg2 -> 'result
(** partial application of a closure *)
val env_apply : t -> AnyArray.t -> t
val env_apply1 : t -> 'arg1 -> t
val env_apply2 : t -> 'arg1 -> 'arg2 -> t
(** partial application of a closure with type information about pushed args *)
val env_apply_with_ty : t -> AnyArray.t -> AnyArray.t -> t
val env_apply1_with_ty : t -> 'arg1 -> 'ty_arg1 -> t
val env_apply2_with_ty : t -> 'arg1 -> 'arg2 -> 'ty_arg1 -> 'ty_arg1 -> t
(** {6 Interface for serialization} *)
val is_empty : 'closure -> bool
val get_identifier : 'closure -> 'ident option
val set_identifier : t -> 'ident -> unit
val get_args : t -> AnyArray.t
val get_tyargs : t -> AnyArray.t
(** {6 Interface for bsl projections} *)
val import : 'ml_closure -> int -> t
val export : t -> 'ml_closure
Jump to Line
Something went wrong with that request. Please try again.