Creating a Record where field name is a reserved keyword

Well, there is the ‘raw keywords’ feature: \#class OCaml 5.2.0 released

But that is available only in OCaml 5.2.0+, is not really meant for this use case, and is a super obscure feature that will confuse everyone who reads the code.

In short, it would be advisable to stick with the typical pattern of suffixing the keyword with _ to turn it into a normal valid identifier.

2 Likes