»ö« 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.
mantovani I awlays forget the Perl'6 cpan name, I should stop to smoke :) 01:07
I spend a lot of time on airplanes, do you guys know if I can download Perl'6 documentation on PDF or something like it ? 01:08
MasterDuke mantovani: it's available somewhere as a single page, you could print that to pdf 01:17
Herby_ utilizing unicode characters confused me 01:20
it looks like U+2260 is the "not-equal" symbol
how do I use that in REPL? or with camelia?
mantovani MasterDuke: could you help me to find ? 01:21
MasterDuke: there's no a perldoc like ?
MasterDuke mantovani: there is p6doc 01:22
can be installed with zef
trying to find the single page docs...
mantovani: docs.perl6.org/perl6.html this maybe 01:23
Herby_ m: [U+2260]
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
U used at line 1
Herby_ m: put [U+2260]
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
U used at line 1
mantovani thank you very much!
Herby_ m: put "[U+2260]"
camelia [U+2260]
mantovani MasterDuke++
MasterDuke Herby_: have you seen this? docs.perl6.org/language/unicode_entry 01:24
m: say "\c[2260]" 01:25
camelia rakudo-moar b07874e06: OUTPUT: «ࣔ␤»
mantovani MasterDuke: it's so big that chrome is suffering to generate the PDF.
Herby_ MasterDuke: I had not. thanks!
mantovani Herby_: thank you very much, you help me a lot. 01:26
MasterDuke mantovani: it took firefox about 10-15s 01:27
mantovani I think took about 50 seconds from Chrome on a I7 2.5 01:28
Herby_ mantovani: happy to help :) 01:36
abbychau hi! 02:00
mantovani just to be sure, github.com/sylvarant/Avro 02:02
"{favorite_color => (Any), favorite_number => 256, name => Alyssa}"
This output "(Any)" is a bug, correctly ?
mantovani suppose to be "{u'favorite_color': None, u'favorite_number': 256, u'name': u'Alyssa'} 02:04
lindylex m: say "\c[2260]" 02:10
camelia rakudo-moar b07874e06: OUTPUT: «ࣔ␤»
lindylex mantovani : wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains perl6.org --no-parent docs.perl6.org/perl6.html 02:32
Herby_ looking at a perl6 exercise: What is 7.297e-3 as a fraction 02:41
kind of stumped
m: 7.297e-3.Int 02:43
camelia ( no output )
Herby_ m: put 7.297e-3.Int
camelia 0
MasterDuke m: say 7.297e-3.Rat 02:50
camelia 0.007297
MasterDuke m: my @n = 7.297e-3.Rat.nude; say "@n[0] / @n[1]" 02:51
camelia 23 / 3152
lindylex SmokeMachine : I went back to my original regex and it worked with the addition of the <?after [^|\s]> 02:54
say "Phone numbers 917.234.5678, 1-526-553-1234, 1.917.123.4567 or FAIL > 0.0.0.000.000.00000, 1..111.111.1111 , 22-222-222-2222 , 52-14-54" ~~ m:global/ <?after [^|\s]> \d? [<[.-]>]? [ << \d ** 3..4 >> ] ** 3 % <[.-]> / ; 02:55
evalable6 (「917.234.5678」 「1-526-553-1234」 「1.917.123.4567」)
lindylex m: say "Phone numbers 917.234.5678, 1-526-553-1234, 1.917.123.4567 or FAIL > 0.0.0.000.000.00000, 1..111.111.1111 , 22-222-222-2222 , 52-14-54" ~~ m:global/ <?after [^|\s]> \d? [<[.-]>]? [ << \d ** 3..4 >> ] ** 3 % <[.-]> / ;
camelia (「917.234.5678」 「1-526-553-1234」 「1.917.123.4567」)
lindylex timotimo : thanks for th help earlier I got it to work as I had originally written the addition of the <?after [^|\s]> EXAMPLE :: say "Phone numbers 917.234.5678, 1-526-553-1234, 1.917.123.4567 or FAIL > 0.0.0.000.000.00000, 1..111.111.1111 , 22-222-222-2222 , 52-14-54" ~~ m:global/ <?after [^|\s]> \d? [<[.-]>]? [ << \d ** 3..4 >> ] ** 3 % <[.-]> / ; 02:56
timotimo : This <?after [^|\s]> solved the problem. 02:57
SmokeMachine lindylex: good to know! 03:02
SmokeMachine mantovani: hi!!! Why do you think that’s a bug? 03:03
mantovani SmokeMachine: isn't 03:03
lindylex It is a game changer for me. Because so many problems unpredictable things have occurred which never made sense to me. 03:04
SmokeMachine Yes, that isn’t... (Any) is an any object type
mantovani how do I create a {foo => {bar => "baz"}} in Perl 6 ?
SmokeMachine m: dd {foo => {bar => "baz"}} 03:05
camelia Hash % = {:foo(${:bar("baz")})}
SmokeMachine mantovani: 👆 03:05
mantovani is not working with this Avro module
SmokeMachine: paste.scsys.co.uk/581756 03:06
I want to put the data inside address, address => { street1 => "foo" }
doesn't work like this ^ 03:07
SmokeMachine The `Q<<>>` creates a string
mantovani I know 03:07
is not the schema
$writer.append({name => "Alyssa", address => Any});
I'm talking about this line ^
$writer.append({name => "Alyssa", address => {"street1" => "foo"}); # Doesn't work 03:08
mantovani $writer.append({name => "Alyssa", address => {"street1" => "foo"}}); # Doesn't work 03:08
SmokeMachine Why are you using an undefined Any?
mantovani forget any 03:09
look the last example
SmokeMachine What’s the error message? 03:10
I don’t know this module...
mantovani Parameter '$buf' of routine 'write' must be an object instance of type 'Blob', not a type object of type 'Blob'. Did you forget a '.new'? 03:11
It's not an useful error
zfs install Avro
perl6 test.p6
SmokeMachine I’m not on a computer...
ZzZombo It's about as useful as it can get.
mantovani Someone knows how do I create complex types with Avro module ? 03:12
actually is just a simple {name => "Alyssa", address => {"street1" => "foo"}} 03:13
:(
SmokeMachine: nothing? 03:19
SmokeMachine Does the testfile exists? 03:29
But you are using :w...
mantovani yes....
this is not the issue
the issue is the line that I showed
SmokeMachine yes, but on the modules code, when you `.append` it `$!buffer.write`... 03:33
mantovani: Im on my computer now.. 03:34
it didn't break here...
mantovani: this was the answer: {address => (Any), customer_number => (Any), customer_type => (Any), name => Alyssa, source => (Any)}
what's your perl6's version? 03:35
Herby__ Is there a go-to library for html parsing? 03:45
outside of dom::tiny 03:46
lindylex Not sure why this just freezes. It is a simple crossword puzzle helper hastebin.com/bifegofime.pl 03:58
perlawhirl lindylex: what arguments does the some expect? 04:29
ccc Is there a more succint way to do this %foo{%foo.keys.grep({ ~~ /A|B|C/})}:p
lindylex perlawhirl : ./ch.pl .e.rl 04:30
perlawhirl : update hastebin.com/towoyidoqi.pl
It output nothing when I use a variable. Whne hard coded it output. 04:31
ZzZombo m: my %h=%(a=>'b', c=>'d', e=>'f'); dd %h.grep(* ~~ /a|e/, :p) 04:34
camelia (0 => :e("f"), 2 => :a("b")).Seq
perlawhirl yeah i think there's difficulty in accepting a regex from the outside world. it's comes in as a string, and when you try to create a regex out of it, i think it escapes meta characters
perlawhirl thinking back to my own script... i know i solved it once by eval'ing the string, but i can't remember if i found a better solution. 04:34
i'm looking... 04:35
perlawhirl m: my $pattern = 'p.rl'; say 'perl' ~~ /<$pattern>/; 04:37
camelia 「perl」
ccc m: my %foo=(j => True, A => (2,3,5)); say %foo{%foo.keys.grep({$_ ~~ /A|B|C/})}:p
camelia (A => (2 3 5))
perlawhirl so i think you will need to say: $word if lc($word) ~~ /<$tmp>/;
ccc wouldn't be necessary if the :p was seen by the matcher, but my tests show that the matcher only ever gets the value 04:38
perlawhirl lindylex: I don't understand why you are accepting args as *@wordNum, if you only care about the first arg.
ccc (the matcher in grep)
perlawhirl can just do: sub MAIN($pattern) { for 'words.txt'.IO.words -> $word { say $word if $word.lc ~~ /<$pattern>/ } 04:39
ccc My use case is that I have a hash of properties and in some cases for a group of properties at most one of them can be true. It's expensive to check these properties so they get put in the hash. when the check gets called I need to see if ANY of them exist in the hash 04:42
lindylex perlawhirl : interesting it needed the <> around it to work. 04:43
Thanks 04:44
It is so slow. Any ideas how to speed it up?
perlawhirl regex engine is quite slow at the moment, unfortunately :/ 04:45
lindylex Thanks I will try to use a system call instead then.
perlawhirl FYI, it could also be golf'd down to: .say for 'words.txt'.IO.words.grep(/:i <$pattern> /) 04:48
lindylex Oh let me try. 04:52
perlawhirl it'll still be slow tho :D
lindylex Rats I still like the way you refactored it.
ccc m: my %foo=(j => True, A => (2,3,5)); say %foo{<A B C>}:p
camelia (A => (2 3 5))
lindylex perlawhirl : this throws an error my $message = q:x/grep 'ical$' ./words.txt /; ERROR :: Two terms in a row 04:54
perlawhirl if i was using external grep... i would do it this way: .say for run(« grep -i "$pattern" words.txt », :out).out.lines 04:54
the '/' in './words' is closing your 'q:x/' 04:56
so use another delimiter, eg. .say for qq:x{ grep '$pattern' ./words.txt } 04:57
and use 'qq' so that $vars get interpolated
if required
lindylex perlawhirl : it is so much faster now. 05:02
jmerelo squashable6: staths 05:02
squashable6 jmerelo, I cannot recognize this command. See wiki for some examples: github.com/perl6/whateverable/wiki/Squashable
jmerelo squashable6: status
squashable6 jmerelo, Next SQUASHathon in 21 days and ≈4 hours (2018-10-06 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
jmerelo releasable6: status 05:03
releasable6 jmerelo, Next release in ≈1 day and ≈13 hours. 1 blocker. 1 out of 99 commits logged (⚠ 46 warnings)
jmerelo, Details: gist.github.com/a6a73fc43e7ab15a74...a54e71b9ee
perlawhirl ccc: is this any better for you: say %foo.pairs.grep(*.key eq any <A B C>)
m: my %foo=(j => True, A => (2,3,5)); say %foo.pairs.grep(*.key eq any <A B C>)
camelia (A => (2 3 5))
perlawhirl sorry... '.pairs' isn't even needed there 05:04
m: my %foo=(j => True, A => (2,3,5)); say %foo.grep(*.key eq any <A B C>)
camelia (A => (2 3 5))
ccc perlawhirl: no the one I used above is what I really wanted
m: my %foo=(j => True, A => (2,3,5)); say %foo{<A B C>}:p
camelia (A => (2 3 5))
perlawhirl ahh, i didn't see that message... nice work 05:05
lindylex: yeah, external grep is much faster. it's nice that it's so easy to call from perl 6, but still wish regex engine was faster.
lindylex Same, I feel like a failure. 05:07
perlawhirl think of it as a positive... you learned a bit more about how to call external commands in Perl 6 05:09
ccc goodnight
lindylex Indeed you are the best. 05:09
One time I had a technical job interview for python. The guy have a teask I made a system call because that tool would be faster he did not like it. I said why not. There production env is a unices. He was not having it and said everything must be within the language. I was like dud if it can be done a faster way with a system call why does it matter? I proposed no security risk. 05:11
It proposed no security risk. 05:12
ccc: nite 05:13
perlawhirl there are 2 sides... i usually try to write everything in language. you can't always rely on system commands (and flags!) being portable across unix/linux/bsd. but, if there's no need for portability and it's faster, it can be a quick win 05:14
lindylex Thanks for explaining. 05:15
MorayJ` Hi, I'm looking to do some edits on docs.perl6.org/type/Cool and need clarification on what are methods and what are routines. Had thought methods would be those defined as method, and routines as those defined as sub or method and sub. Doesn't seem to be the case. Anyone able to give me a quick explanation or a link to an explanation..? 11:35
moritz that's how it's supposed to be 11:47
Routine is the parent class of Sub and Method
MorayJ` method exp 11:51
Defined as:
multi sub exp(Cool:D $pow, Cool:D $base?)
Whoops sorry, bad pasting
MorayJ` Method exp (for instance) is defined as a multi sub and a multi method - would that then be best be described as a routine? 11:52
And if something is only defined as a sub, should it then be sub name? 11:56
moritz both correct 11:58
MorayJ` Great...thanks. Will raise it as an issue and look into fixing it 12:01
El_Che moritz: I would have swore that your books were on Safari. I looked for them today, but there aren't there (anymore?). I have a paper version at home. 12:03
moritz El_Che: I don't have any control or information on that -- that's all publisher's business :( 12:13
lichtkind how to get a change into modules.perl6.org if module changes to different fork 12:14
moritz get the maintainer to merge it? 12:17
lichtkind moritz, i dont understand what you mean but Pierre, (current owner) and meare of one opinion that it should move to my github adress 12:22
moritz lichtkind: then you should change the URL in the ecosystem repo 12:23
araraloren . 12:23
m: given :($*a).params.[0] { say .name; say .sigil; say .twigil; } 12:25
camelia $*a
$
araraloren Anyone know is this a bug ?
the twigil is return nothing 12:26
lichtkind moritz ah thanks thats what i wanted know, becaause i looked on the modules repo
moritz araraloren: looks like a bug to me 12:35
m: class A { has $!a; method f(:$!a) { } }; say A.find_method('a').signature.params[0].twigil
camelia No such method 'find_method' for invocant of type 'A'
in block <unit> at <tmp> line 1
moritz m: class A { has $!a; method f(:$!a) { } }; say A.^find_method('a').signature.params[0].twigil
camelia No such method 'signature' for invocant of type 'Mu'
in block <unit> at <tmp> line 1
El_Che moritz: yes, I thought so. But it's good that you know in case someone asks here.
moritz m: class A { has $!a; method f(:$!a) { } }; say A.^find_method('f').signature.params[0].twigil
camelia
moritz El_Che: agreed, thanks 12:36
El_Che moritz: I'll ping when they are available again
El_Che moritz: I was having a look at the new Learning Perl 6. I think your Fundamentals books approach works better 12:37
araraloren moritz I check the source code, so it only support attribute, not for dynamic variable ?
El_Che moritz: haven't finished Learning yes, just impression after a few chapters 12:38
moritz El_Che: it has quite a bit of a different target audience 12:39
El_Che: and you are squarely in the Fundamentals target audience, not in the Learning one
Learning and Thinking overlap more in audience
El_Che I don't know about that
Thinking is more about learning to program 12:40
araraloren I will fill an ticket :)
El_Che and it happens to be with Perl 6
Learning has a reference book feel to it (without being one)
e.g. as it feels compelled to discussed complex numbers, while it's out of the scope of most readers
MorayJ` moritz: I quoted you in the issue. Just to confirm I understood. "Moritz confirmed on #perl6 "Routine is the parent class of Sub and Method" and that if only a method, it should be method name, if only a sub it should be sub name and if both routine name" 12:42
El_Che Moritz as an argument by authority. I like that :)
MorayJ` If Moritz is happy with it, I'll leave it for a while and see if anyone has anything to add, but a good authority from what I can tell :-) 12:44
andrzejku araraloren hello 12:58
:)
moritz if people argue with me as an authority, you could start calling me "The Moritz", right? :D 13:14
timotimo why don't you go where information sits? puttin' on mo' ritz 13:15
El_Che The Ritz Hotels are considering changing their name to Mo'Ritz, just to surf the public opinion wave 13:18
mantovani Hello guys, I'm using Avro module and if the example works fine: $writer.append({name => "Alyssa"}); 13:27
but when I try to have a key => hash it doesn't work
mantovani $writer.append({name => "Alyssa", address => {"street1" => "foo"}}); 13:27
$writer.append({name => "Alyssa", address => {"street1" => "foo"}}); 13:28
paste.scsys.co.uk/581757
Any idea? Idk what to try I'm since yesterday with this problem
If I change to address => Any works 13:29
timotimo perhaps that feature is missing? 13:30
mantovani :( 13:31
El_Che The examples on shows arrays as complex values 13:32
mantovani: raise an issue at the repo?
mantovani that's my next step, I just want to be sure that I wasn't doing something stupid
thanks
El_Che maybe someone here will return from afk and uses the module. Stick around ) 13:33
:)
mantovani thanks 13:34
MorayJ` :-D 13:37
mantovani github.com/sylvarant/Avro/issues/6
Guest40655 liɡht iѕ nഠt dοinɡ􏿽xE2􏿽x80􏿽x81Aⅼⅼɑһ ⅰs􏿽xE2􏿽x80􏿽x80doiᥒg 14:00
fаᥒ is ᥒot doⅰnɡ Aⅼlaһ іѕ doiᥒɡ
busіᥒᥱssesѕ аrе􏿽xE2􏿽x80􏿽x80not dοіᥒɡ Ꭺⅼⅼɑh iѕ ԁoіng
amеrіⅽ іs nоt dⲟiᥒg Allah iѕ doіᥒɡ
amerⅰϲa iѕ nоt doiᥒɡ Allaһ iѕ dഠing
fіre cаn nοt burn wⅰtһoᥙt tһe permiѕsⅰon of ɑⅼlah
kᥒife ϲan not сut wⅰthоut thе рerⅿіѕѕiⲟn􏿽xE2􏿽x80􏿽x80􏿽xE2􏿽xB2􏿽x9Ff aⅼⅼah
fileѕystеⅿ does ᥒot wrⅰtе without pᥱrⅿissіⲟn of􏿽xE2􏿽x80􏿽x81alⅼaһ
rᥙⅼᥱrѕ are not doinɡ Aⅼlɑh is ⅾഠіᥒg
gο⋁erᥒmеnts arᥱ not doinɡ Αⅼlaһ іѕ ⅾoіng
ѕlᥱep іs not ԁⲟіnɡ Allаh is ԁⲟⅰᥒɡ
hunɡer is nоt dഠіnɡ Αllah ⅰѕ doiᥒɡ
foоԁ doᥱѕ ᥒot tаkе􏿽xE2􏿽x80􏿽x81􏿽xD0􏿽xB0way the hᥙnɡer Aⅼlah tаkeѕ awɑу􏿽xE2􏿽x80􏿽x81tһe huᥒger
water ԁοeѕ ᥒⲟt tɑkе ɑᴡɑy thе thirst Ꭺllah takeѕ ɑᴡaу tһe tһirst
sᥱeⅰng􏿽xE2􏿽x80􏿽x80is not dοⅰng Αllɑһ is doіᥒg 14:01
hearinɡ is not doіnɡ Aⅼlah is dⲟinɡ
seɑѕoᥒs ɑre not dοіnɡ Aⅼlaһ is ԁοⅰᥒg
ᴡeathеr iѕ not dоing Allɑh іѕ doiᥒg
hᥙⅿаns are nοt􏿽xE2􏿽x80􏿽x80􏿽xD4􏿽x81οіᥒɡ Аlⅼɑһ ⅰѕ ԁഠinɡ
ɑnⅰmɑls are ᥒot doіᥒɡ Allaһ is ⅾoing
tyil where are mods when you need them
Guest40655 the􏿽xE2􏿽x80􏿽x81beѕt amoᥒɡst уoᥙ are thഠsе whഠ learᥒ aᥒd tеɑcһ quran
onᥱ letter reaԁ from bഠоk οf Aⅼⅼah аⅿouᥒts tഠ oᥒe􏿽xE2􏿽x80􏿽x81gooԁ ԁeed aᥒd Аⅼlah muⅼtiрⅼies oᥒе ɡood ԁeed ten tⅰⅿeѕ
hеаrts gеt r∪ѕteⅾ as dഠeѕ іrⲟn with wɑter tο removᥱ rust from heart reⅽitɑtiоn ഠf ⵕuran aᥒd rеⅿᥱⅿberɑncе of ԁеatһ
heart is likened tⲟ a mіrrоr
timotimo mods are not doing allah is doing
Guest40655 whᥱᥒ a рerѕon сoⅿⅿitѕ оne siᥒ a black dοt ѕustɑіns􏿽xE2􏿽x80􏿽x81the heart
to ɑccᥱpt Іslаm ѕаy that і bear􏿽xE2􏿽x80􏿽x81witneѕѕ tһat thеrᥱ ⅰs nο ԁeity ᴡorthу оf worѕһⅰp exⅽеpt Аⅼlaһ and Ꮇᥙhammad peace be uрοᥒ hiⅿ іs hіѕ sⅼa∨ᥱ ɑᥒdmᥱsѕᥱᥒɡer
sena_kun .o0 ( now is the time to use Perl 6's Unicode support! ) 14:02
tobs I'm still missing some glyphs :/
sena_kun me too. :)
timotimo so how much do i have to blaspheme to make all my kitchen knives become dull and broken immediately? 14:05
mantovani Perl 6 is not doing Allah is doing 14:06
diakopter heh 14:06
timotimo allah is strangely consistent, too? 14:06
Herby_ \o
araraloren What ? Allah ? 14:19
timotimo araraloren: you didn't see the spam a couple minutes earlier? 14:21
mantovani Perl 6 grammar is fantastic, docs.perl6.org/type/Grammar 14:22
araraloren hmm, I see it
mantovani I'm in love with Perl 6 <3
araraloren I want told them Allah love Perl 6, because it is powerful :) 14:24
And I wonder Allah was doing what ?
yeah, Grammar is so powerful 14:25
Geth doc: f3263bbb16 | (Daniel Mita)++ | doc/Type/Promise.pod6
Fix Promises reference to react/whenever
14:39
synopsebot Link: doc.perl6.org/type/Promise
lucasb m: my $v = 10; say my $p = a => $v; $v = 20; say $p 15:25
camelia a => 10
a => 20
lucasb this really surprised me
that pair construction kept a reference to its value argument 15:26
lucasb or, IOW, is an alias 15:27
lucasb is it intended or an oversight? 15:28
lucasb m: my $v = 10; say my $p = Pair.new(key=>'a', value=>$v); $v = 20; say $p 15:29
camelia a => 10
a => 10
lucasb ^^ as a note, this way of building a pair doesn't suffer from this 15:31
Juerd It's not even a read-only alias 15:36
m: my $v = 10; say my $p = :a($v); $p.value = 20; say $v
camelia a => 10
20
Juerd It does seem useful
Juerd lucasb: A simple way to force a copy is assigning to an unnamed lexical: my $p = a => (my $ = $v) 15:37
Xliff m: use NativeCall; sub c-printf-II ('%d/%d',int32,int32 --> int32) is native is symbol<printf> {}; c-printf-II(1,3) 16:10
camelia Calling c-printf-II(Int, Int) will never work with declared signature (Str $ where { ... }, int32, int32 --> int32)
in method CALL-ME at /home/camelia/rakudo-m-inst-1/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 5…
Xliff m: use NativeCall; sub c-printf-II ('%d/%d',int32,int32 --> int32) is native is symbol<printf> {}; c-printf-II(''.1,3) 16:11
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed postfix call
at <tmp>:1
------> 3ve is symbol<printf> {}; c-printf-II(''.7⏏051,3)
Xliff m: use NativeCall; sub c-printf-II ('%d/%d',int32,int32 --> int32) is native is symbol<printf> {}; c-printf-II('',1,3)
camelia ( no output )
Xliff OK. So no const parameters to NativeCall routines. 16:16
timotimo seems like we don't support that, but also don't error out 16:17
potentially a change from when we started compiling nativecall subs to jit?
Xliff Yes. :)
timotimo but what you want may be .assuming rather than putting a constant in the signature
since constants there are about matching, not "providing for the caller"
Xliff Yeah. The '%d/%d' is probably interpreted as Str 16:18
m: use NativeCall; sub c-printf-II ('%d/%d',int32,int32 --> int32) is native is symbol<printf> {}; c-printf-II('%d',1,3)
camelia 1 16:18
Xliff Yup.
El_Che what the difference between say and put? 16:45
El_Che m: say 'foo' 16:45
camelia foo
El_Che m: put 'foo'
camelia foo
lizmat e.g. docs.perl6.org/type/Array with a bar on the left with the table of contents 16:48
wow, did the layout of docs.perl6.org just change ?
El_Che the implementation of put and say look very identical (github.com/rakudo/rakudo/blob/058a...ators.pm6) 16:49
what's their difference in practice?
lizmat .Str vs .gist ? 16:50
geekosaur ^
jjmerelo El_Che: There's a FAQ: docs.perl6.org/language/faq#How_an...nt_differ?
El_Che thx! 16:51
I must confess I have never used put 16:52
came it across when browsing through Learning Perl 6 :)
it seems briandf prefers put :)
I would expect to be the logical choice in a beginner's book? 16:54
I am reading it to know what book to advice to hypothetical newbies 16:55
"Sir, have you heard the good news of Perl 6?"
timotimo pff. i didn't look for five minutes and this happens again 17:25
timotimo and again! 17:43
timotimo now i'm paying attention and no spam is coming 18:02
diakopter timotimo: sorry, yeah, I keep looking away too :( 18:18
timotimo no worries 18:32
we're doing what we can
diakopter mst: should we use /ipkb on these latest spammers or what 18:36
timotimo i hope there's not a lot of talk at the moment just because people have no reason to talk, not because the spam is repulsing them 18:36
i don't actually think the same ip will come back any time soon 18:37
ofperfection[m] I think it's the former 18:43
Geth doc: 46dff366dd | (JJ Merelo)++ | htmlify.p6
Refactors a bit htmlify.p6

Putting two literal (which were different) in a constant. This goes towards #1823 (long time overdue) but fixes #2307
18:44
timotimo i got it! 18:47
diakopter ooooooooo got them
timotimo *smack*
lizmat weird: I have't seen any spam here between 19:43 and now ? 18:49
timotimo ooooh
i know
diakopter and me are mods
we see messages from people without +v
AlexDaniel yep 18:50
and everyone else is confused
timotimo so even when i let the spammer join, spam, and part ... i was the only one who suffered :P 18:53
well, and diakopter
diakopter :D
(oops, ish) 18:54
AlexDaniel p6bannerbot also has to witness all that nonsense 18:55
timotimo poor bot
El_Che timotimo: your pain is appreciated 19:21
same for diakopter 19:22
AlexDaniel ****AND**** p6bannerbot 19:34
El_Che: stoprobotabuse.com/
AlexDaniel nap 💤 19:37
xinming m: class A { method a { "a".say }; method b { "b".say }; method c { "c".say }; }; class B { has $a handles <a b>, :c_differ<c>; }; my $b = B.new(:a(A.new)); $b.a; $b.b; $b.c_differ 19:59
camelia WARNINGS for <tmp>:
Useless use of ":c_differ<c>" in sink context (lines 1, 1)
No such method 'a' for invocant of type 'Any'
in block <unit> at <tmp> line 1
xinming In this case, How can we alias a delegation? 20:00
xinming ignore me, I just realized that we can add () around it 20:00
m: class A { method a { "a".say }; method b { "b".say }; method c { "c".say }; }; class B { has $a handles (<a b>, :c_differ<c>); }; my $b = B.new(:a(A.new)); $b.a; $b.b; $b.c_differ 20:01
camelia No such method 'a' for invocant of type 'Any'
in block <unit> at <tmp> line 1
sarna hey 👋 what's the best way of writing something into a file after a line that matched a regex? 20:19
lucasb modify in-place the file?
sarna yes 20:20
well, I have troubles expressing myself today. I meant - is there a standard way of doing this stuff? should I just load the entire file into memory, loop over the lines, check for matches, insert text I need and overwrite the file? 20:22
moritz the best way is typically to write a temp file with the new contents 20:24
moritz and then move the temp file to the original name 20:26
rindolf moritz: hi, sup? 20:28
sarna moritz: thanks. for some reason I thought I'd need to do it in a loop, without it it's much simpler 20:29
AlexDaniel sarna: what about something like: perl6 -ne 'INIT { $*OUT = ‘tempfile’.IO.open: :w }; END { move ‘tempfile’, @*ARGS[0] }; .say' myinputfile 20:31
that shouldn't slurp the whole file, right? 20:32
I mean, even .lines probably won't
masak moritz: re "temp file with the new contents" -- doesn't the -i flag do this in Perl 5?
sarna AlexDaniel: my God, it's beautiful
moritz masak: it does
AlexDaniel also somebody should implement -i in rakudo :) 20:33
masak yes, seems otherwise it might end up being a FAQ ;) 20:36
AlexDaniel it already is, I've seen this question multiple times 20:37
masak I blame all the lurkers. they never help implement stuff. 20:42
mantovani how is possible to have two modules with the same namespace ? 20:54
modules.perl6.org/search/?q=+XML%3A%3AXPath
mantovani oh, one link go to github and other perl page... 20:55
geekosaur use Module::Name:auth<whatever>; 20:59
or :ver or :from or varios other ways to disambiguate
timotimo AlexDaniel`: the version with END { move $tempfile, $origfile } will clobber the original file if some exception is thrown 21:17
lizmat perhaps a KEEP phaser would be more appropriate ? 21:22
AlexDaniel`: ^^^ 21:23
moritz but KEEP runs at every scope exit 21:24
so not too good inside a loop
maybe just LAST?
m: for 1, 2, 3 { die "foo" if $_ == 2; LAST { .say } } 21:25
camelia foo
in block <unit> at <tmp> line 1
moritz the exception causes LAST not to run
m: for 1, 2, 3 { LAST { .say } }
camelia 3
lizmat ah, good point :-) 21:27
m: m: for 1, 2, 3 { LAST { .say }; die if $_ == 2 } 21:28
camelia Died
in block <unit> at <tmp> line 1
lizmat m: m: for 1, 2, 3 { LAST { .say }; die if $_ == 3 }
camelia Died
in block <unit> at <tmp> line 1
Geth doc: 02a64553dc | (Elizabeth Mattijsen)++ | 2 files
Give minimal info about methods for Positional/Associative roles

We should at least mention the methods that *must* be implemented. And we should refer to the extended information: since I had no clue as to how to properly refer to this internal information in a link, I've just use the URL (which apperently happens more often). If this is incorrect, please fix :-)
21:30
lucasb m: my $a = [10,20]; ($a[1] = 30, $a.say) 22:35
camelia [10 20]
lucasb m: my $a = [10,20]; (($a[1] = 30), $a.say) 22:36
camelia [10 30]
lucasb why do I need parens here? 22:37
it changes evaluation order?
geekosaur it sees $a[1]= (30, $a.say), runs say with the value before the assignment, and then drops the result of say because there's nowhee to put it 22:39
lucasb I thought it was item assignment, so precedence of "=" was tighter than comma 22:42
timotimo it's the difference between item assignment and list assignment 22:42
the LHS of the = doesn't look like something listy
so $a.say doesn't become part of the assignment 22:43
oh, er
lucasb $a[1] becomes (30, True)
timotimo hm, that's not entirely right, i don't think
because it does evaluate the whole list first
lucasb m: my $a = 10; ($a = 20, $a.say) 22:44
camelia 20
lucasb so, @a[...] and %h{...} always imposes list assignment (?) 22:46
lucasb m: my @a; @a[1] = 1,2,3; say @a # seems so. My mistake was that I was expecting item assignment here 22:47
camelia [(Any) (1 2 3)]
lizmat lucasb: only if what's between [] and {} is Iterable
sleep& 22:49
timotimo TBH i don't have a complete understanding of when it does one vs the other 22:53
since it's a syntactic distinction, as both have different precedence levels