»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:02 mcmillhj joined, w_richard_w joined 00:06 mcmillhj left, labster joined 00:14 mcmillhj joined 00:20 mcmillhj left
lookatme mr_ron, I think it's like a method need invocation 00:30
m: grammar G { token A is export {"a"}; }; import G; say &A.signature 00:31
camelia (G: *%_)
lookatme `my` and `our` not need that obviously
mr_ron m: grammar G { our token A is export {"a"}; }; import G; say &A.signature 00:33
camelia (Mu: *%_)
00:34 markong left
mr_ron lookatme: not obviously for me. Are you saying that `my` and `our` mean that `A` is no longer a method? 00:34
lookatme yeah, mr_ron it is
00:35 Xx_ZareZare_xX joined 00:36 epony joined
mr_ron sorry - still confused - 'it is no longer a method with my/our' - correct? 00:36
TimToady it does not participate in the grammar as if it were a method 00:37
yoleaux 10 May 2018 20:47Z <Zoffix> TimToady: did you still want for π, τ, and 𝑒 constants to be MidRats (Rat/FatRat allomorphs)? irclog.perlgeek.de/perl6-dev/2018-...i_15887340 Kinda think it's pointless unless we also implement all the trig functions that support Rationals otherwise we're just adding overhead of coercing them to Num.
10 May 2018 20:48Z <Zoffix> TimToady: plus also Complex with Rational components to make cool stuff like Euler's identity give "right" results :)
mr_ron OK - thanks
00:38 Xx_ZareZare_xX left
TimToady but I suspect the method form is attaching some lexer info to the routine that is interfering with use as an export 00:38
or maybe it's looking for the corresponding action routine 00:39
00:43 comborico1611_ left
mr_ron m: class C { our $a is export = 3 }; import C; say $a 00:44
camelia 3
mr_ron m: class C { my $a is export = 3 }; import C; say $a
camelia 5===SORRY!5=== Error while compiling <tmp>
Can't apply trait 'is export' on a my scoped variable. Only our scoped variables are supported.
at <tmp>:1
------> 3class C { my $a is export7⏏5 = 3 }; import C; say $a
expecting any of:…
mr_ron m: class C { my token A is export { 'a' } }; import C; say 'a' ~~ /<A>/; 00:45
camelia 「a」
A => 「a」
mr_ron m: class C { our token A is export { 'a' } }; import C; say 'a' ~~ /<A>/;
camelia 「a」
A => 「a」
lookatme Anyway it's weird using the my/our before token/rule 00:46
00:46 mcmillhj joined
mr_ron lookatme: there are good uses to exporting rules 00:47
00:47 espadrine left
lookatme mr_ron, Is there some document point out this usage ? 00:48
mr_ron you can't export a my scoped variable but you can export a my scoped token - that looks odd 00:49
lookatme m: class C { my method A is export { } }
camelia ( no output )
lookatme Maybe they not check that 00:50
mr_ron exporting a method is documented someplace
00:51 AlexDaniel left
lookatme m: grammar G { token A is export {"a"}; }; say G.subparse("a", rule("A")); 00:51
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
rule used at line 1
lookatme m: grammar G { token A is export {"a"}; }; say G.subparse("a", :rule("A"));
camelia 「a」
lookatme have you consider the subparse ?
00:51 mcmillhj left
lookatme mr_ron, It's better than export something is my, I think 00:51
mr_ron lookatme: thanks for the input but there may be a useful variant of CPAN Regexp::Common or similar use case where I think export makes more sense 00:54
lookatme mr_ron, welcome
mr_ron exporting methods documented here - `close` towards end: perl6advent.wordpress.com/2009/12/...exporting/ 01:00
01:00 w_richard_w left 01:03 mcmillhj joined 01:06 telex left 01:08 telex joined, mcmillhj left 01:13 w_richard_w joined 01:17 Merfont joined, Kaypie left 01:19 mcmillhj joined, Merfont left 01:21 Kaiepi joined 01:24 mcmillhj left 01:31 unicodable6 joined 01:32 zare joined 01:35 zare left 01:37 ryn1x left, molaf left 01:38 mcmillhj joined 01:39 ryn1x joined 01:43 mcmillhj left 01:49 ilbot3 left 01:50 molaf joined 01:52 mcmillhj joined 01:53 mr_ron left 01:56 ilbot3 joined, ChanServ sets mode: +v ilbot3 01:57 mcmillhj left 01:59 silug left 02:01 zakharyas joined 02:02 itaipu joined 02:09 mcmillhj joined 02:10 silug joined 02:13 mcmillhj left 02:21 pilne left 02:22 zachk left 02:26 melezhik joined 02:30 mcmillhj joined 02:34 mniip left 02:35 mcmillhj left 02:36 ufobat_ joined 02:37 mniip joined 02:38 Todd joined
Todd Is there a way to tell `perl6 -c xxx` to stay within the pl6 in question and leave the pm6's alone? 02:38
02:39 ufobat left 02:45 mcmillhj joined 02:50 mcmillhj left
Todd never mind. I don't want to talk about it 02:54
03:02 Todd left 03:07 committable6 joined 03:08 itaipu left 03:14 eliasr left 03:16 khw left 03:17 molaf left 03:19 mcmillhj joined 03:24 mcmillhj left 03:36 mcmillhj joined 03:40 mcmillhj left 03:54 wamba joined 03:59 statisfiable6 joined
geekosaur dammit, I lost the brown paper bag jpg 03:59
04:05 ewilhelm joined 04:10 mcmillhj joined, Todd joined
Todd This is perl5: `$dir_entry =~ /.*?(\d{1,4}\D\d{1,4}\D\d{1,4}).*${Extension}/;` P6 doesn't like the `{1,4}`. How do I change it over to P6? 04:12
04:15 mcmillhj left
Todd I just caught the ${ and changed it to {$, but that was another problem 04:15
geekosaur \d ** 1..4 04:17
(\d**1..4 \D \d**1..4 \D \d**1..4) 04:19
Todd Thank you! 04:20
04:26 lizmat_ left 04:28 BenGoldberg left 04:32 Kaiepi left 04:33 Kaiepi joined 04:34 ewilhelm left 04:39 lizmat joined 04:41 lizmat left 04:44 Todd left 04:45 skids left 04:57 mcmillhj joined 05:01 mcmillhj left
moritz (\d ** 1..4) ** 3 % \D 05:07
geekosaur even better, yes 05:10
05:10 lizmat joined
geekosaur (but I can already smell neurons sizzling :p ) 05:10
05:13 jmerelo joined 05:16 mcmillhj joined 05:20 mcmillhj left 05:23 sauvin joined 05:26 lizmat left
jmerelo Somebody in the mailing list has mentioned that this documentation is not helpful docs.perl6.org/language/regexes#Lo...Assertions Can you put on your beginner glasses and check it? 05:32
05:39 lizmat joined, wamba left 05:44 mcmillhj joined 05:49 mcmillhj left 05:59 windyhouse joined, wamba joined
moritz it doesn't really explain what's different to just writing the regex 06:01
jmerelo moritz: or provide examples for that... 06:02
06:02 mcmillhj joined
jmerelo moritz: something around these lines www.regular-expressions.info/lookaround.html 06:04
p6: say "foobar" ~~ / foo <?before bar> (bar)/ 06:05
camelia 「foobar」
0 => 「bar」
06:05 espadrine joined
jmerelo To be fair, that's explained right before docs.perl6.org/language/regexes#Ze...Assertions 06:06
06:06 windyhouse left
moritz still, a more practical example wouldn't hurt 06:06
jmerelo moritz: I'll issue that. Thanks! 06:07
moritz for example "replace all numbers that are followed by a unit"
06:07 mcmillhj left 06:10 raynold left 06:16 mcmillhj joined 06:17 vivus-ignis joined 06:21 mcmillhj left 06:26 espadrine left 06:28 mcmillhj joined 06:30 jmerelo left 06:32 mcmillhj left 06:36 vivus-ignis is now known as ignis__away 06:38 abraxxa joined, ignis__away is now known as vivus-ignis 06:45 robertle joined 06:46 mcmillhj joined 06:51 mcmillhj left 06:52 Ven`` joined
Voldenet lookahead and lookbehind assertions can be used to parse xml with regex ;) 06:52
Geth doc: 895f932dec | (Moritz Lenz)++ | doc/Language/regexes.pod6
Add somewhat practical regex look-ahead example
06:54
synopsebot Link: doc.perl6.org/language/regexes
06:55 vivus-ignis is now known as ignis__away
geekosaur that sounds like ossa and pelion 06:56
06:58 ignis__away is now known as vivus-ignis 07:06 mcmillhj joined 07:10 mcmillhj left 07:11 jmerelo joined 07:14 Ven`` left, Ven`` joined 07:16 Ven` joined, Ven`` left 07:18 windyhouse joined
masak Voldenet: you might be right about that, but it feels to me like some sort of rule recursion is what's needed (like in a pushdown automaton) 07:18
in the end because XML elements can contain other XML elements, ad infinitum or thereabouts
Voldenet masak: they actually can't 07:19
can't be used to parse a regex
ugh
regexes can't be used to parse an xml
masak of course, at this point we should define terms, otherwise further discussion will just be confusing
how about this: "regular expression" is the Kleene-star CS thing that CS talks about 07:20
"regex" is the thing in Perl 5 and Perl 6 and lots of other languages, which often embraces-and-extends regular expressions so that they are no longer the CS thing that CS talks about
I'd say with this definition, regular expressions definitely can't parse XML, but regexes definitely can in many languages, Perl 5 and Perl 6 among them 07:21
that is, the thrust of something like swtch.com/~rsc/regexp/regexp1.html is that modern languages have abandoned something elegant (regular expressions) in favor of something slower much less theoretically appealing (regexes), in the name of features and pragmatism 07:23
Voldenet in perl 5.10*
masak granted. 07:24
I dunno, I don't think much about older Perl 5 versions ;)
07:25 rindolf joined
Voldenet I'm just nitpicking, don't mind me 07:26
07:26 jmerelo left 07:27 jmerelo joined
masak anyway, my original point still stands: regular expressions can't parse XML because XML's structure is recursive/inductive -- but if you "upgrade" your FSM to a pushdown automaton, you can parse XML with it 07:30
dunno if there's a name corresponding to a pushdown automaton, but if there is it ought to be something like "stack-based regular expressions" :)
07:31 raynold joined
Voldenet True, I've remember writing something to check if xml is balanced before actually doing anything else with it 07:31
07:31 windyhouse left 07:32 Ven` left, Ven`` joined 07:33 Ven`` left, Ven` joined
Voldenet so I'd guess a lot of things could be done using that approach, nobody would like the complexity of such regexes though 07:33
07:33 mcmillhj joined
masak it's the usual tradeoff: you make your DSL more powerful/complex, it also ends up being less analyzable/manipulable 07:34
until finally it reaches sentience and lunges out the window, screaming "Turing equivalence!" as it runs for the hills
07:35 rightfold left 07:36 darutoko joined
masak Voldenet: also, your "check if xml is balanced" reminded me of this thing: gist.github.com/masak/5129165 07:37
(I spent some time on this channel being obsessed with the balanced-bracket problem)
07:38 Ven` left, mcmillhj left
Voldenet Wow, I like comments more than I like the code. :) 07:39
masak I remember TimToady wrote a solution too 07:41
07:48 mcmillhj joined
masak hey, I just noticed rosettacode.org/wiki/Balanced_brac..._a_grammar is not correct 07:50
it wrongly rejects '[][]'
(the other three solutions don't seem to make this mistake) 07:51
buggable New CPAN upload: P5getpriority-0.0.3.tar.gz by ELIZABETH modules.perl6.org/dist/P5getpriorit...:ELIZABETH 07:52
07:53 mcmillhj left, Ven`` joined, Ven`` left
El_Che jmerelo: a candidate for SO tag: nativecall 07:55
it's a very specific subset, and there seems to be quite a lot of questions about it
07:59 Ven`` joined
El_Che ah it exists already 08:00
El_Che shuts up 08:01
08:01 lizmat left, athenot_ joined 08:02 athenot left 08:11 vivus-ignis is now known as ignis__away 08:21 mcmillhj joined, ignis__away is now known as vivus-ignis 08:22 HaraldJoerg joined 08:26 mcmillhj left
TEttinger masak: apparently .NET regexes are pushdown automata 08:26
masak oh, in what sense? 08:27
TEttinger they have a stack of matches they accrue and can push and pop from it
meant for matching xml
masak I mean, I'm pretty sure they also do things like capture groups and backreferences
which are things that disqualify PCRE and others from being regular expressions
TEttinger yeah, since pushdown automata are a step above regular expressions 08:28
masak my point is that as soon as the "bells and whistles" are added, it doesn't make sense to call the things _either_ regular expressions _or_ pushdown automata 08:29
TEttinger en.wikipedia.org/wiki/Pushdown_automaton calls it a stack automaton
en.wikipedia.org/wiki/Template:For...d_grammars 08:32
wow there's a lot here
masak :)
I don't think we're in disagreement, by the way: (a) pushdown automata/stack automata can parse XML, (b) because of the extra features, the things in Perl 5/Perl 6/C# are not finite-state machines or automata 08:34
08:37 joe34 joined
TEttinger blog.stevenlevithan.com/archives/ba...ing-groups 08:37
hm 08:38
I don't know what would make C# not some form of automaton
since IIRC a turing machine is a kind of automaton
there's just different levels of power 08:39
08:39 jsimonet left 08:40 jsimonet joined
TEttinger perl 6 I think supports parsers as well as regexps? so there's some hazy confusion there 08:40
masak TEttinger: all implementations of regular expressions in mainstream languages add things like \1 backreferences, which make them no longer "pure" regular expressions 08:42
TEttinger yeah, since they can then parse more than a regular language
08:42 mcmillhj joined
masak yes, exactly 08:43
TEttinger regexps+
masak it's easy to make the case that adding features makes something more powerful
but there's also a counter-case to be made where adding things makes it no longer the original thing 08:44
TEttinger regexps with spicy flavor
nacho cheese regexps
08:44 joe34 left
masak notably since a lot of nice properties have been proven about regular expressions. when you add bells and whistles, those nice properties go out the window. 08:44
TEttinger mmm
i hope the partial derivative regex people are getting somewhere 08:45
brzozowski method 08:46
08:47 ChoHag left 08:48 mcmillhj left 08:56 Kaffe joined, mcmillhj joined 08:58 ChoHag joined 09:01 mcmillhj left 09:02 athenot_ left 09:07 lalitmee joined 09:14 dct joined 09:15 ChoHag left 09:27 w_richard_w left 09:30 Ven`` left 09:31 wamba left 09:34 noganex left, athenot joined 09:35 dct left 09:37 rindolf left 09:38 dct joined 09:39 rindolf joined, aborazmeh joined 09:40 aborazmeh left, aborazmeh joined 09:47 noganex joined 09:48 zakharyas left, theovdh joined
theovdh I am getting loads of "Cannot resolve caller protect(Lock: Block); none of these signatures match: (Lock:D $: &code, *%_)" when installing rakudo2018.4 on my ubuntu16.04. 09:50
is that anything to worry about? 09:51
El_Che theovdh: I haven't seen it. How did you install? (there is also a dot release 2018.04.1) 09:54
theovdh I followed the exact instructions on the rakudo site literally. 09:55
jnthn That looks...very broken o.O
09:55 aborazmeh left 09:56 dct left
theovdh jnthn: and El_Che: noetheless I get "Rakudo Star has been built and installed successfully." 09:56
El_Che theovdh: do you get the errors when building rakudo? when running perl6? when running a specific program?
theovdh El_Che: running"make install" 09:57
El_Che theovdh: I provide ubuntu 16.04 packages. You could see if they also have the same problem on your system: github.com/nxadm/rakudo-pkg
the build logs are on travis and I don't get any errors when building on Ubuntu 16.04
theovdh: If you just want the pkg instead of the repo for a quick test, it's here: github.com/nxadm/rakudo-pkg/releases 09:58
if my pkg is also broken, it would be a rakudo bug. If it isn't, a bug should be opened for Rakudo Star 09:59
(I use the 18.04 pkg personally, but every pkg is built on a container of the exact os-release and installed on it) 10:00
mm, i need to remove the prerelease (it was a docker hub test) 10:01
theovdh El_Che: it could not be a stupid little thing like having to "sudo", could it? Meanwhile i try your pkg
El_Che theovdh: I haven't built Rakudo Star in a long time. I would expect the build to die earlier if it could not write 10:03
actually it would die on de ./Configure.pl part if you passed the --gen-moar parameter
theovdh El_Che: that is what I would expect too.
El_Che the Star maintainer stmuk is often on the channel, if he this maybe he'll recognize the error 10:04
theovdh El_Che: I am a *nix noob so probably messing up here, but when I install your package perl -v tells me I am still on 2018.01. 10:05
El_Che /opt/rakudo-pkg/bin/perl6 -v
run /opt/rakudo-pkg/bin/add-perl6-to-path to add it to your path 10:06
so you can use "perl6" without the full path
but for the test it does not matter
ok, but now perl6 made your computer explode :) 10:09
theovdh El_Che: Boooooom, Just kidding. But it still tells me its on 2018.01
10:10 brabo joined
El_Che "/opt/rakudo-pkg/bin/perl6 -v" tells you 2018.01? 10:10
if you don't set the PATH, you need the complete path with the command 10:11
theovdh El_Che: no, sorry. it says 2018.04.01.
El_Che that's the one
10:11 ChoHag joined, brabo left
El_Che /opt/rakudo-pkg/bin/perl6 your_script.p6 10:12
if you cant to use that perl6 to run a script
read the README for instructions about PATH and zef as a user
bbl 10:13
theovdh El_Che: will do. NB there is no .\COnfigure.pl in the description at rakudo.org/files/star/source 10:14
10:20 vivus-ignis is now known as ignis__away 10:23 darutoko left
El_Che "perl Configure.pl --backend=moar --gen-moar" 10:25
theovdh El_Che: Oh yes. I overlooked it. But I had applied it in the appropriate order the first time. 10:28
donpdonp intuition fail: my $c = {host: "host"}; $c.host => No such method 'host'. $c['host'] => Cannot convert string to number 10:32
moritz bad javascript, no cookie :) 10:34
10:39 ignis__away is now known as vivus-ignis
donpdonp my $c = host => "foo"; $c{"host"} => "foo" #tricksy 10:42
moritz Pair, not tricksy :) 10:44
10:54 wamba joined 11:09 Ven`` joined
Ven`` pmurias: just wanted to say, the idea of a truffle backend sounds absolutely amazing 11:10
11:13 eliasr joined 11:14 markong joined, abraxxa left 11:18 lalitmee left 11:31 itaipu joined 11:43 jmerelo left 11:45 sena_kun joined 11:46 xinming_ left, xinming joined
theovdh El_Che: and jnthn: retried make install after cleaning up my $PATH. Removing paths to older rakudos (2018.1) did the trick. 11:47
... but will continue to use the 2018.04.01 package 11:48
12:00 Ven`` left
Ulti win 4 12:03
noooooo
why is it always in here I screw up
moritz because all others have thrown you out already? :D 12:04
masak ouch -- harsh :P 12:05
12:05 Ven`` joined
moritz hopes that Ulti takes no offense, because it really was meant only as a joke 12:07
12:11 vivus-ignis is now known as ignis__away 12:15 Ven`` left, emeric left 12:19 Ven`` joined 12:20 raynold left 12:23 jmerelo joined
Ulti maybe you're all just more comfortable with failure >:P 12:24
#nooffense
12:26 ignis__away is now known as vivus-ignis
El_Che theovdh: there is a repo so you get updates automatically 12:27
theovdh: good to hear that a make clean would have probably have worked and that's not a Star bug!
12:30 darutoko joined 12:31 grumble left, grumble joined
Geth doc: ebc0276fcf | (Will "Coke" Coleda)++ | xt/words.pws
learn new word
12:38
doc: 53b5986bdb | (Will "Coke" Coleda)++ | doc/Language/regexes.pod6
whitespace
synopsebot Link: doc.perl6.org/language/regexes
masak Ulti: dunno about being _comfortable_ with failure, but being able to recover from failure is pretty central to the success rate of any enterprise except the most trivial :) 12:39
12:39 mcmillhj joined, Ven`` left, mcmillhj left
Ulti yeah I agree, but being comfortable with it is more about the rate of it happening hence the *burn* 12:39
failure is one of those odd words, people who have a problem with it have essentially a different meaning to everyone else 12:40
12:41 scobra joined
scobra hello, wondering if there is any documentation on the --optimize flag? 12:42
12:42 mcmillhj joined
jmerelo scobra: I've looked up in the doc repo, and there is apparently none. 12:44
12:44 Ven`` joined
jmerelo scobra: any issue will be welcome and addressed ASAP 12:44
scobra no issue, was just considering if there are flags to disable assertions, or perhaps target PRE/POST phasers to increase runtime speed 12:45
jmerelo scobra: well, this is what the Synopsis says... design.perl6.org/S19.html#Options_and_Values 12:46
scobra: nothing about optimization and/or phasers... 12:47
scobra: there's this on running from the command line github.com/rakudo/rakudo/wiki/Runn...mmand-line
scobra: not much there either... 12:48
scobra hmm, alright
jmerelo scobra: StackOverflow, as always, might be of help. 12:50
scobra: but I take note and will try to add some info...
scobra I'm digging around in rakudo to have a look 12:51
it's not critical for me, I've come from python whose -O disables assert an so on, so was more curious than anything
jmerelo scobra: whatever you find, feel free to share :-) 12:52
scobra sure thing
12:54 jmerelo left
mcmillhj is there a way to parameterize return type constraints, i.e. not only does f() return an Array but an Array of Str? 12:56
cono Array[Str] 12:58
masak m: sub foo(--> Array[Str]) { return ["a", "b"] }; say foo() 12:59
camelia Type check failed for return value; expected Array[Str] but got Array ($["a", "b"])
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
masak mcmillhj: for the above reason, I wouldn't recommend doing that
mcmillhj masak: yeah, that is what I encountered when I tried Array[Str] and thus came here to ask about it
masak m: sub foo(--> Array[Str]) { return Array[Str].new(["a", "b"]) }; say foo()
camelia [a b]
masak ^ this works, for which I'm almost completely sure lizmat++ deserves praise somehow 13:00
mcmillhj I just had to update the type signature of the array I was returning to match. thanks masak
masak mcmillhj: but the situation with typed containers in Perl 6 is a little bit sad, essentially because the types are nominal, but people have structural expectations
or, at least I do :)
"structural" as in "if it's an Array and it's full of Str values, then it's an Array[Str]" 13:01
fun fact: I was kvetching about this even before I knew about TypeScript
mcmillhj yeah, I had expected the same thing. I wouldn't think I would need both my Str @array; and also --> Array[Str] to make it work
masak right, exactly
but that's what a nominal type system gives you 13:02
m: sub foo(--> Array[Str]) { my Str @array; @array.push("a", "b"); return @array }; say foo() 13:03
camelia [a b]
masak that apparently works, too
m: sub foo(--> Array[Str]) { }; say foo() 13:08
camelia Nil
masak m: sub foo(--> Array[Str]) { return }; say foo()
camelia Nil
masak m: say Nil ~~ Array[Str]
camelia False
masak .oO( all types are special, but some types are more special than others )
timotimo at some point maybe we'll have sub test(--> Str @foo) { @foo = 1, 2, 3 }
yeah, Failure and Nil go through any return typecheck 13:09
masak timotimo: what do you mean your `sub test` would do? typefail? coerce? 13:10
13:10 AlexDaniel joined 13:12 Herby_ joined
Herby_ \o 13:12
masak ahoy, Herby_ o/ 13:13
timotimo the @foo inside the sub would already be an Array[Str] 13:15
so you wouldn't have to declare it again, DRY and so on
masak right, but then you go and assign Ints to it...
...maybe that wasn't part of your point? :)
timotimo oh, haha
yes, it wasn't 13:16
i wasn't wearing my glasses or something :P
masak clearly you are in the target group for this kind of typechecking :P :P :P
13:16 domidumont joined
masak .oO( "ahem. and here we see the use of this new feature, ladies and butterflies" ) 13:17
mcmillhj m: my %dictionary = (a => <b c d>, e => <f g h>); for %dictionary<a> -> $letter { say $letter; } 13:18
camelia (b c d)
mcmillhj ^ how come this doesn't iterate over %dictionary<a>? 13:19
13:19 wamba left
masak m: my %dictionary = (a => <b c d>, e => <f g h>); for %dictionary<a> -> $letter { say $letter.^name; } 13:19
camelia List
masak m: my %dictionary = (a => <b c d>, e => <f g h>); for @(%dictionary<a>) -> $letter { say $letter } 13:20
camelia b
c
d
jnthn Because values of a Hash are Scalar containers (and thus items)
mcmillhj oh interesting, I thought for some reason that dereferencing was no longer required
masak m: my %dictionary = (a => <b c d>, e => <f g h>); for @%dictionary<a> -> $letter { say $letter }
camelia Type Seq does not support associative indexing.
in block <unit> at <tmp> line 1
mcmillhj I am very used to @{ $dictionary{a} } however.
masak mcmillhj: it wasn't always required, IIRC. changed with the Big List Refactor. 13:21
(or was it "Grand List Refactor". probably was.)
jnthn Method calls and indexing operators automatically dereference
[Coke] masak: hard to remember, it was a BLR. 13:22
jnthn m: my %dictionary = (a => <b c d>, e => <f g h>); for %dictionary<a><> -> $letter { say $letter }
camelia b
c
d
mcmillhj jnthn: hash lookups don't count as indexing?
jnthn Yes, that's why you can write `%dictionary<a>[0]` and it doesn't matter if %dictionary<a> has a Scalar container there or not, it'll work 13:23
13:23 domidumont left
jnthn I tend to prefer the trailing <> over wrapping the whole thing up in @(...), but timtowtdi :) 13:23
13:24 domidumont joined 13:30 abraxxa joined 13:31 domidumont left 13:35 abraxxa left 13:46 skids joined 13:51 abraxxa joined 13:53 abraxxa left 14:01 atweiden-air joined
atweiden-air question about ENTER phasers 14:02
why does ENTER fire twice and LEAVE fire once here: ix.io/1a2E
it seems the only way to prevent this behavior is to not use ENTER, but i don't get why that is
14:10 vivus-ignis is now known as ignis__away, ignis__away is now known as vivus-ignis 14:11 epony left, epony joined 14:13 Zoffix joined
Zoffix atweiden-air: you can prevent the behaviour by wrapping the body of the proto into another block so only when THAT is entered that the phasers get triggered 14:14
14:15 lucasb joined 14:16 kurahaupo left
atweiden-air Zoffix: cool, works 14:17
but curious why ENTER is firing twice, but LEAVE only once?
El_Che atweiden-air: we're the Hotel California of the programming languages
Zoffix Not sure yet. Still playing with the code.
atweiden-air lol 14:18
Zoffix releases: class { method z { ENTER say "[ENTER]"; say "In the method"; } }.z; 14:22
committable6 Zoffix, ¦releases (29 commits): «[ENTER]␤[ENTER]␤In the method␤»
Zoffix atweiden-air: looks like a bug. In QAST I see two calls to ENTER inserted. 14:26
14:26 lalitmee joined 14:27 lalitmee left, lalitmee joined
Zoffix
.oO( this sort of thing initial set of tests for a feature can easily find and eliminate -_- )
14:28
14:29 lalitmee left, lalitmee joined
Zoffix Filed as R#1815 14:30
synopsebot R#1815 [open]: github.com/rakudo/rakudo/issues/1815 ENTER fires twice in some(?) methods
Ulti are there any docs/tutes anywhere for creating binary wrapping modules? specifically where you want to bundle and build the shared library too? 14:34
from the couple of modules I've looked at they all roll their own a bit on how things work... this looks like the most advanced for finding libs already installed at least github.com/perl6/gtk-simple/blob/m...iveLib.pm6 14:35
jnthn Ulti: Hm, I think LibraryMake perhaps 14:36
Pretty sure the native SHA1 module uses that
Ulti yeah for the building the library I've got github.com/retupmoca/P6-LibraryMake down on the list of things
ahh ok cool I will take a look
I guess another question is does zef assume a recursive clone? 14:37
lucasb m: ENTER { 42 } 14:38
camelia ( no output )
lucasb m: LEAVE { 42 }
camelia WARNINGS for <tmp>:
Useless use of constant integer 42 in sink context (line 1)
lucasb ^^ maybe other phasers differs with regard to useless use warnings?
jnthn lucasb: Some phasers keep their results around, others not. ENTER is one of the ones that lets you do stuff like `say now - ENTER now` 14:39
So I suspect it's a question of `LEAVE` knowing its value is always sunk, and `ENTER` not knowing so immediately 14:40
lucasb understood, thanks 14:42
14:44 domidumont joined, khw joined 14:48 Zoffix left 14:54 vivus-ignis is now known as ignis__away, mcmillhj left 14:57 molaf joined 14:58 ignis__away is now known as vivus-ignis 15:02 araraloren joined 15:03 kurahaupo joined 15:05 lalitmee left 15:08 mcmillhj joined 15:12 mcmillhj left 15:14 Ven`` left, lalitmee joined 15:17 araraloren left, araraloren joined, robertle left 15:18 Sgeo_ joined 15:20 Sgeo__ left 15:24 mcmillhj joined, mcmillhj left 15:26 vivus-ignis is now known as ignis__away 15:27 scobra left
perlawhirl quick question... given $foo is a Scalar List... is there any semantic difference between `for $foo[]` and `for $foo<>` 15:31
15:32 ignis__away is now known as vivus-ignis 15:36 jmerelo joined, mcmillhj joined
Ulti im sort of surprised $foo<> even works without error 15:36
given the moment you put some kind of index in there it will asplode 15:37
15:38 cgfbee left 15:39 atweiden-air left
lucasb I was surprised too. Even $foo{} works 15:40
seems like everything can be zen-sliced 15:41
m: say 42[], 'oh'{}
camelia 42oh
15:42 vivus-ignis is now known as ignis__away
Voldenet I prefer not doing for $foo[] but @$foo instead 15:43
Ulti the issue is the type you might expect doesnt come out the other end
Voldenet more perlish
Ulti dunno thats too close to the Perl 5 for my liking
lucasb "returns the subscripted object itself" it's documented 15:44
Voldenet I consider perl5 pretty perlish ;D
kurahaupo survived Perl4 15:45
15:46 jmerelo left, cgfbee joined
Voldenet perl4 wasn't as far from perl5 as perl6 though 15:47
donpdonp moritz: so what *is* $c, given my $c = {host: "host"}; 15:51
jnthn m: my $c = {host: "host"}; say $c() 15:52
camelia host
mcmillhj Where should initialization things be put in a class in Perl6? i.e. I have an attribute that is passed in called $.filename, a private attribute %!dictionary that is populated by calling create-dictionary($.filename). Where should I put such initialization?
jnthn It's a closure with a labelled statement host: that returns a string. 15:53
Thus calling the closure returns the string.
donpdonp hmm. o^O. i'll have to look into labeled statements
jnthn A label is used in things like nested loops to say which one to break out of
donpdonp so its really nothing at al like a js object literal, it just happened to look like one 15:54
jnthn I hadn't noticed before this this is a fun little trap for anyone who writes a JavaScript literal in Perl 6 :)
Geth doc: 360e50fc15 | (Will "Coke" Coleda)++ | doc/Language/classtut.pod6
fix typo
synopsebot Link: doc.perl6.org/language/classtut
doc: be46025756 | (Will "Coke" Coleda)++ | xt/words.pws
learn new words
donpdonp jhthn++
jnthn No, it's valid syntax that means something entirely different :)
m: my $c = { foo: 1, bar: 2 } 15:55
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3my $c = { foo: 1, bar:7⏏5 2 }
expecting any of:
colon pair
jnthn Note that it's also a syntax error if there's more than one element, however
15:55 ignis__away is now known as vivus-ignis
timotimo fun, Nim has a for 1 .. 2 and for 1 ..< 2 syntax 15:56
donpdonp m: my $c = a => "a", b => "b"
camelia WARNINGS for <tmp>:
Useless use of "b => \"b\"" in sink context (lines 1, 1)
timotimo narimiran.github.io/2018/05/10/pyt...y-nim.html - someone want to try to rewrite this for perl6, and maybe mostly-nqp perl6 (or straight-up nqp) to see how well we do? 15:57
donpdonp what type of thing is the unquoted ab in my $c = ab => "z"; $c{"ab"} => "z" 15:58
timotimo AFK again
moritz donpdonp: a string 15:59
donpdonp o^O
moritz it's the => that automatically quotes it
16:01 lucasb left
donpdonp perl6 certainly retains the 'there's more than one way to do it' motto. my $d = :a<b>, :c<d> => (a => b c => d) 16:01
m: my $e = sub {}; my $d = :a<b>, :b(1), :c(e) 16:04
camelia WARNINGS for <tmp>:
Useless use of ":c(e)" in sink context (lines 1, 1)
Useless use of ":b(1)" in sink context (lines 1, 1)
16:06 vivus-ignis is now known as ignis__away
donpdonp is camelia out of date? 2018.04.1 returns (a => b b => 1 c => 2.718281828459045) 16:07
where i was going to ask where the 2.71... came from
moritz e?
m: say e
camelia 2.718281828459045
moritz the camelia version is 2018.04.1-70-gfebcb91
Euler's number etc. 16:08
donpdonp lol! i get it. 16:11
16:11 Sgeo_ left
donpdonp i would not have guessed any global namespace single letter vars would be defined 16:12
16:12 Sgeo_ joined
donpdonp m: say i 16:12
camelia 0+1i
16:14 ignis__away is now known as vivus-ignis
jnthn m: say π 16:15
camelia 3.141592653589793
jnthn They're constants rather than variables, though
moritz donpdonp: it's not so bad, because variables are not in the same namespace (through the sigils)
donpdonp ah i see. 16:17
16:20 mcmillhj left 16:34 domidumont left 16:36 mcmillhj joined 16:41 mcmillhj left 16:42 vivus-ignis is now known as ignis__away 16:50 lizmat joined 16:55 pilne joined 16:57 mcmillhj joined 16:58 mcmillhj left, ignis__away is now known as vivus-ignis, lizmat left 17:00 ExtraCrispy joined, lizmat joined 17:01 araraloren left 17:02 mcmillhj joined 17:08 andrzejku left 17:14 lasse_ joined
lasse_ Hi I'm trying to compile star 2018.04 on openSUSE tumbleweed. It starts to loop last, message I see is " testing LWP". any suggestion what Im doing wrong? 17:19
17:22 gregf_ joined, Zoffix joined
Zoffix lasse_: is the "testing LWP" repeating? Can you pastebin the full output? 17:23
lasse_: also, if you don't wanna bother debugging it, you could install an openSUSE package and then just install only the modules you need instead of whatever comes with Rakudo Star nxadm.github.io/rakudo-pkg/ 17:24
(the compiler-only package)
17:25 vivus-ignis is now known as ignis__away 17:26 ignis__away is now known as vivus-ignis 17:29 itaipu left
lasse_ ===> Testing: LWP::Simple:ver<0.101>:auth<Cosimo Streppone> 17:30
after that nothing more
yes I can try tomorrow. now I have to finish for the day 17:32
Zoffix lasse_: OK. If you can, report the problem so people could take a closer look at it: github.com/rakudo/star/
lasse_ try to install the openSUSE package that is
yes i report tomorrow 17:33
17:33 xinming_ joined
Zoffix Thanks. 17:33
17:33 lookatme left 17:34 lookatme joined 17:36 xinming left, Zoffix left 17:41 st_elmo joined
Ulti mcmillhj: you might want to check out docs.perl6.org/language/objects#Ob...nstruction 17:44
submethod BUILD is the main thing you want to check out
17:45 itaipu joined 17:52 vivus-ignis left 17:56 greppable6 joined 17:57 vivus-ignis joined, espadrine joined
mcmillhj Ulti: I figured it out eventually :) I was looking at the Classes and Objects doc and eventually found the one you linked 18:00
18:00 lasse_ left
buggable New CPAN upload: FanFou-0.0.1.tar.gz by FANFAN cpan.metacpan.org/authors/id/F/FA/...0.1.tar.gz 18:02
18:12 itaipu left
Geth ecosystem: ohmycloud++ created pull request #395:
Add FanFou to ecosystem
18:12
18:13 wamba joined 18:23 sauvin left
Geth ecosystem: c7824a64d5 | ohmycloud++ (committed by Zoffix Znet) | META.list
Add FanFou to ecosystem (#395)

Add a module called FanFou to ecosystem
18:27
18:31 vivus-ignis is now known as ignis__away 18:36 redhands joined, ignis__away is now known as vivus-ignis 18:41 robertle joined 18:47 itaipu joined 18:52 zachk joined, ExtraCrispy left 18:56 mcmillhj left 18:59 lalitmee left 19:00 lalitmee joined 19:01 vivus-ignis is now known as ignis__away
stmuk lasse_: I think one of the new test sites for LWP::Simple is unreliable 19:01
19:03 lalitmee left, lalitmee joined
rindolf hi all 19:05
stmuk you could try running with NO_NETWORK_TESTING=1
19:06 mcmillhj joined
stmuk if fact star probably should and will do this 19:06
19:08 lalitmee left 19:09 lalitmee joined 19:10 zachk left, zachk joined 19:13 lalitmee left, lalitmee joined 19:14 mcmillhj left 19:15 darutoko left 19:18 ignis__away is now known as vivus-ignis 19:21 lalitmee left, lalitmee joined 19:25 lalitmee left, mcmillhj joined, lalitmee joined 19:27 st_elmo left 19:30 lalitmee left, lalitmee joined 19:31 lalitmee left, lalitmee joined 19:33 lalitmee left 19:50 athenot left 19:52 vivus-ignis is now known as ignis__away 19:53 nolan_ joined
nolan_ P E R L 19:54
is there anybody out there ? 19:57
skids o/ 19:58
nolan_ o
does anyone use perl6 ? 19:59
moritz no, we just all pretend to
nolan_ sweet
what type of applications and such do you all pretend to write ?
i am an aspiring young perl5 man. been thinking on getting into perl6 but im still trying to figure out how/where i'd use it 20:00
moritz mostly command line scripts, occasional small web services
mostly when the grammars are useful
nolan_ oh really? why grammar in particular? 20:01
masak I try to use Perl 6 in as many new ways as possible 20:02
nolan_ i work at a cPanel based webhosting company
so we use perl5 all the time
avuserow I'm almost done writing a password manager in perl6 and a small CLI music player that I use daily.
nolan_ it made me sad today cuz i do a do a bunch of datamining across our server farm 20:03
and apparently we only have 1291 users with custom perl modules installed via cpanel
made me start to wonder if perl was really dying 20:04
i like perl5 cuz it comes default with most linux distros 20:05
stmuk perl never really solved the shared hosting problem as well as php did TBH
moritz nolan_: because the grammars are really awesome for parsing test
nolan_ what type of parsing capabilities does perl6 have? 20:06
i love PCRE in perl5
but not sure i'd parse grammar with PCRE
so im guessing perl6 has something newer?
20:07 ignis__away is now known as vivus-ignis
stmuk PCRE is an external perl 5 regexp like library not directly perl 5 20:07
nolan_ also, what is the compatibility of perl6 like? 20:08
like how portable is it
stmuk perl 6 grammars are not only more powerful but probably more readable than perl 5 regexps
nolan_ ohh grammars is the name of the thing 20:09
stmuk docs.perl6.org/language/grammar_tutorial
nolan_ grammars look cool 20:10
do any other languages have similar capabilities?
the more i read about it the more exciting it is 20:11
i used to search PHP files with regular expressions 20:12
it got really uglyl
stuff like this:
m%\Q$function\E(?>\s++|//.*+(?=[\r\n])|/\*[\s\S]*?\*/|#.*+(?=[\r\n]))*+(?P<parentheses>\((?>(?>\\.|<<<(?>\x22|\x27)?+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)(?>\x22|\x27)?+(?=[\r\n])[\s\S]*?^\g{-1};|/(?!\*|/)|//.*+(?=[\r\n])|/\*[\s\S]*?\*/|\x22(?>(?>\\.)++|[^\x22\\]++)*?\x22|\*(?!/)|\x27(?>(?>\\.)++|[^\x27\\]++)*?\x27|\[(?>(?>\\.)++|[^]\\]++)*?\]|#.*+(?=[\r\n])|[^()])++|(?&parentheses))*\))%gm
but yeah im not sure i've seen something similar to grammars in other languages. is this exclusively a perl6 thing? 20:14
[Coke] Until someone steals it.
20:15 mcmillhj left
El_Che Every artist is a cannibal, every poet is a thief 20:16
nolan_ cool stuff. how portable is perl6 ?
what systems does it run on? etc
one of the things i liked about perl5 was as long as you stayed out of a cryptic shorthands or experimental syntaxes, it's largely as portable as a shell script 20:17
stmuk all three common systems 20:18
nolan_ windows, linux, mac ?
stmuk yes and most modern UNIX like systems 20:19
El_Che potentially everywhere where libuv runs
some people have built is succesfully on the bsds and solaris
20:20 mcmillhj joined
nolan_ well cool 20:20
[Coke] porters welcome of course. (wonder if we had any guidelines for porters)
stmuk actually I was just looking at github.com/libuv/libuv/issues/983 and wondering if anyone had tried AIX :)
nolan_ the grammars would probably come in handy for automated malware detection 20:21
what do all of you guys do for work? 20:23
20:24 mcmillhj left
stmuk I would guess the usual perlish mixture of sys admin and programming 20:24
[Coke] AIX. "That's a name I've not heard in a long time" 20:25
20:25 vivus-ignis is now known as ignis__away
El_Che [Coke]: We have an AIX team whois main app run on a Linux appliance: ) 20:26
:)
nolan_ yawl are a bunch of nerds
loljk
El_Che i see ljk and I think of vim
nolan_ yeah, we're nerds. confirmed. 20:27
[Coke] last time I worked on AIX, I was also working on xenix, and was using Perl 4 20:28
(nerds) Thank you, that's the nicest thing anyone's said to me all day!
nolan_ lol
perl4 sounds like dark ages
stmuk if El_Che knows AIX people maybe he should be the AIX porter? ;) 20:29
nolan_ when was perl4's release date?
El_Che last time I worked with AIX I went to a 2 week holiday in Amsterdam. A manager wanted that everyone could be on call for aix (I was mainly working with Solaris). We explained him that it didn't work like that, but he didn't want to listen. I had a lot of fun in IBM/Amsterdam :) 20:30
:)
it was btw next the building where the last YAPC::EU was held
stmuk Larry 4.000 1991-Mar-21
nolan_ yikes. i wasn't even born yet 20:31
El_Che old geeks
20:31 sena_kun left 20:32 ignis__away is now known as vivus-ignis 20:34 nolan_ left 20:35 mcmillhj joined
stmuk www.polarhome.com/ appears to have low cost AIX shell accounts if anyone is braver than me 20:39
20:40 mcmillhj left 20:46 noganex left 20:48 comborico1611 joined 20:53 vivus-ignis is now known as ignis__away 20:55 mcmillhj joined 20:59 mcmillhj left 21:00 lancew joined 21:05 ignis__away is now known as vivus-ignis 21:10 mcmillhj joined 21:19 mcmillhj left 21:25 vivus-ignis is now known as ignis__away, ignis__away is now known as vivus-ignis 21:26 skids left 21:30 noganex joined, wamba left 21:31 vivus-ignis left 21:40 robertle left
timotimo Ulti: could you recommend TWEAK rather than BUILD? :) 21:41
21:52 mcmillhj joined 21:57 mcmillhj left 22:00 theovdh left 22:01 vike1 left 22:02 vike1 joined 22:08 espadrine left 22:09 mcmillhj joined 22:14 mcmillhj left 22:22 lancew left 22:25 redhands left, mcmillhj joined 22:29 mcmillhj left 22:47 rindolf left 22:54 mcmillhj joined 22:59 mcmillhj left 23:10 itaipu left 23:20 mcmillhj joined 23:25 mcmillhj left 23:30 skids joined 23:47 zachk left 23:54 comborico1611 left