Bitwise Operators

Does rescript have any support for bitwise operators?

Yes. lor function.

external ( lor ) : int -> int -> int = "%orint"
1 Like

This works for or, but what about the others? Did you find a doc for this or is it some artifact from ocaml/reason/BS that still works in rescript

Full set can be found under pervasives: https://github.com/rescript-lang/rescript-compiler/blob/master/jscomp/stdlib-406/pervasives.mli

It’s inherited from Reason/OCaml afaik. I see https://github.com/rescript-lang/rescript-compiler/issues/5176 to move some stuff into Belt, but I dont think anyone ever made a PR for it.

1 Like