Skip to content

Fix examples in DDOX documentation for std.algorithm.mutation.remove #4213

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

Closed
wants to merge 1 commit into from

Conversation

Prthmsh7
Copy link

@Prthmsh7 Prthmsh7 commented Apr 2, 2025

In the issue #4007 where examples in the DDOX-generated documentation for std.algorithm.mutation.remove were reported as incorrect.

The examples have several issues:

  • Missing std.stdio import for examples using writeln and not showing that reassignment is necessary to modify the original array which lead to potential confusion in examples

Solution
I've implemented a client-side fix that:

  • Adds warning notices above problematic examples
  • Enhances examples to show proper variable declaration and usage
  • Clarifies the need for reassignment when using remove

Fixes #4007

This adds warning notices and clarifications to the problematic examples
in the DDOX-generated documentation. Fixes dlang#4007.
@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @Prthmsh7! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Copy link
Member

@CyberShadow CyberShadow left a comment

Choose a reason for hiding this comment

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

Hi, as I think you noticed, this repository does not host the documentation for the standard library. Instead, it is recorded alongside the implementation in the Phobos source code.

By the way, did you use an LLM to create this patch? If so, it would be nice if you disclosed this.

@CyberShadow
Copy link
Member

Closing with same rationale as #4214 (comment).

@CyberShadow CyberShadow closed this Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation for std.algorithm.mutation.remove: some code examples look wrong
3 participants