»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
AbdallahDeBourgo Hi 01:03
Doc_Holliwood AbdallahDeBourgo Ho 02:16
guifa It’s off to work we go 02:17
jmerelo releasable6: status 06:09
releasable6 jmerelo, Next release in ≈13 days and ≈12 hours. R6 is down. At least 4 blockers. Unknown changelog format
jmerelo, Details: gist.github.com/19b61b626e4e4b81e6...82fce47c77
jmerelo notable6: Perl 6 Quick Syntax Reference is out already: t.co/QQoX47iXJJ?amp=1 06:37
notable6 jmerelo, Noted! (weekly)
discord6 <Aearnus> jmerelo++ 06:42
jmerelo Aearnus: thanks... It's been a rather long ride, but it's finally out. 06:48
discord6 <Aearnus> looks good! i'll check it out next paycheck hehe 06:49
jmerelo Aearnus: Sure :-) Fortunately, it's not too expensive... I see it's also available in Safari, for those who have subscribed. 06:50
Xliff . 10:08
o/
jmerelo Xliff: hey! 10:11
luk weekly: pointieststick.com/2019/09/28/this...asma-5-18/ 10:34
notable6 luk, Noted! (weekly)
Xliff m: say 'a'..'z'.join('') ~ 'A'..'Z'.join('') 10:53
camelia 5===SORRY!5=== Error while compiling <tmp>
Operators '..' and '..' are non-associative and require parentheses
at <tmp>:1
------> 3say 'a'..'z'.join('') ~ 'A'.7⏏5.'Z'.join('')
Xliff m: say ('a'..'z').join('') ~ ('A'..'Z').join('')
camelia abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
Xliff m: (5..10).pick.say 11:24
camelia 9
Xliff m: (5..10).pick.say
camelia 9
Xliff m: (5..10).pick.say
camelia 9
p_gurra I'm trying to use a sub as a accumulator using a state hash as container and want to use multi-dispatch with a proto sub as setter (with parameters), and another as getter (w/o parameters). When a use the getter sub the hash always is empty. This is an example: 11:59
multi yyy (Str $s, @a) { state %h; %h{$s}.append: @a; say %h } 12:00
Xliff p_gurra: yyy will always return true like that.
If you want yyy to function like a get/set, try this: 12:01
p_gurra sub multi yyy () { state %h; say %h; return %h } 12:01
Xliff Yes
m: sub yyy is rw {}
camelia ( no output )
Xliff m: sub yyy (Str $s, @a) is rw { Proxy.new( FETCH => -> { %h{$s} } 12:02
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '%h' is not declared
at <tmp>:1
------> 3s, @a) is rw { Proxy.new( FETCH => -> { 7⏏5%h{$s} }
Xliff m: sub yyy (Str $s, @a) is rw { Proxy.new( FETCH => -> $, { %h{$s} }, STORE -> $, { %h{$s} = $a} ); }; yyy('hello') = 'b'; yyy('hello').say 12:03
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '%h' is not declared
at <tmp>:1
------> 3@a) is rw { Proxy.new( FETCH => -> $, { 7⏏5%h{$s} }, STORE -> $, { %h{$s} = $a} );
Xliff m: sub yyy (Str $s, @a) is rw { state %h; Proxy.new( FETCH => -> $, { %h{$s} }, STORE -> $, { %h{$s} = $a} ); }; yyy('hello') = 'b'; yyy('hello').say
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared. Did you mean '@a'?
at <tmp>:1
------> 3> $, { %h{$s} }, STORE -> $, { %h{$s} = 7⏏5$a} ); }; yyy('hello') = 'b'; yyy('hello
Xliff m: sub yyy (Str $s, @a) is rw { state %h; Proxy.new( FETCH => -> $, { %h{$s} }, STORE -> $, $a { %h{$s} = $a} ); }; yyy('hello') = 'b'; yyy('hello').say
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
STORE used at line 1
Xliff m: sub yyy (Str $s, @a) is rw { state %h; Proxy.new( FETCH => -> $, { %h{$s} }, STORE => -> $, $a { %h{$s} = $a} ); }; yyy('hello') = 'b'; yyy('hello').say
camelia 5===SORRY!5===
Calling yyy(Str) will never work with declared signature (Str $s, @a)
at <tmp>:1
------> 3 STORE => -> $, $a { %h{$s} = $a} ); }; 7⏏5yyy('hello') = 'b'; yyy('hello').say
Calling yyy(Str) will never work with declared s…
Xliff m: sub yyy (Str $s) is rw { state %h; Proxy.new( FETCH => -> $, { %h{$s} }, STORE => -> $, $a { %h{$s} = $a} ); }; yyy('hello') = 'b'; yyy('hello').say 12:04
camelia b
Xliff ^^^
p_gurra Hmm, maybe that's a bit to sofisticated for my needs. I'd like output like this: my %hh = yyy(); 12:09
Xliff OK. Your initial description was unclear. 12:10
p_gurra Sorry!
Xliff The problem there is that it sounds like you are looking for more of an object than a sub.
Xliff m: class yyy does Associative { }; my $y = yyy.new; $y<me> = 1; $y.gist.say 12:11
camelia Associative indexing implementation missing from type yyy
in block <unit> at <tmp> line 1
Xliff p_gurra: See this page: docs.perl6.org/type/Associative 12:12
You'd really only need to implement AT-KEY and EXISTS-KEY. 12:13
p_gurra OK, maybe so. As a newcomber to p6 I intented to create a more elegant solution than a namespace- or a closure, which I would have used in p5 12:14
Aha, thanks
Xliff m: class yyy does Associative { has %!h; method AT-KEY (\key) { %!h{key} }; method EXISTS-KEY (\key) { %!h{key}:exists }; }; my $y = $yyy.new; $yyy<me> = 'b'; my %h = $y; %h.gist.say 12:15
lizmat p_gurra: github.com/lizmat/Hash-Agnostic may be of help
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$yyy' is not declared. Did you mean 'yyy'?
at <tmp>:1
------> 3 (\key) { %!h{key}:exists }; }; my $y = 7⏏5$yyy.new; $yyy<me> = 'b'; my %h = $y; %h
Xliff m: class yyy does Associative { has %!h; method AT-KEY (\key) { %!h{key} }; method EXISTS-KEY (\key) { %!h{key}:exists }; }; my $y = yyy.new; $yyy<me> = 'b'; my %h = $y; %h.gist.say 12:16
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$yyy' is not declared. Did you mean 'yyy'?
at <tmp>:1
------> 3 %!h{key}:exists }; }; my $y = yyy.new; 7⏏5$yyy<me> = 'b'; my %h = $y; %h.gist.say
Xliff m: class yyy does Associative { has %!h; method AT-KEY (\key) { %!h{key} }; method EXISTS-KEY (\key) { %!h{key}:exists }; }; my $y = yyy.new; $y<me> = 'b'; my %h = $y; %h.gist.say
camelia Cannot modify an immutable 'Any' type object
in block <unit> at <tmp> line 1
Xliff m: class yyy does Associative { has %.h is rw; method AT-KEY (\key) { %!h{key} }; method EXISTS-KEY (\key) { %!h{key}:exists }; }; my $y = yyy.new; $y<me> = 'b'; my %h = $y; %h.gist.say 12:17
camelia Cannot modify an immutable 'Any' type object
in block <unit> at <tmp> line 1
Xliff Yeah. I'd go with lizmat's solution.
p_gurra Thank you all! I'll try that suggestion. 12:23
lizmat .u not equal 13:24
unicodable6 lizmat, U+2244 NOT ASYMPTOTICALLY EQUAL TO [Sm] (≄)
lizmat, U+2246 APPROXIMATELY BUT NOT ACTUALLY EQUAL TO [Sm] (≆)
lizmat, 27 characters in total (≄≆≉≠≨≩⊊⊋⋠⋡⋢⋣⋤⋥⋬⋭⍯⪇⪈⪱⪲⪵⪶⪹⪺⫋⫌): gist.github.com/00ebdbb4a513347b05...c5bb3402bf
lizmat .u unequal 13:25
unicodable6 lizmat, Found nothing!
lizmat .u not greater 13:26
unicodable6 lizmat, U+2269 GREATER-THAN BUT NOT EQUAL TO [Sm] (≩)
lizmat, U+226F NOT GREATER-THAN [Sm] (≯)
lizmat, 5 characters in total (≩≯⋧⪈⪊): gist.github.com/80d172fb1ca730b31c...7ae2ff23b0
lizmat weekly: perl6.eu/binary-clock.html 13:29
notable6 lizmat, Noted! (weekly)
SmokeMachine m: my %h; multi yyy { %h = () }; multi yyy($key) is rw { %h{ $key } }; multi yyy($key, *@value where .elems) { %h{ $key }.append: @value }; yyy "bla", "ble", "bli"; say yyy "bla"; dd yyy 14:01
camelia [ble bli]
Hash %h = {}
guifa Any preference between Intl::Date.new($gregorian, :hebrew) or Intl::Date.new($gregorian, :calendar<hebrew>) ? (or any effect on performance? Seems about the same from code maintanence) 14:27
sena_kun guifa, how many other alternatives to hebrew are there? 14:29
guifa presently…. none :-) (Hebrew is probably the most complicated of the calendars so I tackled it first ha). But near future, a dozen, long term, probably three dozen 14:30
sena_kun then :$calendar you can work with sounds wiser 14:31
I don't know how is it done internally, but it sounds strange to me that you are saying they are the same from code maintanence perspective
e.g. this... 14:32
m: sub a(:$a, :$b, :$c) { with $a { 1.say} orwith $b { 2.say } orwith $c {3.say} }; a(:a);
camelia 1
sena_kun or
Doc_Holliwood when I look at all the solutions for the current challenge, it seems people have no idea `react / whenever` are in the language
everybody uses Promises or even `sleep` 14:33
sena_kun m: sub a(:$d) { my %h = :1a, :2b, :3c; say %h{$d}; }; a(:d<a>);
camelia 1
sena_kun the second one seems a lot more scale-able to me
guifa, I mean, you can have three dozens of named arguments... but this does not sound very cool to me 14:34
and performance-wise too, because you either have to init a single variable or three dozens of them, even when only one is used 14:35
sena_kun votes for `Intl::Date.new($gregorian, :calendar<hebrew>)`
guifa sena_kun: the way I saw it, the first method just means lots of multisubs: method new(Date $g, :$hebrew! where True), or even slurping *%s and grabbing the key 14:36
sena_kun still probably more dispatch and possibly boilerplate 14:37
*% option is in the middle, maybe 14:39
cpan-p6 New module released to CPAN! Slang::Subscripts (0.0.2) by 03ELIZABETH 14:40
sena_kun but it opens the door for bugs with wrong named arguments passed silently. it might be viewed as not a big deal, but I like to avoid that
m: sub foo(*%foo) { say %foo<a> }; foo(:42a, :24hours);
camelia 42
sena_kun m: sub foo(:$a) { say $a }; foo(:42a, :24hours); 14:41
camelia Unexpected named argument 'hours' passed
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff o/ 14:42
sena_kun o/
chloekek p6: sub 🤷 { (*) } 14:46
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3sub7⏏5 🤷 { (*) }
expecting any of:
new name to be defined
chloekek p6: sub term:<🤷> { (*) }
camelia ( no output )
chloekek p6: sub term:<🤷> { (*) }; say 🤷 14:46
camelia *
chloekek p6: sub term:<🤷> { (*) }; say 🤷🏽‍♀️ 14:47
camelia 5===SORRY!5===
Argument to "say" seems to be malformed
at <tmp>:1
------> 3sub term:<🤷> { (*) }; say7⏏5 🤷🏽‍♀️
Bogus postfix
at <tmp>:1
------> 3sub term:<🤷> { (*) }; say 7⏏5🤷🏽‍♀️
expectin…
chloekek Is there an easy way to define all skin tone and gender variations of the emoji to be the same term?
guifa chloekek: maybe with a slang? From a unicode perspective, an undefined-toned man shrugging, a white man shrugging, a black man shrugging, and a black woman shrugging are as a different as a, á, à, À — which are all recognized as different by Perl 6 14:51
sena_kun: Now that I’m thinking about it, they could coexist nicely if I use *%s. I could just call samewith $gregorian, %s.keys[0]; and in the main :$calendar one there should be a catch for an unknown calendar type anyways with a hard fail for unknown calendar type 14:54
cpan-p6 New module released to CPAN! Algorithm::LibSVM (0.0.6) by 03TITSUKI 14:55
sena_kun guifa, if you are not pedantic enough to be concerned with the thing I described (as in, *% silencing wrong nameds), then the way you see fitting is best. :) 14:56
guifa fair ha 14:59
guifa just hates line noise whenever possible :-)
But I think I can have it catch and bomb on wrong nameds
sena_kun how does the second approach add noise? 15:00
guifa is thinking from user’s perspective 15:05
Intl::Date.new(Date.today, :calendar<gregorian>) vs Intl::Date(Date.today, :gregorian)
guifa is probably overthinking all of this anyways 15:06
chloekek guifa: thought so. 15:07
Might be sufficiently easy with EXPORT.
SmokeMachine .tell ugexe Hi, I'm thinking of PRing something like this on zef (it still is using `no precompilation` and I'll try to fiz that before PRing) that way I think it will be easier to use zef inside of other code... what do you think about that? github.com/FCO/zef/commit/1c95922a...b6d7c220e0 17:10
tellable6 SmokeMachine, No! It wasn't me! It was the one-armed man! Backtrace: gist.github.com/6bab10d57e37f2824a...4468dd5b58
SmokeMachine s/fiz/fix/ 17:11
AlexDaniel .tell timotimo test ` test
tellable6 AlexDaniel, No! It wasn't me! It was the one-armed man! Backtrace: gist.github.com/7e493867739fb8223a...1178badf21
AlexDaniel SmokeMachine: ok can you please try again without ` ? :)
I'll fix that later
.tell timotimo test test 17:12
tellable6 AlexDaniel, No! It wasn't me! It was the one-armed man! Backtrace: gist.github.com/2ed51e51fa9ebf0651...7fe33f360a
AlexDaniel ok, well…
SmokeMachine: nevermind, it's currently broken
SmokeMachine :) 17:13
AlexDaniel: what about a new feature: s/// to fix the last message?
AlexDaniel SmokeMachine: that'd be awesome!
xinming_ in object, the "self" is a keyword or a function? 17:41
It seems, to me, that self is like a function where it return an dynamic container which contains the current class. 17:42
chloekek xinming_: it's special syntax: github.com/rakudo/rakudo/blob/6c35....nqp#L3006 17:46
SmokeMachine .tell SmokeMachine am I crazy? 17:47
tellable6 SmokeMachine, I'll pass that message to your doctor
xinming_ Thanks 17:48
xinming_ Is it possible to add a customized keyword like self in rakudo at runtime? 17:49
let's say, we now have self.object-method another-self-like-kw.object-method 17:50
Geth_ doc: 78708c44ef | (JJ Merelo)++ | doc/Language/grammars.pod6
Changes a bit the example

