»ö« 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.
Zoffix And I was wrong about chaining after postfix ops: 00:01
m: sub postfix:<.sq>($n) { $n * $n }; 42.sq.say
camelia rakudo-moar 19e91e: OUTPUT«1764␤»
00:04 TreyHarr1 left
gfldex m: class Foo { has $!bar = 'meow'; }; my method baz { say $!bar }; Foo.new.&baz 00:05
camelia rakudo-moar 19e91e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/yM5N4z8wP5␤Cannot understand $!bar in this context␤at /tmp/yM5N4z8wP5:1␤------> 3r = 'meow'; }; my method baz { say $!bar7⏏5 }; Foo.new.&baz␤»
00:08 finanalyst_ joined 00:09 pierre joined, Actualeyes left
gfldex m: class Foo { has $!bar = 'meow'; }; use MONKEY-TYPING; augment class Foo { method baz { say $!bar } }; Foo.new.&baz 00:09
camelia rakudo-moar 19e91e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/oQG_IVDDY3␤Undeclared routine:␤ baz used at line 1. Did you mean 'bag'?␤␤»
Zoffix m: class Foo { has $!bar = 'meow'; }; use MONKEY-TYPING; augment class Foo { method baz { say $!bar } }; Foo.new.baz 00:14
camelia rakudo-moar 19e91e: OUTPUT«meow␤»
00:17 pierre left 00:21 cpage_ left 00:22 cpage_ joined 00:26 cdg left 00:32 huggable left, huggable joined 00:45 TimToady left 00:47 TimToady joined 00:53 sufrostico joined 01:05 Actualeyes joined 01:14 finanalyst_ left 01:21 itaipu left 01:28 BenGoldberg joined 01:29 mojca1 left 01:30 gorgonzola joined 01:40 molaf left 01:45 ilbot3 left 01:47 ilbot3 joined 01:48 nadim left 01:49 sufrostico left 01:50 MasterDuke joined 01:52 molaf joined 01:55 kid51 left 01:59 TreyHarr1 joined 02:05 kurahaupo left 02:10 pierre joined 02:30 finanalyst_ joined 02:37 cpage_ left 02:51 |2701 left, noganex_ joined 02:54 noganex left 03:07 pierre left 03:11 pierre joined 03:12 Actualeyes left 03:13 cpage_ joined
MadcapJake So I'm almost finished with my database build script for this Perl 6 webapp! 03:26
(been some time since I've done SQL so I hope I'm doing everything right :S
jdv79 what does it do? 03:46
03:46 pierre left 04:03 khw left 04:05 pierre joined 04:10 pierre left 04:11 pierre joined 04:14 pierre left 04:15 cpage_ left, bjz_ joined 04:16 bjz left 04:18 BenGoldberg left 04:26 _28_ria left 04:29 skids left, pierre joined
MadcapJake It's Perl 6's S99 glossary + Urban Dictionary style voting (users can upvote/downvote term descriptions and the best will be shown on the main page) 04:31
04:32 pierre left, huggable left
MadcapJake so my db has users, terms, entries, and votes tables 04:32
04:35 Cabanossi left
MadcapJake I'm trying to decide how new terms will be added: (a) users submit term + description, (b) users submit only term and term sits in "probationary" period until enough users request an explanation, or (c) users submit only term and term waits for at least one (or two?) explanations (basically answered/unanswered statuses) 04:36
04:37 pierre joined 04:38 Actualeyes joined 04:39 Cabanossi joined 04:40 pierre left 04:51 buharin joined, zacts joined 04:54 _28_ria joined 04:58 bjz joined 04:59 bjz_ left 05:02 mojca joined 05:15 ssotka joined 05:17 azawawi joined
azawawi hi 05:17
.tell RabidGravy Please take a look at github.com/perl6/gtk-simple/pull/33 05:18
yoleaux azawawi: I'll pass your message to RabidGravy.
azawawi .seen RabidGravy
yoleaux I saw RabidGravy 24 May 2016 19:40Z in #perl6: <RabidGravy> no doc.perl6.org/language/glossary#Allomorph is fine, just missed a character
05:18 azawawi left 05:22 labster left 05:23 _mg_ joined
buharin hi :) 05:24
05:33 xinming left 05:34 xinming joined 05:45 CIAvash joined 06:16 ssotka left 06:28 buharin left 06:30 jack_rabbit joined, mohae left 06:33 jjido joined 06:34 grondilu joined 06:36 jjido left 06:39 firstdayonthejob joined 06:41 wamba joined 06:42 pierre_ joined
moritz \o 06:43
06:47 jjido joined 06:50 firstdayonthejob left 06:52 aries_liuxueyang left, rindolf joined 06:53 aries_liuxueyang joined 06:54 azawawi joined
azawawi Good morning 06:55
github.com/perl6/gtk-simple/pull/33 # Feedback is welcome
06:58 ufobat joined
ufobat morning 07:00
07:01 azawawi left 07:05 labster joined 07:06 jjido left 07:09 CIAvash left 07:10 gorgonzola left 07:11 mojca left 07:12 _dolmen_ joined, drvvv left 07:15 mr-foobar left 07:17 CIAvash joined, finanalyst_ left 07:22 _dolmen_ left 07:29 aindilis left 07:32 abraxxa joined 07:36 mojca joined 07:40 Xliff joined
Xliff \o 07:40
What is the named args equivalend of @_?
s/equivalend/equivalent/
07:40 bjz_ joined
nine m: sub foo(*%args) { say %args.keys }; foo(:foo(1), :bar(2)); 07:41
camelia rakudo-moar 19e91e: OUTPUT«(bar foo)␤»
nine m: sub foo(*@args) { say @args }; foo(1, 2); 07:42
camelia rakudo-moar 19e91e: OUTPUT«[1 2]␤»
07:42 bjz left
Xliff nine: But you expressly used a slurpy hash there. If you use the signature (:$foo, :$bar) can you still access them without using :$foo and :$bar? 07:43
07:48 g4 joined, g4 left, g4 joined
nine m: sub foo($foo, $bar) { say @_; }; foo(1, 2); # doesn't work with positionals either 07:49
07:49 telex left
camelia rakudo-moar 19e91e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/5spYWk2_L3␤Placeholder variable '@_' cannot override existing signature␤at /tmp/5spYWk2_L3:1␤------> 3sub7⏏5 foo($foo, $bar) { say @_; }; foo(1, 2);␤» 07:49
nine Xliff: ^^^
07:50 telex joined
llfourn_ Xliff: nah you can't I don't think. I often find myself wanting to though :\. 07:51
nine This being Perl 6, I'd not be surprised if there's some way through the meta layer. Probably through the callframe. 07:52
llfourn_ yeah there is an nqp::capture..something 07:53
I would love to be able to get a p6 Capture from some magic variable for the current call frame
or even callframe.capture. Though I guess it might get in the way of inlining or something 07:54
07:55 darutoko joined 07:56 buharin joined 07:57 buharin left
Xliff llfourn_++ and nine++: Thanks. 07:58
08:01 kurahaupo joined 08:04 tharkun left 08:05 tharkun joined 08:12 dakkar joined
Xliff Hrm. 08:15
I thought I had what I needed with XML::Class, but it's tied to namespaces.
08:18 zacts left 08:23 sno left
Xliff Damn. And XML::Parser::Tiny isn't passing its test cases. Time to check CPAN 08:24
08:24 grondilu left
Xliff Will XS modules run with rakudo? 08:25
nine: Inline::Perl5 is failing zef install. 08:28
Known bug?
Looks like it's installing fine using panda. 08:30
tadzik sounds like a zefbug then
or a pandabug, and Inline::Perl5 doing something it's not supposed to :D
08:32 huggable joined 08:33 llfourn_ left
Xliff zefbug 08:33
It installs and works fine after panda install.
08:34 kurahaupo left
Xliff tadzik: Where can I report this? 08:34
Nevermind. Using github.com/ugexe/zef/issues/new
08:38 zacts joined
Xliff m: use v6.c 08:38
camelia ( no output )
08:41 domidumont joined 08:42 CIAvash left 08:44 nadim joined
Xliff m: my $a = 1; if $a == 0 { say "Noseeme"; } elsif $a == 1 { say "Peekaboo!" } 08:44
camelia rakudo-moar 19e91e: OUTPUT«Peekaboo!␤»
Xliff m: my $a = [1]; if $a.^name eq 'Str' { say "Noseeme"; } elsif $a.^name eq 'Array' { say "Peekaboo!" } 08:45
camelia rakudo-moar 19e91e: OUTPUT«Peekaboo!␤»
Xliff sub t (:$a!) { if :$a.^name eq 'Str' { say "Noseeme"; } elsif :$a.^name eq 'Array' { say "Peekaboo!" } } t(:a([1]))
08:45 domidumont left
Xliff m: sub t (:$a!) { if :$a.^name eq 'Str' { say "Noseeme"; } elsif :$a.^name eq 'Array' { say "Peekaboo!" } } t(:a([1])) 08:45
camelia rakudo-moar 19e91e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/cwIisRapqC␤Strange text after block (missing semicolon or comma?)␤at /tmp/cwIisRapqC:1␤------> 3a.^name eq 'Array' { say "Peekaboo!" } }7⏏5 t(:a([1]))␤ expecting any of:␤ infix␤ …»
08:46 domidumont joined
Xliff m: sub t (:$a!) { if :$a.^name eq 'Str' { say "Noseeme"; } elsif :$a.^name eq 'Array' { say "Peekaboo!" } }; t(:a([1])) 08:47
camelia ( no output )
Xliff m: sub t (:$a!) { if :$a.^name eq 'Str' { say "Noseeme"; } elsif :$a.^name eq 'Array' { say "Peekaboo!" }; say :$a.^name }; t(:a([1]))
camelia rakudo-moar 19e91e: OUTPUT«Pair␤»
08:47 RabidGravy joined
Xliff m: sub t (:$a!) { if :$a.^name eq 'Str' { say "Noseeme"; } elsif :$a.^name eq 'Array' { say "Peekaboo!" }; say :$a.^name }; my $b = [1]; t(:a($b)) 08:48
camelia rakudo-moar 19e91e: OUTPUT«Pair␤»
moritz m: sub t (:$a!) { say $a.perl }; t(:a([1])); t(:a[1])
camelia rakudo-moar 19e91e: OUTPUT«$[1]␤$[1]␤»
moritz m: sub t (:$a!) { dd $a }; t(:a([1])); t(:a[1])
camelia rakudo-moar 19e91e: OUTPUT«Array $a = $[1]␤Array $a = $[1]␤»
08:48 pierre_ left
Xliff m: sub t (:$a!) { if :$a.^name eq 'Str' { say "Noseeme"; } elsif :$a.^name eq 'Array' { say "Peekaboo!" }; say :$a.^name }; t(:a[1]) 08:48
camelia rakudo-moar 19e91e: OUTPUT«Pair␤»
moritz ah, you're checking :$a, not $a
well, it's no surprise that :$a is a Pair, because :$a is a pair construction syntax :-) 08:49
Xliff m: my $a = [1]; if :$a.^name eq 'Str' { say "Noseeme"; } elsif :$a.^name eq 'Array' { say "Peekaboo!" }; say :$a.^name }
camelia rakudo-moar 19e91e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/TZwdyozoDV␤Unexpected closing bracket␤at /tmp/TZwdyozoDV:1␤------> 3ray' { say "Peekaboo!" }; say :$a.^name 7⏏5}␤»
Xliff m: my $a = [1]; if :$a.^name eq 'Str' { say "Noseeme"; } elsif :$a.^name eq 'Array' { say "Peekaboo!" }; say :$a.^name };
camelia rakudo-moar 19e91e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/xfX2PPjvxq␤Unexpected closing bracket␤at /tmp/xfX2PPjvxq:1␤------> 3ray' { say "Peekaboo!" }; say :$a.^name 7⏏5};␤»
Xliff m: my $a = [1]; if :$a.^name eq 'Str' { say "Noseeme"; } elsif :$a.^name eq 'Array' { say "Peekaboo!" }; say :$a.^name } };
camelia rakudo-moar 19e91e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/vXg4labMma␤Unexpected closing bracket␤at /tmp/vXg4labMma:1␤------> 3ray' { say "Peekaboo!" }; say :$a.^name 7⏏5} };␤»
Xliff m: my $a = [1]; if :$a.^name eq 'Str' { say "Noseeme"; } elsif :$a.^name eq 'Array' { say "Peekaboo!" }; say :$a.^name;
camelia rakudo-moar 19e91e: OUTPUT«Pair␤»
Xliff Grrr..... 08:50
I think I have barked up the wrong tree.
moritz Xliff: why are you using :$a instead of $a inside the function?
Xliff That's a good question! 08:51
shadowpaste "xliff" at 217.168.150.38 pasted "What am I missing here?" (24 lines) at fpaste.scsys.co.uk/518199 08:53
Xliff moritz: The paste is the actual use case.
And error
moritz Xliff: the first thing you're missing is ~~ for type checks 08:54
08:54 domidumont left
moritz if $thing ~~ Str { ... } 08:54
that works also for subclasses of Str
checking .^name directly is very fragile
Xliff I started using ~~ and keep having the interpreter telling me to use .^name. 08:55
moritz huh?
dalek c: 42a5c98 | (Daniel Green)++ | doc/Type/ (4 files):
Fix some typos in the docs for the allomorph types
c: 4ec6150 | RabidGravy++ | doc/Type/ (4 files):
Merge pull request #548 from MasterDuke17/master

