-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MPR#7500: Remove Uchar.dump #1081
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IANDG, but a breaking change at this stage for 4.05 seems unlikely. However, perhaps Format.print_dump_uchar
and Format.pp_print_dump_uchar
with a deprecation of Uchar.dump
might be OK for 4.05? Further changes to the stdlib which rely on this change must obviously be at least 4.06.
stdlib/format.mli
Outdated
{{:http://www.unicode.org/versions/latest/appA.pdf}notational | ||
convention for code points}. | ||
|
||
@since 4.05 *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be very surprised if @damiendoligez will permit a breaking change this close to the 4.05 release - this'd be 4.06 (and below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a breaking change. However if people don't want this in 4.05 I can remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did mean the entire GPR (which is breaking) - I had the deprecation idea seconds later!
stdlib/format.mli
Outdated
@@ -520,6 +528,9 @@ val pp_print_as : formatter -> int -> string -> unit | |||
val pp_print_int : formatter -> int -> unit | |||
val pp_print_float : formatter -> float -> unit | |||
val pp_print_char : formatter -> char -> unit | |||
val pp_print_dump_uchar : formatter -> Uchar.t -> unit | |||
(** @since 4.05 see {!print_dump_uchar}. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous
A review of the all the public uses of |
With all due respect I believe Why tie this production of a printable representation with the printing on a formatter? A lot of OCaml users never use the |
Neither of these names would make sense in my opinion, the first one would be ambiguous in the context of Unicode characters and the second one would be inconsistent with what
|
Just to make things clear I'm all for having a better name than For all it's badness one virtue of it is that it is sufficiently curious that a reader won't take it for what it's not (e.g. things like |
I think it would make sense to separate the change in two:
This split would mean that it would be possible to be release with |
Ok, I'll wait for @damiendoligez's decision about either removal or deprecation before proceeding as you suggest. I'll just mention that:
This is not really about an interface. It's just a name for a pretty printer that can be used either for printing your own datastructures or for quickly turning:
into
via an
Anyone seriously using |
I stand by my claim that the functionality should be exposed as a function in |
I see Daniel's point that it is convenient to have |
and make the Uchar independent from the Format and Printf modules. Previously this made it impossible to use the type in the natural habitat that the String, Bytes and Buffer modules could be.
615cf6b
to
f22579a
Compare
So I amended the commit to simply remove Regarding:
The module already declares
If one wants to improve the usability of the toplevel and the stdlib this should be given a serious thought at some point. Type directed usage of formatters in the wider ecosystem is an established idiom (libraries that provide toplevel and printf debugging support on their values, for usage in testing frameworks to print offending values, for usage in logging frameworks, or, tupled with corresponding parsers, to support textual interaction with humans). |
Since this PR is now only about removing Uchar.dump, let's focus on this part (and not a future replacement). I support this change, even for inclusion in 4.05. |
I think we need @damiendoligez input before merging the PR in 4.05. |
I'm OK with merging this in 4.05 and I agree with Xavier: the basic functionality is a |
and make the Uchar independent from the Format and Printf modules. Previously this made it impossible to use the type in the natural habitat that the String, Bytes and Buffer modules could be.
Cherry-picked to 4.05 (commit 07e4594). |
and make the Uchar independent from the Format and Printf modules. Previously this made it impossible to use the type in the natural habitat that the String, Bytes and Buffer modules could be.
Does this mean there's no functionality in 4.05 / 4.06 to produce a debugging-representation of a |
@ELLIOTTCABLE - there’s still |
and make the
Uchar
independent from theFormat
andPrintf
modules. Previously this made it impossible to use the type in the
natural habitat that the
String
,Bytes
andBuffer
modules could be.https://caml.inria.fr/mantis/view.php?id=7500