So that it can be expanded to fulfill #1759
17:55
synopsebot Link: doc.perl6.org/language/grammars
AlexDaniel u: \uD83E\uDD37\uD83C\uDFFD‍ 18:29
unicodable6 AlexDaniel, U+005C REVERSE SOLIDUS [Po] (\)
AlexDaniel, U+0075 LATIN SMALL LETTER U [Ll] (u)
AlexDaniel, 25 characters in total: gist.github.com/53472d14c0b64b320a...347ecfc3df
AlexDaniel u: \uD83E \uDD37 \uD83C \uDFFD‍
unicodable6 AlexDaniel, U+D83E <surrogate-D83E> [Cs] (unencodable character)
AlexDaniel, U+DD37 <surrogate-DD37> [Cs] (unencodable character)
AlexDaniel, No! It wasn't me! It was the one-armed man! Backtrace: gist.github.com/fd224bbe055f9963bd...647ea1a4d1
AlexDaniel timotimo: no idea what's going on but I have a feeling that JSON::Fast encoded something that it cannot decode later 18:30
cpan-p6 New module released to CPAN! ORM::ActiveRecord (0.0.7) by 03GDONALD 20:54
webart is it true that perl (from perl 4 and 5 era) is an acronym? 21:48
sjn No. People later made acronyms after the fact, but mostly for fun 21:52
the actual name is "Perl" (capital P, lowercase otherwise) 21:53
webart hmm a romaji acronym for "raku" = rangeji anrakuna koka-teki umai (commodious effective beautiful language) 21:55
Juerd That's often called a "backronym" 21:57
sjn "Pathologically Eclectic Rubbish Lister" :)
webart but I don't know japanese very well and got the romaji from a mess of katakana hiragana and kanji :-D ... a japanese speakers said I was wrong and that acronyms inromaji don't exist (they are not a native speaker) 21:58
ランゲージ 安楽な 効果的 うまい =~ rangeji anrakuna koka-teki umai (commodious effective beautiful language)
anyway the renaming thing is marketing and I hope if the name change happens that when I open up the REPL it says "Welcome to raku (Perl 6.d)" :-D ... for years I logged into Solaris boxes that knew their inner sleves as SunOS :-D 22:01
sort of a rose by any other name kinda thing ... 22:02
webart and I think romaji acronyms *DO* exist .... japanese.stackexchange.com/a/71730 22:05
Grinnz any outward indication that it is "perl" will unfortunately defeat part of the purpose of the rename 22:08
AlexDaniel timotimo: colabti.org/irclogger/irclogger_lo...10-06#l267 23:36
timotimo: that message 23:37
timotimo: this is how it was encoded: say \uD83E\uDD37\uD83C\uDFFD‍♀️
timotimo: note the ♀ character and also ZWJ before it
I guess it was supposed to turn them into \u sequences but didn't
.tell timotimo test 23:38
tellable6 AlexDaniel, No! It wasn't me! It was the one-armed man! Backtrace: gist.github.com/8c855c1ce29da85809...3ac6416fc3
AlexDaniel .tell timotimo test
tellable6 AlexDaniel, I'll pass your message to timotimo
AlexDaniel “fixed”
timotimo: also it seems to have generated some weird escape codoes 23:39
codes*
Xliff m: class Metamodel::myClass is Metamodel::ClassHOW { method compose package ($o, :$compiler_services) { samewith($o, :$compiler_services); say 'MYCLASS!'; } package EXPORTHOW { package DECLARE { constant class = Metamodel::myClass }; }; class A { }; A.new
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3 is Metamodel::ClassHOW { method compose7⏏5 package ($o, :$compiler_services) { sam
AlexDaniel .tell ugexe colabti.org/irclogger/irclogger_lo...10-06#l298 23:40
Xliff m: class Metamodel::myClass is Metamodel::ClassHOW { method compose ($o, :$compiler_services) { samewith($o, :$compiler_services); say 'MYCLASS!'; } package EXPORTHOW { package DECLARE { constant class = Metamodel::myClass }; }; class A { }; A.new
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3 :$compiler_services); say 'MYCLASS!'; }7⏏5 package EXPORTHOW { package DECLARE { c
expecting any of:
tellable6 AlexDaniel, I'll pass your message to ugexe
Xliff m: class Metamodel::myClass is Metamodel::ClassHOW { method compose ($o, :$compiler_services) { samewith($o, :$compiler_services); say 'MYCLASS!'; }; package EXPORTHOW { package DECLARE { constant class = Metamodel::myClass }; }; class A { }; A.new
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3amodel::myClass }; }; class A { }; A.new7⏏5<EOL>
expecting any of:
statement end
statement modifier
statement modifier loo…
Xliff m: class Metamodel::myClass is Metamodel::ClassHOW { method compose ($o, :$compiler_services) { samewith($o, :$compiler_services); say 'MYCLASS!'; }; }; package EXPORTHOW { package DECLARE { constant class = Metamodel::myClass }; }; class A { }; A.new
camelia ( no output )
Xliff m: class Metamodel::myClass is Metamodel::ClassHOW { method compose ($o, :$compiler_services) { samewith($o, :$compiler_services); say 'MYCLASS!'; }; }; package EXPORTHOW { package DECLARE { constant class = Metamodel::myClass }; }; class A { }; A.HOW.name.say 23:41
camelia Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
Xliff m: class Metamodel::myClass is Metamodel::ClassHOW { method compose ($o, :$compiler_services) { samewith($o, :$compiler_services); say 'MYCLASS!'; }; }; package EXPORTHOW { package DECLARE { constant class = Metamodel::myClass }; }; class A { }; A.HOW.^name.say
camelia Perl6::Metamodel::ClassHOW
Xliff m: class Metamodel::myClass is Metamodel::ClassHOW { method compose ($o, :$compiler_services) { samewith($o, :$compiler_services); say 'MYCLASS!'; }; }; package EXPORTHOW { package DECLARE { constant class = Metamodel::myClass }; }; Metamodel::myClass.^mro.say 23:45
camelia ((myClass) (ClassHOW) (Any) (Mu))
Xliff ^^ What am I doing wrong, here?
m: class Metamodel::myClass is Metamodel::ClassHOW { method compose ($o, :$compiler_services) { samewith($o, :$compiler_services); say 'MYCLASS!'; }; }; package EXPORTHOW { constant class = Metamodel::myClass }; A.new 23:50
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
A used at line 1
Xliff m: class Metamodel::myClass is Metamodel::ClassHOW { method compose ($o, :$compiler_services) { samewith($o, :$compiler_services); say 'MYCLASS!'; }; }; package EXPORTHOW { constant class = Metamodel::myClass }; class A { }; A.new
camelia ( no output )
Xliff m: class Metamodel::myClass is Metamodel::ClassHOW { method compose ($o, :$compiler_services) { samewith($o, :$compiler_services); say 'MYCLASS!'; }; }; package EXPORTHOW { constant class = Metamodel::myClass }; class A { }; A.HOW.^name.say
camelia Perl6::Metamodel::ClassHOW
Xliff m: class Metamodel::myClass is Metamodel::ClassHOW { method compose ($o, :$compiler_services) { samewith($o, :$compiler_services); say 'MYCLASS!'; }; }; my module EXPORTHOW { constant class = Metamodel::myClass }; class A { }; A.HOW.^name.say 23:51
camelia Perl6::Metamodel::ClassHOW
Xliff m: class Metamodel::myClass is Metamodel::ClassHOW { method compose ($o, :$compiler_services) { samewith($o, :$compiler_services); say 'MYCLASS!'; }; }; my module EXPORTHOW { constant class = Metamodel::myClass }; EXPORTHOW; class A { }; A.HOW.^name.say 23:52
camelia WARNINGS for <tmp>:
Perl6::Metamodel::ClassHOW
Useless use of constant value EXPORTHOW in sink context (line 1)
Xliff m: class Metamodel::myClass is Metamodel::ClassHOW { method compose ($o, :$compiler_services) { samewith($o, :$compiler_services); say 'MYCLASS!'; }; }; my module EXPORTHOW { constant class = Metamodel::myClass }; use EXPORTHOW 23:53
camelia ===SORRY!===
EXPORTHOW is a builtin type, not an external module