00:03 yqt left 00:05 cognominal left, cognominal joined 00:17 mr_ron left, mr_ron joined 00:30 leont left 00:41 aborazmeh joined, aborazmeh left, aborazmeh joined 00:44 laouji joined 00:53 tokuhiro_ joined 00:54 pmurias left 00:57 tokuhiro_ left 01:02 mr_ron left 01:09 Zoffix is now known as CPAN2, CPAN2 is now known as Zoffix_, Zoffix_ is now known as FunBag, FunBag left
awwaiid hm. Well I was going to ask a question about some slang thing I was messing with but then I saw that whitespace-before-method-dot (or infix:<.>) is core now. amazing. 01:11
01:11 lichtkind joined 01:12 Zoffix joined 01:13 mr_ron joined 01:20 aborazmeh left
Juerd awwaiid: Before and after, if you like :) 01:20
awwaiid hops up and down and mutters about being excited for Christmas 01:24
01:36 BenGoldberg joined
Zoffix mumbles something about this still being just September 01:40
timotimo learnxinyminutes probably has some verbiage about "you have to put a \ after $foo and before the newline" 01:42
timotimo disappears
01:51 lichtkind_ joined 01:58 vvz left 02:08 makapa joined, kid51_ joined 02:10 lichtkind_ left, kid51 left 02:11 kid51_ is now known as kid51 02:19 telex left 02:20 telex joined 02:21 mr_ron left 02:24 kid51 left
dalek kudo/nom: e5a266b | TimToady++ | src/Perl6/Actions.nqp:
infix:<o> shouldn't curry WhateverCode
02:33 AlexDaniel left
dalek ast: fc511ea | TimToady++ | S03-operators/composition.t:
test o against whatevers
02:35 noganex joined 02:38 noganex_ left 02:45 makapa left 02:54 tokuhiro_ joined 02:58 kaare_ joined 02:59 tokuhiro_ left 03:12 pierrot left 03:13 tokuhiro_ joined, pierrot joined 03:21 lichtkind left 03:39 makapa joined 03:44 makapa left 04:15 makapa joined 04:27 makapa left 04:28 makapa joined 04:36 skids left 04:40 [Sno] left 04:43 davido_ joined 05:00 BenGoldberg left
dalek kudo/nom: 92be579 | TimToady++ | src/core/Range.pm:
Calculate elems of non-num range more directly
05:32 makapa left 05:36 anon joined 05:37 anon is now known as Guest72063 05:44 Guest72063 left, Guest72063 joined 05:45 araujo left, Guest72063 is now known as wooden_, araujo joined 05:48 wooden_ left 05:56 darutoko joined 05:57 emilbarton joined
emilbarton hello, how can I pass a reference to a class as attribute in another class and not get "Cannot lookup attributes in a Type object" when trying to use a method of the first class within a method in the second one? 05:58
I mean a ref to a class instance 06:02
06:05 [Sno] joined 06:09 FROGGS joined
emilbarton hello, how can I pass a reference to a class instance as attribute in another class and not get "Cannot lookup attributes in a Type object" when trying to use a method of the first class within a method in the second one? 06:20
FROGGS .tell jnthn why will shaped arrays in future declared as 'my @a[3,3]' but used as '@a[1;1] = 42'? why not semicolons in the decl too? 06:27
yoleaux FROGGS: I'll pass your message to jnthn.
nine emilbarton: if you can show us some code, that would help answering your question 06:30
FROGGS .tell Skarsnik You'd declare the CStruct as 'class Foo is repr<CStruct> { has int32 $.bar }' and then 'say nativecast(Foo, $pointer)' 06:33
yoleaux FROGGS: I'll pass your message to Skarsnik.
06:37 Ven joined
TimToady they're declared as my @a[3;3] 06:37
Ven waves 06:38
06:40 bjz joined 06:41 bjz left 06:46 davido_ left
moritz particles 06:49
emilbarton hello, how can I pass a reference to a class instance as attribute in another class and not get "Cannot lookup attributes in a Type object" when trying to use a method of the first class within a method in the second one? 06:51
nine emilbarton: if you can show us some code, that would help answering your question 06:55
emilbarton nine: Class1 { method my1 { ... } } ; Class2 { has Class1 $!classref; method my2 { .. $!classref.my2() } }; my Class1 $C1 = new.(); my Class2 $C2 = new.( classref => $C1 ); $C2.my2(); # Cannot lookup attributes in a Type object... 06:57
nine m: class Class1 { method my1 { } } ; class Class2 { has Class1 $.classref; method my2 { $!classref.my1() } }; my Class1 $C1 = Class1.new(); my Class2 $C2 = Class2.new( classref => $C1 ); $C2.my2(); 06:59
camelia ( no output )
nine emilbarton: a fixed version ^^^
emilbarton yes I forgot Classx. but that's not the point, it still answers idem 07:00
nine emilbarton: the error is in the has Class1 $!classref; That creates a private attribute which the default constructor does _not_ set. You have to make it public or to add your own BUILD method to initialize it using the parameter of the constructor.
07:01 abraxxa joined
nine emilbarton: doc.perl6.org/language/classtut#Constructors 07:01
emilbarton nine: I thought there was no real public attribute in perl6 ($.classref does n't help) 07:02
nine emilbarton: that's sort of true. The attribute itself is still only accessible through the accessor methods. But those are generated for you by declaring it as has $.classref; and this also tells the constructor to initialize it. 07:03
m: class Class1 { has $.foo = "foo"; method my1 { self.foo; } } ; class Class2 { has Class1 $.classref; method my2 { $!classref.my1() } }; my Class1 $C1 = Class1.new(); my Class2 $C2 = Class2.new( classref => $C1 ); $C2.my2();
camelia ( no output )
nine emilbarton: also a reference to a class instance is more commonly referred to as "object". 07:05
emilbarton nine: ok, I see where it messed up, I already have a BUILD() in Class2 but forgot to update it when I added classref. Thanks. 07:08
07:10 eugu joined 07:11 Ven left 07:12 emilbarton left
tokuhiro_ hi, i got a issue around IO::Socket::Async. my network server written in perl6 stucks around 1000 requests. 07:13
code is here: gist.github.com/tokuhirom/0b6901f3cea1c3bf6170
07:14 bjz joined
FROGGS TimToady: okay, so just a typo in jnthn++'s blog :o) 07:16
tokuhiro_ ah, i forgot to close socket. 07:20
07:21 bjz left, bjz joined 07:24 bjz left 07:29 Ven joined
Ven I just realized D has a similar features to our phaser, but with a separate keyword (instead of uppercased ones): `scope(success) write("yay"); scope(failure) write(":(");` 07:35
(I just uppercased names are just considered "not explicit enough" in that kind of area) 07:36
07:38 bjz joined
.oO( explicit content )
07:42 g4 joined
timotimo plasmas 07:52
masak good state of matter, timotimo
timotimo though i find you can't really write "/me liquids" or "/me gasses" without it sounding ... funny in a bad way :) 07:53
moritz better than a matter of state, for sure
masak .oO( enemy of the states of matter ) 07:54
lizmat condenses
moritz waits for somebody to (re)sublimate 07:55
Ven m: say(); say() 07:56
camelia rakudo-moar 92be57: OUTPUT«␤␤»
lizmat m: note(); note() 07:57
camelia rakudo-moar 92be57: OUTPUT«Noted␤Noted␤»
lizmat m: note; note
camelia rakudo-moar 92be57: OUTPUT«Noted␤Noted␤»
moritz duly.
Ven .oO( /dullies ) 07:58
timotimo no time for duly dallying 08:03
lizmat m: say (-> --> Int { |(1,2,3) })().WHAT # eh, shouldn't this fail ? 08:09
camelia rakudo-moar 92be57: OUTPUT«(Slip)␤»
08:11 duncan_dmg joined
masak lizmat: at compile time, yes. 08:11
lizmat well, ideally, yes
masak yes
lizmat but I'll settle for runtime
for now
masak .oO( or both ) :P
lizmat m: say (-> --> Int { fail })().WHAT
camelia ( no output )
lizmat m: say (-> --> Int { die })().WHAT 08:12
camelia rakudo-moar 92be57: OUTPUT«Died␤ in block <unit> at /tmp/i4Xc5H0FAT:1␤␤»
timotimo well, fail works with the outer Routine, so at least i understand the first thing
08:12 RabidGravy joined
lizmat RT #126232 submitted 08:20
08:28 eugu left 08:31 Khisanth left 08:32 larion joined 08:36 vvz joined 08:41 dakkar joined 08:43 telex left 08:51 Khisanth joined 08:54 laouji left 08:58 laouji joined, telex joined 09:01 ][Sno][ joined, bjz left 09:02 bjz joined 09:04 [Sno] left
timotimo it seems like i didn't push the manual change to the CALLER::CALLER:: stuff 09:04
and i also didn't start implementing the optimization in the static optimizer 09:06
another thing is that my manual optimization didn't factor out the CALLER::CALLER:: into a single lookup yet 09:07
that could also give a tiny performance boost on top of what's already there 09:08
though of course the nqp ops that access the lexpad "directly" aren't nearly as expensive as allocating a pseudostash or something like that 09:09
09:31 laouji left 09:34 laouji joined 09:38 ChoHag joined
ChoHag I have (want) a class which has a Foo attribute. A Foo can be created from a string (and a string created from a Foo) so Foo has a method new (Str $newfoo) { ... }. How can I create an attribute so that the class using it will create it from a string without needing to manually create a Foo? 09:43
yoleaux 1 Sep 2015 20:46Z <TimToady> ChoHag: irclog.perlgeek.de/perl6/2015-08-30#i_11144152 looks like a bug to me, since .= is sugar for assignment, and assignment is supposed to be eager; please file a bug report, if you haven't already
timotimo do we still have the COERCE multi sub? 09:44
ChoHag ie. how can I enable the ability to say Bar.new(foo => "Something") rather than being forced to say Bar.new(foo => Foo.new("Something"))?
timotimo well, with a .new it's very easy
if all else fails, the constructor can do the conversion for you
and you can have a Proxy for your attribute that does conversion as well
so no tricky business needed even in that case 09:45
does that help, ChoHag? 09:47
if Str had a method "Foo" on it, you can just set the type of $.foo to be Foo(Str) 09:48
you can augment Str to have that method, but subclasses of Str won't have it (like IntStr, NumStr, RatStr, Complexstr)
ChoHag No, I want to be able to use it in locations other than another class' attribute. 09:49
ie. my SpecialString $foo = "normal-string-but-fooified". 09:50
timotimo unless you declare $foo to be coercive (like Foo(Str)) that won't work
ChoHag my SpecialString(Str) $foo? 09:51
timotimo yeah
that will call .SpecialString on anything that's Str
09:51 laouji left
ChoHag So can I have something like ReallySpecialString which stands in for SpecialString(Str)? 09:53
timotimo there used to be something that'd allow you to declare coercions as a multi sub, but that has the problem that unless you export that multi sub into other scopes, the coercion wouldn't work there
good question
m: constant CToInt = Int(Str); my CToInt $foo = "100"; say $foo.WHAT 09:54
camelia rakudo-moar 92be57: OUTPUT«5===SORRY!5=== Error while compiling /tmp/IwUEdyBXDu␤Coercion Int(Str) is insufficiently type-like to qualify a variable␤at /tmp/IwUEdyBXDu:1␤------> 3nstant CToInt = Int(Str); my CToInt $foo7⏏5 = "100"; say $foo.WHAT␤ expecting any of…»
timotimo m: my Int(Str) $foo = "100"; say $foo.WHAT
camelia rakudo-moar 92be57: OUTPUT«5===SORRY!5=== Error while compiling /tmp/WjQi1BQkqO␤Coercion Int(Str) is insufficiently type-like to qualify a variable␤at /tmp/WjQi1BQkqO:1␤------> 3my Int(Str) $foo7⏏5 = "100"; say $foo.WHAT␤ expecting any of:␤ constraint␤»
timotimo oh, i didn't know that doesn't work
that seals it, then
ChoHag Well basically what I have/want is an object which can search through a bunch of linked items. The search object needs to be passed around/stored in various places, and the original string needs to be obtainable from it. 10:00
And basically I want to be able to provide a regular string in all the places the search object is expected and have it magically turn into a search string for me. 10:01
Pretty basic.
gfldex ChoHag: did you consider to subclass Str? 10:02
timotimo doesn't really help to make the code simpler there
there's a module that'll let you change how literals are created, but that'll really only enhance your literals 10:03
and it'll enhance "all" literals
what you can do is mix in a role to improve your Str into the SearchStr 10:04
10:04 lizmat left, lizmat joined
ChoHag role Magic { ... }; class SearchStr is Str does Magic { ... }? 10:04
timotimo not even that 10:05
role Magic { ... }; my $foo = "foobar" but Magic;
10:05 espadrine joined
timotimo sub searchWithMagic($inputStr is rw) { $inputStr does Magic unless $inputStr ~~ Magic; ... } 10:05
10:10 laouji joined
ChoHag So anywhere I need a magic string but can coerce to one from a regular string I need to do so explicitely? 10:11
timotimo seems so 10:12
ChoHag Sticking to constructors then, how do I enhance this: 10:13
m: role Magic { method end { "knob" } }; class Wizard { has Magic $.staff }; my $rincewind = Wizard.new(staff => "wizzard");
camelia rakudo-moar 92be57: OUTPUT«Type check failed in assignment to $!staff; expected Magic but got Str␤ in block <unit> at /tmp/OyhDQgdKqC:1␤␤»
10:14 rindolf joined
timotimo m: role Magic { method end { "knob" } }; class Wizard { has Magic $.staff; method new(Str :$staff) { self.bless(staff => $staff ~~ Magic ?? $staff !! $staff but Magic) } }; my $rincewind = Wizard.new(staff => "wizzard"); say $rincewind.staff.perl 10:15
camelia rakudo-moar 92be57: OUTPUT«"wizzard"␤»
timotimo m: role Magic { method end { "knob" } }; class Wizard { has Magic $.staff; method new(Str :$staff) { self.bless(staff => $staff ~~ Magic ?? $staff !! $staff but Magic) } }; my $rincewind = Wizard.new(staff => "wizzard"); say $rincewind.staff.end
camelia rakudo-moar 92be57: OUTPUT«knob␤»
ChoHag Of course. I should have known that. 10:17
10:19 laouji_ joined, laouji left 10:20 Ven left
ChoHag Is there any advantage to the ternary rather than a multi method which distinguishes between Str :$staff and Magic :$staff? 10:23
grondilu suspects using a multi is better a choice 10:25
because possible compile time optimizations or something 10:26
but other people surely know better
gfldex m: my Int|Str $a;
camelia rakudo-moar 92be57: OUTPUT«5===SORRY!5===␤Type 'Int' is not declared. Did you mean 'int'?␤at /tmp/kuUWtnhKeF:1␤------> 3my Int7⏏5|Str $a;␤Malformed my␤at /tmp/kuUWtnhKeF:1␤------> 3my Int7⏏5|Str $a;␤␤»
gfldex i'm pretty sure Int is declared
grondilu m: my int|Str $ 10:27
camelia rakudo-moar 92be57: OUTPUT«5===SORRY!5===␤Type 'int' is not declared. Did you mean 'Int'?␤at /tmp/3S4oURehT5:1␤------> 3my int7⏏5|Str $␤Malformed my␤at /tmp/3S4oURehT5:1␤------> 3my int7⏏5|Str $␤␤»
grondilu lol
gfldex and i believed that used to work
m: sub foo(Int|Str $a){};
camelia rakudo-moar 92be57: OUTPUT«===SORRY!===␤No compile-time value for Str␤»
10:28 zakharyas joined 10:32 kid51 joined
moritz gfldex: you can make an explicit subtype 10:33
subset IntOrStr of Cool where Int|Str
10:36 AlexDaniel joined
grondilu m: my Str|Int $ 10:38
camelia rakudo-moar 92be57: OUTPUT«5===SORRY!5===␤Type 'Str' is not declared. Did you mean 'str'?␤at /tmp/FI7BDfvGlk:1␤------> 3my Str7⏏5|Int $␤Malformed my␤at /tmp/FI7BDfvGlk:1␤------> 3my Str7⏏5|Int $␤␤»
dalek osystem: 66aa639 | (Tokuhiro Matsuno)++ | META.list:
Retire Raw-Socket
10:58 andreoss joined 11:08 abraxxa left, rindolf left 11:13 vvz left 11:14 Ven joined, g4 left 11:19 telex left 11:20 telex joined
masak grondilu: that's definitely a LTA error message. 11:28
11:29 cognominal left
masak so is the one with the `foo(Int|Str $a){}` 11:30
Ven .tell timotimo irclog.perlgeek.de/perl6/2015-10-01#i_11301705 something like this, probably
yoleaux Ven: I'll pass your message to timotimo.
gfldex i rakudobuged that LTA as #126234
Ven m: say (*o*) 11:31
camelia rakudo-moar 92be57: OUTPUT«WhateverCode.new␤»
Ven it's great to have smileys :-)
11:31 rindolf joined
moritz m: say (*o*)(* * 2, * + 2)(5) 11:31
camelia rakudo-moar 92be57: OUTPUT«14␤»
Ven m: my \id = -> $a { $a }; (*o*)(id, id)(5).say
camelia rakudo-moar 92be57: OUTPUT«5␤»
moritz still occasionally wants * as a callable to be the identity function 11:32
timotimo don't we have an identity method now, though? 11:33
yoleaux 11:30Z <Ven> timotimo: irclog.perlgeek.de/perl6/2015-10-01#i_11301705 something like this, probably
11:34 [ptc] joined, [ptc] left
lizmat moritz: it it is just for map, we could e.g. add a candidate for Whatever ? 11:34
moritz lizmat: no, never for map 11:35
usually for experimenting with other higher-order functions
lizmat where would you use it as a callable then ?
I usually use something like *.Str
Ven timotimo: I want to update the learnx big time for xmas 11:39
timotimo it gets mentioned from time to time on twitter still
mostly in the "look at this crazy shit, a hundred pages to learn the basics of perl6" 11:40
11:40 ptc joined, ptc is now known as Guest69182, Guest69182 left
Ven timotimo: I'd be interested to see such tweets 11:42
"the author got a bit carried away :)" well, as a learnx contributor, I can say without a single doubt that the perl6 tutorial goes far, far, far beyond what the others provide 11:44
timotimo right 11:45
Ulti .tell tony-o just sent you a little pull request for Slang::SQL for use nqp; there is another issue around the /is rw/ ish changes 11:46
yoleaux Ulti: I'll pass your message to tony-o.
11:52 ptc_ joined, ptc_ is now known as [ptc] 11:53 FROGGS[tab] left 11:54 [ptc] left 11:55 [ptc] joined, laouji_ left 11:57 lizmat left 12:01 rindolf left 12:02 FROGGS[tab] joined 12:03 [ptc] left, [ptc] joined
Ven timotimo: not sure that's a bad, or good thing, per se 12:12
12:16 sufrostico joined
timotimo it makes a little bit of a bad impression; learnxinyminutes isn't the right place for such a big thing, it seems 12:19
i'm not saying "you did bad" or "the tutorial isn't good"; it's just the unfortunate view of others :\
Ven timotimo: that's why I stopped putting stuff in it, fwiw 12:20
Ven certainly has tons of ideas on how to make ruby's tutorial 10 times bigger
ShimmerFairy Just giving it a quick glance, it seems like it needs a serious reduction, if my understanding of xinyminutes as an introduction to get you up and running is correct. 12:21
12:21 rindolf joined 12:23 AlexDaniel left 12:24 abraxxa joined 12:35 ZoffixWork left 12:42 zakharyas left 12:47 zakharyas joined
dalek osystem: 9a888ba | (Shoichi Kaji)++ | META.list:
add HTTP::Tinyish
osystem: f16bd64 | (Zoffix Znet)++ | META.list:
Merge pull request #62 from shoichikaji/http-tinyish

add HTTP::Tinyish
masak maybe the learnx page should link on to pages of the perl6 docs, for example. 12:56
"look here to learn more!", like
Ulti or clone the structure from other languages and fill out the Perl 6 stuff doc.rust-lang.org/stable/book/ 12:58
I semi started doing that via a git books site 12:59
Ven I should probably start writing my blog...
13:03 pippo joined
pippo m: say lines(); 13:03
camelia rakudo-moar 92be57: OUTPUT«(Céad slán ag sléibhte maorga Chontae Dhún na nGall Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll; Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí I mo dhiaidh bhí gleanntáin ghlas’ Ghaoth…»
Ulti m: lines().elems.say 13:04
camelia rakudo-moar 92be57: OUTPUT«20␤»
pippo m: say grep {/^C/}, lines();
camelia rakudo-moar 92be57: OUTPUT«Method 'match' not found for invocant of class 'Any'␤ in block <unit> at /tmp/yY3Dm2vEXU:1␤␤»
13:04 aborazmeh joined, aborazmeh left, aborazmeh joined
pippo ^^ that used to work. 13:05
moritz m: say grep /^C/, lines()
camelia rakudo-moar 92be57: OUTPUT«(Céad slán ag sléibhte maorga Chontae Dhún na nGall)␤»
Ulti m: lines().map( *.words.elems ).Bag.perl.say
camelia rakudo-moar 92be57: OUTPUT«(5=>1,9=>1,12=>1,13=>4,11=>1,8=>1,16=>2,15=>2,14=>3,0=>3,17=>1).Bag␤»
moritz workaround
pippo moritz: thank you. Is is a bug?
ShimmerFairy pippo: I seem to recall jnthn calling that an accident that it ever did work, but I'm not sure.
pippo ShimmerFairy: Hah. OK then. I'll correct my script. 13:06
Thank you all!
moritz m: given 'abc' { say !/x/ } 13:07
camelia rakudo-moar 92be57: OUTPUT«Method 'match' not found for invocant of class 'Any'␤ in block <unit> at /tmp/xMRcmv9l9D:1␤␤»
moritz I'm sure *that's* a bug
and somehow it smells like the same (or a similar) issue
ShimmerFairy moritz: perhaps, though to be honest I've never seen someone try to negate a regex (and visually, it just doesn't make sense to me) 13:08
at least, not until people started pointing out that bug :)
13:08 duncan_dmg left
moritz ShimmerFairy: I've seen it quite often 13:08
ShimmerFairy P5 must be weird then :P 13:09
moritz my @sane = grep { !/\s/ }, @list_of_potential_usernames
ShimmerFairy: it's not negating the regex, it's negating the result of the regex match
ShimmerFairy moritz: but it reads like negating a regex. I'd argue that you shouldn't expect it to work in the first place.
(and fwiw I still think not using ~~ to match against a regex is kinda weird :P) 13:10
13:10 duncan_dmg joined
moritz ShimmerFairy: but why not? 13:11
ShimmerFairy: /foo/ works in a boolean context
ShimmerFairy: and a negation provides a boolean context
13:11 Ven left
moritz programming languages are all about composing bigger pieces from smaller ones, some composability is really key 13:11
if you think something *shouldn't* compose, you need a really good argument to convince me. 13:12
ShimmerFairy moritz: I honestly think it's a mistake that m// and friends magically match against $_ . And I still say it reads like you're negating the actual regex
pippo my @a = <a b c>; my regex letters = { @a }; say grep /^<letters>/, lines();
m: my @a = <a b c>; my regex letters = { @a }; say grep /^<letters>/, lines();
camelia rakudo-moar 92be57: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Zai3tUiH0z␤Malformed regex␤at /tmp/Zai3tUiH0z:1␤------> 3my @a = <a b c>; my regex letters 7⏏5= { @a }; say grep /^<letters>/, lines()␤»
moritz ShimmerFairy: well, but // does match against $_, even if you don't like it 13:13
ShimmerFairy: and "it reads like" doesn't convince me. To me, it doesn't read like it.
pippo: just "my regexe letters { ... }"
m: my @a = <a b c>; my regex letters { @a }; say grep /^<letters>/, lines;
camelia rakudo-moar 92be57: OUTPUT«()␤»
13:13 rindolf left
moritz m: my @a = <A B C>; my regex letters { @a }; say grep /^<letters>/, lines; 13:13
camelia rakudo-moar 92be57: OUTPUT«(Céad slán ag sléibhte maorga Chontae Dhún na nGall Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll; Ag taisteal dom amach trí chnoic Ghleann Domhain ’s an Mucais ar mo chúl Ach trom lámh Gall, le cluain 's le feall, a thi…»
ShimmerFairy moritz: regardless, it looks to me like you're negating the regex. It'd be like claiming that !"str" didn't negate the string, but rather negated the result of doing $_ eq "str" 13:14
moritz ShimmerFairy: ! simply negates the boolean value of whatever comes after it
ShimmerFairy: and the boolean value of a regex just happens to be the match against $_
pippo moritz: TY
m: my @a = <a b c>; my regex letters { @a }; say grep /^<letters>/, lines();
camelia rakudo-moar 92be57: OUTPUT«()␤»
moritz ShimmerFairy: so, by current rules, it should work. That it does not is a bug 13:15
pippo m: my @a = <a b C>; my regex letters { @a }; say grep /^<letters>/, lines();
camelia rakudo-moar 92be57: OUTPUT«(Céad slán ag sléibhte maorga Chontae Dhún na nGall)␤»
eiro hello #p6 folks
pippo eiro: o/
timotimo yeah, /foobar/ isn't the regex, it's an application of the regex already
otherwise you'd write rx/.../ or regex { ... }
ShimmerFairy moritz: that's far too magical a boolean value for my tastes.
m: $_ = "abc"; say ?rx/def/ # then this shouldn't fail, if rx// is meant to be an unapplied regex, no? 13:16
camelia rakudo-moar 92be57: OUTPUT«Method 'match' not found for invocant of class 'Any'␤ in block <unit> at /tmp/g50UwRos6q:1␤␤»
moritz ShimmerFairy: I understand that. You mentioned that multilple times. But that doesn't preclude composability
eiro i remember seeing somthing like the haskell all@(x:xs) in perl6 and currently trying to find the relevant documentation about it 13:18
13:18 skids joined
eiro any clue ? 13:18
ShimmerFairy moritz: You can't convince me otherwise that !/.../ looks so, so wrong. I'm totally fine with the current behavior.
moritz m: sub f(*@all [ $first, *@rest] ) { say @rest }; f <a b c>; # for eiro 13:19
camelia rakudo-moar 92be57: OUTPUT«[b c]␤»
moritz subsignatures
not sure where or if they are documented
eiro thanks moritz 13:21
13:22 Ven joined
moritz eiro: doc.perl6.org/type/Signature#Destru...Parameters 13:26
masak moritz++ 13:28
13:34 rindolf joined
jdv79 ShimmerFairy: Perl is all about terse magic stuff like that. 13:35
pippo o/ #perl6 13:37
13:37 pippo left
masak ShimmerFairy: as another data point, I have no problem with reading !/\s/ in the intended way, as "match $_ against /\s/ and negate the result" 13:39
ShimmerFairy: to be more precise, there are many situations in Perl 6 (and Perl 5) where a regex stands in for its match result
ShimmerFairy: I agree that it's one thing we could aggressively wash that out of the language (like we are slowly doing with implicit flattening everywhere). but I just don't see the reason. 13:40
eiro thanks moritz... i realize i have to make those terms appear in my slides 13:41
jdv79 wash out topical? 13:42
eiro since [+] ^5; why not [&say] ^5 ?
masak jdv79: wash out auto-matching regexes. 13:44
Ven eiro: because &say could be an array value :)
m: [[&say]] &5; # eiro: hence
camelia ( no output )
jdv79 but thst basically kills one liners
Ven m: [[say]] &5; # eiro: hence 13:45
camelia rakudo-moar 92be57: OUTPUT«5===SORRY!5=== Error while compiling /tmp/IkIr9DhIIb␤Unsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument, or use &say to refer to the function as a noun␤at /tmp/IkIr9DhIIb:1␤------> 3…»
ShimmerFairy jdv79: no it doesn't, you can always do $_ ~~ /.../ (I myself have never done without using ~~, as far as I can recall) 13:46
eiro fair enought ... so if [[&say]] ^5, why not [[-> $x , $y { $x + $y }]] ?
jdv79 that alone would push most of minr to a file 13:47
terseness is serious biz in one liners 13:48
13:49 zakharyas left
eiro Ven, ok ... i just realized what [[&say actually is ... forget the question :) 13:51
Ven m: [[&say]] ^5; # eiro: hence
camelia rakudo-moar 92be57: OUTPUT«01␤True2␤True3␤True4␤»
Ven heh.
eiro i'm so excited about [] i hopped we could use a function there 13:52
masak eiro: the parser needs to decide whether the thing it's seeing is a reduce metaop, or an array. 13:55
eiro: [42] is an array. so is [[[[1]]]]. so is [&say]
eiro: only if it sees an infix op in there does it go the metaop path.
13:57 TEttinger left
eiro masak, thanks for those lines 13:58
masak eiro: in general, if you need to reduce on a function, I'd recommend using the .reduce method on lists/arrays. 14:00
m: sub foo($l, $r) { 5 * $l + $r }; say [1, 2, 3, 4].reduce(&foo) 14:01
camelia rakudo-moar 92be57: OUTPUT«194␤»
eiro that's what i'm trying to do right now.
masak eiro: the reason what you were trying is kind of hard is that there *should* be a barrier between the op and function namespaces 14:02
or rather, between their usage syntax
eiro i got it ... not the deep way (i need years for that) but a "pragmatic" way. 14:03
the thing is: whenever there is a operator, i prefer it over the method call 14:04
masak remember that locally, in your lexical scope, you can always create all the functions and operators that you need 14:05
that means you get your wish inside that scope, without screwing up the environment for everyone outside of that scope
more and more I do this, and I really like that Perl 6 supports this in a big way by making a lot of things lexical
eiro i already love it too :) 14:08
PerlJam It's funny to me how "lexical" plays an important role in the 5 -> 6 transition just like it did in the 4 -> 5 transition. 14:09
s/funny/interesting/ (I mean, it doesn't make me laugh or anything :) 14:10
14:11 pmurias joined 14:12 FROGGS[tab]_ joined 14:13 Ven left, FROGGS[tab] left 14:16 tokuhiro_ left
masak PerlJam: and it's even the same idea/concept. in Perl 6 we just turn it up even more. 14:16
14:16 aborazmeh left
pink_mist turn it up to eleve^Wsix! 14:19
14:23 Ven joined 14:30 vvz joined 14:36 pmurias left 14:38 pmurias joined, kaare_ left
jdv79 lex all the things 14:38
lexx wasnt too terrible of a show 14:39
14:39 kaare_ joined
jdv79 what else. lex luther. all i got. 14:39
masak the Lex building, Lex the Iraq war dog, Lex Vehicle Leasing, USS Lexington, and Lex, West Virginia. 14:42
.oO( google++ )
masak there's also the old Roman law by that name. 14:44
mspo elx club 14:46
14:48 Ven left 14:52 Ven joined
dalek ecs: 9bf4b95 | (Nova Patch)++ | S32-setting-library/Containers.pod:
remove loitering space
skids Can't have loiterers conglomerating in the specs. 14:54
.oO( Tune down for loit )
masak .oO( will loit for food ) 14:56
nebuchadnezzar just read 6guts article 14:57
jnthn: I read the single argument rule in S07, as a non native english (maybe), I needed to think twice to understand the comment in “@a.push: @b, # same, trailing comma doesn't make > 1 argument” 15:00
[Tux] panda still fails on rakudobrew checkout 15:01
no time for games or trial-and-error, so no timings today 15:02
_itz [Tux]: I had to "nuke" before it worked 15:04
[Tux] so have a fresh start?
_itz yes
[Tux] $ make again
nebuchadnezzar in the “for” case, “@a” and “@a,” are different, but in “push”, “@b” and “@b,” are the same 15:05
masak nebuchadnezzar: I believe there's been some very recent (as in yesterday) change there.
nebuchadnezzar: .push has split up into .push and .append, IIUC
nebuchadnezzar erf, should read in the git repo 15:06
masak nebuchadnezzar: to reduce the number of special cases of the kind you're confused about
nebuchadnezzar masak: thanks
I thought I understood but in fact not, I see the consistency between “for (@a,)” and “[@a,]”, but not with the “@a.push: @b,” 15:12
hmm, MoarVM september is out, need to package it 15:13
skids nebuchadnezzar: it was decided it was best if pop always got the same things that were pushed, so if you want the consistency, use append. 15:14
(or I guess you have to choose between one of two different consistencies. :-) 15:15
15:16 tokuhiro_ joined 15:20 Ven left 15:21 tokuhiro_ left 15:22 fling left 15:26 lizmat joined
[Coke] m: sub postfix:<thousand>($n) { $n*1000 }; say 1 thousand; 15:28
camelia rakudo-moar 92be57: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zpDjL6c4m6␤Two terms in a row␤at /tmp/zpDjL6c4m6:1␤------> 3ostfix:<thousand>($n) { $n*1000 }; say 17⏏5 thousand;␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤…»
[Coke] m: sub postfix:<thousand>($n) { $n*1000 }; say 1thousand; 15:29
camelia rakudo-moar 92be57: OUTPUT«1000␤»
15:29 FROGGS left
[Coke] I have a clue on the the profile issue with exit. 15:32
I updated MVM_profile_end to unconditionally throw an exception. --profile -e "" says "===SORRY!===\nSURPRISE" . --profile -e "exit" says "SURPRISE\n\nUnhandled exception: SURPRISE\n at..." 15:33
15:38 cognominal joined 15:39 Ven joined
cognominal I forget the syntax to use a function as an operator. Help 15:40
[Tux] Type check failed in assignment to $chunk; expected Str but got Seq
I hoped p6 would have stabalized on that by now 15:41
loop (my int $i = 0; $i < @ch.elems; $i = $i + 1) {
my Str $chunk = @ch[$i]; <==== that line
could that be the .push vs .append change? 15:42
so $buffer.defined and @ch.push: chunks ($buffer, $chx);
lizmat do you have the most recent panda ?
[Tux] will now do something different?
[Coke] m: sub b($a,$b) { $a * 2 + $b } ; 3 [&b] 4 #cognomial 15:43
camelia ( no output )
[Coke] m: sub b($a,$b) { $a * 2 + $b } ; say 3 [&b] 4 #cognomial
camelia rakudo-moar 92be57: OUTPUT«10␤»
[Tux] lizmat, was that q to me or to cognominal ?
lizmat [Tux]: to you
[Tux] I rebuilt from scratch
rm -rf moar*
lizmat ok, weird
rm -rf install is my usual way of nuking things 15:44
cognominal [Coke] thx.
[Tux] $buffer.defined and @ch.push: |chunks ($buffer, $chx); # note the |
fixes things
[Coke] rants about not having gdb available on os x so that ./perl6-gdb-m fails.
[Tux] almost 15:45
15:45 jasanj`` joined
lizmat [Tux]: what you're seeing are some skirmishes in the aftermath of the GLR 15:46
_itz there is lldb on mac now 15:47
15:49 jasanj` left, lichtkind joined
lichtkind will ther be eval in 6.0? 15:50
lizmat m: EVAL "say q/yes'"