Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-07-01

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 buggable ???????????? It's time for the monthly Accidental /win Lottery ???????????? We have 4 ballots submitted by 3 users! DRUM ROLL PLEASE!...
00:00 buggable And the winning number is 28! Congratulations to jnthn! You win a roll of duck tape!
00:00 AlexDaniel XD
00:12 * zengargoyle FML - "thanks @zengargoyle ! been looking for a replacement for something like FocusMe on win/mac, this is the closest iv'e found so far so will continue giving it a shot"
00:18 * zengargoyle expects i will have to write a non-gui version.  this person listened to my non-documented hack-arounds, isn't afraid of the Terminal and sudo and editing YAML files and still wants that thing i made on a whim in response to some random post on a Q&A site.
00:20 * zengargoyle that i never actually used myself because knowing how it works negates the reason for it's existance. aaarrrrggghhh.
00:53 dubi0us joined #perl6
00:55 astj joined #perl6
01:17 ugexe m: class Foo { has %.hash handles <AT-KEY>; multi method AT-KEY($key where {$_ eq 'foo'}) { say "Got foo"; nextsame(); }; }
01:17 camelia rakudo-moar 047464: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Package 'Foo' already has a method 'AT-KEY' (did you mean to declare a multi-method?)␤at <tmp>:1␤»
01:18 ugexe is there a way to make the handles play nice with the multi?
01:22 bjz joined #perl6
01:32 dubi0us joined #perl6
01:32 geekosaur I don't think that does what you want
01:33 geekosaur "handles" trait defines AT-KEY in Foo to do AT-KEY in %.hash
01:33 geekosaur oh, I see, you want overrideable. I think you have to do that by hand
01:34 geekosaur just as you would have to define your own accessors instead of somehow modifying the autogenerated ones with has $.whatever
01:41 astj joined #perl6
01:47 bjz joined #perl6
01:48 ilbot3 joined #perl6
01:48 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:49 BenGoldberg joined #perl6
01:52 aindilis joined #perl6
01:59 dubi0us joined #perl6
02:17 raschipi joined #perl6
02:18 dubi0us joined #perl6
02:18 noganex_ joined #perl6
02:26 astj joined #perl6
02:28 astj joined #perl6
02:32 bjz joined #perl6
02:32 dubi0us joined #perl6
02:34 aborazmeh joined #perl6
02:34 aborazmeh joined #perl6
02:50 dubi0us joined #perl6
02:58 dubi0us_ joined #perl6
03:06 Cabanossi joined #perl6
03:10 literal_ joined #perl6
03:21 dubi0us joined #perl6
03:26 Actualeyes joined #perl6
03:34 bwisti joined #perl6
03:40 bjz joined #perl6
03:49 araraloren joined #perl6
03:50 dubi0us joined #perl6
03:55 bjz joined #perl6
03:56 astj joined #perl6
03:59 dubi0us joined #perl6
04:03 Cabanossi joined #perl6
04:17 dubi0us joined #perl6
04:19 wamba joined #perl6
04:23 mcmillhj joined #perl6
04:25 aquila-chrysaeto joined #perl6
04:27 dubi0us joined #perl6
04:34 Cabanossi joined #perl6
04:38 dubi0us joined #perl6
04:41 astj joined #perl6
04:42 astj joined #perl6
04:48 dubi0us joined #perl6
05:06 aborazmeh joined #perl6
05:06 aborazmeh joined #perl6
05:11 llfourn joined #perl6
05:21 dubi0us joined #perl6
05:22 mcmillhj joined #perl6
05:27 dubi0us joined #perl6
05:38 dubi0us joined #perl6
05:41 kaare_ joined #perl6
05:43 astj joined #perl6
05:48 dubi0us joined #perl6
05:58 dubi0us joined #perl6
06:00 Geth ¦ DBIish: d9378416c0 | (Alexey Melezhik)++ (committed using GitHub Web editor) | README.pod
06:00 Geth ¦ DBIish: An example how to pass dbname as file for qqlite
06:00 Geth ¦ DBIish:
06:00 Geth ¦ DBIish: I took me some time to understand how can I do this.
06:00 Geth ¦ DBIish: review: https://github.com/perl6/DBIish/commit/d9378416c0
06:00 Geth ¦ DBIish: c46dfe5821 | (Alexey Melezhik)++ (committed using GitHub Web editor) | README.pod
06:00 Geth ¦ DBIish: Fix typo
06:00 Geth ¦ DBIish: review: https://github.com/perl6/DBIish/commit/c46dfe5821
06:00 Geth ¦ DBIish: e658df8846 | (Salvador Ortiz)++ (committed using GitHub Web editor) | README.pod
06:00 Geth ¦ DBIish: Merge pull request #94 from melezhik/master
06:00 Geth ¦ DBIish:
06:00 Geth ¦ DBIish: An example how to pass dbname as file for sqlite
06:00 Geth ¦ DBIish: review: https://github.com/perl6/DBIish/commit/e658df8846
06:07 dubi0us joined #perl6
06:17 domidumont joined #perl6
06:19 dubi0us joined #perl6
06:19 Cabanossi joined #perl6
06:19 astj joined #perl6
06:22 astj_ joined #perl6
06:24 domidumont joined #perl6
06:28 dubi0us joined #perl6
06:34 |oLa| joined #perl6
06:37 dubi0us joined #perl6
06:38 rindolf joined #perl6
06:40 espadrine joined #perl6
06:47 dubi0us joined #perl6
06:51 abraxxa joined #perl6
06:54 darutoko joined #perl6
06:58 dubi0us joined #perl6
07:07 dubi0us joined #perl6
07:14 setty1 joined #perl6
07:19 dubi0us joined #perl6
07:30 dubi0us joined #perl6
07:34 huf joined #perl6
07:39 dubi0us joined #perl6
07:40 astj joined #perl6
07:48 dubi0us joined #perl6
07:57 dubi0us_ joined #perl6
08:00 astj joined #perl6
08:01 astj joined #perl6
08:04 Cabanossi joined #perl6
08:08 dubi0us joined #perl6
08:09 domidumont joined #perl6
08:15 kaare_ joined #perl6
08:16 kurahaupo joined #perl6
08:17 dubi0us joined #perl6
08:28 dubi0us joined #perl6
08:34 bjz joined #perl6
08:35 FROGGS joined #perl6
08:37 kyan joined #perl6
08:38 dubi0us joined #perl6
08:49 Cabanossi joined #perl6
08:58 dubi0us joined #perl6
09:02 mcmillhj joined #perl6
09:03 kaare_ joined #perl6
09:03 bjz joined #perl6
09:10 dubi0us joined #perl6
09:16 kaare__ joined #perl6
09:18 dubi0us joined #perl6
09:19 pmurias joined #perl6
09:20 mcmillhj joined #perl6
09:23 astj joined #perl6
09:28 dubi0us joined #perl6
09:28 lichtkind_ joined #perl6
09:37 kurahaupo joined #perl6
09:37 sjoshi joined #perl6
09:39 dubi0us joined #perl6
09:48 dubi0us joined #perl6
09:49 parv joined #perl6
09:56 mcmillhj joined #perl6
09:58 dubi0us joined #perl6
09:58 cpage__ joined #perl6
10:11 Geth ¦ doc: f682cd6abb | (Jan-Olof Hendig)++ | doc/Language/io-guide.pod6
10:11 Geth ¦ doc: Indentation fixes
10:11 Geth ¦ doc: review: https://github.com/perl6/doc/commit/f682cd6abb
10:18 dubi0us joined #perl6
10:23 bjz_ joined #perl6
10:27 dubi0us joined #perl6
10:40 baar joined #perl6
10:40 baar hello all. One question about sigils:
10:41 baar in Python I can create class with methofs typical for some containers. But without to extend base container type
10:41 baar for example iterable but without setting. Or with indexable getter but without setting and other combinations
10:42 dubi0us joined #perl6
10:43 baar This mean that I can not say what is it: list, hash or something else. So if I can do the same in Perl, what sigil I should use for such instances? How to select sigil?
10:43 baar I mean Perl6 sure
10:44 mr-foobar joined #perl6
10:46 notbenh joined #perl6
10:46 jnthn You can put anything in a $ so that's always an option.
10:47 jnthn @ means "I can index into it like @a[...]"; you don't have to subclass anything, just do the Positional role. The role for % is associative and means "I can index into it like %h{...}"
10:47 jnthn *Associative
10:48 jnthn m: my %h is BagHash # an example of an Associative built-in that's not Hash
10:48 camelia rakudo-moar 047464: ( no output )
10:48 jnthn m: say BagHash ~~ Hash
10:48 camelia rakudo-moar 047464: OUTPUT: «False␤»
10:49 jnthn https://docs.perl6.org/language/subscripts#Custom_types may be useful also
10:50 timotimo hmm, if BagHash isn't Hash, maybe it should be called something different. maybe HashyBag :D
10:50 llfourn m: say BagHash ~~ Map
10:50 camelia rakudo-moar 047464: OUTPUT: «False␤»
10:52 travis-ci joined #perl6
10:52 travis-ci Doc build passed. Jan-Olof Hendig 'Indentation fixes'
10:52 travis-ci https://travis-ci.org/perl6/doc/builds/249069522 https://github.com/perl6/doc/compare/e2754690c9ba...f682cd6abb90
10:52 travis-ci left #perl6
10:56 bjz joined #perl6
10:57 dubi0us joined #perl6
11:05 khw joined #perl6
11:07 dubi0us joined #perl6
11:17 dubi0us joined #perl6
11:18 lizmat m: say BagHash ~~ QuantHash   # timotimo
11:18 camelia rakudo-moar 3058ba: OUTPUT: «True␤»
11:20 llfourn .oO(maybe it should be called QuantHashy)Oo
11:24 timotimo :)
11:25 lizmat .oO( QuantyHash )
11:26 dubi0us joined #perl6
11:30 domidumont joined #perl6
11:34 timotimo HantyQuash
11:38 dubi0us joined #perl6
11:47 giraffe joined #perl6
11:47 giraffe joined #perl6
11:47 dubi0us joined #perl6
11:49 Cabanossi joined #perl6
11:56 dubi0us joined #perl6
12:06 dubi0us joined #perl6
12:17 dubi0us joined #perl6
12:27 dubi0us joined #perl6
12:36 dubi0us joined #perl6
12:45 dubi0us joined #perl6
12:49 Cabanossi joined #perl6
12:57 dubi0us joined #perl6
12:58 colomon_ joined #perl6
12:59 bjz joined #perl6
13:06 dubi0us joined #perl6
13:17 dubi0us joined #perl6
13:24 robertle joined #perl6
13:26 dubi0us_ joined #perl6
13:28 colomon joined #perl6
13:33 bjz joined #perl6
13:37 dubi0us joined #perl6
13:39 sacomo hi #perl6
13:46 lucasb joined #perl6
13:47 dubi0us joined #perl6
13:48 rindolf sacomo: moose!
13:49 rindolf sacomo: sup?
13:49 sacomo ola
13:49 sacomo looks like everyone is sleeping
13:49 lucasb yo
13:49 sacomo konbanwa
13:50 sacomo are either of you familiar with match?
13:51 sacomo when I return a list of matches the results are wrapped in 「」 brackets
13:52 lucasb you want just the string matched, not the match object?
13:52 sacomo is the best way to get thos to Str to just use .Str?
13:52 sacomo yeah, is there a better way? like some option I can pass to match?
13:53 lucasb yes, I would guess calling .Str on it is the way to go
13:53 jnthn Can also stringify them with the ~ prefix operator, or if you just use them in a context that wants a Str then you'll get that
13:54 jnthn fwiw, in Perl 6 a Match is an object (and nested matches form a tree)
13:54 sacomo ok, thanks.
13:55 jnthn And it's the .gist method that does the formatted output (which is used by `say`)
13:55 jnthn If using, for example, `put` instead of `say`, which just outputs the string value, then you'd also get them without that
13:56 sacomo the ~ prefix is simple
13:56 sacomo ok, that is good to know
13:56 dubi0us joined #perl6
13:58 sacomo m: say "the quick brown fox".match(/ 'quick'|'brown' /, :g).map({.Str});
13:58 camelia rakudo-moar 75e87d: OUTPUT: «(quick brown)␤»
13:59 sacomo m: say "the quick brown fox".match(/ 'quick'|'brown' /, :g).map({~$_});
13:59 camelia rakudo-moar 75e87d: OUTPUT: «(quick brown)␤»
14:00 jnthn m: say ~<< "the quick brown fox".match(/ 'quick'|'brown' /, :g)
14:00 camelia rakudo-moar 75e87d: OUTPUT: «(quick brown)␤»
14:01 sacomo ooh
14:01 sacomo I like that
14:02 bjz_ joined #perl6
14:04 Cabanossi joined #perl6
14:04 dubi0us joined #perl6
14:09 dubi0us joined #perl6
14:19 leont joined #perl6
14:45 mr-fooba_ joined #perl6
14:47 andrzejku joined #perl6
14:49 araraloren I want make a clone method for my class. Should I clone the parent class first or after child class ?
15:03 jsoo_ joined #perl6
15:05 pilne joined #perl6
15:11 dubi0us joined #perl6
15:13 Ven joined #perl6
15:16 dubi0us_ joined #perl6
15:19 Cabanossi joined #perl6
15:22 Ven_ joined #perl6
15:25 zakharyas joined #perl6
15:26 dubi0us joined #perl6
15:31 araraloren :)
15:33 dubi0us joined #perl6
15:36 dubi0us joined #perl6
15:39 Celelibi joined #perl6
15:41 dubi0us joined #perl6
15:42 dubi0us_ joined #perl6
15:42 ptolemarch joined #perl6
15:49 [particle] joined #perl6
15:51 domidumont joined #perl6
15:51 Rawriful joined #perl6
15:59 mniip joined #perl6
16:03 bjz joined #perl6
16:08 dubi0us joined #perl6
16:09 lichtkind_ joined #perl6
16:12 timotimo the built-in clone doesn't do what you need it to? you need deep cloning semantics?
16:13 FROGGS araraloren: usually you care about dependencies first (in a recursive manner)... but I dunno what your use-case is, and whet difference there is
16:13 araraloren timotimo, yeah right, I want a deep clone
16:14 timotimo with a clone you won't likely have any inter-attribute dependencies?
16:14 timotimo you just set all the attributes?
16:15 araraloren I want figure out what is the right way to do it .
16:16 araraloren m: class B { has $.s; method clone(*%_) { self.bless(s => %_<s> // $!s.clone); } }; class A is B { has @.a; method clone(*%_) { self.bless(a => %_<a> // @!a.clone()); }; }; my $a = A.new(a => [1, 2, 3], s => 8); my $b = $a.clone(); $a.a.push(23);say $b;
16:16 camelia rakudo-moar c56f0a: OUTPUT: «A.new(a => [1, 2, 3], s => Any)␤»
16:17 dubi0us joined #perl6
16:17 araraloren m: class B { has $.s; method clone(*%_) { self.bless(s => %_<s> // $!s.clone); } }; class A is B { has @.a; method clone(*%_) { self.bless(a => %_<a> // @!a.clone()); nextwith(|%_); }; }; my $a = A.new(a => [1, 2, 3], s => 8); my $b = $a.clone(); $a.a.push(23);say $b;
16:17 camelia rakudo-moar c56f0a: OUTPUT: «A.new(a => [], s => 8)␤»
16:19 wamba joined #perl6
16:19 Cabanossi joined #perl6
16:28 dubi0us joined #perl6
16:29 bwisti joined #perl6
16:34 BenGoldberg joined #perl6
16:36 BenGoldberg What's the syntax for declaring a C struct with a fixed-length array embeded in it?  my class Foo is repr('CStruct') { HAS ... }
16:37 timotimo we don't have that yet :(
16:37 zengargoyle m: my %h = <foo bar>; %h{*}.[0]
16:37 camelia rakudo-moar c56f0a: ( no output )
16:37 zengargoyle m: my %h = <foo bar>; %h{}.[0]
16:37 camelia rakudo-moar c56f0a: ( no output )
16:37 dubi0us joined #perl6
16:37 zengargoyle m: my %h = <foo bar>; %h{*}.[0].say
16:37 camelia rakudo-moar c56f0a: OUTPUT: «bar␤»
16:37 zengargoyle m: my %h = <foo bar>; %h{}.[0].say
16:37 camelia rakudo-moar c56f0a: OUTPUT: «{foo => bar}␤»
16:40 zengargoyle jnthn: «make ($<style1> // $<style2> // $<style3>).ast» -- once upon a time... i did «make $/{*}.[0].made» for the same sort of thing.  decent approach or not?
16:42 zengargoyle guess now that would be $/{*}.first.made. :)
16:44 timotimo yeah, or [//] @$/{*}
16:44 * zengargoyle tots wishes i had remembered this before now.  guess that will go into plan-e of my `at` parser. :P
16:45 zengargoyle in grammar, only one thing will be there....
16:45 xinming joined #perl6
16:46 zengargoyle you just don't know which one thing you got...
16:46 timotimo the thing is that to get the .made you'd need to put parens around
16:46 timotimo or
16:46 Mithaldu joined #perl6
16:46 timotimo "made [//] @$/{*}:"
16:46 timotimo okay, so how about this, though:
16:47 timotimo m: my %result = :99style2; say %result{*}:kv:value.perl;
16:47 camelia rakudo-moar c56f0a: OUTPUT: «Failure.new(exception => X::Adverb.new(what => "slice", source => "\%result", unexpected => ["value"], nogo => ["kv"]), backtrace => Backtrace.new)␤»
16:47 timotimo whoops?
16:47 timotimo m: my %result = :99style2; say %result{*}:pair:value.perl;
16:47 camelia rakudo-moar c56f0a: OUTPUT: «Unexpected named argument 'pair' passed␤  in block <unit> at <tmp> line 1␤␤»
16:47 timotimo m: my %result = :99style2; say %result{*}:pairs:value.perl;
16:47 camelia rakudo-moar c56f0a: OUTPUT: «Unexpected named argument 'pairs' passed␤  in block <unit> at <tmp> line 1␤␤»
16:47 timotimo m: my %result = :99style2; say %result{*}:p:value.perl;
16:47 camelia rakudo-moar c56f0a: OUTPUT: «Failure.new(exception => X::Adverb.new(what => "slice", source => "\%result", unexpected => ["value"], nogo => ["p"]), backtrace => Backtrace.new)␤»
16:47 zengargoyle :" -- ? i don't get this...
16:47 timotimo what's that one called again
16:47 dubi0us joined #perl6
16:47 timotimo oh, that's the indirect method call syntax
16:48 timotimo it's for people who really want to write "new MyClass: 1, 2, 3"
16:48 timotimo m: my %result = :99style2; say %result{*}:value;
16:48 camelia rakudo-moar c56f0a: OUTPUT: «Unexpected named argument 'value' passed␤  in block <unit> at <tmp> line 1␤␤»
16:48 timotimo m: my %result = :99style2; say %result{*}:values;
16:48 camelia rakudo-moar c56f0a: OUTPUT: «Unexpected named argument 'values' passed␤  in block <unit> at <tmp> line 1␤␤»
16:49 timotimo there totally was an adverb like that
16:49 timotimo i have no idea what it was
16:49 timotimo m: my %result = :99style2; say %result{*}:v;
16:49 camelia rakudo-moar c56f0a: OUTPUT: «(99)␤»
16:49 timotimo actually, when you have {*} :v makes no sense because you already only get that
16:49 zengargoyle if you match and hit the action, you're going to have a $/ with a $/<something> = Match
16:49 timotimo the stuff that didn't go into the match don't even end up in the match object
16:50 timotimo instead of $/{*}.[0] you can also $/.values.head
16:50 zengargoyle m: my %result = :99style2; say %result{*};
16:50 camelia rakudo-moar c56f0a: OUTPUT: «(99)␤»
16:50 zengargoyle {*} gives you values, {} gives you pairs....
16:51 timotimo did you want the name of the thing matched?
16:51 bjz joined #perl6
16:51 zengargoyle no, just the thing... the $whatever.made is the only really important part in this case.
16:52 timotimo right, so %result.values.head.made?
16:52 timotimo hm, i wonder
16:52 zengargoyle yeah, or %result{*}.first.made
16:52 zacts joined #perl6
16:52 timotimo m: my %result = :99foo; say head values %result:::
16:52 camelia rakudo-moar c56f0a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    head used at line 1␤␤»
16:53 timotimo m: my %result = :99foo; say (head (values %result:):):
16:53 camelia rakudo-moar c56f0a: OUTPUT: «99␤»
16:53 timotimo :) :)
16:53 zengargoyle (that's pretty much what i did recently before i remembered the {*}.[0] thing....
16:57 dubi0us joined #perl6
16:57 zengargoyle m: my %h = <foo bar>; for %h{}.[0].kv -> $k, $v { say "$k -> $v" }
16:57 camelia rakudo-moar c56f0a: OUTPUT: «foo -> bar␤»
17:00 zengargoyle m: my %h = <foo bar>; for %h{}.[0] -> $p { say "$p.key() -> $p.value()" }
17:00 camelia rakudo-moar c56f0a: OUTPUT: «foo -> bar␤»
17:00 zengargoyle howto -> $k, $v { ... }
17:01 timotimo how do you mean?
17:02 zengargoyle m: my %h = <foo bar>; for %h{}.[0] -> $k, $v { say "$k -> $v" }
17:02 camelia rakudo-moar c56f0a: OUTPUT: «Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
17:02 zengargoyle m: my %h = <foo bar>; for %h{}.[0] -> $k => $v { say "$k -> $v" }
17:02 camelia rakudo-moar c56f0a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix > instead␤at <tmp>:1␤------> 3my %h = <foo bar>; for %h{}.[0] -> $k =>7⏏5 $v { say "$k -> $v" }␤»
17:02 zengargoyle m: my %h = <foo bar>; for %h{}.[0] -> ($k, $v){ say "$k -> $v" }
17:02 camelia rakudo-moar c56f0a: OUTPUT: «Too few positionals passed to ''; expected 2 arguments but got 0 in sub-signature␤  in block <unit> at <tmp> line 1␤␤»
17:02 zengargoyle m: my %h = <foo bar>; for %h{}.[0] -> ($k => $v){ say "$k -> $v" }
17:02 camelia rakudo-moar c56f0a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix > instead␤at <tmp>:1␤------> 3y %h = <foo bar>; for %h{}.[0] -> ($k =>7⏏5 $v){ say "$k -> $v" }␤»
17:02 timotimo m: my %h = <foo bar>; say %h{}.perl
17:02 camelia rakudo-moar c56f0a: OUTPUT: «{:foo("bar")}␤»
17:02 zengargoyle sorta like that
17:02 timotimo looks like %h{} just returns %h
17:03 timotimo a zen-slice, like @foo[]
17:03 zengargoyle ah
17:04 perigrin joined #perl6
17:05 timotimo m: my %h = <foo bar>; my ($k, $v) = %h.kv; say $k.perl; say $v.perl
17:05 camelia rakudo-moar c56f0a: OUTPUT: «"foo"␤"bar"␤»
17:06 araraloren so, There is no pretty way to do a clone for a child class ?
17:06 araraloren https://github.com/araraloren/perl6-terminal-table/blob/master/lib/Terminal/Table/String.pm6#L22
17:06 dubi0us joined #perl6
17:06 timotimo in that clone method you have there the result of self.bless is unused and just thrown away
17:07 araraloren Look at this String, it inherit from Str, also I know that clone maybe wrong.
17:07 araraloren Yeah, so what should I do..
17:08 timotimo i'd my $theclone = callsame; $theclone.style = $theclone.style.clone
17:08 timotimo of course you'll have to have accessors for $!style
17:08 araraloren I also have read some rakudo source code, but found no way.
17:08 timotimo oh
17:08 timotimo how about this
17:08 timotimo nextwith(|(%_, {style => self.style.clone}))
17:09 araraloren em, I will try
17:09 timotimo m: my %foo = :1bar, :2baz; sub sayparams(*%_) { say %_.perl }; sayparams(|(%foo, {style => 99}))
17:09 camelia rakudo-moar c56f0a: OUTPUT: «Too many positionals passed; expected 0 arguments but got 2␤  in sub sayparams at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
17:09 timotimo m: my %foo = :1bar, :2baz; sub sayparams(*%_) { say %_.perl }; sayparams(|%(%foo, {style => 99}))
17:09 camelia rakudo-moar c56f0a: OUTPUT: «{:bar(1), :baz(2), :style(99)}␤»
17:09 timotimo there we go
17:11 * zengargoyle sould have said make a .perl and EVAL. :)   method clone() { return EVAL self.perl } -- like.
17:12 araraloren timotimo, seems like you code is right, I will make more test
17:12 araraloren thanks
17:13 perigrin joined #perl6
17:13 araraloren s/you/your/
17:17 dubi0us joined #perl6
17:19 Cabanossi joined #perl6
17:27 dubi0us joined #perl6
17:33 bjz joined #perl6
17:35 nhywyll joined #perl6
17:37 dubi0us joined #perl6
17:37 zengargoyle m: my %h = <foo bar>; given %h.first -> (:key($k), :value($v)) { say "$k -> $v" }
17:37 camelia rakudo-moar c56f0a: OUTPUT: «foo -> bar␤»
17:38 zengargoyle that's what i was looking for.
17:47 dubi0us joined #perl6
17:53 bjz joined #perl6
17:57 dubi0us joined #perl6
17:59 jnthn zengargoyle: Hm, that's cute. %().first.made may also work (iirc %() is short for %($/))
18:06 zengargoyle m: grammar D { rule TOP { a+ | b+ { say "in TOP" } } }; say so D.parse("aaa");
18:06 camelia rakudo-moar c56f0a: OUTPUT: «True␤»
18:06 zengargoyle where's my "in TOP" ?
18:07 grumble joined #perl6
18:08 zengargoyle m: grammar D { rule TOP { a+ | b+ { make "in TOP" } } }; say D.parse("aaa").made;
18:08 camelia rakudo-moar c56f0a: OUTPUT: «No such method 'gist' for invocant of type 'NQPMu'. Did you mean 'isa'?␤  in block <unit> at <tmp> line 1␤␤»
18:10 zengargoyle m: grammar D { rule TOP { a+ | b+ { make "in TOP" } } }; say D.parse("bbb").made;
18:10 camelia rakudo-moar c56f0a: OUTPUT: «in TOP␤»
18:10 jamesaxl joined #perl6
18:10 * zengargoyle frell
18:10 zengargoyle m: grammar D { rule TOP { [ a+ | b+ ] { make "in TOP" } } }; say D.parse("aaa").made;
18:10 camelia rakudo-moar c56f0a: OUTPUT: «in TOP␤»
18:18 Geth ¦ ecosystem: d22b30e8ea | loren++ (committed using GitHub Web editor) | META.list
18:18 Geth ¦ ecosystem: Update Terminal::Table version
18:18 Geth ¦ ecosystem:
18:18 Geth ¦ ecosystem: fix clone method
18:18 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/d22b30e8ea
18:19 dubi0us joined #perl6
18:20 Ven joined #perl6
18:21 zengargoyle m: my grammar D { token a { a+ }; token b { b+ }; rule TOP { [ <a> | <b> ] { given %().kv -> ($k,$v) { make [ $k, $v ] } } }; }; say so D.parse("aaaa"); say D.parse("aaaa").made;
18:21 camelia rakudo-moar c56f0a: OUTPUT: «True␤[a 「aaaa」]␤»
18:25 cdg joined #perl6
18:26 Geth ¦ doc: 64a0330591 | (Jan-Olof Hendig)++ | doc/Type/IO/CatHandle.pod6
18:26 Geth ¦ doc: Formatting fixes
18:26 Geth ¦ doc: review: https://github.com/perl6/doc/commit/64a0330591
18:27 dubi0us_ joined #perl6
18:32 Cabanossi joined #perl6
18:36 zengargoyle m: my grammar D { token a { a+ }; token b { b+ }; rule TOP { [ <a> | <b> ] { make %().kv } }; }; say so D.parse("aaaa"); say D.parse("aaaa").made;
18:36 camelia rakudo-moar c56f0a: OUTPUT: «True␤(a 「aaaa」)␤»
18:37 dubi0us joined #perl6
18:47 dubi0us joined #perl6
18:47 Geth ¦ doc: 33a6888252 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/quoting.pod6
18:47 Geth ¦ doc: show the example as described
18:47 Geth ¦ doc: review: https://github.com/perl6/doc/commit/33a6888252
18:56 dubi0us joined #perl6
19:02 Kaffe joined #perl6
19:04 Khisanth joined #perl6
19:09 dubi0us joined #perl6
19:16 sjn how does one introspect the signature of the method you're currently in? (I'm thinking of calling .signature on something similar to Perl5's __SUB__)
19:16 travis-ci joined #perl6
19:16 travis-ci Doc build errored. Jan-Olof Hendig 'Formatting fixes'
19:16 travis-ci https://travis-ci.org/perl6/doc/builds/249162155 https://github.com/perl6/doc/compare/f682cd6abb90...64a0330591a5
19:16 travis-ci left #perl6
19:18 dubi0us_ joined #perl6
19:28 dubi0us joined #perl6
19:29 geekosaur m: class A { method a { dd &?ROUTINE.signature } }; A.new.a
19:29 camelia rakudo-moar c56f0a: OUTPUT: «:(A $: *%_)␤»
19:29 geekosaur sjn ^^
19:32 tbrowder hi, how can i get the number of bytes in a Str? i can get graphemes, but i haven't been able to convert to a Buf to get bytes.
19:34 geekosaur you need to specify an encoding
19:34 tbrowder never mind, looks like Str encode method is the route to go, thnx
19:35 geekosaur m: say "Åä".encode('UTF-8').bytes
19:35 camelia rakudo-moar c56f0a: OUTPUT: «4␤»
19:35 geekosaur yes
19:37 madgoat joined #perl6
19:37 dubi0us joined #perl6
19:38 travis-ci joined #perl6
19:38 travis-ci Doc build errored. Tom Browder 'show the example as described'
19:38 travis-ci https://travis-ci.org/perl6/doc/builds/249166391 https://github.com/perl6/doc/compare/64a0330591a5...33a68882521e
19:38 travis-ci left #perl6
19:40 madgoat left #perl6
19:47 dubi0us joined #perl6
19:52 lucasb joined #perl6
19:55 Shanta joined #perl6
19:57 dubi0us joined #perl6
19:57 kyan joined #perl6
19:57 Shanta Hi I am new to perl 6 in the process of installing zef using. 2 git clone https://github.com/ugexe/zef.git 3 cd zef 4 perl6 -Ilib bin/zef install zef
19:58 Shanta Too few positionals passed; expected 2 arguments but got 1   in code  at /home/shanta/zef/lib/Zef/Repository/LocalCache.pm6 (Zef::Repository::LocalCache) line 90   in method slurp-package-list at /home/shanta/zef/lib/Zef/Repository/LocalCache
19:59 Shanta What am I missing?
20:07 TEttinger joined #perl6
20:07 dubi0us joined #perl6
20:08 dubi0us joined #perl6
20:16 cyphase joined #perl6
20:19 user3 joined #perl6
20:19 Cabanossi joined #perl6
20:20 user3 how do I get the symmetric difference between 2 hash variables %h1 and %h2
20:23 user3 %h1 is a proper superset of %h2
20:25 moritz Shanta: what's your version of Perl 6?
20:25 yoleaux 30 Jun 2017 22:01Z <AlexDaniel> moritz: clog handles unicode rather poorly nowadays… ¦ appears as ¦ and I don't think this issue existed previously
20:25 moritz perl6 --version
20:25 zengargoyle Shanta: try: perl6 -I. ./bin/zef install .
20:25 moritz user3: sets support difference as an operator, duno if hashes do
20:27 zengargoyle and/or the instructions say: perl6 -Ilib bin/zef install .
20:28 zengargoyle it might not be able to install a named module from the internets from it's source dir 'install zef', but should install a directory (itself) with 'install .'
20:28 sjn Shanta: perl6 -v # gives the version you're running now. zef needs a recent version
20:30 jnthn m: my %h1 = :a, :b, :c; my %h2 = :c, :d; say %h1 ⊖ %h2
20:30 camelia rakudo-moar c56f0a: OUTPUT: «set(d, b, a)␤»
20:30 jnthn m: my %h1 = :a, :b, :c; my %h2 = :c, :d; say %h1 (^) %h2 # ascii
20:30 camelia rakudo-moar c56f0a: OUTPUT: «set(d, b, a)␤»
20:31 zengargoyle oh, yeah, maybe perl6 version. :)
20:32 rindolf joined #perl6
20:33 zengargoyle .u ⊖
20:33 yoleaux U+2296 CIRCLED MINUS [Sm] (⊖)
20:36 zengargoyle https://docs.perl6.org/language/setbagmix#index-entry-Symmetric_set_difference_operator
20:38 zengargoyle i think https://docs.perl6.org/language/glossary#index-entry-Texas_operator needs a link to https://docs.perl6.org/language/unicode_texas
20:42 Khisanth joined #perl6
20:42 |oLa| joined #perl6
20:44 BenGoldberg joined #perl6
20:45 ilbot3 joined #perl6
20:45 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
20:46 moritz m: say 42
20:46 camelia rakudo-moar c56f0a: OUTPUT: «42␤»
20:49 Cabanossi joined #perl6
20:51 leont My code is doing «my $raw = $optional || %variables{$key}:exists», and the compiler complains about «You can't adverb &infix:<||>», what am I doing wrong?
20:52 rindolf joined #perl6
20:54 moritz just precedence
20:54 moritz my $raw = $optional || (%variables{$key}:exists);
20:54 * zengargoyle thinks it's too late in the day to figure out usage of L<> in docs. :)
20:56 user3 left #perl6
20:58 Juerd Interesting that adverbs are looser than ||
20:58 Juerd Does that have use cases?
20:59 leont Solved it be switching them around
20:59 leont *by
20:59 |oLa| joined #perl6
20:59 masak Juerd: adverbs don't really participate in the precedence game. they just seek out the highest node in the AST fragment they're in.
21:01 Juerd masak: What's a good strategy for me, as a code reading human, to know what the adverb will be applied to?
21:01 leont ugexe: And now zef doesn't want to do anything. «Too few positionals passed; expected 2 arguments but got 1», Zef::Repository::LocalCache line 90
21:04 masak Juerd: it will apply to the loosest operator that precedes it (but no looser than infix:<,>)
21:05 parv joined #perl6
21:05 masak Juerd: so if you have a sense of the order the operators will execute in, you can form an intuition of what the adverb will bind to
21:05 Juerd masak: Oh, so in %foo{$key}:exists it applies to the operator {}, rather than the hash?
21:05 masak aye
21:05 Juerd I should read up on adverbs. I understand very little about them.
21:05 masak %foo is a term, not an operator :)
21:05 Juerd Good point, but I find this syntax rather alien :)
21:06 masak but with `+%foo{$key} :exists`, it applies to the prefix:<+>; probably not intended
21:06 Juerd Ahh
21:06 masak because prefix:<+> is very loose
21:06 Juerd Thanks, this clears up a lot of the fog in my mind, regarding adverbs
21:06 masak the one that always bites me is the `||` above. or `&&`
21:06 masak basically, I find (for me) adverbs break a fundamental expectation of refactoring
21:07 masak that subexpressions can be re-arranged according to mathematical laws
21:07 leont I would have expected them to bind on proximity
21:07 masak yes, that might have been nice
21:09 timotimo maybe it's time for a slang to explore this
21:09 masak \o/
21:09 masak to the slang machine!
21:09 timotimo that was not me volunteering
21:09 timotimo :)
21:10 masak history will be the judge of that
21:11 timotimo historians from the future will not be able to retroactively force me to implement this :)
21:12 timotimo well, if sufficiently far in the future, it might be possible
21:13 iH2O joined #perl6
21:13 masak any sufficiently advanced future-historianism is indistinguishable from coercion
21:14 iH2O why doesn't "say;" work to print an empty line? what is the cleanest way to do it?
21:14 masak m: say ""
21:14 camelia rakudo-moar c56f0a: OUTPUT: «␤»
21:14 iH2O say ''
21:14 masak iH2O: historical reasons.
21:14 evalable6 iH2O, rakudo-moar c56f0af9a: OUTPUT: «»
21:15 masak iH2O: in Perl 5, `say` means `say $_`
21:15 iH2O ok
21:16 masak iH2O: and it was decided early on that people who wrote `say;` in Perl 6 would be far too likely to mean `say $_;` (influenced by Perl 5) even though by the logic of Perl 6 it clearly means `say "";`
21:16 timotimo m: put
21:16 camelia rakudo-moar c56f0a: OUTPUT: «5===SORRY!5===␤Argument to "put" seems to be malformed␤at <tmp>:1␤------> 3put7⏏5<EOL>␤Other potential difficulties:␤    Function "put" may not be called without arguments (please use () or whitespace to denote arguments, or &put to r…»
21:16 timotimo m: put()
21:16 camelia rakudo-moar c56f0a: OUTPUT: «␤»
21:16 timotimo m: say()
21:16 camelia rakudo-moar c56f0a: OUTPUT: «␤»
21:16 timotimo there you go, you can do that, as well
21:18 parv m: say put
21:18 yoleaux 30 Jun 2017 10:19Z <HelpBot[perl6]> parv: you should only ever use releases and not "build every day" off a random commit. Non-release commits aren't as thoroughly tested and it isn't uncommon for them to have some regressions. People who build them are like people who do 30 over speed limit: they think they know better and would like to get (bugfixes) fast, but eventually they'll come across a untested pothole that wipes all their data.
21:18 camelia rakudo-moar c56f0a: OUTPUT: «5===SORRY!5===␤Argument to "put" seems to be malformed␤at <tmp>:1␤------> 3say put7⏏5<EOL>␤Other potential difficulties:␤    Function "put" may not be called without arguments (please use () or whitespace to denote arguments, or &put …»
21:18 masak I've always felt that those of us who don't have a strong Perl 5 lilt have been short-changed by that "potential difficulty" error. `say;` is such a nice, short, clear, straightforward thing to write.
21:18 masak but, on the other hand, I haven't been strongly pushing for a pragma-or-something to turn it off, either, so... :)
21:20 parv masak, i won't have minded if Perl 6 would not even bear a passing similarity to Perl 5 (which I have been using for a long time)
21:20 parv m: say say
21:20 camelia rakudo-moar c56f0a: OUTPUT: «5===SORRY!5===␤Argument to "say" seems to be malformed␤at <tmp>:1␤------> 3say say7⏏5<EOL>␤Other potential difficulties:␤    Unsupported use of bare "say"; in Perl 6 please use .say if you meant to call it as a method on $_, or use an…»
21:21 iH2O left #perl6
21:24 timotimo with slanngs you can make it as outlandish as you like :D
21:34 Shanta This is Rakudo version 2016.12 built on MoarVM version 2016.12 implementing Perl 6.c.
21:35 timotimo that's rather old
21:38 Shanta zengargoyle tried yor sugestion shorter error list but same problem
21:44 timotimo Shanta: it's definitely possible that your version of rakudo is too old to install zef
21:47 Shanta Just downloaded from the site.
21:51 timotimo you're on a 32bit windows?
21:51 timotimo no, that's 2016.01
21:51 Shanta linux
21:51 timotimo where did you download it? rakudo.org has 2017.04, or 2016.01, not 2016.12
21:51 Shanta yes
21:52 Shanta I will try again from the tar.
21:53 Shanta did the first install from the web page code as shown way above.
21:57 El_Che Shanta: in case you just want rakudo and want to install modules with zef: https://github.com/nxadm/rakudo-pkg/releases
21:57 Shanta wget  https://rakudo.perl6.org/downloads/rakudo/rakudo-2017.06.tar.gz 3 tar xzf rakudo-2017.06.tar.gz 4 cd rakudo-2017.06/ 5 perl Configure.pl --gen-moar --gen-nqp --backends=moar 6 make 7 make install
21:58 timotimo it will not install that rakudo systemwide btw
21:58 Shanta El_Che can't get zef installed yet.
21:59 timotimo maybe you have a PATH that points to an older perl6 binary?
21:59 timotimo what would "which perl6" say?
22:00 El_Che Shanta: the link I gave you are precompiled linux packages that include a script to install zef.
22:00 Shanta I am reading the i should have .06
22:00 El_Che rakudo star on linux are: source to compiles with a set of pre-chose modules
22:01 Shanta code used to get zef git clone https://github.com/ugexe/zef.git Cloning into 'zef'...
22:02 timotimo + documentation
22:02 Shanta path seems to be /usr/bin/perl6
22:03 timotimo okay, it wouldn't install that with the commandline you gave above
22:03 timotimo so that must be the przoblem
22:03 timotimo did you try installing a perl6 with your package manager?
22:03 Shanta yes them removed it as it would be too old.
22:04 timotimo hm, but somehow it must have stuck around
22:07 Shanta Maybe I pull a windows to get the path to refresh Primarily flowing Gabor Szabo's new book.
22:07 timotimo oh cool
22:07 timotimo if there's no perl6 binary at that path, which wouldn't output it and calling perl6 wouldn't try to run it
22:12 Shanta joined #perl6
22:20 sftp joined #perl6
22:33 bjz joined #perl6
22:59 dubi0us_ joined #perl6
23:04 Cabanossi joined #perl6
23:06 cyphase joined #perl6
23:06 Ven joined #perl6
23:10 dubi0us joined #perl6
23:11 dubi0us_ joined #perl6
23:14 dubi0us__ joined #perl6
23:27 cyphase joined #perl6
23:27 dubi0us joined #perl6
23:35 dubi0us joined #perl6
23:35 dubi0us_ joined #perl6
23:48 bjz joined #perl6
23:49 Cabanossi joined #perl6
23:53 dubi0us joined #perl6
23:56 Ben_Goldberg joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo