I would like to know if there is anyway I can call the same function but with different arguments within another function. This is my code for the function I would like to call.
let concattoset s set = SS.add s set
With this function, I have another function that calls this function but is it possible to do something like this:
let op_change p set = concattoset (Format.asprintf "%a" processoperatorchange p) set ;concattoset (Format.asprintf "%a" processoperatorchange2 p) set ; concattoset (Format.asprintf "%a" processoperatorchange3 p) set
I know that whenever I do this, the last term is added and any other term before that is ignored. Is it possible to find out the best approach for this or if possible an alternative way of doing this?
In a similar situation within a match pattern is it possible to use the same operator. So for instance this is my match function:
let rec processoperatorchange4 fmt = function
| Zero -> Format.fprintf fmt "0"
| Pproc x -> Format.fprintf fmt "%s" x
| Procdef (p1, x) -> Format.fprintf fmt "%a(%s)" processoperatorchange4 p1 x
**| Par (p1, p2) -> Format.fprintf fmt "(%a | %a)" processoperatorchange4 p1 processoperatorchange4 p2 |> Format.fprintf fmt "(%a + %a)"**