Quantcast
Channel: Active questions tagged ocaml - Stack Overflow
Viewing all articles
Browse latest Browse all 591

Infix operators with 3 parameters ocaml

$
0
0

Is it possible in ocaml to define an operator like the array set function which can be written a.(n)<-v?

The OCaml manual explains how to define 2-parameters infix operators but not 3-parameters operators. I would like to know if there is a way to define a function , a bit like the Array.set method which can be called using the a.(n)<-v syntax.

I would like to create a new operator that could be called using this syntax: a[b<-c]

I tried some things like this:

let ([<-]) a b c = ... 
let (#1[#2<-#3]) a b c =...

but these didn't work.

Thanks in advance for your help!


Viewing all articles
Browse latest Browse all 591

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>