Skip to content

Conversation

dukc
Copy link
Contributor

@dukc dukc commented Sep 20, 2024

Since it's Hackathon today, even if I'm not there I decided to do something in similar spirit.

@atilaneves new symbol canditate for phobos, meaning it needs your approval!

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @dukc! 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.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#9053"

@dukc
Copy link
Contributor Author

dukc commented Sep 24, 2024

ping @atilaneves

The new function is a cross between the existing $(REF graphemeStride, std,
uni) and $(REF decodeGrapheme, std, uni) functions. The new function both
supports `@safe pure nothrow @nogc` like `graphemeStride` does as long as you
don't rely on autodecoding (side node: `@nogc` support for `graphemeStride`
Copy link
Contributor

Choose a reason for hiding this comment

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

This side note sounds like it should be its own PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is. I felt an added @nogc compability to an existing funtion alone wasn't worth a changelog entry so didn't add one in that PR. But since I'm writing here that graphemeStride is @nogc anyway, which until very recently wasn't the case, I feel it's useful to mention it. As in: "this note applies only with the latest compiler/Phobos".

@atilaneves
Copy link
Contributor

I don't know how useful this is so I would like someone that knows/cares about unicode more than me opines. Not sure who. @rikkimax ?

@rikkimax
Copy link
Contributor

rikkimax commented Oct 1, 2024

I don't know how useful this is so I would like someone that knows/cares about unicode more than me opines. Not sure who. @rikkimax ?

It allows you to get the grapheme length extracted, so you can slice and dice your string without allocation.

Kinda like graphemeStride except it pops it from the input like parse does.

It is one of those things that if a unicode library is being used you'll end up having a hundred variations of. I see nothing wrong with wanting functions like this.

@dukc
Copy link
Contributor Author

dukc commented Oct 4, 2024

I don't know how useful this is so I would like someone that knows/cares about unicode more than me opines. Not sure who.

Maybe @John-Colvin ? I think he was supposed to take charge, at one point at least, of my Unicode-related project at Symmetry.

@dukc
Copy link
Contributor Author

dukc commented Oct 4, 2024

Or alternatively @DmitryOlshansky .

@atilaneves
Copy link
Contributor

I don't know how useful this is so I would like someone that knows/cares about unicode more than me opines. Not sure who. @rikkimax ?

It allows you to get the grapheme length extracted, so you can slice and dice your string without allocation.

Kinda like graphemeStride except it pops it from the input like parse does.

It is one of those things that if a unicode library is being used you'll end up having a hundred variations of. I see nothing wrong with wanting functions like this.

So you're saying we should merge it?

@rikkimax
Copy link
Contributor

rikkimax commented Oct 9, 2024

I don't know how useful this is so I would like someone that knows/cares about unicode more than me opines. Not sure who. @rikkimax ?

It allows you to get the grapheme length extracted, so you can slice and dice your string without allocation.
Kinda like graphemeStride except it pops it from the input like parse does.
It is one of those things that if a unicode library is being used you'll end up having a hundred variations of. I see nothing wrong with wanting functions like this.

So you're saying we should merge it?

I have no argument against merging. It is sound, it's a variation of something that exists and is worth having different variants for.

The reason I'm avoiding the phrase "merge it" is because of PhobosV3 vs V2. I don't know how you and @LightBender want to handle it.

@LightBender
Copy link
Contributor

LightBender commented Oct 10, 2024

I'm good with merging this. Need to get it passing the build though.

@LightBender LightBender self-requested a review October 10, 2024 08:33
@dukc
Copy link
Contributor Author

dukc commented Oct 10, 2024

Need to get it passing the build though.

Fails at some of the platforms but passes on others, and I'm not doing anything platform-specific. So probably spurious. I'll attempt restarting the tests.

EDIT: Done now. For transparency, I'll note that I made a small change while there: added popGrapheme to the index of the module documentation.

@dukc
Copy link
Contributor Author

dukc commented Oct 10, 2024

Windows 64bit test is now passing, Mac tests are still failing. Seems to be the same issue in #9056 . I wonder what's going on there. @RazvanN7 do you know?

@RazvanN7
Copy link
Collaborator

It seems that the Mac machines are broken. Most likely this PR is not at fault.

@dukc
Copy link
Contributor Author

dukc commented Oct 10, 2024

Well Mac machines don't apparently have the "required" labes so probably should just ignore them.

@atilaneves good to go now?

@LightBender
Copy link
Contributor

I'm going to merge this as there has been no dissent to date.

@LightBender LightBender merged commit bdedad3 into dlang:master Oct 12, 2024
8 of 10 checks passed
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.

6 participants