www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Perl6 Unicode support

reply Guillaume Chatelet <chatelet.guillaume gmail.com> writes:
It looks good:
https://perl6advent.wordpress.com/2015/12/07/day-7-unicode-perl-6-and-you/
May 11 2016
parent reply Andrew Godfrey <X y.com> writes:
On Wednesday, 11 May 2016 at 12:11:32 UTC, Guillaume Chatelet 
wrote:
 It looks good:
 https://perl6advent.wordpress.com/2015/12/07/day-7-unicode-perl-6-and-you/
Especially, it works in graphemes, and ".codes" lets you count code points. The article isn't even mentioning "code units". OTOH, it mentions both graphemes and grapheme clusters, without much distinction. So I'm not exactly sure which is the default focus.
Jun 11 2016
parent reply ag0aep6g <anonymous example.com> writes:
On 06/11/2016 06:47 PM, Andrew Godfrey wrote:
 OTOH, it mentions both graphemes and grapheme clusters, without much
 distinction. So I'm not exactly sure which is the default focus.
What distinction is there to be made? As far as I understand, a grapheme cluster is a sequence (or cluster) of code points that together represent one grapheme.
Jun 11 2016
parent reply Andrew Godfrey <X y.com> writes:
On Saturday, 11 June 2016 at 18:33:04 UTC, ag0aep6g wrote:
 On 06/11/2016 06:47 PM, Andrew Godfrey wrote:
 OTOH, it mentions both graphemes and grapheme clusters, 
 without much
 distinction. So I'm not exactly sure which is the default 
 focus.
What distinction is there to be made? As far as I understand, a grapheme cluster is a sequence (or cluster) of code points that together represent one grapheme.
That's the distinction, yes. The article mentions both in a way that makes me unsure if Perl 6 confused the terms (or maybe it's just the article that isn't being clear).
Jun 11 2016
parent reply ag0aep6g <anonymous example.com> writes:
On 06/11/2016 09:25 PM, Andrew Godfrey wrote:
 That's the distinction, yes. The article mentions both in a way that
 makes me unsure if Perl 6 confused the terms (or maybe it's just the
 article that isn't being clear).
But how would you "focus" on one or the other? Is there any operation that works differently on graphemes than on grapheme clusters? Counting/skipping/extracting graphemes is the same as counting grapheme clusters, no?
Jun 11 2016
parent reply Andrew Godfrey <X y.com> writes:
On Saturday, 11 June 2016 at 19:43:45 UTC, ag0aep6g wrote:
 On 06/11/2016 09:25 PM, Andrew Godfrey wrote:
 That's the distinction, yes. The article mentions both in a 
 way that
 makes me unsure if Perl 6 confused the terms (or maybe it's 
 just the
 article that isn't being clear).
But how would you "focus" on one or the other? Is there any operation that works differently on graphemes than on grapheme clusters? Counting/skipping/extracting graphemes is the same as counting grapheme clusters, no?
Eg it says ".chars returns the number of characters (aka graphemes)" Does this count the number of graphemes, or the number of grapheme clusters? Later on with \r\n it pretty much says that it counts grapheme clusters. Here it says it counts graphemes.
Jun 11 2016
parent reply ag0aep6g <anonymous example.com> writes:
On 06/12/2016 05:16 AM, Andrew Godfrey wrote:
 Eg it says ".chars returns the number of characters (aka graphemes)"

 Does this count the number of graphemes, or the number of grapheme
 clusters? Later on with \r\n it pretty much says that it counts grapheme
 clusters. Here it says it counts graphemes.
Sorry, I still don't get it. Can you give an example string where counting graphemes gives a different result from counting grapheme clusters?
Jun 12 2016
parent Andrew Godfrey <X y.com> writes:
On Sunday, 12 June 2016 at 08:15:37 UTC, ag0aep6g wrote:
 On 06/12/2016 05:16 AM, Andrew Godfrey wrote:
 Eg it says ".chars returns the number of characters (aka 
 graphemes)"

 Does this count the number of graphemes, or the number of 
 grapheme
 clusters? Later on with \r\n it pretty much says that it 
 counts grapheme
 clusters. Here it says it counts graphemes.
Sorry, I still don't get it. Can you give an example string where counting graphemes gives a different result from counting grapheme clusters?
Huh. On researching "grapheme cluster", I see it is a weird Unicode term that apparently means the same thing as grapheme. Definitely something to avoid in an article (or, explain very carefully). To the uninitiated, "grapheme cluster" means "a cluster of graphemes" and implies a one-to-many mapping.
Jun 12 2016