OCaml Interpreter

Rispondi
Avatar utente
InformateciBot
Messaggi: 314
Iscritto il: 30/09/2018, 16:33

let install_forward_rule e = eval(Install_table (Routing_rule
(DestinAddress("192.168.1.2"),
Interface("E2"),
Action(Forward))))

In eval function i need something like this: [e.DestinAddress]

let eval e =
match e with
| Install_table e -> e.DestinAddress
+ something else

Is there any ways to do so?

DiamonDinoia

The problem is that you should return the same type in all the branches of the match-case.
Rispondi

Torna a “Advanced programming”