Fix some typos in the docs for the allomorph types
moritz Xliff: anyway, you don't close the curly brace from the if block
08:55 CIAvash joined
Xliff moritz: There's some warning rakudo keeps emitting when I use ~~. 08:55
Or maybe it is when I interpolate. 08:56
moritz yes, when you interpolate
which isn't the same as checking
Xliff Oh geez. That's my brain telling me its way past time to go to bed.
moritz m: if 1 { elsif { } 08:57
camelia rakudo-moar 19e91e: OUTPUT«5===SORRY!5===␤Function 'elsif' needs parens to avoid gobbling block␤at /tmp/79hvbRahZh:1␤------> 3if 1 { elsif { }7⏏5<EOL>␤Missing block (apparently claimed by 'elsif')␤at /tmp/79hvbRahZh:1␤------> 3if 1 7⏏5{ elsif { }␤␤»
Xliff m: $a = [1]; say "Y" if $a ~~ Array 08:58
camelia rakudo-moar 19e91e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/PYCySMOXDL␤Variable '$a' is not declared␤at /tmp/PYCySMOXDL:1␤------> 3<BOL>7⏏5$a = [1]; say "Y" if $a ~~ Array␤»
Xliff m: my $a = [1]; say "Y" if $a ~~ Array
camelia rakudo-moar 19e91e: OUTPUT«Y␤»
Xliff OK. Fixed. Thanks, moritz! 08:59
moritz also I don't think you even need a branch here
09:00 Actualeyes left
moritz m: sub t($x) { my $url = ''; $url ~= "a=$_" for $x.list; return $url }; say t 'bla'; say t ['bla', 'blubb'] 09:00
camelia rakudo-moar 19e91e: OUTPUT«a=bla␤a=blaa=blubb␤»
moritz m: sub t($x) { my $url = ''; $url ~= "&a=$_" for $x.list; return $url }; say t 'bla'; say t ['bla', 'blubb']
camelia rakudo-moar 19e91e: OUTPUT«&a=bla␤&a=bla&a=blubb␤»
09:05 g4 left 09:07 pmurias joined, g4 joined 09:12 _mg_ left 09:13 sno joined, finanalyst_ joined
moritz I found joelgrus.com/2016/05/23/fizz-buzz-in-tensorflow/ quite amusing 09:20
09:21 xinming_ joined 09:24 xinming left
Xliff moritz: Ooh! Nice optimization! 09:25
09:30 mojca left
Ulti something recent made a 4% speedup in my tests yay #perl6++ 09:30
09:32 kaare_ joined
RabidGravy given that «» is actually qqww and not qqw, are there short quotes for qqw ? 09:35
yoleaux 05:18Z <azawawi> RabidGravy: Please take a look at github.com/perl6/gtk-simple/pull/33
09:36 domidumont joined
RabidGravy .tell azawawi seems reasonable to me, I'm documenting at the moment but will test later, would like more feedback though 09:40
yoleaux RabidGravy: I'll pass your message to azawawi.
09:40 iH2O joined 09:42 iH2O left
Xliff WAT? 09:47
So I have a class WebService::EveOnline::EveCentral. When I do: perl6 -Ilib -e 'use WebService::EveOnline::EveCentral; my $ws = WebService::EveOnline::EveCentral.new(); $ws.getMarketStat(:typeID<34>)' -- I get the following error: Could not find symbol '&EveCentral'. 09:48
What am I missing?!
lib/WebService/EveOnline/EveCentral.pm6 and perl6 -c reports "Syntax OK!" 09:50
RabidGravy typoed some "module" or "class" name? 09:52
Xliff "class WebService::EveOnline::EveCentral {" 09:53
09:53 ocbtec joined
Xliff Believe me. I've looked at that line 3 times to Tuesday. 09:53
RabidGravy is there some other containing scope
Xliff Changed from "unit class WebService::EveOnline::EveCentral" 09:54
I don't think so.
09:54 CIAvash left
Xliff code is here: github.com/Xliff/p6-webservice-eve...fitshopper 09:54
09:57 pierre_ joined
RabidGravy looks fine at first glance 09:58
09:58 vendethiel left 09:59 vendethiel joined
Xliff Which means it's something hard-to-find-but-stupid. 09:59
Late night code binges have been good for ideas, but bad for coding accuracy and efficiency. 10:00
At least lately.
10:07 tbrowder_ joined 10:09 CIAvash joined 10:11 tbrowder_ left 10:14 tbrowder_ joined, kid51 joined 10:18 tbrowder_ left 10:19 azawawi joined
azawawi . 10:19
yoleaux 09:40Z <RabidGravy> azawawi: seems reasonable to me, I'm documenting at the moment but will test later, would like more feedback though
azawawi ..
...
:)
RabidGravy boom 10:20
azawawi my eyes... :)
RabidGravy: one of the thing that worries me about GTK::Simple is the usage of the GTK::... namespace 10:21
RabidGravy: github.com/perl6/gtk-simple/tree/master/lib/GTK
RabidGravy: namely GTK::GDK and GTK::NativeLib
RabidGravy yeah, I've thought that about other modules too 10:22
I was going to write something up about avoiding doing that
my general feeling is that for a given module Foo::Bar then you should attempt to only use the Foo::Bar::* namespace, otherwise it potentially blocks out someone else using Foo:: 10:25
Ulti also there was a trend of calling nearly everything for Perl 6 thats the first implementation pass "Simple" rather than it just being the first version of the real deal
10:26 TEttinger left
Ulti ::Simple was meant to mean something about the API not the authors attitude to their own work :3 10:26
RabidGravy which is probably a hostage to fortune to be honest
hahainternet i do think that Go's adoption of an import path being the authoritative name is quite lovely
so good luck using 'github.com' as your namespace 10:27
Ulti I thought the way P6 packages worked is you had namespaces broken down by authority anyway
RabidGravy well if we could uniformly use the module long name everywhere then it wouldn't be a problem
pmurias Ulti: +1 using ::Simple how it was orginated in Perl 5 10:28
Ulti DBIish also >:P I always forget if its one 'i' or two, if you dont know what DBI was then its a bad name and if you do then you wonder why its not just DBI here and if there's meant to be a real one coming 10:32
10:32 grondilu joined
Ulti its an ecosystem of doubt :Z 10:32
pmurias is a real one coming? 10:33
Ulti fairly sure we can defacto say it is the real one, especially since its really functional 10:34
nine Well a new one with a redesigned API was in the works back then.
jnthn fwiw, GTK::Simple was originally written by me, for the purpose of demonstrating how supplies are a really nice way to deal with UI events. I didn't really think about how to make it handle all of GTK (knew I'd no way have time for that), so it was meant to handle simple use cases. :) I'm happy it's now in hands other than mine, but if it's going to support All The Things then a name change is likely sensible :) 10:35
azawawi starts reading developer.gnome.org/gtk3/stable/ :) 10:36
Ulti nine I guess with Inline its nice to have the name be different too 10:38
pmurias Ulti: Tim Bunce had plans how the Perl 6 version of DBI would look like (with a JDBC style standardized api for backends), it's understandable that people didn't want to "steal" then namespace from him 10:42
Zoffix .seen stmuk
yoleaux I saw stmuk 24 May 2016 09:56Z in #perl6: <stmuk> something like that is better
Zoffix Don't we have :auth<> stuff? :)
stmuk Zoffix: just saw this buffer! 10:43
Ulti ^ this
DBI:auth<tim> would have been that one, with a major version number bump ahead of what anyone else was doing?
I thought that was meant to be the Perl 6 way of handling the namespace camping issue? 10:44
I guess at the time we didnt have much versioining in modules either :) 10:45
as in the ability to do it
Zoffix Well, version is supposed to irrelevant. :auth stuff alone is sufficient.... were people to actually use it.
Ulti well the version number bump makes it easier to discuss since you could say DBI 2 rather than DBI-the-tim-bunce-one 10:46
Zoffix heh
10:46 andreoss joined
Ulti authority is more often going to be you trust someones patches and release schedule rather than its a fork or parallel project you'd hope? 10:47
10:48 skingsbu joined, skingsbu left
Zoffix I'd think it's more to prevent stuff like this: (4 top results): metacpan.org/search?size=20&q=...pe=modules 10:49
:auth basically gives each author an ability to name their module anything they want, regardless of what other authors name their stuff. 10:50
It also creates a problem that without :auth, you may or may not get what you want :/
Zoffix foresees module installers having a "trusted authors" list in the future 10:51
stmuk, if you have no idea why perl6.party desn't show up on pl6anet, then I could try replicating another feed to-the-letter... I just didn't wanna do the work if I didn't have to :) 10:53
And if all else fails, I guess we can revert it back to blogs.perl.org :/
10:56 pmurias left 11:01 rindolf left 11:03 pmurias joined 11:12 azawawi left
RabidGravy in the pod parser that docs uses can I use any matching characters around an X< > if I want to have both << and « inside? 11:23
e.g X{blah blah, << >>, «»} 11:24
or is it only angley brackets 11:25
11:26 labster left 11:31 wamba left, CIAvash left 11:32 wamba joined, g4 left
RabidGravy of course I can just generate the html and see what happens 11:34
11:36 g4 joined 11:44 zhmylove_ joined
Xliff Maybe now that there are more folks on.... 11:45
So I have a class WebService::EveOnline::EveCentral. When I do: perl6 -Ilib -e 'use WebService::EveOnline::EveCentral; my $ws = WebService::EveOnline::EveCentral.new(); $ws.getMarketStat(:typeID<34>)' -- I get the following error: Could not find symbol '&EveCentral'.
RabidGravy ah, it's just increase the number of chevrons
Xliff code is here: github.com/Xliff/p6-webservice-eve...fitshopper
11:45 kid51 left, zhmylove left
Xliff And that name is getting changed. 11:45
RabidGravy have you tried it with RAKUDO_MODULE_DEBUG=1 11:50
Xliff Didn't know that existed.
RabidGravy it'll tell you what it is doing when it tries to load the module 11:52
Xliff 1233 3409 RMD: /home/cbwood/projects/p6-webservice-eveonline-fitshopper/lib/WebService/EveOnline/EveCentral.pm6 aborted precompilation without failure 11:53
11:53 CIAvash joined
Xliff Is that a good or a bad thing. The message isn't clear, but "aborted" has me leaning to "not good" 11:54
RabidGravy what happens if you put "no precompilation;" at the top of the file
it would suggest you are doing something that it doesn't like at compile time 11:55
11:56 psch joined 11:58 finanalyst_ left
Xliff No change. It looks like it doesn't parse the pragma until the attempt to precompile has already been made. 11:58
psch m: sub f { say %_ }; f :1a, :2b
camelia rakudo-moar 19e91e: OUTPUT«{a => 1, b => 2}␤»
psch Xliff: ^^^ you looked for that in the backlog i think?
Xliff psch: O_O
Missed that! My client was net-farting, earlier. I might have not been online to see it. 11:59
RabidGravy Xliff, you did put it above the "unit class" right?
Xliff hugs psch++
RabidGravy, first line.
Even before "use v6.x"
psch Xliff: i don't think anyone mentioned it before 12:00
well, today at least :)
Xliff And I've switched it from "unit class" to a regular class definition.
psch .tell llfourn %_ exists, analogue to @_
yoleaux psch: I'll pass your message to llfourn.
dalek c: c4101f5 | RabidGravy++ | doc/Language/quoting.pod:
Add qww and qqww

