Dear caml-list, while refining an API I felt the need to rename a record
field. I'd like to be nice to my users and have the API evolve without
breaking compilation but eventually emitting deprecation warnings.
What I'd like to do, concretely is to move from this
record t = { bad : int; stuff : ty }
to
record old = { bad : int [@deprecated "use good"]; stuff : ty }
record t = old = { good : int; stuff : ty }
The last line does not type check since old and good are different
names. What I'd like to obtain is to have bad and good act as synonyms,
and have OCaml generate a warning when bad is used.
This is pretty much what you would do for a function: leave the old one
in place and stick a deprecate attribute to it.
Is there a way to achieve that for records?
Best,
--
Enrico Tassi
--
Caml-list mailing list. Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs