Skip to content

Commit 9cf3bcd

Browse files
committed
shorter names
1 parent 2a5d9f2 commit 9cf3bcd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+501
-501
lines changed

jscomp/core/lam_compile_primitive.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,9 @@ let translate loc
535535
| [e;e1] -> Js_of_lam_array.ref_array e e1 (* Todo: Constant Folding *)
536536
| _ -> assert false)
537537
| Parrayrefs ->
538-
E.runtime_call Js_runtime_modules.array "caml_array_get" args
538+
E.runtime_call Js_runtime_modules.array "get" args
539539
| Parraysets ->
540-
E.runtime_call Js_runtime_modules.array "caml_array_set" args
540+
E.runtime_call Js_runtime_modules.array "set" args
541541
| Pmakearray ->
542542
Js_of_lam_array.make_array Mutable args
543543
| Parraysetu ->

jscomp/runtime/caml_array.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ let caml_array_concat (l : 'a array list) : 'a array =
6565
fill result 0 l ;
6666
result
6767

68-
let caml_array_set xs index newval =
68+
let set xs index newval =
6969
if index <0 || index >= Caml_array_extern.length xs
7070
then raise (Invalid_argument "index out of bounds")
7171
else xs.!( index)<- newval
7272

73-
let caml_array_get xs index =
73+
let get xs index =
7474
if index <0 || index >= Caml_array_extern.length xs then
7575
raise (Invalid_argument "index out of bounds")
7676
else xs.!( index)

jscomp/runtime/caml_array.mli

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ val caml_make_float_vect : int -> float array
3434

3535
val caml_array_blit : 'a array -> int -> 'a array -> int -> int -> unit
3636

37-
val caml_array_get: 'a array -> int -> 'a
37+
val get: 'a array -> int -> 'a
3838

39-
val caml_array_set: 'a array -> int -> 'a -> unit
39+
val set: 'a array -> int -> 'a -> unit

jscomp/test/array_safe_get.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var x = [
1111
var y;
1212

1313
try {
14-
y = Caml_array.caml_array_get(x, 3);
14+
y = Caml_array.get(x, 3);
1515
}
1616
catch (raw_msg){
1717
var msg = Caml_js_exceptions.internalToOCamlException(raw_msg);

jscomp/test/array_subtle_test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ eq("File \"array_subtle_test.ml\", line 17, characters 5-12", [
6060

6161
eq("File \"array_subtle_test.ml\", line 21, characters 5-12", [
6262
3,
63-
Caml_array.caml_array_get(v, 2)
63+
Caml_array.get(v, 2)
6464
]);
6565

66-
Caml_array.caml_array_set(v, 2, 4);
66+
Caml_array.set(v, 2, 4);
6767

6868
eq("File \"array_subtle_test.ml\", line 23, characters 5-12", [
6969
4,
70-
Caml_array.caml_array_get(v, 2)
70+
Caml_array.get(v, 2)
7171
]);
7272

7373
while(v.length > 0) {

jscomp/test/array_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function starts_with(xs, prefix, p) {
1919
}
2020
try {
2121
for(var i = 0; i < len2; ++i){
22-
if (!Curry._2(p, Caml_array.caml_array_get(xs, i), Caml_array.caml_array_get(prefix, i))) {
22+
if (!Curry._2(p, Caml_array.get(xs, i), Caml_array.get(prefix, i))) {
2323
throw {
2424
RE_EXN_ID: H,
2525
Error: new Error()
@@ -46,7 +46,7 @@ function is_sorted(x) {
4646
if (i >= (len - 1 | 0)) {
4747
return true;
4848
}
49-
if (!Caml_obj.caml_lessthan(Caml_array.caml_array_get(x, i), Caml_array.caml_array_get(x, i + 1 | 0))) {
49+
if (!Caml_obj.caml_lessthan(Caml_array.get(x, i), Caml_array.get(x, i + 1 | 0))) {
5050
return false;
5151
}
5252
_i = i + 1 | 0;

jscomp/test/bdd.js

+25-25
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function $$eval(_bdd, vars) {
88
if (typeof bdd === "number") {
99
return bdd === 0;
1010
}
11-
if (Caml_array.caml_array_get(vars, bdd._1)) {
11+
if (Caml_array.get(vars, bdd._1)) {
1212
_bdd = bdd._3;
1313
continue ;
1414
}
@@ -72,16 +72,16 @@ function resize(newSize) {
7272
};
7373
}
7474
var ind = hashVal(getId(n._0), getId(n._3), n._1) & newSz_1;
75-
Caml_array.caml_array_set(newArr, ind, {
75+
Caml_array.set(newArr, ind, {
7676
hd: n,
77-
tl: Caml_array.caml_array_get(newArr, ind)
77+
tl: Caml_array.get(newArr, ind)
7878
});
7979
_bucket = bucket.tl;
8080
continue ;
8181
};
8282
};
8383
for(var n = 0 ,n_finish = sz_1.contents; n <= n_finish; ++n){
84-
copyBucket(Caml_array.caml_array_get(arr, n));
84+
copyBucket(Caml_array.get(arr, n));
8585
}
8686
htab.contents = newArr;
8787
sz_1.contents = newSz_1;
@@ -90,7 +90,7 @@ function resize(newSize) {
9090

9191
function insert(idl, idh, v, ind, bucket, newNode) {
9292
if (n_items.contents <= sz_1.contents) {
93-
Caml_array.caml_array_set(htab.contents, ind, {
93+
Caml_array.set(htab.contents, ind, {
9494
hd: newNode,
9595
tl: bucket
9696
});
@@ -99,9 +99,9 @@ function insert(idl, idh, v, ind, bucket, newNode) {
9999
}
100100
resize((sz_1.contents + sz_1.contents | 0) + 2 | 0);
101101
var ind$1 = hashVal(idl, idh, v) & sz_1.contents;
102-
return Caml_array.caml_array_set(htab.contents, ind$1, {
102+
return Caml_array.set(htab.contents, ind$1, {
103103
hd: newNode,
104-
tl: Caml_array.caml_array_get(htab.contents, ind$1)
104+
tl: Caml_array.get(htab.contents, ind$1)
105105
});
106106
}
107107

@@ -120,7 +120,7 @@ function mkNode(low, v, high) {
120120
return low;
121121
}
122122
var ind = hashVal(idl, idh, v) & sz_1.contents;
123-
var bucket = Caml_array.caml_array_get(htab.contents, ind);
123+
var bucket = Caml_array.get(htab.contents, ind);
124124
var _b = bucket;
125125
while(true) {
126126
var b = _b;
@@ -199,12 +199,12 @@ function not(n) {
199199
}
200200
var id = n._2;
201201
var h = id % 1999;
202-
if (id === Caml_array.caml_array_get(notslot1, h)) {
203-
return Caml_array.caml_array_get(notslot2, h);
202+
if (id === Caml_array.get(notslot1, h)) {
203+
return Caml_array.get(notslot2, h);
204204
}
205205
var f = mkNode(not(n._0), n._1, not(n._3));
206-
Caml_array.caml_array_set(notslot1, h, id);
207-
Caml_array.caml_array_set(notslot2, h, f);
206+
Caml_array.set(notslot1, h, id);
207+
Caml_array.set(notslot2, h, f);
208208
return f;
209209
}
210210

@@ -232,8 +232,8 @@ function and2(n1, n2) {
232232
var v2 = n2._1;
233233
var l2 = n2._0;
234234
var h = hash(i1, i2);
235-
if (i1 === Caml_array.caml_array_get(andslot1, h) && i2 === Caml_array.caml_array_get(andslot2, h)) {
236-
return Caml_array.caml_array_get(andslot3, h);
235+
if (i1 === Caml_array.get(andslot1, h) && i2 === Caml_array.get(andslot2, h)) {
236+
return Caml_array.get(andslot3, h);
237237
}
238238
var match = cmpVar(v1, v2);
239239
var f;
@@ -249,9 +249,9 @@ function and2(n1, n2) {
249249
break;
250250

251251
}
252-
Caml_array.caml_array_set(andslot1, h, i1);
253-
Caml_array.caml_array_set(andslot2, h, i2);
254-
Caml_array.caml_array_set(andslot3, h, f);
252+
Caml_array.set(andslot1, h, i1);
253+
Caml_array.set(andslot2, h, i2);
254+
Caml_array.set(andslot3, h, f);
255255
return f;
256256
}
257257

@@ -279,8 +279,8 @@ function xor(n1, n2) {
279279
var v2 = n2._1;
280280
var l2 = n2._0;
281281
var h = hash(i1, i2);
282-
if (i1 === Caml_array.caml_array_get(andslot1, h) && i2 === Caml_array.caml_array_get(andslot2, h)) {
283-
return Caml_array.caml_array_get(andslot3, h);
282+
if (i1 === Caml_array.get(andslot1, h) && i2 === Caml_array.get(andslot2, h)) {
283+
return Caml_array.get(andslot3, h);
284284
}
285285
var match = cmpVar(v1, v2);
286286
var f;
@@ -296,9 +296,9 @@ function xor(n1, n2) {
296296
break;
297297

298298
}
299-
Caml_array.caml_array_set(andslot1, h, i1);
300-
Caml_array.caml_array_set(andslot2, h, i2);
301-
Caml_array.caml_array_set(andslot3, h, f);
299+
Caml_array.set(andslot1, h, i1);
300+
Caml_array.set(andslot2, h, i2);
301+
Caml_array.set(andslot3, h, f);
302302
return f;
303303
}
304304

@@ -332,7 +332,7 @@ function random(param) {
332332
function random_vars(n) {
333333
var vars = Caml_array.caml_make_vect(n, false);
334334
for(var i = 0; i < n; ++i){
335-
Caml_array.caml_array_set(vars, i, random(undefined));
335+
Caml_array.set(vars, i, random(undefined));
336336
}
337337
return vars;
338338
}
@@ -354,12 +354,12 @@ function bool_equal(a, b) {
354354
function test_hwb(bdd, vars) {
355355
var ntrue = 0;
356356
for(var i = 0 ,i_finish = vars.length; i < i_finish; ++i){
357-
if (Caml_array.caml_array_get(vars, i)) {
357+
if (Caml_array.get(vars, i)) {
358358
ntrue = ntrue + 1 | 0;
359359
}
360360

361361
}
362-
return bool_equal($$eval(bdd, vars), ntrue > 0 ? Caml_array.caml_array_get(vars, ntrue - 1 | 0) : false);
362+
return bool_equal($$eval(bdd, vars), ntrue > 0 ? Caml_array.get(vars, ntrue - 1 | 0) : false);
363363
}
364364

365365
function main(param) {

jscomp/test/bs_mutable_set_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ eq("File \"bs_mutable_set_test.ml\", line 200, characters 5-12", Belt_internalAV
463463
var vv = Array_data_util.randomRange(0, 100000);
464464

465465
for(var i$4 = 0 ,i_finish$2 = vv.length; i$4 < i_finish$2; ++i$4){
466-
Belt_MutableSetInt.remove(v$3, Caml_array.caml_array_get(vv, i$4));
466+
Belt_MutableSetInt.remove(v$3, Caml_array.get(vv, i$4));
467467
}
468468

469469
eq("File \"bs_mutable_set_test.ml\", line 206, characters 5-12", Belt_internalAVLset.size(v$3.data), 0);
@@ -493,7 +493,7 @@ eq("File \"bs_mutable_set_test.ml\", line 216, characters 5-12", Belt_internalAV
493493
var vv$1 = Array_data_util.randomRange(1, 28);
494494

495495
for(var i$5 = 0 ,i_finish$3 = vv$1.length; i$5 < i_finish$3; ++i$5){
496-
Belt_MutableSetInt.remove(v$4, Caml_array.caml_array_get(vv$1, i$5));
496+
Belt_MutableSetInt.remove(v$4, Caml_array.get(vv$1, i$5));
497497
}
498498

499499
eq("File \"bs_mutable_set_test.ml\", line 221, characters 5-12", Belt_internalAVLset.size(v$4.data), 0);

jscomp/test/class3_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ function printable_point2_init($$class) {
299299
]);
300300
CamlinternalOO.add_initializer($$class, (function (self$6) {
301301
console.log("initializingFile \"class3_test.ml\", line 76, characters 50-57");
302-
return Caml_array.caml_array_set(v, 0, self$6[x]);
302+
return Caml_array.set(v, 0, self$6[x]);
303303
}));
304304
return function (env, self, x_init$1) {
305305
var origin$1 = Math.imul(x_init$1 / 10 | 0, 10);

jscomp/test/const_block_test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ var c = [
2525
];
2626

2727
function f(param) {
28-
Caml_array.caml_array_set(a, 0, 3.0);
29-
return Caml_array.caml_array_set(b, 0, 3);
28+
Caml_array.set(a, 0, 3.0);
29+
return Caml_array.set(b, 0, 3);
3030
}
3131

3232
function h(param) {
@@ -38,8 +38,8 @@ function g(param) {
3838
return {
3939
TAG: /* Eq */0,
4040
_0: [
41-
Caml_array.caml_array_get(a, 0),
42-
Caml_array.caml_array_get(b, 0)
41+
Caml_array.get(a, 0),
42+
Caml_array.get(b, 0)
4343
],
4444
_1: [
4545
3.0,
@@ -57,8 +57,8 @@ var suites_1 = {
5757
hd: [
5858
"avoid_mutable_inline_test",
5959
(function (param) {
60-
Caml_array.caml_array_set(c, 0, 3);
61-
Caml_array.caml_array_set(c, 1, 4);
60+
Caml_array.set(c, 0, 3);
61+
Caml_array.set(c, 1, 4);
6262
return {
6363
TAG: /* Eq */0,
6464
_0: [

jscomp/test/cps_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function test_closure(param) {
4040
return x;
4141
}));
4242
for(var i = 0; i <= 5; ++i){
43-
Caml_array.caml_array_set(arr, i, (function(i){
43+
Caml_array.set(arr, i, (function(i){
4444
return function (param) {
4545
return i;
4646
}
@@ -62,7 +62,7 @@ function test_closure2(param) {
6262
}));
6363
for(var i = 0; i <= 5; ++i){
6464
var j = i + i | 0;
65-
Caml_array.caml_array_set(arr, i, (function(j){
65+
Caml_array.set(arr, i, (function(j){
6666
return function (param) {
6767
return j;
6868
}

jscomp/test/digest_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ Mt.from_pair_suites("Digest_test", Pervasives.$at({
234234
return {
235235
TAG: /* Eq */0,
236236
_0: Digest.to_hex(Digest.string("a".repeat(i))),
237-
_1: Caml_array.caml_array_get(ref, i)
237+
_1: Caml_array.get(ref, i)
238238
};
239239
})
240240
];

jscomp/test/flexible_array_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ function sort(s) {
279279
function of_array(arr) {
280280
var v = empty;
281281
for(var i = 0 ,i_finish = arr.length; i < i_finish; ++i){
282-
v = push_back(v, Caml_array.caml_array_get(arr, i));
282+
v = push_back(v, Caml_array.get(arr, i));
283283
}
284284
return v;
285285
}

jscomp/test/floatarray_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ for(var i = 0; i <= 4; ++i){
2121
v[i] = 0;
2222
}
2323

24-
Caml_array.caml_array_set(v, 2, 15.5);
24+
Caml_array.set(v, 2, 15.5);
2525

2626
eq("File \"floatarray_test.ml\", line 17, characters 5-12", [
2727
v.length,
2828
v[2],
29-
Caml_array.caml_array_get(v, 1)
29+
Caml_array.get(v, 1)
3030
], [
3131
5,
3232
15.5,

0 commit comments

Comments
 (0)