Also move the « » from qqw to qqww Not sure if there are appropriate unicode variants
This may cover #533
12:01
Xliff psch: Ahh! but %_ can't be used if there is a signature.
psch Xliff: well, not implicitely, no 12:02
m: sub f($a, $b, :$c, *%_, *@_) { say "$a $b $c"; say "other stuff: @_[]" , %_ }; f 1, 2, :3c, :10foo, "bar" 12:03
camelia rakudo-moar 19e91e: OUTPUT«1 2 3␤other stuff: bar{foo => 10}␤»
RabidGravy on a method it can, it just slurps all the otherwise not mention named parameters
psch right, interface consistency :)
Xliff Well, those things are good to know. 12:04
shadowpaste "xliff" at 217.168.150.38 pasted "Precompile, oh Precompile.... where for art thou, Precompile?!?" (137 lines) at fpaste.scsys.co.uk/518242 12:05
Xliff Yes. I am getting punchy in my exhaustion.
About to do a food run to compensate. 12:06
psch m: my method foo (Any: $a, $b, :$c) { say "a, b and c: $a $b $c"; say "other (named) stuff: " ~ %_ }; .&foo: 1, 2, :3c, :foo<bar> 12:09
camelia rakudo-moar 19e91e: OUTPUT«a, b and c: 1 2 3␤other (named) stuff: foo bar␤»
psch ...probably don't do that in code you want maintainable :)
RabidGravy delete the .precomp directory 12:11
12:11 nicqbot joined
pmurias [Coke]: hi 12:17
12:17 AlexDaniel joined
pmurias [Coke]: the current build process is a horrible hack 12:18
:(
12:18 sufrostico joined
pmurias I ln -s the node_modules from nqp-js 12:18
12:19 ZoffixW joined
pmurias and ln -s nqp-bootstrapped.js 12:20
ZoffixW Xliff, it's something to do with XML::Hash::XS. If I comment out this line (and the use of its sub on 24) the problem disappears github.com/Xliff/p6-webservice-eve...ral.pm6#L5
pmurias [Coke]: I think it's better that I figure out a sane way to build it rather then you duplicate my horrible setup 12:21
12:23 ZoffixW left
Xliff Zoffix: DAMMIT! I was worried about that. 12:23
I kinda need XML::Hash::XS, or something similar. I searched the ecosystem, but couldn't find anything that looked like it would work (at least not without serious work). 12:24
Zoffix++ -- Thanks for finding that.
Maybe I can cheat. 12:25
12:26 rindolf joined 12:29 Vishwanath joined 12:31 nicqbot left
RabidGravy If the web service has a nice regular definition for the documents then XML::Class would fit the bill 12:31
12:32 nicqbot joined, lizmat joined
RabidGravy obviously you would have to define classes for all the messages 12:32
12:32 huggable left 12:35 rindolf left 12:37 Vishwanath left
Xliff YES! I CAN! 12:40
Zoffix, more experimentation may need to be done, but I changed the calls to use the regular Inline::Perl5 method via .use and .call and it's working. 12:41
I've pushed if you wanna see.
12:42 AlexDaniel left
Xliff RabidGravy: I was hoping to avoid that, because there are several nested classes and the docs of XML::Class didn't go very far in their explanation to my sleep-deprived brain. 12:43
RabidGravy it works fine, though if you can find an example that doesn't I would be keen to know about it
12:44 domidumont left, zhmylove_ left
Xliff RabidGravy, the eventual goal is to build a data structure from this: api.eve-central.com/api/marketstat?...t=10000002 12:44
Actually... that's the light case. 12:45
RabidGravy trivial 12:46
Xliff :P
Trivial this: api.eve-central.com/api/quicklook?typeid=34 12:47
=)
RabidGravy just big, not particularly complex 12:48
12:48 zhmylove joined
Xliff OK. However the docs didn't talk about how it would handle multiple tags. Ala the <order> tag in the last example. 12:49
Also... sleep-deprived!!!
But stubborn.
12:50 Sgeo left
Xliff So class for quicklook. Class for Sell_orders. Class for Buy_orders. Class for order. 12:50
grondilu jeez eve-online stuff? What a coincidence. Last week I starting playing this until I realize I should really stop if don't want to end up doing that 100% of my time
Xliff I might actually try that after I sleep, however I have a working implementation and I didn't need to do the extra work.
grondilu, =) 12:51
grondilu at some point I was wishing the in-game chat would support IRC so that I can hang out here while playing.
12:52 cognominal joined
Xliff It's got a web browser.... 12:52
grondilu it's pretty terrible though
Xliff Yes. Yes, it is.
The sad part is that it's actually gotten better than it used to be.
ilmari wonders what Xliff's strange highlighting is 12:53
ct
showing up as inverted-video ] here (and I can create it by pressing ctrl-])
Xliff ilmari, italics
12:56 sufrostico left 12:57 bjz_ left
ilmari ah 12:59
13:07 bjz joined 13:12 aindilis joined 13:18 finanalyst_ joined 13:22 zxd joined 13:24 skids joined
[Coke] perl6 13:27
RabidGravy it is indeed 13:28
[Coke] ww. ^H 13:29
13:35 vendethiel- joined 13:36 vendethiel left, bjz left 13:37 bjz joined 13:44 pierre_ left 13:46 zakharyas joined 13:47 brrt joined 13:54 pierre_ joined 13:55 cdg joined 13:59 Actualeyes joined 14:02 Tonik joined 14:04 MadcapJake_ joined, MadcapJake_ left, jack_rabbit left 14:15 ocbtec left 14:16 domidumont joined 14:21 AlexDaniel joined 14:25 khw joined 14:30 rindolf joined
nicqbot So, what is the difference between a 'Buf' object and an array? 14:34
Seems like an array just has some extra methods to it. 14:35
14:36 ZoffixW joined
psch m: my $x = "foo".encode('ascii'); say $x 14:37
camelia rakudo-moar a5c46b: OUTPUT«Blob[uint8]:0x<66 6f 6f>␤»
psch ah, right, immutable
AlexDaniel m: my Buf $x = Buf.new(104, 101, 108, 108, 111); say $x ~ ‘ world’
psch nicqbot: a Buf is a mutable Blob. as in, binary data
camelia rakudo-moar a5c46b: OUTPUT«Cannot use a Buf as a string, but you called the Stringy method on it␤ in block <unit> at /tmp/XPWlfax8gw line 1␤␤»
ZoffixW nicqbot, Buf is for binary data. Array is for itemized values. Hence the difference in methods. Sure, you can represent many things inside an Array, including strings, but it's better to have a specific type.
AlexDaniel docs claim that it is Stringy
psch m: my $x = Buf.new(70, 79, 79); say $x.decode('ascii');
camelia rakudo-moar a5c46b: OUTPUT«FOO␤»
psch m: say Buf ~~ Stringy
camelia rakudo-moar a5c46b: OUTPUT«True␤»
psch AlexDaniel: yeah, the Exception seems counterintuitive, but consider that you don't have an encoding on the Buf 14:38
ZoffixW New post: Perl 6 Hands-On Workshop: Weatherapp (Part 2): perl6.party/post/Perl-6-Hands-On-Wo...pp--Part-2
AlexDaniel psch: eh? But then why is it stringy?
ZoffixW This workshop was a bad idea... I feel I'm out of my depth :/ Hello, Impostor Syndrome :P 14:39
14:39 cdg_ joined
jnthn A Buf is basically a binary string. It's an item. 14:39
An array is a bunch of items
andreoss m: my $x = Buf.new(class :: {} .new);say $x.perl;
camelia rakudo-moar a5c46b: OUTPUT«Type check failed in initializing element #0 to Buf; expected uint8 but got <anon|50804864> (<anon|50804864>.new)␤ in any at gen/moar/m-Metamodel.nqp line 1736␤ in block <unit> at /tmp/byfJMat0dC line 1␤␤Actually thrown at:␤ in any at gen/mo…»
andreoss m: my $x = Array.new(class :: {} .new);say $x.perl;
camelia rakudo-moar a5c46b: OUTPUT«$[<anon|66921696>.new]␤»
jnthn m: my int @a = 1..5; for @a { .say } 14:40
camelia rakudo-moar a5c46b: OUTPUT«1␤2␤3␤4␤5␤»
jnthn A native array can be iterated like that
But a buf is naturally an item
andreoss m: my $x = Buf.new(my Int $i = 1);say $x.perl;
camelia rakudo-moar a5c46b: OUTPUT«Buf.new(1)␤»
AlexDaniel but why can't Buf just be a Buf, what purpose serves the Stringy part of it?
14:41 xue_ joined
psch ...i'm wondering that too right now, actually 14:41
14:41 cdg left 14:42 xue_ left
andreoss Buf can only handle native types? 14:42
nicqbot What do you mean 'it's naturally an item'? The entire 'Buf' object is an item, or the things within?
ugexe maybe so things like BufA ~ BufB make sense (and can be clearer than `push` everywhere sometimse)
moritz m: say Buf[Int].new(42)
camelia rakudo-moar a5c46b: OUTPUT«Could not instantiate role 'Blob':␤Method 'nativesize' not found for invocant of class 'Perl6::Metamodel::ClassHOW'␤ in any at gen/moar/m-Metamodel.nqp line 2437␤ in any specialize at gen/moar/m-Metamodel.nqp line 2424␤ in any specialize at gen…»
AlexDaniel m: my Buf $x = Buf.new(104, 101, 108, 108, 111); say $x ~ $x
camelia rakudo-moar a5c46b: OUTPUT«Buf:0x<68 65 6c 6c 6f 68 65 6c 6c 6f>␤»
AlexDaniel mmm… 14:43
14:45 g4 left, itaipu joined
psch m: my $x = Buf.new(70); $x = $x ~ Buf.new(79); 14:45
camelia ( no output )
psch m: my $x = Buf.new(70); $x = $x ~ Buf.new(79) xx 2
camelia rakudo-moar a5c46b: OUTPUT«Cannot use a Buf as a string, but you called the Stringy method on it␤ in block <unit> at /tmp/KVCff_EGJz line 1␤␤»
andreoss m: say (Buf.new(72) ~ Buf.new(73)).decode: 'utf-8' 14:46
camelia rakudo-moar a5c46b: OUTPUT«HI␤»
ugexe has to be Buf.new(79 xx 2)
psch how does that even precedence? xx tighter than = but looser than ~?
jnthn andreoss: You can only have a Buf of some native integer type, yes 14:47
psch m: my $x; $x = $x ~ 1 xx 2; say $x
camelia rakudo-moar a5c46b: OUTPUT«Use of uninitialized value $x of type Any in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block <unit> at /tmp/W4IyZr6SkD line 1␤1 1␤»
psch m: my $x = 0; $x = $x ~ 1 xx 2; say $x
camelia rakudo-moar a5c46b: OUTPUT«01 1␤»
psch ah, so tighter than both, but stringy infix:<,>..?
14:48 ZoffixW left
nicqbot p6: my $buf = Buf.new(1,3,2,4); for $buf[] { .say } 14:51
camelia rakudo-moar a5c46b: OUTPUT«1␤3␤2␤4␤»
ugexe well Buf has a method list 14:54
Buf also has `array_type` trait 14:55
14:59 xue_ joined 15:02 domidumont left, ocbtec joined 15:05 colomon joined, zakharyas left 15:13 mohae joined
andreoss what is [] in $buf[]? 15:13
is it the same as @$buf? 15:14
psch m: class A { method ZEN-POS { "[]" }; method list { "@" } }; say (A)[]; say @(A) 15:15
camelia rakudo-moar a5c46b: OUTPUT«[]␤@␤»
[Coke] p6: my $buf = Buf.new(1,3,2,4); say (@$buf).perl; say ($buf[]).perl;
camelia rakudo-moar a5c46b: OUTPUT«(1, 3, 2, 4).Seq␤Buf.new(1,3,2,4)␤»
nicqbot Not entirely sure, I honestly just tried it and it worked. From what I can tell, it tells perl6 that this is like an array
[Coke] andreoss: so, no, not the same. 15:16
psch andreoss: postcircumfix:<[ ]> without a second argument is a zen slice, that is a slice of all elements. prefix:<@> is equivalent to .list
zen slices are mostly for qq interpolation of @-sigiled variables, afaik 15:17
m: my @a = ^5; say "@a"; say "@a[]"
camelia rakudo-moar a5c46b: OUTPUT«@a␤0 1 2 3 4␤»
andreoss okay, thanks 15:18
hoelzro o/ #perl6 15:23
15:24 pierre_ left
brrt ohai hoelzro 15:26
hoelzro o/ brrt
15:31 _28_ria left 15:34 _28_ria joined 15:36 llfourn joined
psch oh, now i notice how badly i skimmed the %_ discussion earlier today in the clog :/ 15:39
Xliff Heh.
We love you anyway, psch. 15:40
psch >_>
Xliff ^_^
psch m: sub f( *%f (:$a, :$b) ) { say $a }; f :1a 15:41
camelia rakudo-moar a5c46b: OUTPUT«1␤»
psch the opposite works... vOv
m: sub f( *%f (:$a!, :$b) ) { say $a }; f :1b 15:43
camelia rakudo-moar a5c46b: OUTPUT«Required named argument 'a' not passed in sub-signature of parameter %f␤ in sub f at /tmp/ONO0A8LZRt line 1␤ in block <unit> at /tmp/ONO0A8LZRt line 1␤␤»
15:43 petercom1and is now known as petercommand 15:44 kurahaupo joined, _28_ria left
llfourn m: sub f( *%f (:$a, :$b) ) { say %f.perl }; f :1a 15:44
yoleaux 12:00Z <psch> llfourn: %_ exists, analogue to @_
camelia rakudo-moar a5c46b: OUTPUT«{:a(1)}␤»
llfourn psch: I knew about %_ but I never thought of unpacking it psch++ 15:45
now if only we could unpack a capture...
m: sub f( |a(:$a,:$b) ) { say %f.perl }; f :1a 15:46
camelia rakudo-moar a5c46b: OUTPUT«5===SORRY!5=== Error while compiling /tmp/pgvEu2LfGv␤Variable '%f' is not declared␤at /tmp/pgvEu2LfGv:1␤------> 3sub f( |a(:$a,:$b) ) { say 7⏏5%f.perl }; f :1a␤»
llfourn m: sub f( |a(:$a,:$b) ) { say a.perl }; f :1a
camelia rakudo-moar a5c46b: OUTPUT«\(:a(1))␤»
llfourn m: sub f( |a(:$a,:$b) ) { say $a.perl }; f :1a
camelia rakudo-moar a5c46b: OUTPUT«1␤»
llfourn wow. My life just changed.
15:46 ssotka joined
llfourn that is so damn cool! 15:47
psch huh
15:47 brrt left
psch unpacking of implicit %_ sounds like a wonderfully terrible idea for a slang :P 15:47
something like < sub f ( (:$a, :$b) ) { say %_ } >
llfourn m: sub f( |a(:$a,:$b,$c) ) { say $a.perl; say a; say $c }; f "foo",:1a 15:48
camelia rakudo-moar a5c46b: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Jc5kfDRgqw␤Cannot put required parameter $c after variadic parameters␤at /tmp/Jc5kfDRgqw:1␤------> 3sub f( |a(:$a,:$b,$c7⏏5) ) { say $a.perl; say a; say $c }; f "f␤ expecting any of:␤ …»
llfourn m: sub f( |a($c,:$a,:$b) ) { say $a.perl; say a; say $c }; f "foo",:1a
camelia rakudo-moar a5c46b: OUTPUT«1␤\("foo", :a(1))␤foo␤»
llfourn \o/
psch, does that work? 15:49
psch m: sub f( |a(*@b ($c, *@))) { say $c }; f 1,2,3
camelia rakudo-moar a5c46b: OUTPUT«1␤»
llfourn m: sub f ( (:$a, :$b) ) { say %_ } f :a<weee>;
camelia rakudo-moar a5c46b: OUTPUT«5===SORRY!5=== Error while compiling /tmp/CL_TjzbWVO␤Placeholder variable '%_' cannot override existing signature␤at /tmp/CL_TjzbWVO:1␤------> 3sub7⏏5 f ( (:$a, :$b) ) { say %_ } f :a<weee>;␤»
llfourn hmm
psch llfourn: it can't. %_ isn't declared if there is a signature at all
llfourn right.
psch well, excepting if %_ is in the signature :)
15:49 _28_ria joined
llfourn this is a really great discovery for me 15:50
psch m: sub f( |a(*@b ($c, *@ ($d)))) { say $d }; f 1,2,3
camelia rakudo-moar a5c46b: OUTPUT«Too many positionals passed; expected 1 argument but got 2 in sub-signature in sub-signature of parameter @b in sub-signature of parameter a␤ in sub f at /tmp/d3tKwd9ZjH line 1␤ in block <unit> at /tmp/d3tKwd9ZjH line 1␤␤»
psch m: sub f( |a(*@b ($c, *@ ($d, *@)))) { say $d }; f 1,2,3
camelia rakudo-moar a5c46b: OUTPUT«2␤»
15:51 andreoss left
psch subsubsubsubsignatures /o\ 15:51
llfourn m: sub f( |a($c,:$a,:$b) ) { say $a.perl; say a; say $c }; f "foo","bar",:1a
camelia rakudo-moar a5c46b: OUTPUT«Too many positionals passed; expected 1 argument but got 2 in sub-signature of parameter a␤ in sub f at /tmp/K4mi5Vk0YR line 1␤ in block <unit> at /tmp/K4mi5Vk0YR line 1␤␤»
llfourn good.
perl6devs++ for thinking so far ahead to make unpacking captures work
so I can make subs with sigs that proxy to methods without having to write out all the params again 15:52
llfourn becomes eurphoric
15:53 cognominal left
mst I don't understand what insanity you're planning to perpetrate there, but I think you should make it into a blog post (or make zoffix write one) 15:53
llfourn mst: I think that's a great idea. I will think of some mischief to do with it and do that. 15:55
Ulti llfourn do you know about 'handles' too? 15:56
llfourn Ulti: I don't think so... but ready to learn ^_^ 15:57
15:57 sno left 15:58 Emeric1 joined
Ulti so for a Cat class you might do: has $whisker handles <twitch sense> = Whisker.new(); 15:58
then Cat.twitch will just proxy to the whisker objects method 15:59
iirc
llfourn ah yeah I did know about handles :)
you can also put a role name
moritz m: class A { has @.array handles <push pop shift unshift> }; given A.new(array => [1, 2]) { .push(42); say .array.perl }
camelia rakudo-moar a5c46b: OUTPUT«[1, 2, 42]␤»
llfourn moritz: but iirc you can't put a class name... 16:00
moritz llfourn: maybe, but I've yet to see a case where that's a good idea
llfourn m: class A { has @.a handles Array; } A.new.push("foo").say
camelia rakudo-moar a5c46b: OUTPUT«5===SORRY!5=== Error while compiling /tmp/XiXSPo9fdP␤Strange text after block (missing semicolon or comma?)␤at /tmp/XiXSPo9fdP:1␤------> 3class A { has @.a handles Array; }7⏏5 A.new.push("foo").say␤ expecting any of:␤ infix␤…»
llfourn m: class A { has @.a handles Array; }; A.new.push("foo").say
camelia rakudo-moar a5c46b: OUTPUT«Cannot call push(A: Str); none of these signatures match:␤ (Any:U \SELF: |values is raw)␤ in block <unit> at /tmp/bGKzdzJrsb line 1␤␤»
Ulti probably because you would need an instance whereas a Role would be mixed in to the class with the handles
psch m: class A { has @.a handles Positional; }; A.new.push("foo").say
camelia rakudo-moar a5c46b: OUTPUT«Cannot call push(A: Str); none of these signatures match:␤ (Any:U \SELF: |values is raw)␤ in block <unit> at /tmp/z8iNzdlQer line 1␤␤»
llfourn is there a role with .push in it? 16:01
Ulti Pushable :3
psch curious that it's only the Any:U there
llfourn moritz: handles Array is not a good idea?
RabidGravy the syntax highlighter that is used by the docs htmlify doesn't understand some of the quoting thingies BTW
llfourn hmmm 16:02
moritz llfourn: do you want it to handle everything that Array does? incuding .Bool and .ACCEPTS and what not?
llfourn: or did I misunderstand what 'handles Array' does?
llfourn moritz: that's a good point
16:04 phi__ joined
phi__ Hello, is it normal for "join + @array" to return a blank string? e.g., my @fields = <1 2 3>; my $c = join + @fields; say $c 16:07
I'm using the latest version of Perl 6 (2016-05-11) 16:09
RabidGravy I'm surprised it isn't an error
psch m: say &join.candidates>>.signature
camelia rakudo-moar a5c46b: OUTPUT«(($sep = "", *@values))␤»
psch well, it joins nothing with the number of elements in the array as Str
m: say join +[1,2,3,4]
camelia rakudo-moar a5c46b: OUTPUT«␤»
psch m: say join +[1,2,3,4], "foo", "bar"
camelia rakudo-moar a5c46b: OUTPUT«foo4bar␤»
jnthn Indeed, the + there is prefix +, not infix + 16:10
psch m: say join +<a b c>, "foo", "bar"
camelia rakudo-moar a5c46b: OUTPUT«foo3bar␤»
jnthn So nothing strange
psch phi__: i'd guess your intention was 'join "+", @fields'?
m: my @fields = <1 2 3>; my $c = join '+', @fields; say $c
camelia rakudo-moar a5c46b: OUTPUT«1+2+3␤»
geekosaur or they've confused join with reduce on a conceptual level 16:11
16:11 itaipu left
phi__ @psch, yes, my intention was +, but why doesn't perl6 complain about the lack of comma? 16:11
psch phi__: because it's valid syntax :)
16:11 nicqbot left
psch m: say +[1,2,3] 16:11
camelia rakudo-moar a5c46b: OUTPUT«3␤»
psch m: my @a = ^10; say +@a
camelia rakudo-moar a5c46b: OUTPUT«10␤»
timotimo m: say +, [1, 2, 3] 16:12
camelia rakudo-moar a5c46b: OUTPUT«5===SORRY!5=== Error while compiling /tmp/VbxQCZCSqf␤Prefix + requires an argument, but no valid term found␤at /tmp/VbxQCZCSqf:1␤------> 3say +7⏏5, [1, 2, 3]␤ expecting any of:␤ prefix␤»
timotimo there's your syntax error for "too many commas"
phi__ ok. Thanks. Another question: what is the equivalent in P6 of foldLeft and foldRight?
16:13 Cabanossi left, cognominal joined
timotimo one equivalent is the reduce metaoperator, like [+] 16:13
it'll choose between left and right based on the associativity of the operator you give it 16:14
psch m: my @a = ^5; say @a.reduce(&[**]); say @a.reverse.reduce(&[**])
camelia rakudo-moar a5c46b: OUTPUT«0␤262144␤»
psch not sure if we have "force associativity" in that sense
but yeah, what timotimo++ says is the more perlish one, in my opinion 16:15
llfourn m: class A { has @.a handles BEGIN Array.^method_table.keys.grep({ ! Mu.can($_) }).List }; my $a = A.new; $a.push("foo"); say $a[0] # sorry to interrupt but this is coolish
camelia rakudo-moar a5c46b: OUTPUT«foo␤»
llfourn moritz: ^ I think that's what I want handles Array to do :o
psch m: class A { has @.a handles BEGIN Array.^method_table.keys.grep({ ! Mu.can($_) }).List }; my $a = A.new; $a.push("foo"); say $a 16:16
camelia rakudo-moar a5c46b: OUTPUT«A.new(a => ["foo"])␤»
psch ponders what we have in Any that makes that awkward...
llfourn push :)
m: say ? Any.can('push') 16:17
camelia rakudo-moar a5c46b: OUTPUT«True␤»
psch nah, i think that's fine
cause you want to push to @.a, not to A
RabidGravy yeah, handels <*> blows up on a positional too
llfourn psch: what do you mean? 16:18
psch m: class A { has @.a handles BEGIN Array.^method_table.keys.grep({ ! Mu.can($_) }).List }; my $a = A.new; $a.push("foo"); my $b = A.new.push("bar"); say ($a|$b) ~~ /"foo"/;
camelia rakudo-moar a5c46b: OUTPUT«any(Nil, Nil)␤»
psch that's looks pretty awkward to me :)
16:18 phi__ left
psch oh, no, actually 16:19
i'm not paying enough attention again :P
dogbert17 o/ #perl6
16:21 finanalyst_ left
psch m: say Array.^method_table.keys.grep({ !Mu.can($_) }) 16:21
camelia rakudo-moar a5c46b: OUTPUT«(STORE name List AT-POS BIND-POS unshift splice of shift pop default DELETE-POS reification-target dynamic flat push from-iterator shape ASSIGN-POS append prepend)␤»
psch m: class A { has @.a handles BEGIN Array.^method_table.keys.grep({ ! Mu.can($_) }).List }; my $a = A.new; $a.push("foo"); say $a.name
camelia rakudo-moar a5c46b: OUTPUT«@!a␤»
psch *that* is awkward .P
llfourn o.o lol 16:22
dogbert17 have tried to document a few methods in Complex with the help of S32, if anyone wants to review I'd be grateful. gist.github.com/dogbert17/50d2cdaf...c5240f1626
psch m: class A { has @.a handles BEGIN Array.^method_table.keys.grep({ ! Mu.can($_) }).List; method name { "kitty!" } };
camelia rakudo-moar a5c46b: OUTPUT«5===SORRY!5=== Error while compiling /tmp/29r0s3g4dq␤Package 'A' already has a method 'name' (did you mean to declare a multi-method?)␤at /tmp/29r0s3g4dq:1␤»
llfourn m: [].name.say
camelia rakudo-moar a5c46b: OUTPUT«Nil␤»
llfourn so attrs have a .name method that somehow gets called o.o? 16:23
psch m: my $x = "foo"; say $x.VAR.name
camelia rakudo-moar a5c46b: OUTPUT«$x␤»
llfourn m: class A { has @.a; method foo { @!a.name.say } }; A.new.foo
camelia rakudo-moar a5c46b: OUTPUT«@!a␤»
psch llfourn: containers have a .name method
llfourn m: my $a; say $a.name 16:24
camelia rakudo-moar a5c46b: OUTPUT«Method 'name' not found for invocant of class 'Any'␤ in block <unit> at /tmp/uNA_oOh1mF line 1␤␤»
llfourn ? do you mean attributes?
or am I missing something
psch llfourn: methodop on a scalar calls the method on the value inside the container, not the container
m: say (my $x).VAR.^methods 16:25
camelia rakudo-moar a5c46b: OUTPUT«(<anon> <anon> name of default dynamic WHICH)␤»
llfourn but so do method ops on attributes usually?
psch llfourn: but Array is a container
16:25 pierre_ joined
psch m: my @a; say @a.name 16:25
camelia rakudo-moar a5c46b: OUTPUT«@a␤»
16:25 abraxxa left
psch a container container, even :) 16:25
llfourn eh >.<
I think I need time to absorb that 16:26
RabidGravy the thing about this is that when the expression is a type or a whatever it adds a fallback method to do it rather than explicitly adding a method 16:27
timotimo why wouldn't the RHS of handles be BEGIN-evaluated already without saying "BEGIN"?
llfourn timotimo: because Array.^method_table is not a compile time value 16:28
but maybe it should be wrapped in an implicit BEGIN
so to speak
psch m: class A { has @.a handles Array.^method_table.keys.grep({ ! Mu.can($_) }).List; method name { "kitty!" } };
camelia ( no output )
psch m: class A { has @.a handles Array.^method_table.keys.grep({ ! Mu.can($_) }).List; }; say A.new.push("foo")
camelia rakudo-moar a5c46b: OUTPUT«Cannot call push(A: Str); none of these signatures match:␤ (Any:U \SELF: |values is raw)␤ in block <unit> at /tmp/RSeFPqmVql line 1␤␤»
psch yeah, i think that should be implicit there 16:29
llfourn if you give handles a bogus value it seems not to report and error which is another problem
report an error*
16:30 pierre_ left
RabidGravy yeah, the way it is constructed is that doesn't happen until the method gets called 16:35
timotimo oh, i see 16:38
16:40 cdg_ left
llfourn m: class A { has @.a handles ({; <push> }.()); }; my $a = A.new; $a.push("foo"); say $a.perl 16:44
camelia rakudo-moar a5c46b: OUTPUT«A.new(a => ["foo"])␤»
llfourn that should be runtime
timotimo you can put a few "say" in there to locate the time it runs
psch m: my $x; class A { has @.a handles OUTERS::<$x> }; $x = "push"; say A.new.push("foo"); 16:45
camelia rakudo-moar a5c46b: OUTPUT«Cannot call push(A: Str); none of these signatures match:␤ (Any:U \SELF: |values is raw)␤ in block <unit> at /tmp/1C69j6WFi2 line 1␤␤»
psch vOv
llfourn m: class A { has @.a handles ({say "HELLO"; <push> }.()); }; say "RUNTIME"; my $a = A.new; $a.push("foo"); say $a.perl # good point
camelia rakudo-moar a5c46b: OUTPUT«HELLO␤RUNTIME␤A.new(a => ["foo"])␤»
psch m: my $x = "push"; class A { has @.a handles OUTERS::<$x> }; say A.new.push("foo"); 16:46
camelia rakudo-moar a5c46b: OUTPUT«Cannot call push(A: Str); none of these signatures match:␤ (Any:U \SELF: |values is raw)␤ in block <unit> at /tmp/GUK3UDAiWU line 1␤␤»
llfourn m: class A { has @.a handles ({say "HELLO"; <push> }.()); }; say "RUNTIME"; my $a = A.new; say "CONSTRUCTED"; $a.push("foo"); say $a.perl # good point
camelia rakudo-moar a5c46b: OUTPUT«HELLO␤RUNTIME␤CONSTRUCTED␤A.new(a => ["foo"])␤»
timotimo put a say before the class definition?
llfourn m: say "BEFORE CLASS"; class A { has @.a handles ({say "HELLO"; <push> }.()); }; say "RUNTIME"; my $a = A.new; say "CONSTRUCTED"; $a.push("foo"); say $a.perl # good point
camelia rakudo-moar a5c46b: OUTPUT«HELLO␤BEFORE CLASS␤RUNTIME␤CONSTRUCTED␤A.new(a => ["foo"])␤»
timotimo so it is begin time, eh? 16:47
llfourn m: INIT say "INIT"; class A { has @.a handles ({say "HELLO"; <push> }.()); }; say "RUNTIME"; my $a = A.new; say "CONSTRUCTED"; $a.push("foo"); say $a.perl # good point
camelia rakudo-moar a5c46b: OUTPUT«HELLO␤INIT␤RUNTIME␤CONSTRUCTED␤A.new(a => ["foo"])␤»
llfourn hmm
m: class A { has @.a handles INIT <push>; }; my $a = A.new; $a.push("foo"); say $a.perl
camelia rakudo-moar a5c46b: OUTPUT«5===SORRY!5=== Error while compiling /tmp/NlXsJJDjAe␤Type check failed in binding $expr; expected Any but got Mu (Mu)␤at /tmp/NlXsJJDjAe:1␤»
llfourn im kinda not sure what's happening now 16:48
psch m: say INIT <foo>
camelia rakudo-moar a5c46b: OUTPUT«WARNINGS for /tmp/OJa416xihZ:␤Useless use of constant value foo in sink context (line 1)␤foo␤»
llfourn m: say "RUNTIME"; class A { has @.a handles (say "HELLO") }; my $a = A.new; $a.push("foo"); say $a.perl 16:49
camelia rakudo-moar a5c46b: OUTPUT«HELLO␤RUNTIME␤Cannot call push(A: Str); none of these signatures match:␤ (Any:U \SELF: |values is raw)␤ in block <unit> at /tmp/boe9lPTUHd line 1␤␤»
16:50 itaipu joined
llfourn so handles is run at compile time but unless the value returned from handles is known at the compile time of the compile time it won't work :S 16:51
returned to*
passed to* 16:52
dalek c: a495b5a | (Jan-Olof Hendig)++ | doc/Type/Complex.pod:
Added docs for methods floor, ceiling, round and truncate in class Complex
17:00
17:03 pmurias left 17:08 |2701 joined 17:16 domidumont joined 17:17 Tonik left 17:18 dakkar left 17:29 baest left, grondilu left
RabidGravy m: role F {}; my @a = <a b c d>; $_ does F for @a; # is there a way to do this and not get the warning? 17:30
camelia rakudo-moar a5c46b: OUTPUT«WARNINGS for /tmp/HU7xpsOrYw:␤Useless use of $_ in sink context (use Nil instead to suppress this warning) (line 1)␤»
17:31 acrussell joined
psch m: role F {}; my @a = <a b c d>; $= $_ does F for @a; 17:31
camelia ( no output )
17:32 ufobat left, xue_ left
psch m: role F {}; my @a = <a b c d>; $_ does F for @a; @a[0].WHAT.say 17:32
camelia rakudo-moar a5c46b: OUTPUT«WARNINGS for /tmp/FbmYMUeSaP:␤Useless use of $_ in sink context (use Nil instead to suppress this warning) (line 1)␤(Str+{F})␤»
psch i think the warning is misplaced there, fwiw
RabidGravy yeah
psch m: my @a = ^4; $_++ for @a; say @a[0] 17:33
camelia rakudo-moar a5c46b: OUTPUT«1␤»
psch or it's missing there
17:39 baest joined
RabidGravy m: role F {}; my @a = <a b c d>; Nil // $_ does F for @a; say $_.WHAT for @a ; # shuts it up but eugh 17:40
camelia rakudo-moar a5c46b: OUTPUT«(Str+{F})␤(Str+{F})␤(Str+{F})␤(Str+{F})␤»
psch yeah i think $= is a bit prettier there :) 17:41
RabidGravy yeah
17:42 sortiz joined
psch m: role F {}; my @a = <a b c d>; { no warnings; $_ but= F for @a; } @a[0].WHAT.say 17:42
camelia rakudo-moar a5c46b: OUTPUT«===SORRY!===␤Don't know how to 'no warnings' just yet␤»
RabidGravy boo! 17:43
sortiz \o #perl6 17:44
AlexDaniel where's the line number 17:45
17:47 willthechill left 17:56 spider-mario joined, jjido joined, jjido left, labster joined 17:59 jjido joined, tmtowtdi joined 18:00 bdmatatu joined 18:02 _dolmen_ joined 18:03 xtreak_ joined 18:04 jjido left
sortiz RabidGravy++ # The care for GTK::Simple, lot of work 18:04
RabidGravy I only wanted to make one aoolication with it :) 18:05
bdmatatu Is it possible to have a Date attribute be coerced from a Str? (<git.io/vrPKl>) 18:08
psch bdmatatu: i think you have to do that yourself in BUILD 18:09
bdmatatu Okay, thanks
psch m: sub f(Date(Str) $x) { say $x }; f "2015-12-25" 18:10
camelia rakudo-moar a5c46b: OUTPUT«Method 'Date' not found for invocant of class 'Str'␤ in sub f at /tmp/4tXzM7sxc3 line 1␤ in block <unit> at /tmp/4tXzM7sxc3 line 1␤␤»
mst oh, application, I'd been wondering if you were inventing terms again
psch bdmatatu: the coercion as such doesn't exist in the first place, unlike e.g. Str(Cool)
...although ISTR that coercion in general is somewhat underimplemented still 18:11
perlpilot bdmatatu: Is it possible? Yes. You just have to be prepared to do some more work than just declaring your vars with Date(Str) ;) 18:13
bdmatatu ok...I just tried making a "Date" method for "Str" but got "This type cannot box a native string" 18:14
mst natives don't box, they prefer cricket 18:15
mst twiddles moustache, adjusts monocle 18:16
psch m: class C { has Date $.x; submethod BUILD(Str :$x) { $!x = Date.new($x) } }; say C.new(x => "2015-12-25")
camelia rakudo-moar a5c46b: OUTPUT«C.new(x => Date.new(2015,12,25))␤»
timotimo tee hee, ms 18:17
mst
18:18 _dolmen_ left 18:20 azawawi joined
azawawi ; 18:20
acrussell does perl6 migrate concurrent code to other cores? Suppose I have three functions running to completetion using promises, are all three migrated to different cores? 18:21
18:21 Zoffix__ joined, Zoffix left
TimToady acrussell: yes 18:22
assuming real threads are doing that in your underlying OS, of course
if you don't have multiple cores, well, then, no :)
acrussell TimToady: great, thanks for clarifying! 18:23
TimToady we use a number of worker threads to schedule in-process concurrency
currently defaults to 16 I think
psch m: say $*SCHEDULER.perl 18:24
camelia rakudo-moar a5c46b: OUTPUT«ThreadPoolScheduler.new(initial_threads => 0, max_threads => 16, uncaught_handler => Callable)␤»
TimToady should probably revisit that default sometime before everyone has 1000 cores... :)
perlpilot I'm sure we'll have a "dynamic default" at some point :) 18:25
azawawi so we need a 22-core cpu for optimal performance... :) i.e. ark.intel.com/products/91317/Intel-...e-2_20-GHz
TimToady
.oO(Our Core Values)
18:26
azawawi :)
RabidGravy is anyone running it on some 64 core sparc monster? 18:27
azawawi RabidGravy: what about github.com/perl6/gtk-simple/pull/33 ? :)
RabidGravy I'm going to merge it, just giving a consulatation period ;-) 18:29
consultation
dogbert17 does anyone want to review my attempt to doc methods abs, conj, gist and perl in class Complex? gist.github.com/dogbert17/c8891f3e...7a159152a4 18:30
azawawi RabidGravy: :( 18:31
RabidGravy: :)
18:32 gorgonzola joined
azawawi RabidGravy: anyway it will give me time to test glade to perl6 code 18:32
RabidGravy: anything like that so far?
perlpilot dogbert17++ looks good. 18:34
dogbert17: Is there a reason $z is mentioned in the signature of the sub form? 18:35
of abs
RabidGravy azawawi, take a look at github.com/perl6/gtk-simple/pull/16
just so you get an idea of the kind of code you'll be targetting 18:36
18:36 ZoffixW joined
ZoffixW m: 1000000000000066600000000000001.is-prime.say 18:36
camelia rakudo-moar a5c46b: OUTPUT«True␤»
ZoffixW Cool, no? :)
perlpilot dogbert17: Also, I might spell out the equation on the (3-4i).abs example i.e. say (3-4i).abs; # sqrt(3*3 + 4*4) == 5
18:36 Zoffix joined
dogbert17 perlpilot: no obvious reason no, looked at some other docs and copied it. should I remove it? 18:37
perlpilot dogbert17: no, it's just something my eye picked out as slightly weird 18:38
dogbert17 perlpilot: I'll fix the example
done, gist updated 18:39
18:39 Zoffix__ left
dogbert17 perlpilot: the code in Complex.pm looks like this 'multi sub abs(Complex:D \a) returns Num:D' 18:40
dogbert17 and the precomp bug when running htmlify.p6 strikes again, grrr 18:43
azawawi RabidGravy: cool... just read it
RabidGravy: so basically something like what we did for Wx in Padre metacpan.org/pod/Padre::Plugin::FormBuilder :) 18:46
dalek c: 555615d | (Jan-Olof Hendig)++ | doc/Type/Complex.pod:
Added docs for methods abs, conj, gist and perl in class Complex. perlpilot++
18:49
18:49 ZoffixW left
azawawi RabidGravy: the on-the-fly XML to Class file translation in BEGIN { ... } looks cool until you have big UI projects with many dialogs/windows/components. It adds up to the cost of compiling Perl 6 code and slows down the work of IDEs trying to show errors 18:49
RabidGravy yeah, I'm not that keen on that part 18:50
azawawi RabidGravy: and you need to look at the timestamp of each glade file in question which adds more I/O
RabidGravy: Generating stuff in glade is done once at the start of a project to speed up development and then no one really uses it for maintenance 18:52
RabidGravy: though i could be wrong ofcourse 18:53
azawawi reads developer.gnome.org/gtk3/stable/GtkBuilder.html 18:54
RabidGravy I actually don't find glade any easier than building it by hand 18:55
geekosaur I thought glade got you some isolation from gnome3/gtk3 folks changing everything at the drop of a hat 18:56
azawawi RabidGravy: so more complete widget support is more important than glade translation support atm. I see. 18:57
geekosaur (that is, that was the main reason to prefer glade)
RabidGravy yeah, you'd need to support all the widgets to be able to use glade properly anyway 18:58
azawawi so why not create another project for glade XML -> class translation? 18:59
RabidGravy that would be cool
azawawi GTK::Simple -> widgets wrapper and App::GladeTranslator is a separate effort 19:00
and maybe GTK Scintilla editor support :) 19:02
19:09 willthechill joined 19:12 itaipu left 19:16 AlexDaniel left 19:18 azawawi left 19:19 domidumont left, itaipu joined 19:28 richi235 left
dalek c: 39d583a | (Jan-Olof Hendig)++ | doc/Type/Mix (2 files):
Fixed three broken links
19:31
19:37 nowan left 19:38 richi235 joined 19:39 ZoffixW joined
ZoffixW m: class Foo does Associative {}; my Foo $o .= new; say $o<foo> 19:40
camelia rakudo-moar a5c46b: OUTPUT«Associative indexing implementation missing from type Foo␤ in block <unit> at /tmp/Nju6Wj6YIN line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/Nju6Wj6YIN line 1␤␤»
ZoffixW Are there docs for what exactly "indexing implementation" looks like? Searching for Associative just gives the role docs 19:41
hoelzro ZoffixW: having the error message specify details on what needs doing would be really cool
19:43 nowan joined
RabidGravy yeah 19:44
docs.perl6.org/language/subscripts#...bscripting
ZoffixW Thanks
19:45 firstdayonthejob joined, sno joined
ZoffixW m: class Foo does Associative { method AT-KEY($key) { self.$key() }; method temp { 42 } }; my Foo $o .= new; say $o<temp> 19:46
camelia rakudo-moar a5c46b: OUTPUT«No such method 'CALL-ME' for invocant of type 'Str'␤ in method AT-KEY at /tmp/dIDPsF9tsK line 1␤ in block <unit> at /tmp/dIDPsF9tsK line 1␤␤»
19:46 CIAvash left
ZoffixW Isn't this how to call methods with names stored in a variable :S 19:46
19:47 itaipu left
timotimo no 19:47
you do $foo."$methname"()
$foo.$bar is, i think, the same kind of thing $foo.&bar is
ZoffixW m: class Foo does Associative { method AT-KEY($key) { self."$key"() }; method temp { 42 } }; my Foo $o .= new; say $o<temp> 19:48
camelia rakudo-moar a5c46b: OUTPUT«42␤»
ZoffixW Thanks
timotimo YW
19:50 ZoffixW left
psch m: my $x = sub f($a) { say "!" }; Any.$x() 19:52
camelia rakudo-moar a5c46b: OUTPUT«!␤»
psch m: my $x = sub f($a) { say "!" }; $x(Any:)
camelia rakudo-moar a5c46b: OUTPUT«5===SORRY!5=== Error while compiling /tmp/sS45cKuGYa␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/sS45cKuGYa:1␤------> 3my $x = sub f($a) { say "!" }; $x(Any:7⏏5)␤ expecting any of:␤ colon pair␤»
psch m: say(Any:) 19:53
camelia rakudo-moar a5c46b: OUTPUT«(Any)␤»
psch right, that's "where do we look for the Callable"
19:53 colomon left
psch m: my @a = ^5; map (grep @a: * > 3): &say 19:54
camelia rakudo-moar a5c46b: OUTPUT«4␤»
19:54 colomon joined
psch it really never stops with that colon, does it 19:54
m: my @a = ^5; map( (grep @a: * > 3): &say ) 19:55
camelia rakudo-moar a5c46b: OUTPUT«4␤»
19:55 acrussell left
dalek osystem: 68fedd3 | (Rajkumar Reddy)++ | META.list:
weather

