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

Inline::Perl5::Array doesn't decont like Perl6's array #102

Closed
zoffixznet opened this issue Oct 3, 2017 · 1 comment
Closed

Inline::Perl5::Array doesn't decont like Perl6's array #102

zoffixznet opened this issue Oct 3, 2017 · 1 comment

Comments

@zoffixznet
Copy link
Contributor

In Perl 6, you can use <> slice to decont an Array:

sub foo { $[1, 2] }; dd foo()<>; # OUTPUT: [1, 2]

But the same doesn't happen with Inline::Perl5::Array:

use Unicode::Collate:from<Perl5>;

my $az = [~] 'Əski dövr adlandırılan birinci dövr XIII əsrdən XVIII əsrə qədər ',
'olan dövrü, yeni adlandırıla bilən ikinci dövr isə XVIII əsrdən yaşadığımız ',
'günlərə qədər olan bir dövrü əhatə edir. Əski Azərbaycan dilində söz ',
'birləşmələrinin quruluşu daha çox ərəb və fars dillərinin sintaktik ',
'modelində olmuşdur: fəsli-gül (gül fəsli), tərki-təriqi-eşq (eşq təriqinin ',
'(yolunun) tərki), daxili-əhli-kamal (kamal əhlinə daxil)…';

my $c = Unicode::Collate.new: :normalization(Str), :1level, entry => q:to/ENTRY/;
0131;[.1CAD.0020.0002.0069]
0259;[.1C25.0020.0002.0065]
018F;[.1C25.0020.0008.0045]
ENTRY

for <adlandirilan Azerbaycan cox dovru ehate Eski gul qurulusu teriqinin yasadigimiz> {
  dd $c.index($az, $^user_input);
}

OUTPUT:

$[10, 12]
$[187, 10]
$[240, 3]
$[70, 5]
$[170, 5]
$[0, 4]
$[304, 3]
$[226, 8]
$[343, 9]
$[129, 11]
niner added a commit that referenced this issue Nov 20, 2019
Thanks to zoffix++ for reporting!
Fixes GH #102
@niner
Copy link
Owner

niner commented Nov 20, 2019

Fixed in commit d89ec7d
Thanks for the report!

@niner niner closed this as completed Nov 20, 2019
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

No branches or pull requests

2 participants