Skip to content

Commit

Permalink
base: renamed stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
pveber committed Nov 20, 2018
1 parent ad10dbd commit b01fb09
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 36 deletions.
14 changes: 7 additions & 7 deletions lib/base/OCamlR_base.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 ->
Expand Down
22 changes: 0 additions & 22 deletions lib/base/OCamlR_base_types.ml

This file was deleted.

2 changes: 1 addition & 1 deletion lib/base/dune
Original file line number Diff line number Diff line change
Expand Up @@ -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))))

0 comments on commit b01fb09

Please sign in to comment.