weather for openweathermao
19:58
osystem: e947656 | RabidGravy++ | META.list:
Merge pull request #209 from palapitta/patch-1

   weather
19:58 mst is now known as mst{[, mst{[ is now known as mst
dalek k-simple: 841ab17 | azawawi++ | t/01 (2 files):
Underscores to dashes in test file names
19:59
k-simple: 8a98a1c | azawawi++ | lib/GTK/Simple (5 files):
Move GTK::Simple::Widget into its own file along along with ::Common, ::Raw and ::PropertyFacade
k-simple: 57d81d1 | azawawi++ | lib/GTK/ (7 files):
Refactor ::ConnectionHandler, ::Container and ::Scheduler into their own files
k-simple: a02b052 | azawawi++ | lib/GTK/Simple (8 files):
Refactor more classes into their own files
k-simple: e0538a0 | azawawi++ | lib/GTK/Simple (17 files):
All inner classes/roles have their own files now
k-simple: 444744a | RabidGravy++ | / (35 files):
Merge pull request #33 from azawawi/master

Refactor all inner classes and roles into their own files under GTK::Simple namespace
RabidGravy azawawi++ # nice one
20:04 cdg joined, zxd left 20:09 ZoffixMobile joined 20:11 mls_ is now known as mls
ZoffixMobile *notices Weather.pm6 go into the ecosystem* looks like people are actually reading my articles :) 20:11
20:11 dha joined
ZoffixMobile tries hard not to comment on the implementation of that module... 20:13
20:13 kaare_ left, darutoko left 20:16 colomon left, cpage_ joined
dha Bleah. 20:17
yoleaux 23 May 2016 23:22Z <AlexDaniel> dha: now I understand your point about quote protection
23 May 2016 23:22Z <AlexDaniel> dha: I may be wrong, but it looks like you missed the point that under :ww 'hello world' is a single element
23 May 2016 23:22Z <AlexDaniel> dha: anyway, I've left a comment on your gist
20:18 grondilu joined
dha Bah. I forget the semantics for leaving messages via yoleaux 20:22
RabidGravy .tell dha it's use .tell 20:23
yoleaux RabidGravy: I'll pass your message to dha.
psch .ask dha do you want to ask instead?
yoleaux psch: I'll pass your message to dha.
psch (note, those are not actually different :) )
dha ah.
yoleaux 20:23Z <RabidGravy> dha: it's use .tell
20:23Z <psch> dha: do you want to ask instead?
RabidGravy all good :)
dha .tell AlexDaniel Yes, you are correct. Have commented back. :-) 20:24
yoleaux dha: I'll pass your message to AlexDaniel.
dha .kill all humans
psch .help
yoleaux psch: I'm yoleaux. Type .commands to see what I can do, or see dpk.io/yoleaux for a quick guide.
dha Suggested patch for yoleaux: have it msg that to anyone who msg's "help" to yoleaux... 20:25
20:26 brrt joined
dha Unless that dot-command thing became standard while I wasn't looking. 20:26
brrt .mangle who wants to go to yapc::eu
yoleaux And he wants to implement and yapcan ::
geekosaur there is no standard for bots. I think I'm in 2 other channels with different bots that have .-commands 20:27
brrt .tz
yoleaux brrt: I don't currently have a timezone preference set for you.
geekosaur (one of them has bots that respond to pretty much every other non-alphanumeric prefix though...)
dha That's what I figured. Hence my suggestion that if someone says "help" to the bot, which seems a fairly obvious thing to try, it would respond appropriately. 20:28
psch dha: fwiw, i don't think the author of yoleaux is around here 20:29
dha Ah. 20:30
20:41 ZoffixMobile left 20:47 ocbtec left 20:48 nowan left 20:49 jjido joined 20:51 nowan joined 20:54 jjido left, gorgonzola left 20:57 dwarring joined
Xliff Oh, GHOD. 20:59
I hate OAuth2
21:00 jjido joined
RabidGravy yes, I keep meaning to spin out the partial implementation from webservice::soundcloud 21:03
but it's a pain
21:03 skids left, pmurias joined
dha RabidGravy++ #qqww doc patch 21:04
21:04 Emeric1 left
RabidGravy even the search works :) 21:06
21:07 bdmatatu left 21:08 wamba left
dogbert17 "Initiates spawning of the external program. Returns a promise that will be kept with a Proc::Status object ..." - doc.perl6.org/type/Proc::Async#method_start # is this really correct? 21:13
21:13 brrt left
dogbert17 Can't find this Proc::Status object in the src 21:14
geekosaur thought someone already fixed (or attempted to fix?) that 21:17
dogbert17 Running the code example it seems that a Proc object is returned 21:18
21:22 grondilu left 21:24 ptolemarch left
RabidGravy $!exit_promise.keep(Proc.new(:exitcode(status +> 8), :signal(status +& 0xFF))) 21:26
so yes, that doc is wrong 21:27
dogbert17 RabidGravy: then the doc will be fixed :) thanks for helping out
dalek c: 3f93613 | (Jan-Olof Hendig)++ | doc/Type/Proc/Async.pod:
Fixed error in the documentation for method start. RabidGravy++
21:29
dogbert17 tada
dha Oh, and FWIW, I took a look at the grammar (I'm clearly insane). I still have no idea how :w and :ww figure out what are quotes. 21:30
geekosaur has seen worse grammars... 21:31
21:31 Zoffix left 21:38 xtreak_ left 21:45 willthechill left
dha Oh, I'm sure. 21:47
psch dha: what do you mean "what are quotes"? 21:49
dha There's been discussion on how qqw and qqww work wrt quote preservation. In that context, what counts as a quote? 21:50
psch dha: did you see role ww? 21:51
dha straight quotes, curly quotes, japanese quotes all seem to work. But I think there should be an official description
yep. and japanese quotes, although they are considered quotes in this conext, apparently, are not listed there.
(AFAICT) 21:52
psch oh, that's the weird angle-y things, right?
like, the ones that Match.gist uses
dha Yep.
psch m: say "a" ~~ /(a)/ # just to have them for searching
camelia rakudo-moar a5c46b: OUTPUT«「a」␤ 0 => 「a」␤»
psch token metachar:sym<'> { <?[ ' " ‘ ‚ ’ “ „ ” 「 ]> <quote=.LANG('MAIN','quote')> <.SIGOK> }
ah, that's in RegexGrammar 21:53
dha ...and looking at role ww doesn't give any indication that I should be looking there (again, afaict). 21:54
So figuring out what the *actual* answer is to this, is, IMO, not obvious. (maybe someone who understands the grammar better than I do would be able to figure it out, but... I dunno). 21:55
psch dha: well, afaiu, QGrammar is what parses every q//
dha: and the adverb determin which of the roles inside of QGrammar are applied
+e
21:56 AlexDaniel joined
psch role ww says "if we are :ww, everything that uses one of these quote characters gets a new QGrammar with these roles instead, until we hit FAILGOAL 21:56
"
AlexDaniel .
yoleaux 20:24Z <dha> AlexDaniel: Yes, you are correct. Have commented back. :-)
dalek c: 36044a5 | (Jan-Olof Hendig)++ | doc/Type/Supply.pod:
Two broken links fixed
21:57
dha psch - great. So where does it say "look at RegexGrammar too!"
?
:-/
Also, I'm not really sure how to parse that line you posted from RegexGrammar 21:58
So... I still don't know how to answer the question. Also, since I don't know how RegexGrammar figures into this, I also don't know if there's something *else* that affects this.
Etc. Etc.... blah.. blah... :-)
psch dha: well, it declares a metachar token with the symbol <'> that can be any of those quotes, and inside switches to the quote language 21:59
s/can be any/gets matched when any of the opening quote characters match/
dha: so, basically, it states that where that rule is in effect a metchar that would match ' can also match e.g. 」 22:00
err
the opening one of those two.. :)
of course, that doesn't explain how that goes from Perl6::RegexGrammar into Perl6::QGrammar 22:01
dha Right.
which, again raises the question, what *else* might go into Perl6::QGrammar. :-/
Keep in mind, here, I JUST VOLUNTEERED TO WRITE SOME GOLDARNED DOCUMENTATION 22:02
;-)
psch ...so what's the documentation-level question? :) 22:04
dha when :w does quote preservation... what counts as a quote? 22:05
psch everything that also counts as a quote in the main language
dha (or, conversely, when :ww *doesn't* do it)
psch m: .say for <a <b c>>
camelia rakudo-moar a5c46b: OUTPUT«Value of type List uselessly passed to val() in block <unit> at /tmp/k7duwuvbLL line 1␤a␤<b␤c>␤»
psch grr
dha Great! What are those things?
psch well, except for "end and start character is identical" i suppose
if you want to pull that out of the grammar, it's all the "token quote:sym<..>" declaration 22:06
or you can hope someone volunteers to do that for you... :) 22:07
well, i suppose not all
e.g. token quote:sym<q> is the q// (without the //) construct
dha Aha.
psch eh, it's a bit more involved, anyway :/
like, quote:sym</ /> is obviously QRegex, not QGrammar 22:08
dha So, the stuff under 'proto token quote', then.
psch on a glance, apos, sapos, lapos, hapos, dblq, sdblq, ldblq, hdblq, crnr
those are definitely all variations on q// or qq// 22:09
dha (until the <q>, at least)
ok. *that* seems to be what I was trying to find.
No idea where to put it in the docs, but at least I know where to find it now. 22:10
psch in general, looking for 'nibble(self.quote_lang' is a good hint, yeah
22:10 Zoffix joined
Zoffix m: class Foo is Hash { method weather { self = temp => 42, wind => 'NW'; }; method temp { self<temp> }; method wind { self<wind> } }; my $x = Foo.new; $x.weather; say $x; say .temp, .wind given $x; say $x<temp wind>; 22:10
camelia rakudo-moar a5c46b: OUTPUT«{temp => 42, wind => NW}␤42NW␤(42 NW)␤»
psch that's where we switch into QGrammar
Zoffix Curious, why does this work? Doesn't weather() overwrite the self with a plain hash?
psch Zoffix: what does "plain" mean here? 22:12
Zoffix psch, one that doesn't have methods temp and wind.
psch Zoffix: my gut answer is "assignment calls STORE, which is inherited"
m: class Foo is Hash { method weather { self = Hash.new(temp => 42, wind => 'NW'); }; method temp { self<temp> }; method wind { self<wind> } }; my $x = Foo.new; $x.weather; say $x; say .temp, .wind given $x; say $x<temp wind>; 22:13
camelia rakudo-moar a5c46b: OUTPUT«{}␤(Any)(Any)␤((Any) (Any))␤»
dha psch++
Thanks!
psch m: class Foo is Hash { method STORE { die "no candoozeville, babydoll!" }; method weather { self = Hash.new(temp => 42, wind => 'NW'); }; method temp { self<temp> }; method wind { self<wind> } }; my $x = Foo.new; $x.weather; say $x; say .temp, .wind given $x; say $x<temp wind>;
camelia rakudo-moar a5c46b: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤ in method STORE at /tmp/XJ2j8Zvtau line 1␤ in method weather at /tmp/XJ2j8Zvtau line 1␤ in block <unit> at /tmp/XJ2j8Zvtau line 1␤␤»
psch Zoffix: ^^^ i think my gut is in good shape :) 22:14
22:14 jjido left
psch m: class Foo is Hash { method STORE($:$) { die "no candoozeville, babydoll!" }; method weather { self = Hash.new(temp => 42, wind => 'NW'); }; method temp { self<temp> }; method wind { self<wind> } }; my $x = Foo.new; $x.weather; say $x; say .temp, .wind given $x; say $x<temp wind>; 22:15
camelia rakudo-moar a5c46b: OUTPUT«no candoozeville, babydoll!␤ in method STORE at /tmp/4h4C1f7mF6 line 1␤ in method weather at /tmp/4h4C1f7mF6 line 1␤ in block <unit> at /tmp/4h4C1f7mF6 line 1␤␤»
psch ...i forget which movie that quote was from
dha Looks like it's from How I Met Your Mother. www.youtube.com/watch?v=MAnX98MbfNo 22:16
22:16 rindolf left
psch yeah, found that too 22:17
i don't even like that show :S
dha I'm not a huge fan either. :-)
Zoffix m: class Foo { method STORE ($a, $b) { .say for $a, $b} }; my $x = Foo.new; $x= 42;
camelia ( no output )
psch m: class Foo is Hash { method STORE ($a, $b) { .say for $a, $b} }; my $x = Foo.new; $x= 42;
camelia ( no output )
psch m: class Foo is Hash { method STORE ($a, $b) { .say for $a, $b} }; my $x = Foo.new; $x<a> = 42; 22:18
camelia ( no output )
Zoffix Ah, k: github.com/rakudo/rakudo/blob/nom/.../Map.pm#L9
psch++ thanks
Wait...
dha anyway...
22:18 dha left
Zoffix What does "self = blah" do? Does it call .new? 22:18
psch m: class A { method new { die "yes" }; method foo { self = "foo" } }; A.foo
camelia rakudo-moar a5c46b: OUTPUT«Cannot modify an immutable A␤ in method foo at /tmp/Lnnrcm13UM line 1␤ in block <unit> at /tmp/Lnnrcm13UM line 1␤␤»
psch hrm 22:19
m: class A { has $.a; method new() { die "yes" }; method foo { self = "foo" } }; A.foo(:1a)
camelia rakudo-moar a5c46b: OUTPUT«Cannot modify an immutable A␤ in method foo at /tmp/XH8Histvxu line 1␤ in block <unit> at /tmp/XH8Histvxu line 1␤␤»
psch m: class A { has $.a; method new() { die "yes" }; method foo { self = "foo" } }; A.new(:1a).foo
camelia rakudo-moar a5c46b: OUTPUT«yes␤ in method new at /tmp/edvbiukFgh line 1␤ in block <unit> at /tmp/edvbiukFgh line 1␤␤»
psch there's *probably* a good reason for that... :)
m: use nqp; class A { method new { self = nqp::create(self.WHAT) } }; A.new # i'm thinking this timeouts..? 22:20
camelia rakudo-moar a5c46b: OUTPUT«Cannot modify an immutable A␤ in method new at /tmp/EvaAgwnSKB line 1␤ in block <unit> at /tmp/EvaAgwnSKB line 1␤␤»
psch ah, no, 'cause we haven't blessed yet..?
m: use nqp; class A { method new { self.bless; self = nqp::create(self.WHAT) } }; A.new # i'm thinking this timeouts..? 22:21
camelia rakudo-moar a5c46b: OUTPUT«Cannot modify an immutable A␤ in method new at /tmp/z2Sc34WhS1 line 1␤ in block <unit> at /tmp/z2Sc34WhS1 line 1␤␤»
psch ...OO is weird :P
Zoffix m: class Foo { method STORE ($a: $b) { .say for $a, $b}; method meow { self = 42;} }; my $x := Foo.new; $x.meow
camelia rakudo-moar a5c46b: OUTPUT«Foo.new␤42␤»
Zoffix Well, I think I get it :)
22:22 sufrostico joined 22:23 Possum joined
psch m: class Foo { method STORE ($a: $b) { .say for $a, $b}; method meow { self = 42;} }; my $x = Foo.new; $x.meow 22:24
camelia rakudo-moar a5c46b: OUTPUT«Foo.new␤42␤»
psch hopes the resulting blogpost explains it well
cause i think i don't :)
22:24 Sgeo joined
psch Zoffix++ # lotsa blogging 22:25
Zoffix That's not for a blog, I'm arguing: www.reddit.com/r/programming/comme..._2/d3jfzcw 22:26
xkcd.com/386/ 22:27
22:27 skids joined 22:29 pmurias left 22:30 jjido joined, jjido left 22:31 TEttinger joined
psch Zoffix: i want to knee-jerk "but you can return a Hash and 'but' an update method on it if you need it"... :) 22:31
Zoffix: i'm also not really far into the comment chain :D
AlexDaniel MasterDuke: hey 22:32
MasterDuke AlexDaniel: hey hey
Zoffix psch, heh, right :) I forgot about but :)
AlexDaniel MasterDuke: ok, so one way is to make an account. Then reply button will start working 22:33
Zoffix But the entire argument is pointless really. Both sides are reasonable, I just chose one over the other.
AlexDaniel MasterDuke: another way is to just write an email with [perl #128214] in subject
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128214
AlexDaniel
psch Zoffix: that really is a thing, and i staunchly blame larry for that
(forgetting features, i mean)
AlexDaniel MasterDuke: to [email@hidden.address] I believe
psch Zoffix: also, yeah, the argument is pointless, especially considering the previous point, which implies timtowtdi 22:34
Zoffix: but that's why you linked the xkcd, isn't it
Zoffix ;)
psch oh hm 22:35
MasterDuke ahh, thanks, good to know
psch "Built-in data types are nice because they're guaranteed not to have weird behavior."
Zoffix "is Hash" done
psch that is such a weird argument to me
i mean, it's literally "i don't use modules", isn't it 22:36
because that's the only way to be completely sure of that
MasterDuke AlexDaniel: i do have an account. i thought i tried replying/commenting when logged in, but maybe no
22:36 peteretep left
psch m: module Fooey { use MONKEY-TYPING; augment class Int { method foo { "this isn't particularly Int-y" } } }; import Fooey; say 5.foo 22:37
camelia rakudo-moar a5c46b: OUTPUT«this isn't particularly Int-y␤»
22:37 peteretep joined
psch Zoffix: in the i'd say you missed the opportunity to say "sure, it could be a hash with all those methods stuffed in there, but isn't it weird to expect users to have to look up what new methods a module adds to a built-in data type?", but that'd probably just make them fume 22:38
Zoffix: ah, the final comment there concretizes my understanding. they don't like OO :) 22:40
22:40 bjz left
MasterDuke AlexDaniel: just logged in. however, i can't see anything when logged in. the "display" url (rt.perl.org//Public/Bug/Display.html?id=128214) doesn't work, and the "goto ticket" 22:40
box say no permission to display that ticket 22:41
22:41 cpage_ left
AlexDaniel MasterDuke: in other words, your account is broken when you're logged in? 22:41
MasterDuke: OK, it seems like every new account has this problem
22:42 RabidGravy left
MasterDuke AlexDaniel: ah ha, any solution? 22:42
AlexDaniel MasterDuke: yes. I wrote an email to [email@hidden.address] and somebody fixed my problem
MasterDuke thanks, i'll try the same 22:43
AlexDaniel MasterDuke: do you see SelfService when you login?
or whenever you go anywhere
MasterDuke i see "Tickets" and "logged in as <my email>" 22:44
AlexDaniel MasterDuke: This? files.progarm.org/2016-02-05-02140..._scrot.png
geekosaur it'll be in the URL
MasterDuke yep 22:45
AlexDaniel okay, then it's definitely the same problem :)
we should probably tell people to go bombard [email@hidden.address] right after registering… I don't believe that it is possible to create an account without getting this problem 22:46
MasterDuke email sent 22:47
22:47 willthechill joined
MasterDuke hmm, not so user friendly 22:47
AlexDaniel MasterDuke: ok, now wait. I received a reply in two days 22:48
MasterDuke: meanwhile you can write a comment by sending an email…
MasterDuke now to remember what i was going to say...
AlexDaniel: btw, you're in Estonia? 22:50
AlexDaniel MasterDuke: yes
MasterDuke i spent a week or so in Tallin a couple years ago, really enjoyed it
best salmon i've ever had in my life 22:51
AlexDaniel hah :)
many things have changed over the last few years, e.g. it is much more bicycle-friendly now :) 22:52
that is, you should probably visit it again ;) 22:53
22:53 jrandm joined
MasterDuke i hope to. vana tallinn shots at the dm bar was loads of fun 22:53
23:00 spider-mario left
Zoffix m: my %souped-up-hash = {temp => 42, wind => 'NW'} but role { method update { self<temp wind> = 100, 'SE' } }; say %souped-up-hash; %souped-up-hash.update; say %souped-up-hash; 23:01
camelia rakudo-moar a5c46b: OUTPUT«{temp => 42, wind => NW}␤Method 'update' not found for invocant of class 'Hash'␤ in block <unit> at /tmp/5c0VWcT66S line 1␤␤»
Zoffix No way to do the same as my $x = 42 but ....
?
m: my %souped-up-hash = temp => 42, wind => 'NW'; %souped-up-hash = %souped-up-hash but role { method update { self<temp wind> = 100, 'SE' } }; say %souped-up-hash; %souped-up-hash.update; say %souped-up-hash; 23:02
camelia rakudo-moar a5c46b: OUTPUT«{temp => 42, wind => NW}␤Method 'update' not found for invocant of class 'Hash'␤ in block <unit> at /tmp/HedILDbxar line 1␤␤»
Zoffix :S
m: my $souped-up-hash = %(temp => 42, wind => 'NW') but role { method update { self<temp wind> = 100, 'SE' } }; say $souped-up-hash; $souped-up-hash.update; say $souped-up-hash; 23:03
camelia rakudo-moar a5c46b: OUTPUT«{temp => 42, wind => NW}␤{temp => 100, wind => SE}␤»
Zoffix Something to do with containers...
23:05 bjz joined 23:07 bjz left 23:08 bjz joined, firstdayonthejob left 23:12 bjz left 23:14 _dolmen_ joined
Zoffix m: sub weather-for ($a, $b) { %( temp => $a, wind => $b ) }; say weather-for <Brampton ca> 23:15
camelia rakudo-moar a5c46b: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤ in sub weather-for at /tmp/c1jyMKzBDf line 1␤ in block <unit> at /tmp/c1jyMKzBDf line 1␤␤»
Zoffix I could've swore stuff like that auto-flattened :S
timotimo no, like that they'd never do that 23:16
only if you make it slurpy or flatten it with |
Zoffix k, I may be confusing this with Perl 5 :/
timotimo yeah, perl5 does it like that i believe
23:16 kid51 joined
timotimo because you always do $foo, $bar = @_ 23:16
23:22 vendethiel- left 23:29 cpage_ joined 23:32 kid51 left 23:36 kid51 joined 23:38 nadim left 23:46 cdg left 23:47 cdg joined 23:51 cdg left