diff --git a/lib/base/OCamlR_base.ml b/lib/base/OCamlR_base.ml index b7088a7..bd543c0 100644 --- a/lib/base/OCamlR_base.ml +++ b/lib/base/OCamlR_base.ml @@ -2,23 +2,23 @@ open OCamlR type any -module LL = OCamlR_base_stubs -module Stubs = OCamlR_base_generated_stubs +module Stubs = OCamlR_base_stubs +module Stubs2 = OCamlR_base_stubs2 let ( |? ) o f = match o with | Some x -> Some (f x) | None -> None -let subset x i = LL.subset x (R.int i) -let subset_ii x i j = LL.subset_ii x (R.int i) (R.int j) -let subset2_i x i = LL.subset2_i x (R.int i) -let subset2_s x s = LL.subset2_s x (R.string s) +let subset x i = Stubs2.subset x (R.int i) +let subset_ii x i j = Stubs2.subset_ii x (R.int i) (R.int j) +let subset2_i x i = Stubs2.subset2_i x (R.int i) +let subset2_s x s = Stubs2.subset2_s x (R.string s) module Environment = struct type t = any R.t let create () = Stubs.new'env () let unsafe_get env ~class_ x = - let y = LL.subset2_s env (R.string x) in + let y = Stubs2.subset2_s env (R.string x) in let cls = R.classes (y : _ R.t :> R.sexp) in if List.mem class_ cls then Some y diff --git a/lib/base/OCamlR_base_stubs.ml b/lib/base/OCamlR_base_stubs2.ml similarity index 100% rename from lib/base/OCamlR_base_stubs.ml rename to lib/base/OCamlR_base_stubs2.ml diff --git a/lib/base/OCamlR_base_stubs.mli b/lib/base/OCamlR_base_stubs2.mli similarity index 69% rename from lib/base/OCamlR_base_stubs.mli rename to lib/base/OCamlR_base_stubs2.mli index 9f6d242..a0eaf45 100644 --- a/lib/base/OCamlR_base_stubs.mli +++ b/lib/base/OCamlR_base_stubs2.mli @@ -1,7 +1,5 @@ open OCamlR -open OCamlR_base_types - val length : _ R.t -> R.integer R.t val subset : _ R.t -> R.integer R.t -> 'a R.t @@ -15,14 +13,14 @@ val subset2_i : _ R.t -> R.integer R.t -> 'a R.t val dim : < dim : R.integers R.t ; .. > R.t -> R.integers R.t module Matrix : sig - val subset : 'a matrix R.t -> R.integer R.t -> 'a matrix R.t - val subset_ii : 'a matrix R.t -> R.integer R.t -> R.integer R.t -> 'a R.scalar R.t - val subset2 : 'a matrix R.t -> R.integer R.t -> 'a R.atomic_vector R.t + val subset : _ R.t -> R.integer R.t -> _ R.t + val subset_ii : _ R.t -> R.integer R.t -> R.integer R.t -> 'a R.scalar R.t + val subset2 : _ R.t -> R.integer R.t -> 'a R.atomic_vector R.t end val rle : (_ #R.atomic_vector as 'a) R.t -> - < lengths : R.integers R.t ; values : 'a R.t > list_ R.t + < lengths : R.integers R.t ; values : 'a R.t > R.t val sample : (< length : R.integer R.t ; subset : 'b. R.integer R.t -> 'b R.t ; .. > as 'c) R.t -> diff --git a/lib/base/OCamlR_base_types.ml b/lib/base/OCamlR_base_types.ml deleted file mode 100644 index 225b486..0000000 --- a/lib/base/OCamlR_base_types.ml +++ /dev/null @@ -1,22 +0,0 @@ -open OCamlR - -class type ['a] list_ = object - inherit ['a] R.s3 constraint 'a = < .. > - method ty : 'a - method length : R.integer R.t - method subset2_s : 'b. R.string_ R.t -> 'b R.t - method subset2_i : 'b. R.integer R.t -> 'b R.t -end - -class type ['a] data'frame = object - inherit ['a] list_ - method dim : R.integers R.t -end - -class type ['a] matrix = object - inherit ['a] R.atomic_vector - method dim : R.integers R.t - method subset : R.integer R.t -> 'a matrix R.t - method subset_ii : R.integer R.t -> R.integer R.t -> 'a R.scalar R.t - method subset2 : R.integer R.t -> 'a R.atomic_vector R.t -end diff --git a/lib/base/dune b/lib/base/dune index 33c32ca..542a701 100644 --- a/lib/base/dune +++ b/lib/base/dune @@ -5,6 +5,6 @@ (libraries ocaml-r.interpreter)) (rule - (targets OCamlR_base_generated_stubs.ml) + (targets OCamlR_base_stubs.ml) (deps (:exe ../../stubgen/stubgen.exe)) (action (with-stdout-to %{targets} (run %{exe} base))))