_ prefixed identifies not shown in signatures
In utop:
# module Foo = struct let x = 1 let _y = 2 end ;;
module Foo : sig val x : int end
in ocaml:
# module Foo = struct let x = 1 let _y = 2 end ;;
module Foo : sig val x : int val _y : int end
This is just wrong. T_T
It's a feature ;) You can disable it with:
UTop.set_hide_reserved false;;- the
-show-reservedcommand line flag
For the record it was requested for syntax extensions that generate _ prefixed values.
I'm not very fond of inconsistency with regular ocaml by default, it's confusing for most people, and informed users can change the default if they want to.
utop doesn't try to mimic exactly the behavior of the default toplevel. It tries to focus on the user experience so I don't think it is a problem if it makes different choices. If the consensus was that show-reserved is a better default then it could certainly be changed but there have been more requests for making hide-reserved the default.
Hum, ok, fair enough. Would it be possible to enable only in presence of camlp4 ?
Even without camlp4 it is common practice to have _ prefixed identifiers for private stuff that shouldn't be exposed to the user. And automatically setting this when loading camlp4 or ppx would not play nice with command line flags or the user calling [UTop.set_hide_reserved] explicitly.