Skip to content
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

add Format.pp_print_nothing #12716

Merged
merged 1 commit into from
Nov 4, 2023
Merged

add Format.pp_print_nothing #12716

merged 1 commit into from
Nov 4, 2023

Conversation

zapashcanon
Copy link
Contributor

Hi,

This adds a Format.pp_print_nothing. I noticed I'm often defining this function when I'm starting to have too much lines starting with Format.pp_print_list ~pp_sep:(fun _fmt () -> ()).

Format.pp_print_list ~pp_sep:Format.pp_print_nothing is not shorter - unless you have Format opened where you gain 3 characters :-) - but it makes code easier to read.

Copy link
Member

@gasche gasche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rationale makes sense and the cost of the change is very low. Approved.

This is a stdlib PR so a second approval is needed.

stdlib/format.ml Outdated Show resolved Hide resolved
Copy link
Contributor

@nojb nojb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Changes entry and @since annotation in the .mli needed.

@zapashcanon
Copy link
Contributor Author

Thanks, should be good now.

@nojb nojb added the merge-me label Nov 4, 2023
@gasche gasche merged commit f09aa85 into ocaml:trunk Nov 4, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants