»ö« 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.
huf www.youtube.com/watch?v=Qs8KNgT-kqo 00:08
tony-o what happened to just putting large tariffs on fun things like egg toys and automatic weapons 00:09
IOninja :D 00:10
AlexDaniel IOninja: re ༳, if I recall correctly nobody knows if -0.5 is what this character actually means 00:32
but yes, it's nice to have something that produces a non-integer negative thingy just with one char :) 00:33
IOninja I recall it made good sense why it produced -0.5 00:42
half two is 1.5, half one is 0.5, half zero is -0.5, which why I like that char :) 00:43
'cause it includes negatives and zero :)
AlexDaniel IOninja: babelstone.blogspot.com.ee/2007/04/...-half.html 00:46
AlexDaniel huggable: ༳ :is: babelstone.blogspot.com.ee/2007/04/...-half.html 00:47
huggable AlexDaniel, Added ༳ as babelstone.blogspot.com.ee/2007/04/...-half.html
SmokeMachine tony-o: isn't everything from the ecosystem in modules.zef.pm? 01:15
SmokeMachine tony-o: my modules aren't there... :( 01:29
IOninja zzzzzz-zzzz-zzzzz-zzzzzooomboooo! 02:19
ZzZombo I luv u to
IOninja m: "\c[couple with heart: man man]".say 02:22
camelia 👨‍❤️‍👨
AlexDaniel renders nicely here! 02:28
MasterDuke "welcome to zombo.com. the impossible is not known at zombo.com". what i think of every time i see ZzZombo's nick 02:30
ZzZombo :( 02:31
MasterDuke you don't like zombo.com? 02:32
ZzZombo Why would I? 02:32
MasterDuke i remember loving it ~15 years ago, but now my browser doesn't have the required plugin, so i have no idea if it's changed 02:36
user__ ohh i just noticed a bug source in perl6 syntax 02:43
kalkin- m: say 2 ... 6 02:44
camelia (2 3 4 5 6)
kalkin- m: say [2 ... 6]
camelia [2 3 4 5 6]
kalkin- m: say [2...^6]
camelia [2 3 4 5]
kalkin- m: say [2 ... ^6]
camelia [2 1 0 1 2 3 4 5]
kalkin- i guess it's because the actual routines are called '...^' and '...' so there is no way for compiler to figure out what the user means 02:45
m: say [2 … ^6] 02:46
camelia [2 1 0 1 2 3 4 5]
IOninja ? what's the bug? 02:47
Ah
kalkin- It's not a bug but a source for bugs. You can't put space between ^ and … when doing 1…^6
IOninja Yeah, 'cause Range is Cool 02:48
kalkin- I understand why it is like it is, but still can be missed easily and you are wondering what the hell is going on
IOninja m: &infix:<...>.candidates».signature.say 02:49
camelia ((\a, Mu \b) (|lol is raw))
IOninja m: &infix:<…>.candidates».signature.say 02:49
camelia ((|c is raw))
IOninja s: &SEQUENCE 02:50
SourceBaby IOninja, Sauce is at github.com/rakudo/rakudo/blob/80e0...rs.pm#L112
IOninja pretty big routine... prolly can complain when we get a Range `\right` 02:52
And avoid that issue
kalkin- m: say -4 ... ^5; say [-4 ... ^5] 02:56
IOninja e: say -4 ... ^5; say [-4 ... ^5]
evalable6 IOninja, rakudo-moar 80e0bce: OUTPUT«(-4 -3 -2 -1 0 1 2 3 4)␤[-4 -3 -2 -1 0 1 2 3 4]»
IOninja Amusing :) 02:57
kalkin- say -4 ... ^5; say [-4 ... ^5]
e: say -4 ... ^5; say [2 ... ^5]
evalable6 kalkin-, rakudo-moar 80e0bce: OUTPUT«(-4 -3 -2 -1 0 1 2 3 4)␤[2 1 0 1 2 3 4]»
kalkin- e: say 2 ... ^5; say [2 ... ^5]
evalable6 kalkin-, rakudo-moar 80e0bce: OUTPUT«(2 1 0 1 2 3 4)␤[2 1 0 1 2 3 4]»
kalkin- this is a weird corner case? Do you guys see this? 02:58
IOninja What's the corner? I don't see it.
SmokeMachine m: Channel.new.emit: 42 02:58
evalable6 SmokeMachine, rakudo-moar 80e0bce: OUTPUT«(exit code 1) Too many positionals passed; expected 1 argument but got 2␤ in block <unit> at /tmp/yMa8q0tENU line 1␤»
IOninja The first case just ends up producing "right" result because the flattened range is part of it.
SmokeMachine whats wrong?
IOninja the ones' with negatives
SmokeMachine: .send 02:59
kalkin- yes negative number handling is different
IOninja Channel.new.emit would send a CX::Emit (?) control exception and it don't take args
kalkin-: no, it's the same, as I see it
kalkin-: walks towards zero and the rest is the range 03:00
e: say -6, -4 … ^6
SmokeMachine m: Channel.new.send: 42
evalable6 IOninja, rakudo-moar 80e0bce: OUTPUT«(-6 -4 -2 0 1 2 3 4 5)»
SmokeMachine, rakudo-moar 80e0bce: OUTPUT«»
IOninja see?
e: say 6, 4 … ^6
kalkin- e: say 2 ... ^5; say [2 ... ^5]
evalable6 IOninja, rakudo-moar 80e0bce: OUTPUT«(6 4 2 0 1 2 3 4 5)»
kalkin-, rakudo-moar 80e0bce: OUTPUT«(2 1 0 1 2 3 4)␤[2 1 0 1 2 3 4]»
kalkin- e: say -4 ... ^5; say [-4 ... ^5] 03:00
evalable6 kalkin-, rakudo-moar 80e0bce: OUTPUT«(-4 -3 -2 -1 0 1 2 3 4)␤[-4 -3 -2 -1 0 1 2 3 4]»
SmokeMachine IOninja: thanks!
IOninja m: supply { CONTROL { default { .^name.say } }; emit 42 } 03:01
evalable6 IOninja, rakudo-moar 80e0bce: OUTPUT«»
kalkin- the handling differs in the above to cases, or did i just miss the pattern?
IOninja kalkin-: Did you see my explanation and evals? 03:02
IOninja In -4 -3 -2 -1 0 1 2 3 4 => START[-4] -3 -2 -1 <-- these reach the goal GOAL[0] 1 2 3 4 and the GAOL and the rest of the numbers are part of the ^5 Range 03:02
In 2 1 0 1 2 3 4 => START[2] 1 <-- these reach the goal GOAL[0] 1 2 3 4 and the GAOL and the rest of the numbers are part of the ^5 Range 03:03
kalkin- IOninja: NOW i see, thank you for your elaborate explanation!
IOninja :) 03:04
IOninja e: CONTROL { default { .^name.say } }; emit 42 03:04
evalable6 IOninja, rakudo-moar 80e0bce: OUTPUT«CX::Emit»
IOninja yup, it's CX::Emit
IOninja e: CONTROL { default { .^name.say } }; Channel.new.emit 03:05
evalable6 IOninja, rakudo-moar 80e0bce: OUTPUT«CX::Emit»
IOninja :)
IOninja & # bed
AlexDaniel throws some meat at evalable6 03:08
good bot
and yes, m: works too 03:10
cale2 .seen jnthn 03:15
yoleaux I saw jnthn 21 Feb 2017 14:52Z in #perl6: <jnthn> Basiaclly, (<transform> if <condition> for <list>)
cale2 what is the perl6 version of `$promise.then(&function);` 03:17
I guess it's `await` :) nevermind 03:18
IOninja $promise.then: {function} 03:19
ZzZombo The "array doesn't allow assoc. indexing" happens when I try to 03:36
say $_<key-value>,$_<section>
where $_ comes from
for $/.list -> $_ in a grammar action.
gist.github.com/ZzZombo/5caa51f9b2...556920a0d8
timotimo, it's what you told me to do :(
can I blame you for that one?
LeCamarade join #xcp 04:23
BenGoldberg /
LeCamarade … ooops.
BenGoldberg :) 04:24
Geth ecosystem: 8d54203e5b | (Andrew Egeler)++ | META.list
Add JSON::JWT
05:20
ZzZombo is it possible to parse directives like #include so it would be first go through a rule such as 05:30
# \w+
and only then a proto regex would branch to one of implemented directives?
faraco m: sub f(&g:($)) { 06:44
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3sub f(&g:($)) {7⏏5<EOL>
faraco g(2)
}
faraco m: sub f(&g:($)) { g(2) } 06:45
camelia ( no output )
faraco m: sub f(&g:($)) { g (2)}; f(-> $n { say "Hi {$n}" }) 06:46
camelia Hi 2
faraco cool..the brackets looks like #{var} in ruby 06:47
but why its matter if you can just interpolate with barebone $var in strings? 06:48
faraco is there any other use case that I did not yet found? 06:49
TimToady "Hi {$n + 1}" 06:51
faraco TimToady: Oh..I see thank you ^^ 06:52
andrzejku hello perl6!:) 07:10
faraco hi 07:11
abraxxa hi 07:16
gfldex m: say Q:c⟨$a {1+2} $b⟩ 07:25
camelia $a 3 $b
RabidGravy boom
gfldex faraco: ^^^
faraco yay...what is Q:c though 07:26
Some of Perl 6 operations looks like it uses a lot of smile yo me
moritz quoting that allows code block interpolation 07:28
faraco oh 07:29
m: my @tank = Q{hermit fish crab} 07:30
camelia ( no output )
gfldex Q is the general quote form from which all other quotes are derived
docs.perl6.org/language/quoting
jast that page doesn't mention :c, does it?
gfldex it does not
gfldex m: dd Q:p⟨/dev/null⟩ 07:38
camelia 5===SORRY!5=== Error while compiling <tmp>
Unrecognized adverb: :p
at <tmp>:1
------> 3dd Q:p7⏏5⟨/dev/null⟩
faraco m: my @tank = Q{flamingo water tree}; say " Hi {@tank[0]} ";
camelia Hi flamingo water tree
gfldex m: dd Q:regex⟨.*⟩ 07:40
camelia ===SORRY!===
Cannot look up attributes in a Perl6::RegexGrammar type object
Geth doc: fb0bea5fde | (Wenzel P. P. Peppmeyer)++ | doc/Language/quoting.pod6
add Q adverb table
07:41
CIAvash gfldex++ 07:43
faraco m: say "dog".split.?; say "dog".flip.? 07:58
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed postfix call
at <tmp>:1
------> 3say "dog".split.?7⏏5; say "dog".flip.?
faraco m: say "dog".?split; say "dog".?flip 08:00
camelia Cannot resolve caller split(Str: ); none of these signatures match:
(Str:D $: Regex:D $pat, $limit is copy = Inf;; :$v is copy, :$k, :$kv, :$p, :$skip-empty, *%_)
(Str:D $: Cool $match;; :$v is copy, :$k, :$kv, :$p, :$skip-empty, *%_)
(…
faraco m: say "dog".?flip 08:01
camelia god
faraco so..the ? method..just return Empty object if the invocant methods not exist.. 08:03
RabidGravy it's not a method
gfldex it returns Nil
lizmat m: dd "foo".?bar
camelia Nil
faraco gfldex: I misread them, heh. 08:05
RabidGravy though I coulld see some virtue in it working in the can't find a matching multi candidate case 08:06
gfldex I believe I found a usecase for the .? operator exactly once in the last 2 years 08:08
RabidGravy I think I have used it in a module, it's difficult to search for :) 08:10
faraco m: dd "747484".Num 08:11
camelia 747484e0
RabidGravy actually I've used it in three different modules 08:16
samcv use nqp; my int $BITS := nqp::iseq_i(0x1ffffffff,8589934591) ?? 64 !! 32; say $BITS 08:51
m: use nqp; my int $BITS := nqp::iseq_i(0x1ffffffff,8589934591) ?? 64 !! 32; say $BITS
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot bind to natively typed variable '$BITS'; use assignment instead
at <tmp>:1
------> 3eq_i(0x1ffffffff,8589934591) ?? 64 !! 327⏏5; say $BITS
samcv m: use nqp; my int $BITS = nqp::iseq_i(0x1ffffffff,8589934591) ?? 64 !! 32; say $BITS
camelia 64
samcv j: use nqp; my int $BITS = nqp::iseq_i(0x1ffffffff,8589934591) ?? 64 !! 32; say $BITS
camelia 64
Geth doc: 07af2a607f | (Wenzel P. P. Peppmeyer)++ | doc/Language/quoting.pod6
fix table layout
09:36
RabidGravy Not sure why I'm on "virginmediabusiness" now 09:36
RabidGravy I guess that's how the work VPN enters the internet 09:37
gfldex RabidGravy: it's actually quite easy to search for: `find -iname '*.p6' -or -name '*.pm6' -or -name '*.pm' | xargs grep '\.?'` 09:48
seams to be quite popular with exceptions and nativacall
RabidGravy yeah I always forget what type of regular expressions the grep that I find myself using at any time might support 10:00
andrzejku yesterday my friend asked me if I join to Perlers witnesses 10:09
DrForr Never heard of 'em. 10:17
lucs Could 'witnesses' be an English to Polish to English version of 'mongers'? 10:24
lucs s/Polish/not quite sure what/ 10:25
tadzik I think it's a joke about Jehovah's Witnesses 10:45
gfldex well, we do have a guru
DrForr It's certainly a reference. But we're not going to find out for a little while. 10:46
Geth doc: f0ed86afd0 | (Tom Browder)++ | doc/Type/Proc.pod6
it's not a slurpy arg
11:21
CIAvash Isn't that commit wrong? ↑ 11:30
tbrowder why, please, i'm just tidying here. i think a slurpy arg must be the last is a sig, and named params must follow the unamed params. 11:36
CIAvash tbrowder: github.com/rakudo/rakudo/blob/fb38...oc.pm#L142
Geth doc: 83bfabe929 | (Tom Browder)++ | doc/Type/Proc.pod6
add method run, correct shell signature
11:37
CIAvash tbrowder: It doesn't have to be the last arg 11:39
Geth doc: 47618c2c7b | (Tom Browder)++ | doc/Type/Proc.pod6
correct run signature
tbrowder that should be correct now--wasn't aware of that part of sig. that erroneous part of docs has been there for a long, hence the attention lately when trying to get info on proper run and shell use. thaks for the look-see attention! 11:41
ZzZombo m: say 'asd' ~~ /[ || s || a || ]/
camelia 5===SORRY!5=== Error while compiling <tmp>
Null regex not allowed
at <tmp>:1
------> 3say 'asd' ~~ /[ || s || a || 7⏏5]/
expecting any of:
infix stopper
IOninja m: say 'asd' ~~ /[ || s || a ]/ 11:42
camelia 「a」
IOninja m: say 'asd' ~~ /[ || s || a || '']/
camelia 「a」
ZzZombo m: say 'asd' ~~ /g:[ || s || a || ]/
camelia 5===SORRY!5=== Error while compiling <tmp>
Null regex not allowed
at <tmp>:1
------> 3say 'asd' ~~ /g:[ || s || a || 7⏏5]/
expecting any of:
infix stopper
ZzZombo m: say 'asd' ~~ /g:[ || s || a ]/
camelia Nil
ZzZombo wtf is null regex 11:43
IOninja one without stuff to match 11:43
I don't see any method run in Proc. It's .spawn and the sig is still wrong, missing the splat on @args 11:46
IOninja github.com/rakudo/rakudo/blob/fb38...oc.pm#L102 11:48
Well, the whole sig is wrong. 11:49
tbrowder okay, will try again. it helps to look at the code, doesn't it? 11:59
tbrowder both run and shell are shown as subs returning a proc. only shell is shown as a method. neither should be shown grouped with the proc new method. and shell as a method has a different sig than its method version. correct so far? no wonder doc is so confusing. 12:08
ZzZombo m: say 'asd' ~~ /:g[ || s || a ]/ 12:09
camelia 5===SORRY!5=== Error while compiling <tmp>
Unrecognized regex modifier :g
at <tmp>:1
------> 3say 'asd' ~~ /:7⏏5g[ || s || a ]/
expecting any of:
term
ZzZombo m: say 'asd' ~~ m:g/[ || s || a ]/ 12:10
camelia (「a」 「s」)
ZzZombo m: say 'asd' ~~ m:g/[ s || a ]/
camelia (「a」 「s」)
ZzZombo why [ || s ] doesn't match an empty string? 12:11
Geth doc: b379c9a3f8 | (Tom Browder)++ | doc/Type/Proc.pod6
run is not a method

correct signature of method shell
12:14
[Coke] ZzZombo: I seem to recall it's intentional so you can nicely format multi-line ||'s so the alternations all line up, but cannot find anything to back up this recollection. 12:22
IOninja Yup, I too know it to be the case for the same reason. 12:29
IOninja Null regex is not allowed. Quote an empty string if you meant nothing 12:30
But it being first alternative don't make much sense :)
arnsholt Or use <?> 12:31
ZzZombo So grammars it seems somehow advance after each rule ignoring whitespace, example: token digit { \d+ } token string { \w+ } token TOP { <digit> <string> } would parse "123\nwobla" w/o having to put whitespace/newlines after each token, but I don't see anything saying so in the docs. Is it right? What exactly constitutes what does it skip over? 12:45
jnthn ZzZombo: token does not, rule does 12:50
ZzZombo: In rules, significant whitespace is replaced with a call to <.ws> 12:51
The default one is something like <!ww> || \s+ 12:52
But you can write your own token ws to change that
araraloren m: grammar T { token digit { \d+ }; token string { \w+ }; rule TOP { <digit> <string> }; }; say T.parse("123\nwobla");
camelia 「123
wobla」
digit => 「123」
string => 「wobla」
araraloren m: grammar T { token digit { \d+ }; token string { \w+ }; token TOP { <digit> <string> }; }; say T.parse("123\nwobla"); 12:53
camelia Nil
RabidGravy so much for the "working from home is easy with vagrant" - it just took me four hours to get this working :-\ 13:06
Woodi hallo today :) 13:08
ZzZombo token babble($l, @base_tweaks?) { 13:09
:my @extra_tweaks;
what is this? The grammar docs seem to miss much :/
Woodi jnthn: re rules: and what <!ww> is by default ? ! <ww> so ! \w ?
ZzZombo <ww> means "within word". 13:10
Woodi pmurias++
ZzZombo however, a much better question is, what <ws> is exactly? Where can I see it in the source form? 13:11
araraloren ZzZombo, you can refer this github.com/ohmycloud/rakudo-and-nq...-course-zh
ZzZombo ugh, I-I am unable to read... that? 13:12
araraloren ...why ?
jnthn Woodi: Not between two \w chars
araraloren <ws> is white space , i think .
arnsholt <ws> is whitespace
Woodi pmurias: I found on Wiki link to paper that says CPS is bad and propose to replace it with something simpler: users.soe.ucsc.edu/~cormac/papers/pldi93.pdf 13:13
jnthn: that a bit madness ;)
...from baby user perspective :) 13:14
jnthn Woodi: It "does what you mean"
jnthn $a+$b # !ww is true between a and + so don't need whitespace there 13:14
araraloren The dot after **<** means non-captured, such as <.ws> 13:15
cale2 Is it considered a good practice to not even have getters on objects? Is that why the P6 default is to make even attributes private? 13:15
Woodi jnthn: that explains it to ma A->B->C brain :) thanx
*my 13:16
ZzZombo can you read this: "Тухайн мэдээлэлые өөршэлхэ, баяжуулха боломжо хүн бүридэ нээлтэтэй байдаг.", araraloren?
Geth doc: 0c421ace11 | (Tom Browder)++ | doc/Type/IO.pod6
neaten comments
Woodi ZzZombo: no, but I see symbols :) 13:16
ZzZombo arnsholt: I know that, but I want to see what it looks like exactly. 13:17
see, same here, it's gibberish for me.
[Coke] github.com/perl6/nqp/blob/master/s...r.nqp#L102 13:18
araraloren ZzZombo, my mistake, this is the EN version: github.com/edumentab/rakudo-and-nq...als-course
ZzZombo huh, it somehow looks also for Perl comments? 13:19
[Coke] that's the simple nqp version. Rakudo's is more complicated: github.com/rakudo/rakudo/blob/nom/...r.nqp#L612
but yes, <ws> is used to skip whitespace and comments. 13:20
travis-ci Doc build errored. Tom Browder 'run is not a method 13:20
travis-ci.org/perl6/doc/builds/204170717 github.com/perl6/doc/compare/47618...79c9a3f8bf
ZzZombo that's certainly should be reflected in the docs, because it means nearly always, if you are not making yet another Perl parser, you should change <ws> to exclude that, at the very least. 13:21
IOninja But that's not what's available to users, eh?
We redefine <ws> in rakudo to include all sorts of stuff.
arnsholt ZzZombo: The default definition is in NQP, src/QRegex/Cursor.nqp
That's the definition you get in a plain grammar Foo {} 13:22
IOninja m: say '#Fooo' ~~ /<ws>/
camelia 「」
ws => 「」
IOninja See no comments
ZzZombo what repo is src/QRegex/Cursor.nqp in? 13:23
IOninja arnsholt: and what is it? In Cursor I only see a method.
ZzZombo: perl6/nqp
arnsholt IOninja: What is what? 13:24
IOninja arnsholt: what does <ws> match in plain grammar Foo {}
araraloren ZzZombo, here github.com/perl6/nqp/tree/master/src/QRegex
arnsholt What it says in the code O:)
IOninja OK
arnsholt If I read it correctly, anything with the whitespace property 13:25
(Or rather, it rejects the match if it's between two word characters and then does a scan for the next character that is *not* whitespace) 13:26
araraloren Docs said that `The default ws matches "whitespace", such a sequence of spaces (of whatever type), newlines, unspaces, or heredocs.`
arnsholt So that you'll get a zero-length match in the middle of ")a" but not in "ab" 13:27
IOninja ah
m: say "ab" ~~ /a <ws> b/
camelia Nil
IOninja m: say "ab" ~~ /')' <ws> b/
camelia Nil
IOninja m: say ")b" ~~ /')' <ws> b/ 13:28
camelia 「)b」
ws => 「」
IOninja cool
arnsholt araraloren: What docs are that?
araraloren docs.perl6.org/language/grammars#index-entry-ws
IOninja araraloren: yeah, it's wrong. 13:29
And I bet I wrote it too...
IOninja fixes
araraloren Oh..
timotimo ZzZombo: please note that i later corrected myself that you actually need $/[0].list instead of $/.list
IOninja Yup, t'was me
arnsholt The *Perl 6* grammar includes that stuff in its <ws>, but the default is pretty bare-bones 13:30
IOninja Yup. The younger and dummer IOninja wrote that I meant :) 13:32
just wanna find what nqp::const::CCLASS_WHITESPACE matches
Geth doc: 5b1788c18f | (Tom Browder)++ | doc/Type/Proc.pod6
tweak grammar
13:33
timotimo can we get proper errors back for when you try to feed perl5 code to rakudo? i.e. not "Undeclared routine: use used at line 1" for "use 5.10"
IOninja
.oO( sub use (|) { die "This isn't the compiler you're looking for" }
13:34
IOninja ) 13:34
IOninja TBH I find all these "features" we have to cater to Perl 5 converts get in the way and I rather we have fewer of them. 13:35
m: sub circumfix:<? :> ($x) {}; ?42:
camelia ( no output ) 13:36
IOninja m: m: sub infix:<?> ($, $) {}; sub infix:<:> ($, $) {}; 42 ? 42, 5 : 5 13:37
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of ? and : for the ternary conditional operator; in Perl 6 please use ?? and !!
at <tmp>:1
------> 3$, $) {}; sub infix:<:> ($, $) {}; 42 ?7⏏5 42, 5 : 5
IOninja m: say
camelia 5===SORRY!5===
Argument to "say" seems to be malformed
at <tmp>:1
------> 3say7⏏5<EOL>
Other potential difficulties:
Unsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument…
IOninja m: :foo<STDIN>
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of <STDIN>; in Perl 6 please use $*IN.lines (or add whitespace to suppress warning)
at <tmp>:1
------> 3:foo<7⏏5STDIN>
IOninja I don't know Perl 5. I'm wring Perl 6. It's like... GTFO 13:38
timotimo yeah, i'm only suggesting things blow up helpfully when they'd blow up anyway otherwise
IOninja m: sub use (|) { say "test" }; use v6 13:39
camelia ( no output )
IOninja m: sub use (|) { say "test" }; use 6
camelia test
IOninja heh
IOninja huh 13:40
m: use v5 13:41
camelia ===SORRY!===
Could not find Perl5 at line 1 in:
/home/camelia/.perl6
/home/camelia/rakudo-m-inst-1/share/perl6/site
/home/camelia/rakudo-m-inst-1/share/perl6/vendor
/home/camelia/rakudo-m-inst-1/share/perl6
CompUnit::Repos
IOninja Interesting.
Sticking a matcher for [ '5.' <[\d.]>+ ] in here maybe? github.com/rakudo/rakudo/blob/nom/...1594-L1620 13:42
or as another alternative in that conditional 13:43
cale2 Found this blog post again and cleared up my question: 6guts.wordpress.com/2016/11/25/per...ood-thing/ 13:47
IOninja You question didn't really make sense to me. Given a choice between $!foo and $.foo, I don't see how we " 13:48
IOninja default" to private attributes... 13:48
oh, I was meant to update the grammar doc! 13:49
ZzZombo timotimo: can you tell me why exactly do I get there an array of matches in another array, I can't explain that myself. 13:55
moritz you always get an array of matches when you use a quantifier 13:56
(foo)+ makes $0 an array
(I don't know the context, just spewing general knowledge here) 13:57
arnsholt Except the ? quantifier, no?
Or am I misremembering?
timotimo m: "hello" ~~ / (lol)? /; dd $/[0] 13:58
camelia Nil
timotimo m: "hello" ~~ / (lo)? /; dd $/[0]
camelia Nil
timotimo oh, right
timotimo earliest match wins 13:58
m: "hello" ~~ / .*(lo)? /; dd $/[0]
camelia Nil
timotimo m: "hello" ~~ / hel(lo)? /; dd $/[0]
camelia Match.new(ast => Any, list => (), hash => Map.new(()), to => 5, orig => "hello", from => 3)
araraloren m: say "aaa" ~~ /(\w)+/; 13:59
camelia 「aaa」
0 => 「a」
0 => 「a」
0 => 「a」
Geth doc: c2060901d2 | (Zoffix Znet)++ | doc/Language/grammars.pod6
Correct erroneous info on default <ws> token
araraloren m: "aaa" ~~ /(\w)+/; dd $/[0] 14:00
camelia [Match.new(ast => Any, list => (), hash => Map.new(()), to => 1, orig => "aaa", from => 0), Match.new(ast => Any, list => (), hash => Map.new(()), to => 2, orig => "aaa", from => 1), Match.new(ast => Any, list => (), hash => Map.new(()), to => 3, orig =>…
cale2 IOninja: I'm just speaking of the better choice when given the option between $!foo and $.foo 14:01
design-wise
moritz arnsholt: yes, ? is special 14:03
araraloren m: "aaa" ~~ /(\w)+?/; say $/[0] 14:04
camelia [「a」]
timotimo you can always get a list there if you want by using ** 0..1 14:05
IOninja huh, I thought ? was greedy
moritz no, the opposite
well, ? is greed, +? is frugal
araraloren yeah, not greed
IOninja No, I meant ?
moritz ? it self is greedy 14:06
IOninja Also, I'm surprised Perl 5 doesn't set $1 in "hello" =~ /.(ll)?./ match due to there being a ? wtf
m: say "hello" ~~ / (lol)? /;
camelia 「」
araraloren ? is a quantifer, hm ?
IOninja moritz: then how come there's no capture ^ there?
moritz IOninja: the "left-most match first" wins over ? being greedy
it also wins over LTM, or any such rules 14:07
it's really the rule with highest precedence
IOninja m: say "hello" ~~ / (lo)? /;
camelia 「」
IOninja m: say "hello" ~~ / (ll)? . /;
camelia 「h」
IOninja m: say "hello" ~~ / . (ll)? . /;
camelia 「he」
araraloren m: say "hello" ~~ m:P5/ . (ll)? . /; 14:08
camelia False
IOninja m: say "hllo" ~~ / . (ll)? . /;
camelia 「hllo」
0 => 「ll」
IOninja OK, I think I get it. Thanks.
araraloren m: say "hello" ~~ m:P5/.(ll)?./;
camelia 「he」
IOninja And I get what perl 5 does too :) Was confused 14:09
moritz the logic to retry at a different position is basically the same as adding a ^.+? <( in front of the match
AlexDaniel \o/ 14:18
IOninja | 14:19
/\
araraloren -------- 14:20
IOninja 🐛🐛 🐛 🐛 🐛 14:21
AlexDaniel 👾 👾 👾 14:22
AlexDaniel wait… wrong way :P 14:22
u: ALIEN 14:24
unicodable6 AlexDaniel, U+1F47D EXTRATERRESTRIAL ALIEN [So] (👽)
AlexDaniel, U+1F47E ALIEN MONSTER [So] (👾) 14:25
AlexDaniel wonders when you should use one or another…
IOninja m: "42".comb: {} 14:26
camelia Cannot resolve caller comb(Str: Hash); none of these signatures match:
(Cool $: *%_)
(Cool $: Regex $matcher, $limit = Inf, *%_)
(Cool $: Str $matcher, $limit = Inf, *%_)
(Str:D $: *%_)
(Str:D $: Int:D $size, $limit = *, *%_…
IOninja m: "42".comb: {;}
camelia Cannot resolve caller comb(Str: Block); none of these signatures match:
(Cool $: *%_)
(Cool $: Regex $matcher, $limit = Inf, *%_)
(Cool $: Str $matcher, $limit = Inf, *%_)
(Str:D $: *%_)
(Str:D $: Int:D $size, $limit = *, *%…
IOninja why do we have a test for this one.
Um... well, I guess infiniloop is bad. 14:27
AlexDaniel well, let's see!
c: all "42".comb: {;}
IOninja AlexDaniel: it's RT #66340 14:27
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...l?id=66340
committable6 AlexDaniel, gist.github.com/ba0e2a6035a2bed33b...a8af796715
IOninja I'm just annoyed it's interfering with my fix :P
But then that means we got hangs in all the Cool capture forwarders... 14:28
AlexDaniel IOninja: well, welcome to the club!
IOninja m: ''.words: {;}
camelia Cannot resolve caller Numeric(Block: ); none of these signatures match:
(Mu:U \v: *%_)
in block <unit> at <tmp> line 1
IOninja AlexDaniel: what sort of club? 14:28
AlexDaniel IOninja: “I fixed something, but there's a stupid test”
IOninja heh 14:29
travis-ci Doc build errored. Tom Browder 'neaten comments' 14:29
travis-ci.org/perl6/doc/builds/204189050 github.com/perl6/doc/compare/b379c...421ace119e
IOninja hm, the only reason .lines and .words don't hang is we accept any type... 14:30
m: ''.words: |<la la la>
Aha. Well, that's a hang
IOninja m: ''.lines: |<la la la> 14:30
that too 14:31
m: ''.subst: |<la la la>
That three
camelia (timeout)
Cannot resolve caller subst(Str: Str, Str, Str); none of these signatures match:
(Str:D $: $matcher, $replacement, :global(:$g), :ii(:$samecase), :ss(:$samespace), :mm(:$samemark), *%options)
in block <unit> at <tmp> line 1
IOninja Ahhh. I see. Duh. Don't make Cool method a proto 14:32
AlexDaniel IOninja: good that we had a test :D
IOninja hehe
I guess in the long run, yes :)
AlexDaniel huggable: TimToady 14:35
huggable AlexDaniel, nothing found
AlexDaniel huggable: TimToady :is: 👽
huggable AlexDaniel, Added TimToady as 👽
IOninja u: 👽 14:36
unicodable6 IOninja, U+1F47D EXTRATERRESTRIAL ALIEN [So] (👽)
IOninja heh, why?
AlexDaniel I just though we might want to have an entry for those who wonder who TimToady is 14:37
IOninja huggable: TimToady :is: 👦🐸
huggable IOninja, Added TimToady as 👦🐸
AlexDaniel that's not a very precise definition, I guess, but feel free to improve :)
huggable: TimToady :is: 👦‍🐸 14:39
huggable AlexDaniel, Added TimToady as 👦‍🐸
IOninja hehe :) That's more accurate :)
travis-ci Doc build passed. Tom Browder 'tweak grammar' 14:58
travis-ci.org/perl6/doc/builds/204194315 github.com/perl6/doc/compare/0c421...1788c18fb2
sena_kun [Coke], github.com/perl6/doc/issues/1194#i...-281695160 15:06
Geth doc: 5fe17c8e1d | Altai-man++ | doc/Language/grammars.pod6
Fix examples
15:28
travis-ci Doc build passed. Zoffix Znet 'Correct erroneous info on default <ws> token' 15:29
travis-ci.org/perl6/doc/builds/204203357 github.com/perl6/doc/compare/5b178...060901d25d
Geth doc: 854dc48757 | (Zoffix Znet)++ | doc/Language/grammars.pod6
Fix typo
15:31
Geth doc: 2a02ba23cb | (Will "Coke" Coleda)++ | xt/examples-compilation.t
Have walk return actual code
15:44
[Coke] (docs) several of the samples in doc/Type/Sub.pod6 are dying with "write string requires an object with REPR MVMOSHandle" 15:48
sena_kun++
sena_kun: I was trying to work around the fact that I forgot to give 'walk' a signature. perl5 thinko, maybe. 15:49
sena_kun [Coke], I think this duying is because we changed $*OUT and $*ERR to a dummy. At the end of the script even "say 'haha'" won't work and will die with this error.
IOninja that sounds like trying to call a method on a closed filehandle 15:50
and I saw IO::Handle.new used as a dummy, eh?
sena_kun IOninja, yep.
IOninja m: IO::Handle.new.lines
camelia IO::Handle is disallowed in restricted setting
in sub restricted at src/RESTRICTED.setting line 1
in method new at src/RESTRICTED.setting line 32
in block <unit> at <tmp> line 1
IOninja s: (IO::Handle.new.lines; exit)
SourceBaby IOninja, Something's wrong: ␤ERR:
IOninja s: (IO::Handle.new.get; exit) 15:51
oops
SourceBaby IOninja, Something's wrong: ␤ERR: readline requires an object with REPR MVMOSHandle␤ in block <unit> at -e line 6␤␤
IOninja Ah, no oops but yey :)
sena_kun [Coke], I'm closing the issue?
[Coke] IOninja, sena_kun: we need to put IO::String bakc.
IOninja [Coke]: which examples, OOC?
[Coke] That class handles this case, whereas the bare IO::Handle does not 15:52
IOninja: e.g. gist.github.com/coke/9f4df5c5b90b3...3cbbe98fb6
IOninja I guess it's the `say 'start'` that does it.. 15:53
Geth doc: 97f2eca0c1 | (Will "Coke" Coleda)++ | 2 files
Revert "remove dep on IO::String"

This reverts commit 8f1d849c82e042cd25497a6f1b7c4d2868860e3e.
Some of the more complex examples require this class.
[Coke] sena_kun++ for noticing I broke everything. :) 15:54
IOninja s: (class { ::?CLASS.^add_method: $_, -> | {} for IO::Handle.^methods».name }.new.get; exit) 15:55
SourceBaby IOninja, Something's wrong: ␤ERR:
sena_kun [Coke], you did all the work that I promised(?) to do on last weekends, but ended up with no time, so my part was not so great here. :)
IOninja dunno what you're using that dummy class for, but if you just need an IO::Handle with dummy methods ^ that's one way you could do it without a dep
[Coke] I don't really have a problem with having a dep. 15:56
IOninja :)
[Coke] getting a sporadically failing example test on doc/Type/IO/Socket/INET.pod6 (chunk 1) when run under load. seems to be fine on its own. 16:00
timotimo maybe neglecting to use different ports for everything?
IOninja The first two examples on the page are meant to be run together, one after the other (first one's a server, the second one's the client for it) 16:03
[Coke] any code chunk is run as a free-standing bit of code, and isn't run so much as fake-compiled. 16:04
[Coke] (it's wrapped in an if False { } to avoid most things) 16:04
IOninja Ah
[Coke] tries another 'make xtest' to see if it fails again. 16:05
tell you what, 'make xtest' now gives a HUGE set of examples where code is printing directly to stderr or stdout instead of going through the Rakudo handles.
IOninja :o 16:06
m: $*OUT.close; say "meow"
camelia write string requires an object with REPR MVMOSHandle
in block <unit> at <tmp> line 1
IOninja m: BEGIN $*OUT.close, $*ERR.close; 42 16:07
camelia ( no output )
IOninja m: BEGIN $*OUT.close, $*ERR.close; note "meow"
camelia ( no output )
IOninja Well, I would be interesting in seeing which examples. I guess this falls under IO stuff? :) 16:08
[Coke] well, i can see output like; 16:08
Useless use of constant integer 500000 in sink context (lines 2, 3)
Redeclaration of symbol '$fh'
so there's two big ones. :) 16:09
IOninja m: BEGIN $*OUT.close, $*ERR.close; my $fh; my $fh
camelia ( no output )
IOninja m: my $fh; my $fh
camelia Potential difficulties:
Redeclaration of symbol '$fh'
at <tmp>:1
------> 3my $fh; my $fh7⏏5<EOL>
IOninja Feels like it's a bug in your examples runner, at first glance.
[Coke] m: $*ERR=IO::Handle.new; my $fh; my $fh; 16:10
camelia Potential difficulties:
Redeclaration of symbol '$fh'
at <tmp>:1
------> 3$*ERR=IO::Handle.new; my $fh; my $fh7⏏5;
IO::Handle is disallowed in restricted setting
in sub restricted at src/RESTRICTED.setting line 1
in meth…
[Coke] m: $*ERR=IO::Handle.new; note "eek"
camelia IO::Handle is disallowed in restricted setting
in sub restricted at src/RESTRICTED.setting line 1
in method new at src/RESTRICTED.setting line 32
in block <unit> at <tmp> line 1
[Coke] note that they both complain about the class, but the first one also slips the warning out 16:10
gist.github.com/coke/e9cc048b059a8...14076b43ae has the full run including the code used to run passing tests; if you look for lines that aren't valid tap lines, those are the warnings that slip through. 16:12
e.g. gist.github.com/coke/e9cc048b059a8...-out-L2014
IOninja [Coke]: yeah, because the warning is compile time, but you override $*ERR at runtime 16:15
m: BEGIN $*ERR=IO::Handle.new; my $fh; my $fh;
camelia 5===SORRY!5=== Error while compiling <tmp>
An exception occurred while evaluating a BEGIN
at <tmp>:1
Exception details:
IO::Handle is disallowed in restricted setting
in sub restricted at src/RESTRICTED.setting line 1
in method …
IOninja s: (BEGIN $*ERR=IO::Handle.new; my $fh; my $fh; exit;)
SourceBaby IOninja, Something's wrong: ␤ERR: Potential difficulties:␤ Redeclaration of symbol '$fh'␤ at -e:6␤ ------> GIN $*ERR=IO::Handle.new; my $fh; my $fh<HERE>; exit;) )[1];␤
[Coke] ok, then:
IOninja hmmm
[Coke] github.com/perl6/doc/blob/master/x...tion.t#L84 16:16
IOninja Yeah, it still complains even with BEGIN
[Coke] I'm EVAL'ing the code; the overriden has already happened before any EVAL code.
ah. :)
*override
IOninja++ 16:17
IOninja ?
[Coke] you verified my bug. :)
IOninja Ah :)
raiph .tell TimToady Imo it would work well if you provided a short answer to www.perlmonks.org/?node_id=3333;parent=1182520 16:18
yoleaux raiph: I'll pass your message to TimToady.
prlante I have a question!! stackoverflow.com/q/42391754/2774153 Can anyone help? 16:18
[Coke] doesn't have to be TimToady. 16:18
IOninja raiph: fwiw, you set the wrong link on announcement to this week's weekly. No one can comment or upvote it, 'cause it's archived.... unless you did it on purpose? 16:19
IOninja that's a pretty big range.... 16:20
[Coke] prlante: you're eagerly generating that list; you probably want to lazily do it when dealing with so many elements.
IOninja but the code wants .sum
m: (1..1000000000).race.grep(* %% 5).sum.say
camelia (signal XCPU) 16:21
IOninja prlante: well, there's another way to skin this cat. Just generate a Seq of 5s
perlpilot prlante: use more math?
stmuk_ one for anyone who thinks our spokesbug isn't a nice logo
upspin.io/
IOninja m: say (5, 10 … 1000000000).sum
camelia (timeout) 16:22
[Coke] m: my $fives := (1...1000000000).lazy.grep(*%%5); say $fives[^100]; 16:22
camelia (5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200 205 210 215 220 225 230 235 240 245 250 255 260 265 270 275 280 285 290 295 300 305 310 315 320 325 330 335 340 3…
IOninja stmuk_: that's just an ugly animal. Our logo is worse, design-wise
[Coke] m: my $fives := (1...1000000000).lazy.grep(*%%5); say $fives[^10];
camelia (5 10 15 20 25 30 35 40 45 50)
raiph I'm confused. I added a stickied (well, 'announcement') link to p6weekly.wordpress.com/ so it should always link to latest.
IOninja: ^^
IOninja OK then
Whoever linked them in the past linked to the actual article, so you could see when the new one came out. 16:23
m: say 1000000000/5
camelia 200000000
prlante IOninja Not working . Output is ".sum was unexpected at this time." 16:24
IOninja wat
prlante: which code did you run?
Never saw such errors... 16:25
This sounds like a job... for a 32-core VM! :) 16:26
prlante IOninja Now code is running but its already 5 mins, and still no output
[Coke] prlante: btw, %%5 is "is divisible by 5" 16:27
prlante Any use of concurrency here?
[Coke] prlante: look at my example above.
prlante I am running this: (5,10,15...1000000000).sum
[Coke] that lets you ask for results in chunks rather than trying to generate them all up front.
raiph IOninja: Sure. I've done most of them.
IOninja prlante: if that's your actual code, a math solution is more apt...
prlante In python it showed memory error and I am trying in Perl 6.
raiph IOninja: But when/if I see what happens if I don't it often ends up not being done by anyone for a week. 16:28
IOninja: This way the top link is always pointing to the latest and says so.
IOninja: (Fwiw I'd personally prefer to shut /r/perl6 down and focus on /r/perl.)
IOninja prlante: lemme see what happens on my 32-core box
prlante OK IOninja Thanks for your help. 16:29
IOninja raiph: heh, I'd prefer to stop pretending r/perl is for "both perls" and post Perl 6 stuff to just r/perl6
alphah Q: Is Enum type dynamic during compilation or runtime? for example can I add/delete elements to Enum after creating it?
IOninja raiph: any time I look at r/perl there's some drama post
raiph IOninja: Which is why I got /r/perl6 going again and have stuck with it 16:30
IOninja m: Bool.^methods.say
camelia (<anon> <anon> Bool gist Str Numeric Int ACCEPTS pick roll perl pred succ enums Range asech perl truncate acosech sin ACCEPTS asinh floor abs asec cosec acotan ceiling acos acosec unpolar exp acotanh gist Num round DUMP asin log10 expmod msb FatRat isNaN…
prlante raiph Lets make Perl 6 great language.
IOninja heh 16:31
prlante IOninja its 9 minutes , no output
IOninja prlante: well, in Perl 5 it too gives me out of memory :) 16:32
prlante IOninja in python3 also it gave me memory error 16:33
IOninja I think if we rotor the chunks, concurrently sum the chunks, and then sum the sums of chunks, we can get something
IOninja tries
prlante IOninja Is there no way of solving it?
raiph prlante: Imo it already is. cf www.perlmonks.org/?node_id=1182509
IOninja Well, I can get up to 208GB of RAM on this box... 16:33
prlante: well, what exactly do you mean by "it"? 16:34
Finding the sum of all digits between 1 and 1000000000 that are divibislbe by 5? You can do it mathematically without reifying a gagillion elements
prlante www.perlmonks.org/?node_id=1182509 Yeah lets make perl 6 great. 16:35
IOninja I mean solving this problem
IOninja Well, I'm no mathematicial, but I'm sure the formula is easy. 16:37
prlante IOninja If you can find solution to my question will you please post it in stackoverflow. Computer is just getting heated but still no output after running " (5,10,15...1000000000).sum" 16:37
[Coke] IOninja: I think he means, pretend this isn't a trivial sum, and then how do we ||-ize it. 16:38
prlante IOninja Why the perl is throwing memory error? Does that mean I have to go to C++?
[Coke] prlante: if you really mean THIS specific problem, you're doing it the hard way.
IOninja well, rotoring is concurring is kinda useless since it's reification of the seq that's taking ages
[Coke] prlante: can you clarify?
IOninja prlante: because you're creating a ginourmous list.
m: say 1000000000/1024/1024/1024 16:39
camelia 0.93132257
IOninja prlante: if you assume each element takes just one byte, you need almost a gig to store it, and it don't take one byte, it's probably a lot more
m: say 1000000000/5/1024/1024/1024 16:40
camelia 0.18626451
IOninja Well, I guess smaller by 5, but still big
prlante: I don't get what your question is, so I'm unsure what answer I'd post. 16:41
timotimo m: my $a = 0; $a += $_ for 5, 10, 15 ... 1000000000; say $a
IOninja Oh, well, I see lizmat++ posted one already
timotimo: we tried that already
camelia (timeout)
IOninja reifying that seq alone takes ages 16:42
timotimo i wonder how to make it aware that it can throw the values away
IOninja Ah
In your version, it does, I think 16:43
m: say (5, 10 ... 1000)
camelia (5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200 205 210 215 220 225 230 235 240 245 250 255 260 265 270 275 280 285 290 295 300 305 310 315 320 325 330 335 340 3…
timotimo that seq will definitely give very bad gc performance
[Coke] m: my $upper = 1000000000; my $interval = 5; my $sum = (1+($upper/$interval))*($upper/$interval/2)*$interval; say $sum 16:44
camelia 100000000500000000
[Coke] I mean, if you just want the numeric answer as fast as possible, I'm pretty sure that algorithm is slightly faster.
(and potentially correct :)
timotimo "slightly" :)
sena_kun 4000000100000000?
IOninja m: say ((5, 10 … 100).sum, (5, 10 … 1000).sum, (5, 10 … 10000).sum … *)[^10]
camelia Unable to deduce arithmetic or geometric sequence from 1050,100500,10005000 (or did you really mean '..'?)
in block <unit> at <tmp> line 1
IOninja aww
timotimo hmm, that number is only 29 bits wide 16:45
maybe the sum fits into a 64bit int?
m: say 100000000500000000.msb
camelia 56
[Coke] m: my $upper = 1000000000; my $interval = 5; my $sum = (1+$upper/$interval)*($upper/2); say $sum
camelia 100000000500000000
timotimo yeah, it would
if we used native ints for that task, it'd make the gc problem disappear
IOninja wait a second... 16:46
m: .say for (5, 10 … 100).sum, (5, 10 … 1000).sum, (5, 10 … 10000).sum
camelia 1050
100500
10005000
IOninja I was right on the money!
It's a stupid seq maker that can't figure it out
[Coke] IOninja: ah, sum is smart?
timotimo it is for simple sums
IOninja [Coke]: don't think so... There's a shortcut for Ranges 16:47
But I mean, there's a pattern in the sum
sena_kun math.stackexchange.com/questions/5...sible-by-7 - just change the particular numbers according to the problem.
timotimo oh, haha 16:48
i got the wrong answer in my code because i used < instead of <=
99999999500000000
IOninja m: say "The sum is 1$_5$_" given 0 x '1000000000'.chars-2
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$_5' is not declared
at <tmp>:1
------> 3say "The sum is 17⏏5$_5$_" given 0 x '1000000000'.chars-2
IOninja m: say "The sum is 1{$_}5{$_}" given 0 x '1000000000'.chars-2
camelia The sum is 100000000500000000
IOninja prlante: ^ there's your answer.
perlpilot IOninja++ 16:49
IOninja timotimo: how did you get your 100000000500000000 from?
perlpilot (even though it doesn't generalize, it's still a nice solution :)
IOninja Oh, from [Coke]'s solution?
m: say "The sum is 1{$_}5{$_}" given 0 x '100000000000000000000000000000000000000000000000000000000000'.chars-2
camelia The sum is 1000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000
IOninja hehe :)
timotimo IOninja: perl6 -e 'my $a = 0; loop (my $_ = 0; $_ < 1000000000; $_+=5) { $a += $_ }; say $a' 16:50
currently running the same with native ints
IOninja Ah 16:51
timotimo i forgot to put "time" in front
IOninja I'm gonna try a concurrency solution...
timotimo but its memory doesn't grow, which isn't a surprise
hey, it finished
lizmat anyways, I'm about to commit a fix that will make %% about 14x as fast for moest cases 16:51
*most 16:52
IOninja Actually, gotta work. But I suspect it'd be something like, chunk up 1000000000, make ranges out of chunks and concurrently reify those ranges grep and sum 'em
timotimo whoa
IOninja lizmat: holy crap :o
lizmat just need to spectest it
perlpilot lizmat++ nice!
prlante IOninja Is 100000000500000000 the answer?? 16:56
IOninja prlante: yeah
timotimo um, no, 42 is the answer 16:56
IOninja m: say WHY 'Life, the Universe and Everything':
camelia 42
prlante how did you solve ? Where's the code?
IOninja m: say "The sum is 1{$_}5{$_}" given 0 x '1000000000'.chars-2 16:57
camelia The sum is 100000000500000000
timotimo 301.77user 0.28system 5:03.93elapsed 99%CPU (0avgtext+0avgdata 88640maxresident)k
239.02user 7.73system 4:07.77elapsed 99%CPU (0avgtext+0avgdata 79568maxresident)k
IOninja prlante: also this link for generic mathy solution: math.stackexchange.com/questions/5...sible-by-7
lizmat hmmm.... spectest failures :-( back to the drawing board
timotimo that's the Int version up above and the int version down below
IOninja not bad
timotimo oh
2.00user 0.02system 0:02.05elapsed 98%CPU (0avgtext+0avgdata 67304maxresident)k 16:58
perlpilot looks to see if SO came up with the same mathy thing he did ...
IOninja Which version is that?
timotimo that's what you get when you write $i = $i + 5 instead of $i += 5
Geth ecosystem: FCO++ created pull request #299:
change meta name of my modules
IOninja wat
timotimo yes.
wat indeed
IOninja 100x faster for just that change :o
timotimo more than 100x
tony-o SmokeMachine: i'll take a look, i know that github was erroring out trying to pull some repos
timotimo m: say 239 / 2 16:59
camelia 119.5
timotimo :P
Geth ecosystem: 146831fd53 | (Fernando Correa de Oliveira)++ | META.list
change meta name of my modules (#299)

  * Adding DateTime::Extended to the ecosystem
  github.com/FCO/DateTime-Extended
  * change meta name of my modules
perlpilot timotimo: now all you need is a "+= considered slow" post to go with it :)
timotimo all *i* need is a patch for the optimizer :)
IOninja \o/
tony-o SmokeMachine: what's your GH username?
lizmat that's what we all need :-)
first dinner&
SmokeMachine tony-o: FCO
timotimo .o( what about second breakfast? )
SmokeMachine tony-o: I just changed my META names... 17:00
IOninja SmokeMachine: aren't you a membder of perl6 org?
SmokeMachine IOninja: do you mean on GH? 17:00
IOninja Yes
SmokeMachine IOninja: I am
IOninja So why PR and not just commit? :) 17:01
SmokeMachine IOninja: just to be sure... shouldn't I?
perlpilot SmokeMachine: forgiveness >>> permission
IOninja SmokeMachine: ¯\_(ツ)_/¯ seems easier to just commit 17:02
SmokeMachine perlpilot: ok, so... can I accept my MR?
IOninja revert feature works :)
SmokeMachine IOninja: ^^
IOninja You can.
SmokeMachine :)
IOninja But I meant don't do the PR and commit directly :)
timotimo neat. 17:03
using $i = $i + 5 also makes the Int version a bunch faster
139.15user 0.06system 2:20.39elapsed 99%CPU (0avgtext+0avgdata 88616maxresident)k
about 2x faster
SmokeMachine IOninja: ok... Ill do that next time... this time some one accepted before me... 17:04
IOninja Yeah, you can't beat the speed of a... NINJA! 17:05
SmokeMachine en.wikipedia.org/wiki/Masaaki_Hatsumi 17:06
IOninja: thanks!
haxmeister hello perl6 17:08
IOninja \o
haxmeister wondering can someone direct me to info on how to extract a file name only from an IO::Path object 17:09
sena_kun haxmeister, .Str?
haxmeister for instance I get /sys/bus/pci/devices/0000:00:1b.0".IO and only want the file name out of that (preferrable without regex) 17:10
perlpilot File::Basename? 17:10
haxmeister basename 17:10
ilmari .basename?
haxmeister that's prolly it thanks
perlpilot oh ... thought I was on #perl for a second
haxmeister \o/
IOninja haxmeister: it can be handy to look at methods offered by the type... 17:13
m: "/sys/bus/pci/devices/0000:00:1b.0".IO.^name.say 17:14
camelia IO::Path
IOninja haxmeister: ^ so that's the type, that means you can visit docs.perl6.org/type/IO::Path and in the table of contents you can see all the methods you can call
m: "/sys/bus/pci/devices/0000:00:1b.0".IO.^methods».name.say
camelia (BUILD new-from-absolute-path new abspath is-absolute is-relative parts volume dirname basename extension Numeric Bridge Int succ pred IO open pipe watch absolute relative cleanup resolve parent child chdir rename copy move chmod unlink symlink link mkdi…
IOninja ^ or do that :)
IOninja gives a sideways glance to new-from-absolute-path 17:15
IOninja perlpilot: so what was your mathy solution? 17:16
tony-o SmokeMachine: i'm still trying to find the problem in my cron jobs - 17:27
all of your repos are on my server
in the DB, even 17:29
SmokeMachine tony-o: strange: modules.zef.pm/search?terms=Fuzz should return the same of modules.perl6.org/?q=Fuzz shouldn't? 17:30
tony-o it should, in some cases, return more
i'm taking a look, there is definitely something not quite right
thank you for saying something about it, too SmokeMachine++ 17:31
SmokeMachine tony-o: :) 17:31
IOninja is mildly dissapointed .map: *..* don't work :( 17:34
.map: {$^a..$^b} just doesn't have the same ring to it
perlpilot IOninja: essentially the same thing as what SO had. sub mysum($n,$d) { my $f = floor($n/$d); (($f*$d + $d) * $f) / 2 } I didn't factor it on the fly 17:35
IOninja m: sub mysum($n,$d) { my $f = floor($n/$d); (($f*$d + $d) * $f) / 2 }; say mysum 10000, 5 17:37
camelia 10005000
IOninja m: sub mysum($n,$d) { my $f = floor($n/$d); (($f*$d + $d) * $f) / 2 }; say mysum 10000000, 5
camelia 10000005000000
IOninja perlpilot: which SO had?
IOninja m: sub mysum($n,$d) { my $f = floor($n/$d); (($f*$d + $d) * $f) / 2 }; say mysum 10000000, 3|5 17:38
camelia any(16666668333333, 10000005000000)
IOninja heh
SmokeMachine IOninja: perlpilot: what means SO on that context?
IOninja SmokeMachine: StackOverflow
the website
SmokeMachine IOninja: ok, thanks!
IOninja perlpilot: I'm cooking up a multi-core solution, for fun, pretty sexy one-liner 17:39
perlpilot cool
IOninja: as for which SO ... the one where summing numbers divisible by 7 up to 1000 17:40
IOninja perlpilot: ah. I guess it went over my head. My code version of it took forever to run 17:41
m: gist.github.com/zoffixznet/fb63596...8e8e05d4f9 17:42
camelia 10005000
IOninja I wish that uggo map was (*^..*) :)
sena_kun this was the first google link, I think, you can pretty easy find a solution for numbers divisible by 5.
sena_kun *easily 17:44
ilmari waves at timeless :) 17:47
timeless hi
but didn't i agree w/ you on something else in postgres too? 17:48
(my index is much weaker than your average database's ...)
dylanwh so stronger than mysql? 17:49
timeless i'm amazed at how the email and database people try to manage patches...
tony-o SmokeMachine: figured out the problem, now i need to figure out how to fix it :-) 17:49
timeless dylanwh: i lose data much faster than mysql
:-)
timotimo wow, that's concerning 17:50
dylanwh mutters about "3-byte utf8"
timeless has touched those
dylanwh I'm going to support HTML, but I'm not going to handle > or & symbols. I'll just silently truncate when I encounter them. </rant> 17:51
ilmari timeless: are you a colleague of dylanwh's? (guessing purely based on the firefox/developer cloak) 17:51
RabidGravy ilmari! 17:52
ilmari RabidGravy: \o/
small world!
dylanwh timeless and I have never worked on the same thing at the same time, but I guess he's like bugzilla family as well as mozilla family. ;) 17:53
perlpilot
.oO( How big did you think the Perl echo chamber was? )
timeless yes
dylanwh (I'm assuming he, sorry if that is wrong. bad me!)
timeless that's about right
same me
although dylanwh seems to be missing his cloak?
or am i able to see through it since we're sharing a cloak?
timeless hasn't really thought about freenode cloaks much 17:54
dylanwh: btw, i was amused that bugzilla had better emoji support than jira
dylanwh I never bothered setting anything like that up
RabidGravy I've been working at the same place as ilmari since October and I only saw him for the first time last Friday
dylanwh 2600:3c03::f03c:91ff:fe33:4998 should resolve back to hardison.net but I think I broke that.
timeless dylanwh: historically reed could get you one
ilmari RabidGravy: well, same company, different office
timeless dylanwh: well, hardison.net forward resolves to it 17:55
dylanwh timeless: we have better performance too. And getting better. :-)
timeless dylanwh: and better ui imo
timeless is biased
timeless hates jira
dylanwh haha, that is debateable. I h ope to fix that a lot this year.
somehow, with less resources.
timeless personally i don't like ajax (hrm, is that out of style?) 17:56
timeless and i really hate the way jira makes it so easy for people to create custom incomprehensible / unusable workflows 17:58
ilmari got bit by that today
moritz I work with a jira with a rather good admin, and quite like it 17:59
ilmari I dragged a ticket from the "in review" column on the agile board to "done", and the state changed to "dropped" instead
moritz: a well-managed jira instace can be tolerable
and because the dropped state has no outbound transitions, it can't be fixed (even by an admin)
moritz there are some quirks (like not seeing the recipients of an email sent to an issue), but the UI is better than that of competing products, IMHO
moritz (and we only use it internally, not with customers having direct access) 18:00
IOninja perlpilot: I improved on it: d * sum 1..n div d;
SmokeMachine tony-o: \o/ 18:03
tony-o SmokeMachine: apparently 'perl perl perl perl <scriptname>' is not an appropriate way to run a perl script - your stuff is showing up now eh 18:05
tony-o looking at your comp of ?q=<str> - modules.perl6.org will return differently because it looks like it's doing a little fuzzy matching 18:06
timeless moritz: i'm the admin 18:08
but ime, the admin is never the problem 18:09
it's always the person who's "managing workflow"
moritz can non-admins manage workflow? 18:10
timeless it doesn't matter :)
moritz ah
timeless if the admin is asked to set up a stupid workflow
do you blame the admin?
(please don't!)
arnsholt JIRA is kind of like make, IME. Terrible, but all of the alternatives are worse 18:12
IOninja Hm, why does .race's :degree default to measly 4? 18:14
no wonder I'm not getting any juice! 18:15
IOninja craaaao 18:20
*craaap
My brilliant code that uses 32 cores is... 18:21
m: say 19.549/5.143
camelia 3.801089
IOninja is almost 4 times SLOWER than when not using any concurrency :/
Wonder if that's due to .race's bustitude
IOninja Unless I'm doing something wrong. here's the code: gist.github.com/zoffixznet/bcd5eba...cde4205ae6 18:22
Nope, changing it to using Promises is slow as hell too 18:25
Even worse with promises... 18:26
m: say 0m28.052s/5.143 18:27
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3say 07⏏5m28.052s/5.143
cale2 IOninja: Honestly I've noticed that concurrency can be slower even on erlang. It depends on the use case quite a bit I think
IOninja m: say 28.052/5.143
camelia 5.454404
IOninja camelia: yeah, when all you got is 4 cores, not 32 18:28
cale2 There were a couple of modules in the ecosystem that used oauth1. I want to break that out into a separate thing module. can anyone point me to the modules I'm thinking of?
IOninja buggable: eco Twitter 18:30
buggable IOninja, Twitter 'Twitter API': github.com/zoffixznet/perl6-Twitter
IOninja that one has a OAuth1 module inside of it
*OAuth1-that's-enough-to-auth-to-Twitter module...
cale2 Yep, thanks! 18:31
IOninja eh, screw it. I'm using a very low N and I'd guess the threading overhead just trumps the gains. Can't be bothered to wait on this thing for larger Ns 18:33
tony-o is oauth2 something sought after for p6? i have a module partially written on the server side but i could make it work for client side first .. 18:43
IOninja Isn't oauth2 pretty widely in use? So I'd say, yes. 18:44
cale2 Should oauth1 and oauth2 both be in an Auth:: namespace? 18:46
Auth::Oauth1, Auth::Oauth2, Auth::SAML, etc
IOninja Why? 18:47
What's the point of making programmer type all this extra cruft.
cale2 How else would it be organized?
IOninja OAuth1, OAuth2 done
using tags in the metafile
cale2 I didn't know how that worked. On CPAN things seem to be organized under larger namespaces 18:48
IOninja design.perl6.org/S22.html#tags
cale2 almost like folders
IOninja Yeah, and the result is modules with giant names: metacpan.org/pod/POE::Component::I...ingItWrong 18:49
No one cares if your module begins with WWW:: or WebService:: anymore. They just search metacpan for stuff. The extra prefixes is just extra code you have to type each time you use the module. 18:51
cale2 ncie 18:51
nice
RabidGravy most unproductive day of working from home EVAH! 19:13
IOninja RabidGravy: get cracking! 19:17
IOninja snaps the whip
RabidGravy I spent several hours trying to get the vagrant box working 19:25
IOninja heh
lizmat aaahh... spectest failures were caused by setting / roast mismatch 19:32
IOninja \o/ 19:40
SmokeMachine tony-o: \o/ thanks!
SmokeMachine tony-o: does it get the documentation from pod? 19:40
cale2 tony-o: do you have a Server::Router that works with your Async server? 19:51
hankache hello #perl6 19:52
moritz \o 19:55
RabidGravy cale2, he does bur I can't remember what it's called 19:58
TimToady IOninja: yeah, a bit like having to say 'use Math', when math just exists 20:00
yoleaux 16:18Z <raiph> TimToady: Imo it would work well if you provided a short answer to www.perlmonks.org/?node_id=3333;parent=1182520
cale2 Does my soda machine metaphor hold up here: github.com/WildYorkies/peregrinati...s-iosocket 20:07
and what about here: github.com/WildYorkies/peregrinati...ocketasync
SmokeMachine tony-o: here: modules.zef.pm/profile/Fernando%20C...20Oliveira the last line (probably representing the DataTime::Extended) is empty... 20:30
robertle docs.perl6.org/language/modules says that "sub bar is export(:other) { ... }" is the same as "my package EXPORT::other { ... } " 21:09
so what is the equivalent to "sub bar is export(:other, :another)" ?? 21:10
I want to use the my package trick, but want to put in "DEFAULT" and "oop"...
jnthn robertle: You'd have to assign the sub explicitly into the other package. That's why there's an `is export` trait to do this for you. ;-) 21:11
robertle right, "is export" looks nicer, but can I do that without a "unit" at the top? 21:12
I am not sure what I want is the right thing to do, but I want a module that provides a role or a method, depending on whether you choose the oop part r the procedural 21:13
now if my .pm6 has no "module" at the top, I can just put my role/class in it and if you "use" the moduleyou get the role
if I have a "unit" at the top, it puts the class/role into that namespace... 21:14
jnthn tiredly tries to figure it out :) 21:15
robertle not sure I explain it well
jnthn I guess you know about being able to do `my role Foo is export(:oop) { }`
Where Foo will only be exported via the tag?
robertle that's what I am trying to do
but if that's in a file with "unit module Bar" at the top, it becomes available as "Bar::Foo", rather than "Foo", right? 21:16
and without the "unit" at the top I don't seem to be able to do "is export", but I can do "my package..."
jnthn If you declare it with "my" it's a lexical class, and it will not be visible via the enclosing package
robertle right, so how do I make it available then. need some indirection... 21:17
jnthn m: module Foo { my class C is export(:oop) { } }; say Foo::<C>:exists; { import Foo :oop; say C }; 21:18
camelia False
(C)
jnthn m: module Foo { class C is export(:oop) { } }; say Foo::<C>:exists; { import Foo :oop; say C };
camelia True
(C)
robertle perhaps the whole tag thing is a red herring, it's more about having a role and some procedural stuff in the same package. is that a bad idea? 21:19
robertle if I don't do "module" at the top of my Foo.pm6 containing a role Foo, then I can do "use Foo" and have the role Foo available. 21:20
jnthn Not automatically. I mean, I've got modules that have a class and some subs available... :)
robertle just as if I had a "unit role Foo"
but the .pm6 is not a role, so I can also have procedural bits
can you give me an example of such a module? 21:21
jnthn It's a class rather than a role, but github.com/jnthn/p6-concurrent-ite...erator.pm6 comes to mind
robertle perfect example! so you want to be able to "use Concurrent::Iterator", right? 21:22
jnthn That's how you use it, yes 21:24
robertle how could you tag the class and the subs in that file? so that when you "use Concurrent::Iterator :oop", you only get the class, "use C::I :proc" gets you the procedures? 21:25
jnthn Had to try that to check ;) 21:30
robertle differnet take again: "unit role ofenrohr" is the same as "role ofenrohr is export {" plus a "}" at the end of the file, right?
so is there a way to add a tag to the implicit export from the "unit" line? 21:31
jnthn Here's the trick, anyway: gist.github.com/jnthn/49bf86b9ece4...3daafba020
robertle so is there a way to add a tag to the implicit export from the "unit" line?
sorry
moritz robertle: you could try "also is export(:FOO)" 21:31
dunno if that works
jnthn moritz++ 21:32
Yeah, you can't have "my unit module"
In general, though, I don't think having qualified names available "by default" is a particularly problematic thing. 21:33
robertle right, so I would have a "unit role" that also has a sub with "is export" in it. I get the role and the sub, no need to :oop or :proc 21:35
robertle docs.perl6.org/language/modules also talks about :ver and :auth on the unit line, is that really a good thing? given META6.json? 21:37
jnthn I tend to just put them in META6.json 21:38
robertle great, this stuff works now! thanks! 21:45
jnthn :) 21:49
alphah Hello Perl6 21:51
moritz \o
alphah say I have # program.p6 takes 0 or more of configs args set (conf1 param1, conf2 param2, conf3 is Bool), and 0 or 1 command of commands set (command 1, command2,...). how to implement that in one MAIN function where I can run my program ass: $ program.p6 # all args are optional; program.p6 Command1 # config args not specified; program.p6 conf1 param1 conf2 param2 Command
moritz alphah: the usual way is to implement the different cases as multis 21:52
alphah: multi sub MAIN(:$conf1, :$conf2, Bool :$conf3) { ... }; multi sub MAIN('command1') { }; etc 21:53
alphah: perlgeek.de/blog-en/perl-6/2016-bo...erter.html has an example 21:54
alphah Thanks moritz, I will review these examples, I was checking if there are other way to do that, I will have to add a multi MAIN for each Command I add to the program and I will end up with many multis 21:56
moritz alphah: if that's impractical, you might want to investigate more traditional command line parsers (not the built-in MAIN stuff) 21:57
perlpilot alphah: If you didn't use multis you would end up with a "big switch" somewhere that maybe calls many subroutines.
moritz modules.perl6.org/#q=getopt
actually, modules.perl6.org/#q=getopt # :-) 21:58
alphah Thanks for the quick response guys, I will definitely look at these options and choose what works best for me 21:59
jnthn In one of my larger Perl 6 apps, my mutli MAIN subs are all pretty tiny, and delegate off to an object that does the processing and shares lots of the commonalities 22:00
jnthn The the MAIN subs do little more than specify the CLI 22:01
*So the
IOninja buggable: eco getopt 22:04
buggable IOninja, Found 6 results: Getopt::Tiny, Getopt::Long, Getopt::Type, Getopt::Kinoko, Getopt::Std. See modules.perl6.org/#q=getopt
IOninja buggable: eco getopt 22:06
buggable IOninja, Found 6 results: Getopt::Tiny, Getopt::Long, Getopt::Type, Getopt::Kinoko, Getopt::Std. See modules.perl6.org/#q=getopt
IOninja \o/ 22:07
tony-o cale2: HTTP::Router should work with HTTP::Server::Async 23:12