Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[feature] stdlib: Basic add int32/64 into Opa (needed for safe mongo …

…driver...)
  • Loading branch information...
commit 7f1c453b1bbfcf4bd88883deaa8d31c3879ce779 1 parent 41d408c
@BourgerieQuentin BourgerieQuentin authored
View
10 opabsl/mlbsl/bslNumber.ml
@@ -15,6 +15,10 @@
You should have received a copy of the GNU Affero General Public License
along with OPA. If not, see <http://www.gnu.org/licenses/>.
*)
+##extern-type int64 = Int64.t
+
+##extern-type int32 = Int32.t
+
##module Int \ bsl_int
##register max_int : int
@@ -270,20 +274,20 @@ let comparison (a:float) (b:float) =
Random.self_init()
##register generic_string : string, int -> string
- let generic_string chars len =
+ let generic_string chars len =
let s = String.create len in
for i = 0 to len - 1 do
s.[i] <- chars.[Random.int (String.length chars)]
done;
s
-
+
##register string : int -> string
let string len =
let chars = "abcdefghijklmnopqrstuvwxyz" in
generic_string chars len
##register base64 : int -> string
-let base64 len =
+let base64 len =
let chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" in
generic_string chars len
View
47 stdlib/core/int32.opa
@@ -0,0 +1,47 @@
+/*
+ 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/>.
+*/
+
+/**
+ * This modules defines operations on 32 bits integers
+ *
+ * @category data
+ * @destination public
+ * @stability stable
+**/
+
+/**
+ * {1 About this module}
+ *
+ * {1 Where should I start?}
+ *
+ * {1 What if I need more?}
+ */
+
+/**
+ * {1 Types defined in this module}
+ */
+
+type int32 = external
+
+/**
+ * {1 Interface}
+ */
+
+Int32 = {{
+
+}}
View
47 stdlib/core/int64.opa
@@ -0,0 +1,47 @@
+/*
+ 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/>.
+*/
+
+/**
+ * This modules defines operations on 64 bits integers
+ *
+ * @category data
+ * @destination public
+ * @stability stable
+**/
+
+/**
+ * {1 About this module}
+ *
+ * {1 Where should I start?}
+ *
+ * {1 What if I need more?}
+ */
+
+/**
+ * {1 Types defined in this module}
+ */
+
+type int64 = external
+
+/**
+ * {1 Interface}
+ */
+
+Int64 = {{
+
+}}
Please sign in to comment.
Something went wrong with that request. Please try again.