Expose icu's FoldCase operation to user space #786

Closed
moritz opened this Issue Jun 8, 2012 · 4 comments

Comments

Projects
None yet
4 participants
@moritz
Contributor

moritz commented Jun 8, 2012

Rakudo needs the FoldCase operation (see http://icu-project.org/apiref/icu4c/ustring_8h.html#ab6709b5a5c1606cf0d3ea24934d9acce ) to implement the fc() built-in subroutine. Exposing the FoldCase function from ICU as an op (preferred) or a method in the String PMC would help Rakudo here.

@pmichaud

This comment has been minimized.

Show comment
Hide comment
@pmichaud

pmichaud Jun 8, 2012

Member

When I looked at this, I wasn't sure if ICU's foldcase semantics matched the semantics desired by Perl 6.

Beyond that, we can always implement a foldcase opcode in NQP directly, rather than having to put it into Parrot. We already do something similar to access ICU's properties database -- see the "is_uprop" opcode in src/ops/nqp.ops of the nqp repository.

Pm

Member

pmichaud commented Jun 8, 2012

When I looked at this, I wasn't sure if ICU's foldcase semantics matched the semantics desired by Perl 6.

Beyond that, we can always implement a foldcase opcode in NQP directly, rather than having to put it into Parrot. We already do something similar to access ICU's properties database -- see the "is_uprop" opcode in src/ops/nqp.ops of the nqp repository.

Pm

Whiteknight added a commit that referenced this issue Jun 9, 2012

@Whiteknight

This comment has been minimized.

Show comment
Hide comment
@Whiteknight

Whiteknight Jun 9, 2012

Contributor

Two points:

  1. I've put together a prototype of this new feature in the whiteknight/foldcase_str branch. It is completely untested (mostly because I don't understand it enough to put together a compelling test) but it's relatively straight-forward: Expose the u_strFoldCase function from ICU through the Parrot_str_foldcase function and the new "foldcase" op

  2. Parrot does aim to provide a string system that fully supports unicode. Any ICU capabilities that Rakudo needs and Parrot doesn't yet provide should be provided by Parrot. Semantic mismatches are something we can deal with on a case-by-case basis (with a preference towards doing what Rakudo wants). If Parrot doesn't have an existing implementation to worry about we can put together whatever Rakudo wants.

Contributor

Whiteknight commented Jun 9, 2012

Two points:

  1. I've put together a prototype of this new feature in the whiteknight/foldcase_str branch. It is completely untested (mostly because I don't understand it enough to put together a compelling test) but it's relatively straight-forward: Expose the u_strFoldCase function from ICU through the Parrot_str_foldcase function and the new "foldcase" op

  2. Parrot does aim to provide a string system that fully supports unicode. Any ICU capabilities that Rakudo needs and Parrot doesn't yet provide should be provided by Parrot. Semantic mismatches are something we can deal with on a case-by-case basis (with a preference towards doing what Rakudo wants). If Parrot doesn't have an existing implementation to worry about we can put together whatever Rakudo wants.

rurban pushed a commit that referenced this issue Feb 15, 2016

Initial implementation of the foldcase operation
for strings, in pursuit of GH #786. moritz++ for the suggestion.
@rurban

This comment has been minimized.

Show comment
Hide comment
@rurban

rurban Feb 15, 2016

Member

rebased to the branch smoke-me/foldcase_str and added some testcases. will merge into 8.2.0

Member

rurban commented Feb 15, 2016

rebased to the branch smoke-me/foldcase_str and added some testcases. will merge into 8.2.0

rurban pushed a commit that referenced this issue Feb 15, 2016

Initial implementation of the foldcase operation
for strings, in pursuit of GH #786. moritz++ for the suggestion.

rurban pushed a commit that referenced this issue Feb 15, 2016

Initial implementation of the foldcase operation
for strings, in pursuit of GH #786. moritz++ for the suggestion.

@rurban rurban added this to the 8.2.0 milestone Feb 15, 2016

@rurban rurban self-assigned this Feb 15, 2016

rurban pushed a commit that referenced this issue Feb 16, 2016

Initial implementation of the foldcase operation
for strings, in pursuit of GH #786. moritz++ for the suggestion.

rurban pushed a commit that referenced this issue Feb 16, 2016

@rurban

This comment has been minimized.

Show comment
Hide comment
@rurban

rurban Feb 16, 2016

Member

Will be in 8.2.0, PBC_COMPAT bumped to 13.1

Member

rurban commented Feb 16, 2016

Will be in 8.2.0, PBC_COMPAT bumped to 13.1

@rurban rurban closed this Feb 16, 2016

rurban pushed a commit that referenced this issue Feb 16, 2016

Reini Urban
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment