-
Notifications
You must be signed in to change notification settings - Fork 114
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
Automatically install printers marked with [@@ocaml.toplevel_printer] #269
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scan newly loaded cmi files for values marked with the [@@ocaml.toplevel_printer] attribute and automatically install them as toplevel printers.
ghost
mentioned this pull request
Jan 15, 2019
This is a good idea! Still failing on 4.03 with
|
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Oops, indeed I got the condition wrong. It's fixed now. |
Looks like all checks are successful, so I'll merge this. That said, shouldn't it be documented? |
avsm
added a commit
to avsm/opam-repository
that referenced
this pull request
Jan 31, 2019
CHANGES: The new feature in this release is to automatically install printers marked with `[@@ocaml.toplevel_printer]` (ocaml-community/utop#269 @diml). Adding this annotation to your libraries will remove the need to have a separate `top` package to install the printers. For example, in the [uri](https://github.com/mirage/ocaml-uri) library, the old printing function for `Uri.t` was: ``` val pp_hum : Format.formatter -> t -> unit ``` Just adding this annotation results in `Uri.t` values being automatically pretty printed in this version of utop. ``` val pp_hum : Format.formatter -> t -> unit [@@ocaml.toplevel_printer] ``` * Add cool screenshot to README (ocaml-community/utop#259 @rizo) and update links (ocaml-community/utop#257 @bobot) * Improve robustness by using more tail-recursive functions (ocaml-community/utop#251 @gpetiot) * Remove deprecation warnings in newer compilers (ocaml-community/utop#246 @ncihnegn) * Minimum OCaml version supported is now 4.03.0 (ocaml-community/utop#254 @XVilka) * Publish API documentation online and add `doc:` entry to opam file (ocaml-community/utop#270 @avsm) * Port build to dune from jbuilder (ocaml-community/utop#268 @avsm) * Upgrade local opam metadata to opam 2.0 format (ocaml-community/utop#268 @avsm)
This was referenced Mar 15, 2019
brendanzab
added a commit
to brendanzab/ocaml-integers
that referenced
this pull request
Nov 11, 2024
As of ocaml-community/utop#269 utop automatically installs printers marked with the `[@@ocaml.toplevel_printer]` attribute.
brendanzab
added a commit
to brendanzab/ocaml-integers
that referenced
this pull request
Nov 11, 2024
As of ocaml-community/utop#269 utop automatically installs printers marked with the `[@@ocaml.toplevel_printer]` attribute.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes utop automatically install as printer all functions marked with
[@@ocaml.toplevel_printer]
in mli files. This gives a very simple way for users to define new toplevel printers.