Converting OCaml to Reason? This is intended.
lmao, cc @bobzhang. I guess I kinda get it? Leaving this open til it's documented
To clarify a bit more: within Reason let switch is a syntax error while in OCaml let match is a syntax error.
Swapping strings seems limited in this case.
Do we have infra to substitute this way?
1) ml -> re
match -> switch
switch -> switch_
match_ -> match
switch_ -> switch__
match__ -> match_
switch__ -> switch___
match___ -> match__
...
2) re -> ml
switch -> match
match -> match_
switch_ -> switch
match_ -> match__
switch__ -> switch_
match__ -> match___
switch___ -> switch__
So e.g.
match switch with
ml -> re
switch switch_ {
re -> ml
match switch with
name mangling is something I would like to avoid if we can.
switch x {
case None => 0;
case Some x => x
}
match x {
case None => 0;
case Some x => x
}
They are mostly the same?
@cristianoc I really like your suggestion - it's simple, we should definitely do it.
@cristianoc We don't have the infra to substitute this way but I think we should do this.
Fixed through #1539
Most helpful comment
Swapping strings seems limited in this case.
Do we have infra to substitute this way?
1) ml -> re
match->switchswitch->switch_match_->matchswitch_->switch__match__->match_switch__->switch___match___->match__...
2) re -> ml
switch->matchmatch->match_switch_->switchmatch_->match__switch__->switch_match__->match___switch___->switch__So e.g.
match switch withml -> re
switch switch_ {re -> ml
match switch with