»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
00:21 wolfman2000 left 00:26 wolfman2000 joined
moritz nom: my $x = "foo"; $x .= uc; say $x 00:27
p6eval nom: OUTPUT«FOO␤»
00:35 PZt left 00:38 icwiener left
moritz nqp: say(pir::chopn__Ssi("foo", 0)) 00:43
p6eval nqp: OUTPUT«foo␤» 00:44
moritz nqp: say(pir::chopn__Ssi("foo", 1))
p6eval nqp: OUTPUT«fo␤»
moritz nqp: say(pir::chopn__Ssi("foo", 2))
p6eval nqp: OUTPUT«f␤»
moritz nqp: say(pir::chopn__Ssi("foo", -1)) 00:47
p6eval nqp: OUTPUT«f␤»
00:54 PZt joined 01:00 noganex_ joined 01:04 noganex left, daniel-s joined 01:07 wolfman2000 left
[Coke] wonders how many tests we're running now. 01:30
01:35 cooper joined 01:38 whiteknight left
[Coke] nom: (10/7).WHAT 01:53
p6eval nom: ( no output )
[Coke] nom: (10/7).WHAT.say 01:54
p6eval nom: OUTPUT«Rat()␤»
[Coke] nom: use Test; is( (10/7).WHAT, 'Rat()', 'WHAT');
p6eval nom: OUTPUT«Use of uninitialized value in string context␤not ok 1 - WHAT␤Use of uninitialized value in string context␤# got: ''␤# expected: 'Rat()'␤»
[Coke] why does that print Rat(), but not is() Rat() ? 01:55
01:58 xinming left
[Coke] nom: (10/7).WHAT.WHAT.say 01:58
p6eval nom: OUTPUT«Rat()␤»
02:03 dayangkun joined, leprevost joined 02:04 xinming joined
[Coke] nom: use Test; is( ~(10/7).WHAT, 'Rat()', 'WHAT'); 02:10
p6eval nom: OUTPUT«Use of uninitialized value in string context␤not ok 1 - WHAT␤# got: ''␤# expected: 'Rat()'␤»
[Coke] nom: say (10/7).WHAT == 'Rat()' 02:11
p6eval nom: OUTPUT«Cannot access attributes in a type object␤current instr.: 'Num' pc 472477 (src/gen/CORE.setting.pir:132588) (src/gen/CORE.setting:3256)␤»
dalek kudo/nom: 4336ba9 | Coke++ | t/spectest.data:
note more spectest failure modes.
02:12
02:15 _jaldhar left 02:16 _jaldhar joined 02:19 dayangkun left 02:20 dayangkun joined
[Coke] anyone still awake? 02:20
02:20 wolfman2000 joined
[Coke] seen lue? 02:21
aloha lue was last seen in #perl6 2 days 7 hours ago saying "hello o/".
02:25 drbean left 02:29 jdhore1 left 02:47 lichtkind left 02:57 leprevost left 03:00 kuu joined 03:01 kuu left 03:02 molaf joined 03:09 cschimm1 joined 03:11 [Coke]_ joined, cschimm1_ left, [Coke] left, diakopter left, diakopter joined, kuu joined 03:19 drbean joined 03:26 Su-Shee left 03:28 Su-Shee joined 03:29 simcop2387 left, colomon left 03:31 colomon joined 03:34 simcop2387 joined 03:55 jdhore joined 04:00 jdhore left 04:01 amkrankruleuen left 04:02 amkrankruleuen joined 04:04 barika left 04:05 barika joined 04:07 colomon left 04:10 jdhore joined 04:16 colomon joined 04:24 molaf left 04:34 satyavvd joined
sorear [Coke]_: hi 04:54
05:03 REPLeffect joined 05:06 colomon left 05:12 ymasory left, zby_home joined 05:18 colomon joined 05:19 donri left 05:28 soh_cah_toa left
dalek kudo/nom: 6d53c0a | moritz++ | / (2 files):
fix chomp
05:34
05:39 birdwindupbird joined 05:44 ZaphrodZenovka left 05:45 ZaphrodZenovka joined 05:48 Grrrr left
moritz std: keys my %a 05:52
p6eval std 37a0cdd: OUTPUT«ok 00:01 120m␤» 05:53
moritz std: values my %a
05:53 Grrrr joined
p6eval std 37a0cdd: OUTPUT«ok 00:01 120m␤» 05:53
moritz std: kv my %a
p6eval std 37a0cdd: OUTPUT«ok 00:01 120m␤»
moritz std: pairs my %a
p6eval std 37a0cdd: OUTPUT«ok 00:01 120m␤»
moritz nom: say 1.kv.perkl 05:55
p6eval nom: OUTPUT«Method 'kv' not found for invocant of class 'Int'␤current instr.: '_block1002' pc 75 ((file unknown):76832552) (/tmp/wG3FYvvupO:1)␤»
moritz nom: say (1, 2).kv.perl
p6eval nom: OUTPUT«Method 'kv' not found for invocant of class 'Parcel'␤current instr.: '_block1002' pc 91 ((file unknown):30227876) (/tmp/M0cyIcq67a:1)␤»
moritz nom: say (1, 2).list.kv.perl
p6eval nom: OUTPUT«Method 'kv' not found for invocant of class 'List'␤current instr.: '_block1002' pc 103 ((file unknown):141) (/tmp/PrP81Frpqe:1)␤»
moritz nom: say (1, 2).list.pairs.perl
p6eval nom: OUTPUT«Method 'pairs' not found for invocant of class 'List'␤current instr.: '_block1002' pc 103 ((file unknown):141) (/tmp/bVgYCqBqoA:1)␤»
moritz nom: say { a => 1}.kv.perl 05:56
p6eval nom: OUTPUT«(("a", 1),).list␤»
moritz nom: say { a => 1}.pairs.perl
p6eval nom: OUTPUT«("a" => 1,).list␤»
moritz wonders if that .perl output really needs both the trailing comma and the .list 05:57
05:59 colomon left 06:00 _jaldhar left, colomon joined 06:04 wtw joined 06:07 envi joined
dalek kudo/nom: b901bc0 | moritz++ | / (2 files):
implement &keys, &values, &kv, &pairs
06:10
06:13 Mowah joined 06:15 odrm joined 06:21 Vlavv` joined, kcwu left, kcwu joined, Vlavv left 06:26 colomon left, colomon joined 06:32 dayangkun left, noganex_ is now known as noganex 06:36 zby_home left 06:45 dayangkun joined 06:48 _jaldhar joined, wamba joined 06:56 fhelmberger joined 07:09 cooper left 07:10 _jaldhar left 07:14 _jaldhar joined 07:20 _jaldhar left 07:21 colomon left 07:30 dayangkun_ joined 07:31 colomon joined
thou is there something like self.has('attribute') which returns true if class has $!attribute? i can write one by looking at self.^attributes, but it's fiddly (and kinda slow in rakudo, comared to .can()) 07:32
07:33 dayangkun left
moritz I don't think so 07:34
and I don't really see the point either
if you want variable/programmable attribute names, use a hash
to store the attributes, that is
thou github.com/mberends/http-server-si...m6#L90-103 07:35
07:35 jaldhar_ joined
thou trying to fix that code to work w/ private attrs. i think you're right that it'll be cleaner if i just make it a hash 07:36
07:36 jaldhar_ left, jaldhar_ joined
moritz that doesn't make the least bit of sense 07:37
thou and just always stuff everything in there -- no need really to be picky here, the subclass can just ignore bits it doesn't care about
moritz attributes are resolved at compile time
it seems to rely on a limitation of master about how attributes are shared among subclasses and classes/roles 07:38
just freakin' declare all those attributes and accessors for them 07:39
jnthn morning, #perl6
moritz \o jnthn
jnthn Yeah, nom really really resolves them at compile time :)
thou moritz: in the HTTP::Server::Simple role, you mean, right? 07:40
moritz thou: yes
thou yeah 07:41
07:43 mj41 joined
jnthn Having an efficient way to ask about possession of a method makes sense because you are meant to know about and use the methods. The attributes aren't part of the external interface though, so you really shouldn't be peaking, or relying on them being there. 07:44
Code that used .has_attribute would be very likely fragile, and if it broke you'd have no grounds to complain about API breakage
moritz right; if you have access to an attribute you're inside the class that can use them, and so you can just look at the code
I guess the misunderstanding behind this code is that roles have access to the attributes of the class they are composed into 07:45
jnthn ah
tadzik thou, thou
moritz s/that/that the author thought/
tadzik good morning #perl6
jnthn yeah, that's not good
moritz \o tadzik 07:46
jnthn o/ tadzik, our POD hacker!
moritz jnthn: I've been thinking about enums a bit...
thou well, this code is wrong in another way. those attrs belong to a single http request, not to the server itself. so they should either be part of a Request obj. or just a hash or something created when the request is parsed.
tadzik (:
jnthn moritz: Same. I even stubbed an EnumHOW locally...but it's about empty :)
thou hi, tadzik 07:47
tadzik moritz: I managed to get through the table madness yesterday.
thou: does the code in the pull request change something from the user perspective?
moritz jnthn: I think we should have a type object per enum which holds the list of items of that enum, and maybe a hash for mapping name => item
jnthn: and then each enum item (for example Bool::True) just has an int which indexes into that list
thou tadzik: yes, it puts more stuff in %env. stuff like HTTP_COOKIE, if there's a Cookie: header sent from the client. also fixes PATH_INFO, QUERY_STRING, etc. 07:48
moritz or maybe s/list/RPA/ for performance easons, or whatever
tadzik sounds good to me. That's required for Web/November, si? 07:49
%!env{.key} = .value for (hash-hash-hash); <-- will that create the hash lazily?
moritz no
'for' in sink context is eager 07:50
thou tadzik: i'm open to a nicer way to write that bit
tadzik: i'm thkinking to move that stuff into method headers()
tadzik thou: how about just %!env = foo => 'bar', asd => 5;?
jlaire perl6: role R { method get { $.a } }; class A does R { has $.a = 5 }; class B does R {}; say A.new.get; say B.new.get
p6eval niecza v7-21-gbcc1cf3: OUTPUT«===SORRY!===␤␤Action method trait_mod:does not yet implemented at /tmp/rW1hMyB3gP line 1:␤------> { method get { $.a } }; class A does R ⏏{ has $.a = 5 }; class B does R {}; say ␤␤Cannot use hash access on an object of … 07:51
..rakudo 72d158: OUTPUT«5␤Method 'a' not found for invocant of class 'B'␤ in 'get' at line 22:/tmp/gXfH3Z7tQ2␤ in main program body at line 22:/tmp/gXfH3Z7tQ2␤»
..pugs: OUTPUT«5␤*** No such method in class B: "&a"␤ at /tmp/QtpI3_tORR line 1, column 23-27␤»
thou tadzik: 'cause %!env already has stuff in it before it gets there.
tadzik rakudo: my %a = foo => 1; %a.push(bar => 2, asd => 3); say %a.perl
p6eval rakudo 72d158: OUTPUT«{"foo" => 1}␤»
thou (headers() is called before handler())
tadzik hrm
moritz %!env{%h.keys} = %h.values;
tadzik: try to use positional arguments
tadzik rakudo: my %a = foo => 1; %a.push(bar, 2, asd, 3); say %a.perl 07:52
p6eval rakudo 72d158: OUTPUT«Could not find sub &bar␤ in main program body at line 22:/tmp/MkKH4vVJzo␤»
tadzik ah
moritz rakudo: my %a = foo => 1; %a.push("bar" => 2, "asd" => 3 }; say %a.perl
tadzik rakudo: my %a = foo => 1; %a.push('bar', 2, 'asd', 3); say %a.perl
p6eval rakudo 72d158: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤»
rakudo 72d158: OUTPUT«{"foo" => 1, "bar" => 2, "asd" => 3}␤»
moritz rakudo: my %a = foo => 1; %a.push("bar" => 2, "asd" => 3); say %a.perl
p6eval rakudo 72d158: OUTPUT«{"foo" => 1, "bar" => 2, "asd" => 3}␤»
jlaire rakudo: say (class {}).new
p6eval rakudo 72d158: OUTPUT«()<0x1f90fc8>␤»
moritz nom: my %a = foo => 1; %a.push("bar" => 2, "asd" => 3); say %a.perl
p6eval nom: OUTPUT«Method 'push' not found for invocant of class 'Hash'␤current instr.: '_block1002' pc 146 ((file unknown):35990959) (/tmp/cpumy1tPjN:1)␤»
jlaire rakudo: role R {}; say (class does R {}).new 07:53
p6eval rakudo 72d158: OUTPUT«===SORRY!===␤Malformed package declaration at line 22, near "R {}).new"␤»
jlaire rakudo: role R {}; say (class asdf does R {}).new
p6eval rakudo 72d158: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expected␤ in main program body at line 1:src/metamodel/RoleToInstanceApplier.nqp␤»
tadzik look, a LHF! :)
moritz indeed :-)
jnthn nom: role R {}; say (class asdf does R {}).new
p6eval nom: OUTPUT«asdf<48666312>␤»
jnthn phew :)
jlaire looks like I should start using nom already :) 07:54
jnthn moritz, tadzik: if you look through S32 chunk of t/spectest.data at Coke++'s comments, there's lots of LHF to be seen :)
jlaire nom: role R {}; say (class does R {}).new
p6eval nom: OUTPUT«Unable to parse $*PKGDECL definition at line 1, near "R {}).new"␤current instr.: 'nqp;HLL;Grammar;panic' pc 23533 (src/stage2/gen/NQPHLL.pir:6314) (src/stage2/gen/NQPHLL.pm:328)␤»
tadzik oh oh :)
jlaire std: role R {}; say (class does R {}).new
p6eval std 37a0cdd: OUTPUT«===SORRY!===␤Unable to parse class definition at /tmp/8kaJU5Tr1C line 1:␤------> role R {}; say (class does ⏏R {}).new␤ expecting trait␤Parse failed␤FAILED 00:01 119m␤»
jnthn jlaire: STD would...right :)
jlaire hm, is there a syntax for that? 07:55
jnthn jlaire: either "anon class Foo does R { }" or "class :: does R { }"
I don't remember seeing either done with nom before
jlaire std: role R {}; say (class :: does R { has $.a = 42; }).new.a
p6eval std 37a0cdd: OUTPUT«ok 00:01 122m␤»
jlaire jnthn: ty
perl6: role R {}; say (class :: does R { has $.a = 42; }).new.a
p6eval niecza v7-21-gbcc1cf3: OUTPUT«Unhandled exception: Unable to resolve method ast in class Any␤ at /home/p6eval/niecza/src/NieczaActions.pm6 line 161 (NieczaActions NieczaActions.morename @ 3) ␤ at /home/p6eval/niecza/src/STD.pm6 line 342 (STD STD.morename @ 24) ␤ at /home/p6eval/niecz…
..pugs: OUTPUT«*** ␤ Unexpected " does"␤ expecting "(", twigil or word character␤ at /tmp/aXWBMc2sqs line 1, column 25␤»
..rakudo 72d158: OUTPUT«42␤»
jlaire nom: role R {}; say (class :: does R { has $.a = 42; }).new.a 07:56
p6eval nom: OUTPUT«42␤»
jlaire great!
thou tadzik: good night, gotta sleep 07:57
thanks for the advice, moritz++
moritz tadzik: sleep well 07:58
07:58 colomon left
thou thanks 07:58
\o 07:59
moritz std: say elems 1 08:00
p6eval std 37a0cdd: OUTPUT«ok 00:01 119m␤»
TimToady rosettacode.org/wiki/Sum_of_a_series#Perl_6 <-- greatly expanded
moritz rakudo: say elems 1
p6eval rakudo 72d158: OUTPUT«1␤»
TimToady rosettacode.org/wiki/Literals/String#Perl_6 <-- also new 08:01
08:02 jimmy1980 left, thou left
tadzik moritz: but I just woke up! :) 08:02
08:03 jimmy1980 joined
moritz tadzik: sorry, meant thou :-) 08:03
08:08 colomon joined
dalek kudo/nom: 1bb2883 | moritz++ | / (5 files):
Hash.invert, List.end, tests
08:08
08:11 wamba left 08:21 daxim joined 08:23 dayangkun__ joined 08:26 wamba joined 08:27 dayangkun_ left
jnthn yay, people are nomming LHF :) 08:27
08:27 MayDaniel joined
moritz nom: sub f(&t, *@a) { }; f { $_ * 5 }, 1, 2, 3, 4, 08:29
p6eval nom: ( no output )
moritz should search for errors in his own code before searching for errors in the dispatcher :-) 08:31
08:39 dakkar joined 08:43 Su-Shee left
mathw TimToady: I like the rosettacode sections. I was then amused to poke around and see that Smalltalk's numbers have 'squared' and 'reciprocal' methods 08:45
08:50 MayDaniel left 08:52 drbean left 08:53 Raynes left, kaare_ joined 08:55 Raynes joined 09:02 Su-Shee joined 09:04 im2ee joined 09:09 kuu left
jnthn moritz: on enums, the hash should really be an EnumMap and I suspect it lives in the meta-object. 09:18
09:21 dayangkun__ left
moritz jnthn: why would it live in the meta object? 09:21
jnthn Where else is it going to live? 09:22
moritz jnthn: I mean it's per enum, not shared for all possible enums
jnthn Right
moritz in the type object of the enum
jnthn We have one meta-object instance per enum
Nothing lives in the type object
It has no storag
09:22 Su-Shee_ joined
jnthn *storage 09:22
moritz ok, I thought we had one meta object for all enums
jnthn No 09:23
moritz but that's of course not true
so, you're right
(that makes things easier)
jnthn Well, you *can* have a singleton meta-object, e.g. if you're doing prototype OO
But I think the enum one doesn't want to be a singleton.
I'm wondering to what degree we can have a role EnumStuff { ... } and role NumericEnum { ... } that hold the methods that are interesting to have on an enum. 09:24
iirc there's a few things we only do on numeric ones.
moritz doesn't remember anything about that, but I'd have to look it up 09:25
jnthn And then EnumHOW does a few roles so it's got just enough in order to compose those roles, but otherwise delegates all of its methods to the base type.
Essentially, SomeIntBasedEnum ~~ Int needs to be true, and SomeIntBaeedEnumElem ~~ Int also
09:26 Su-Shee left
moritz rakudo: say Bool ~~ Int 09:26
p6eval rakudo 72d158: OUTPUT«Bool::False␤»
jnthn And those would just fall out of this factoring.
Well, master doesn't consider Bool and enum :)
dalek kudo/nom: 9d969c0 | moritz++ | / (3 files):
classify
moritz also SomeStrBasedEnum ~~ Str?
jnthn *an
Yeah
moritz right
jnthn Or whatever base type is used.
The native base types could get awkward, but I'll worry about those later. 09:27
09:30 amkrankruleuen left, amkrankruleuen joined
pmichaud good morning, #perl6 09:31
wow, lots of commits to review 09:33
09:34 dayangkun__ joined, _jaldhar_ joined 09:35 ruoso_ joined, z-b joined, cxreg2 joined 09:36 diakopte1 joined, cipherte1t joined, noganex_ joined, noganex left, noganex_ is now known as noganex
moritz good am, pm 09:37
and it's still AM here :-)
jnthn o/ pmichaud 09:38
Wow, yes. Early!
09:39 Raynes_ joined
jnthn actually had to get up for $dayjob today :) 09:39
09:39 colomon left 09:40 Raynes left, jaldhar_ left, diakopter left, ciphertext left, am0c left, buubot_backup left, daemon left, hugme left, bbkr left, cotto_work left, tadzik left, cxreg left, zb left, sjohnson left, p6eval left, ruoso left, bbkr joined 09:45 p6eval joined, ChanServ sets mode: +v p6eval 09:46 am0c joined 09:47 tadzik joined, cotto_work joined 09:48 sjohnson joined
mathw Weren't you in China recently? 09:48
jnthn mathw: yes :) 09:49
09:49 daemon joined
mathw was it good? 09:50
jnthn mathw: Yes, though a lot more hot/humid than I could really cope with. 09:51
mathw I've heard it's like that in parts of China. It's not my thing either.
jnthn But the workshop was great, I had nice food and when I did manage do drag myself out in the heat for a while I saw some nice stuff. :) 09:52
*to
09:53 dayangkun_ joined 09:54 buubot_backup joined 09:55 colomon joined, simcop2387 left 09:56 dayangkun__ left 09:59 simcop2387 joined
mathw :) 10:02
Excellent
10:05 skangas left 10:12 colomon left 10:15 colomon joined 10:21 drbean joined 10:25 cipherte1t is now known as ciphertext, skangas joined
dalek kudo/nom: 1478b35 | pmichaud++ | src/core/ (2 files):
Let Parcel.values fall back to Any.values.
10:26
moritz nom: my $x = EnumMap.new; $x<foo> = 'bar'; say $x.perl
p6eval nom: OUTPUT«Cannot assign to a non-container␤current instr.: '_block1002' pc 101 ((file unknown):21917096) (/tmp/oqC5MX8yUK:1)␤»
moritz nom: my $x = Hash.new; $x<foo> = 'bar'; say $x.perl
p6eval nom: OUTPUT«{"foo" => "bar"}␤» 10:27
moritz nom: class A { method !foo() { }; method public() { self!foo } }; A.new.public 10:29
p6eval nom: OUTPUT«Method '!foo' not found for invocant of class 'A'␤current instr.: 'public' pc 592 ((file unknown):25081761) (/tmp/nVbnzmqkP5:1)␤»
10:39 ab5tract joined 10:42 icwiener joined 10:43 jedai_ left 10:45 c9s joined 10:46 jedai joined 10:47 Chillance joined 10:56 dayangkun__ joined 10:57 [perlhack] joined
[perlhack] long time no see 10:57
10:59 dayangkun_ left 11:05 jimmy1980 left 11:06 jimmy1980 joined 11:09 drbean left 11:10 im2ee left, im2ee joined
jnthn ffs, I actually just had to write Visual Basic. :/ 11:20
flussence ouch
11:24 fhelmberger left 11:25 fhelmberger joined 11:26 [perlhack] left 11:28 takadonet joined 11:33 domidumont joined
arnsholt .u ಠ 11:33
phenny U+0CA0 KANNADA LETTER TTHA (ಠ)
jnthn Is that a funny spelling of Canada? :) 11:34
moritz urks, t/spec/S32-list/end.t doesn't pass. Why did I thought it did? 11:48
11:48 Jackneill joined, Jackneill left, Jackneill joined
jnthn gets curious how it fails 11:49
nom: END { say 2 }; say 1;
moritz unshift NYI
p6eval nom: OUTPUT«1␤2␤»
jnthn ah
moritz jnthn: it's Array.end
jnthn nothing to do with END itself
Oh!
:)
moritz not END :-)
11:49 takadonet left
jnthn I guess I should read, but I'm scared of opening my eyes in case I happen to see VB code... 11:50
dalek kudo/nom: d9fcb90 | moritz++ | / (2 files):
Port Hash.push over from master

This doesn't quite work yet, running S32-hash/push.t causes infinite recursion involving some List methods - maybe something that pmichaud++ can investigate?
kudo/nom: acda02a | moritz++ | t/spectest.data:
end.t did not pass, my mistake. Sorry.
moritz nqp: say(pir::rindex__Iss('foobar', 'o')) 11:51
p6eval nqp: OUTPUT«error:imcc:syntax error, unexpected IREG, expecting '(' ('$I100')␤ in file '(file unknown)' line 33␤error:imcc:syntax error ... somewhere␤ in file '(file unknown)' line 103␤syntax error ... somewhere␤»
moritz ah right, it's not an opcode but a method 11:52
jnthn a...method?
moritz on the String PMC
jnthn :(
Well, that sucks. :/ 11:53
moritz rakudo: say 'foo'.rindex('')
p6eval rakudo 72d158: OUTPUT«3␤»
moritz I'm trying to figure out why it segfaults for me
jnthn in Rakudo or nom? 11:54
moritz nom
jnthn We really don't want to play around with the Parrot string PMC...
moritz currently we're doing
nqp::p6box_i(
pir::box__PS(nqp::unbox_s(self.Str)).reverse_index(
nqp::unbox_s($needle.Str),
nqp::unbox_i($pos.Int)
)
); 11:55
11:55 dayangkun_ joined
jnthn Was that nqp::p6box_i( paste an accident? 11:56
moritz nope
the return value from reverse_index is an integer
11:57 satyavvd left 11:58 dayangkun__ left
jnthn Did you try just: (nqp::unbox_s(self.Str)).reverse_index(nqp::unbox_s($needle.Str), nqp::unbox_i($pos.Int)) ? 11:58
Rakudo auto-coerces method return values that are Parrot types
moritz it didn't when I wrote that, iirc :-) 11:59
moritz tries 12:00
jnthn nom: say (nqp::unbox_s('abcd')).reverse_index(nqp::unbox_s('c'), nqp::unbox_i(1))
p6eval nom: OUTPUT«-1␤»
jnthn nom: say (nqp::unbox_s('abcd')).reverse_index(nqp::unbox_s('c'), nqp::unbox_i(4))
p6eval nom: OUTPUT«-1␤»
jnthn nom: say (nqp::unbox_s('abcd')).reverse_index(nqp::unbox_s('c'), nqp::unbox_i(3))
p6eval nom: OUTPUT«2␤»
moritz nom: say (nqp::unbox_s('abcd')).reverse_index(nqp::unbox_s(''), nqp::unbox_i(4)) 12:01
p6eval nom: OUTPUT«-1␤»
jnthn Meanwhile at $dayjob... Me: "Where do you put the unit tests for this project?" Them: "Oh, we don't have any yet." ...so much for the TDD training class they got me to deliver here. :| 12:04
moritz leaving out the explicit boxing didn't help :/ 12:05
moritz also turns to $dayjob 12:06
flussence hey, at least yours has *heard of* TDD... :(
jnthn helps moritz++ finds his $dayjob more worthwhile than he's finding his today
er
12:06 takadonet joined
jnthn s/helps/hopes/ 12:06
:)
takadonet morning all 12:07
moritz jnthn: preparing slides for a talk... not very exciting
12:10 mls joined 12:11 colomon left
moritz it's hard to compete with the -Ofun that nom hacking is these days 12:13
mls jnthn: to distract you from your dayjob a bit more, I've uploaded the P6opaque patch to gist.github.com/1075727
Havin said that, I wonder if gc_mark_repr should mark the auto_viv values in some way 12:15
and gc_free_repr probably should free all allocated arrays and not just name_to_index_mapping 12:17
jnthn moritz: yes, and I suspect the -Ofun won't descrease much after nom becomes master :) 12:20
mls: ooh, yay...looking :)
mls: Patch looks great. :) 12:21
moritz jnthn: I certainly hope so 12:22
jnthn (gc_free_repr) yeah, probably leaks a bit, though only an issue for anonymous types. Worth fixing.
moritz jnthn: currently it's fun for me because there are so many LHFs (but they are usually not boring). I hope after the nom => master transition I can attack not-quite-so-low hanging fruits too :-( 12:23
jnthn mls: (mark auto_viv) +1 to that also. It should never really happen that the repr data is the only thing that holds them, but I guess it'd be possible to construct a contrived situation where it happens.
mls: I'll apply your patch when I get home. :) 12:24
It's faster *and* less code. \o/
mls Thanks!
and it also saves some mem ;-)
jnthn And that.
win all around :)
moritz mls++ # hacking the guts
12:24 JimmyZ joined
jnthn Indeed, I'm delighted somebody other than me is digging into this code. :) 12:25
The more eyes on it, the better.
mls glad I could help a bit
12:26 dayangkun_ left
tadzik mls++ :) 12:27
[Coke]_ there are 4 spec tests or so that need the old pir-based &radcalc - I assume we're trying to avoid raw PIR in nom? 12:28
moritz we try, yes
which are those tests?
sin.t and friends?
[Coke]_ is this something that should not be exposed to the user? (if not, where do we hide it in a pure perl world?) 12:29
moritz: "ack radcalc t/spectest.data"
(other tests may need it but fail earlier on something else.) 12:30
moritz [Coke]_: seems like it should just be just a sub within Actions.pm
[Coke]_ moritz: That seems reasonable.
12:31 mtk joined
moritz [Coke]_: it's also OK to put the PIR chunk in there, and later rewrite it in nqp (or hope that somebody else does), if the PIR stillw orks 12:32
[Coke]_ oh, well that turns it into LHF then. someone should have at it. ;)
12:32 [Coke]_ is now known as [Coke] 12:35 bluescreen10 joined 12:40 drbean joined 12:48 [Coke] left, wamba left 12:50 [Coke] joined
[Coke] irclogs? 12:50
12:51 JimmyZ left
tadzik irclogs are at irclog.perlgeek.de 12:51
[Coke] argh. all my sends after 12:32 are missing.
moritz connection timeout?
[Coke] is there a way to invoke a spec test file that gives you the same output as: 1) delete the old .rakudo file in case it's no longer needed, 2) re-fudge the test, if necessary, 3) use the perl6 binary to run either the .t or the .rakudo file, depending on whether or not it was fudged.
(where the last part is actually showing you all the output of the test file)
(--verbosity doesn't seem to help.)
moritz make t/spec/dir/file.t
[Coke] my IRC client was up, and gave me no (obvious) indication that my sends weren't going anywhere.
moritz hm, but it's not verbose enough for you 12:52
12:52 JimmyZ joined, mls left
moritz perl t/harness --fudge --verbosity=1 t/spec/S32-list/end.t 12:53
alas t='perl t/harness --fudge --verbosity=1' # :-) 12:54
s/alas/alias/
[Coke] that doesn't give the same output.
(as running it by hand with ./perl6)
moritz hm, right 12:55
12:55 im2ee left, im2ee joined 12:59 [Coke] left
moritz then I'm out of ideas, except for a short shell script that does that 12:59
#!/bin/sh
./perl6 `perl t/spec/fudge "$@"`
13:00 [Coke] joined
[Coke] moritz: ah. that's shorter than what I had, since I didn't realize harness was calling t/spec/fudge. 13:03
good enough for now. Danke. 13:04
JimmyZ good evening, #perl6 13:08
13:08 wamba joined 13:09 molaf joined 13:16 Holy_Cow joined 13:17 Holy_Cow left 13:18 Su-Shee_ is now known as Su-Shee 13:23 drbean left
[Coke] ni hao, JimmyZ. 13:28
JimmyZ 您好 Coke 13:32
13:44 fhelmberger left 13:50 fhelmberger joined 13:53 PacoLinux joined 14:02 Chillance left 14:03 Chillance joined 14:05 cbk joined 14:08 jevin left 14:12 jevin joined 14:22 wtw left
dalek kudo/podparser: 597985d | tadzik++ | src/Perl6/Pod.pm:
Refactor Pod.pm
14:24
tadzik okay, it can be revied now. I'm not ashamed of it anymore :) 14:26
* reviewed :)
moritz perl6: say "foo\nbar\n".lines.perl 14:29
p6eval pugs: OUTPUT«*** No such method in class Str: "&lines"␤ at /tmp/LkS2nILTok line 1, column 5 - line 2, column 1␤»
..niecza v7-21-gbcc1cf3: OUTPUT«["foo", "bar"].list␤»
..rakudo 72d158: OUTPUT«("foo", "bar")␤»
14:39 awoodland joined 14:41 z-b is now known as zb 14:45 wamba left, Mowah left 14:48 am0c left, jevin left 14:52 jevin joined
[Coke] nom: say "foo\nbar\n".lines.perl 15:00
p6eval nom: OUTPUT«Method 'lines' not found for invocant of class 'Str'␤current instr.: '_block1002' pc 75 ((file unknown):84591496) (/tmp/BUH0JAvUKk:1)␤»
pmichaud looky at the LHF! 15:01
15:01 am0c joined 15:02 MayDaniel joined 15:08 Jackneill left
tadzik moritz: mind criticising the table implementation a bit? 15:10
15:17 masak joined
masak hi, #perl6. 15:17
JimmyZ hello masak 15:18
TimToady each.\o 15:19
Trashlord hi masak
masak Trashlord! \o/
tadzik hello masak :) 15:20
Trashlord :)
masak likes the p6u email and hopes someone writes a good reply to it 15:21
tadzik masak: you're welcome to look into the Tables implementations too
masak ok, still backlogging.
I have 40 minutes here, then I should be back down with my students.
tadzik what are you teaching? 15:22
masak Esperanto. 15:27
15:29 twinshadow left
masak looks at the table implementation 15:30
15:31 mkramer joined
masak tadzik: ss/3 informations/3 pieces of information/ -- 'information' is a mass noun. 15:31
masak picky, picky
yes, I see that the table implementation is kind of... involved. 15:32
tadzik++
masak gets to the tests 15:33
yes. I am impressed at this.
ok, so '=table' ==> Perl6::Pod::table ==> $=POD[$n] ? 15:37
[Coke] [Hmm yes, and IIRC Perl 5 is *still* more complete for state variables than 15:42
any Perl 6 implementation to date] --nick clark. 15:43
masak are there many stages of completeness for state variables to be in?
15:44 donri joined
masak and what aspects of completeness are Rakudo alpha and Niecza missing? 15:44
jnthn home 15:46
masak jnthn! \o/
tadzik masak: yep 15:47
jnthn masak! \o/
masak has time to implement "it is pitch black" today
15:49 [perlhack] joined
masak std: sub foo {}; if foo { say "OH HAI" } 15:50
p6eval std 37a0cdd: OUTPUT«===SORRY!===␤Function 'foo' needs parens to avoid gobbling block at /tmp/6S1Y0adRES line 1:␤------> sub foo {}; if foo⏏ { say "OH HAI" }␤Missing block (apparently gobbled by 'foo') at /tmp/6S1Y0adRES line 1:␤------> sub foo {…
masak std: sub foo() {}; if foo { say "OH HAI" }
p6eval std 37a0cdd: OUTPUT«===SORRY!===␤Function 'foo' needs parens to avoid gobbling block at /tmp/vGgnOLESuh line 1:␤------> sub foo() {}; if foo⏏ { say "OH HAI" }␤Missing block (apparently gobbled by 'foo') at /tmp/vGgnOLESuh line 1:␤------> sub foo…
masak TimToady: is there a way to declare a function as nullary so that the parser doesn't gobble the block in that way? 15:51
jnthn masak: Maybe declare it as a term. 15:52
masak hm.
jnthn std: sub term:<foo>() {}; if foo { say "OH HAI" }
p6eval std 37a0cdd: OUTPUT«ok 00:01 126m␤»
jnthn That'll do it. :) 15:53
std: sub foo() {}; if foo() { say "OH HAI" }
p6eval std 37a0cdd: OUTPUT«ok 00:01 121m␤»
jnthn So will that, though, which is much nicer to read :)
masak yes.
and with the error message in STD, it's ok when people forget. 15:54
because they will forget.
15:54 MayDaniel left
jnthn right 15:54
15:58 colomon joined 16:01 Jackneill joined, Jackneill left, Jackneill joined 16:02 awoodland left 16:07 [perlhack] left 16:12 Mowah joined 16:18 wamba joined, ab5tract left 16:20 mkramer left, mj41_nb joined 16:21 [perlhack] joined 16:22 [perlhack] left
dalek p: 5335b5b | jonathan++ | src/pmc/sixmodelobject.pmc:
Fix to make sure --trace=1 output is more useful (pmichaud++ for noticing the issue).
16:24
16:25 perlhack joined
[Coke] yawns. 16:25
perlhack haha
yawns too. 16:26
PerlJam stubbornly refuses to yawn 16:29
[Coke] yawns again for good me----asure. 16:31
16:33 mj41_nb left, mj41 left
moritz std: 07 16:34
p6eval std 37a0cdd: OUTPUT«Potential difficulties:␤ Leading 0 does not indicate octal in Perl 6; please use 0o7 if you mean that at /tmp/iBNOq2DuuF line 1:␤------> 07⏏<EOL>␤ok 00:01 118m␤»
16:36 acrussell left 16:37 cooper joined 16:39 JimmyZ left
cognominal rakudo: Regex(',*') 16:39
p6eval rakudo 72d158: OUTPUT«Could not find sub &Regex␤ in main program body at line 22:/tmp/njGjreyLoy␤»
cognominal rakudo: Regex.new(',*') 16:40
p6eval rakudo 72d158: OUTPUT«too few positional arguments: 2 passed, 3 (or more) expected␤ in main program body at line 1:src/metamodel/RoleToInstanceApplier.nqp␤»
16:42 Mowah left
moritz rakudo: say ',,,' ~~ rx/\,*/; 16:42
p6eval rakudo 72d158: OUTPUT«,,,␤»
moritz constructing regexes via API calls inteas of quotiing constructs is not supported, since it would be not easy 16:44
a regex has to know about its outer lexical scope, for example, to support <&foo> style matching
16:51 birdwindupbird left, perlhack left 16:53 acrussell joined
TimToady masak: look at it this way, there's several ways for state to be 'broken': 1) missing declarator, 2) missing @ and % support, 3) missing initialization support, 4) missing cloning (confusing with C static), and 5) missing bare sigil support. 16:56
masak ok, fair enough.
TimToady oh, and 6), not returning the lvalue correctly so you can't ++(state $)
masak I guess talking about degress of implementation makes a lot of sense, then. 16:57
TimToady a bug I ran into with niecza
masak TimToady++
TimToady well, p5 went wrong at least 2 of those ways
maybe more
hmm 16:58
masak but they've now fixed it?
cognominal moritz, what if I got the Regex as a string, say, from the commad line?
TimToady rakudo: state $n
p6eval rakudo 72d158: OUTPUT«===SORRY!===␤"state" not yet implemented at line 22, near ""␤»
TimToady then there's that way to go wrong :)
masak TimToady: isn't that 1) above?
TimToady that's about point 1.5 I guess
moritz cognominal: rx/<$string>/
TimToady rakudo has the declarator
cognominal ha, ok. thx 16:59
TimToady niecza: ++(state $)
p6eval niecza v7-21-gbcc1cf3: OUTPUT«===SORRY!===␤␤Non-simple variables NYI at /tmp/G1p4tv4kWj line 1:␤------> ++(state $⏏)␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 570 (CORE die @ 2) ␤ at /home/p6eval/niecza/…
TimToady so rosettacode.org/wiki/Sum_of_a_series#Perl_6 has to put up with a warning instead 17:00
niecza: ++(state $n)
p6eval niecza v7-21-gbcc1cf3: OUTPUT«Potential difficulties:␤ $n is declared but not used at /tmp/YJRgwP1fYr line 1:␤------> ++(state ⏏$n)␤␤Unhandled exception: System.Exception: Unable to find lexical anon_0 in mainline␤␤Server stack trace: ␤ at Niecza.CLRBackend.NamProce…
TimToady but since the approved way to suppress that warning is to leave off the 'n'...
dalek kudo/nom: 6849c6f | jonathan++ | src/core/ (2 files):
Implement nextwith and lastcall.
TimToady ohh, it got an exception 17:01
17:02 cdarroch joined, cdarroch left, cdarroch joined, colomon left
TimToady niecza: constant @x = [\+] { 1 / ++(state $n) ** 2 } ... *; say @x[999]; 17:02
p6eval niecza v7-21-gbcc1cf3: OUTPUT«Potential difficulties:␤ $n is declared but not used at /tmp/8Bo_iUTzAP line 1:␤------> constant @x = [\+] { 1 / ++(state ⏏$n) ** 2 } ... *; say @x[999];␤␤1.64393456668156␤»
TimToady doesn't there
warns, but gets the answer 17:03
I should poke a 0 on the front so the index is 1000, I guess 17:04
niecza: constant @x = 0, [\+] { 1 / ++(state $n) ** 2 } ... *; say @x[1000];
p6eval niecza v7-21-gbcc1cf3: OUTPUT«Potential difficulties:␤ $n is declared but not used at /tmp/vaqBjOM_on line 1:␤------> constant @x = 0, [\+] { 1 / ++(state ⏏$n) ** 2 } ... *; say @x[1000];␤␤Any()␤»
TimToady ooh, breaks it 17:05
17:05 mberends joined
TimToady wonders what went rong 17:05
sorear++: ^^
17:06 mkramer1 joined, mj41_nb joined 17:07 mj41 joined
TimToady niecza: constant @x = [\+] { 1 / ++(state $n) * $n } ... *; say @x[999]; # probably bogusish 17:08
p6eval niecza v7-21-gbcc1cf3: OUTPUT«1000/1␤»
TimToady oh, yea
17:08 molaf left
TimToady niecza: constant @x = [\+] { 1 / (++state $n * $n) } ... *; say @x[999]; # probably bogusish 17:08
p6eval niecza v7-21-gbcc1cf3: OUTPUT«1.64393456668156␤»
TimToady well, that's one way to suppress the warning :) 17:09
niecza: constant @x = [\+] { Rat.new(1, ++state $n * $n) } ... *; say @x[999]; # funny way to write recip 17:11
p6eval niecza v7-21-gbcc1cf3: OUTPUT«1.64393456668156␤»
17:12 mkramer1 left, im2ee left 17:13 im2ee joined
TimToady niecza: constant @x = 0, [\+] { 1 / ++(state $n) ** 2 } ... *; .say for @x 17:13
p6eval niecza v7-21-gbcc1cf3: OUTPUT«(timeout)Potential difficulties:␤ $n is declared but not used at /tmp/KsgEMYcMVG line 1:␤------> constant @x = 0, [\+] { 1 / ++(state ⏏$n) ** 2 } ... *; .say for @x␤␤0␤1/1␤5/4␤49/36␤205/144␤5269/3600␤5369/3600␤266681/176400␤1077749/70560…
TimToady niecza: constant @x = 0, [\+] { 1 / ++(state $n) ** 2 } ... *; say @x[1000] 17:14
p6eval niecza v7-21-gbcc1cf3: OUTPUT«Potential difficulties:␤ $n is declared but not used at /tmp/FkOFnO1Hd1 line 1:␤------> constant @x = 0, [\+] { 1 / ++(state ⏏$n) ** 2 } ... *; say @x[1000]␤␤Any()␤»
TimToady niecza: constant @x = 0, [\+] { 1 / ++(state $n) ** 2 } ... *; say @x[5]
p6eval niecza v7-21-gbcc1cf3: OUTPUT«Potential difficulties:␤ $n is declared but not used at /tmp/7f9KLWyEO0 line 1:␤------> constant @x = 0, [\+] { 1 / ++(state ⏏$n) ** 2 } ... *; say @x[5]␤␤Any()␤»
TimToady niecza: constant @x = 0, [\+] { 1 / ++(state $n) ** 2 } ... *; say @x[0..5]
p6eval niecza v7-21-gbcc1cf3: OUTPUT«(timeout)Potential difficulties:␤ $n is declared but not used at /tmp/zH9xXEzZgJ line 1:␤------> constant @x = 0, [\+] { 1 / ++(state ⏏$n) ** 2 } ... *; say @x[0..5]␤␤» 17:15
TimToady niecza: constant @x = 0, [\+] { 1 / ++(state $n) ** 2 } ... *; say @x[0]
p6eval niecza v7-21-gbcc1cf3: OUTPUT«Potential difficulties:␤ $n is declared but not used at /tmp/KLKNdjdMCN line 1:␤------> constant @x = 0, [\+] { 1 / ++(state ⏏$n) ** 2 } ... *; say @x[0]␤␤0␤»
TimToady niecza: constant @x = 0, [\+] { 1 / ++(state $n) ** 2 } ... *; say @x[1]
17:15 dakkar left
p6eval niecza v7-21-gbcc1cf3: OUTPUT«(timeout)Potential difficulties:␤ $n is declared but not used at /tmp/xjStPpzmA9 line 1:␤------> constant @x = 0, [\+] { 1 / ++(state ⏏$n) ** 2 } ... *; say @x[1]␤␤» 17:15
TimToady niecza: constant @x = 0, [\+] { 1 / ++(state $n) ** 2 } ... *; say @x[0,1] 17:16
p6eval niecza v7-21-gbcc1cf3: OUTPUT«(timeout)Potential difficulties:␤ $n is declared but not used at /tmp/TeTRlgtC5u line 1:␤------> constant @x = 0, [\+] { 1 / ++(state ⏏$n) ** 2 } ... *; say @x[0,1]␤␤»
TimToady niecza: constant @x = 0, [\+] { 1 / ++(state $n) ** 2 } ... *; say @x.list.[1]
p6eval niecza v7-21-gbcc1cf3: OUTPUT«(timeout)Potential difficulties:␤ $n is declared but not used at /tmp/v83pUJeMRI line 1:␤------> constant @x = 0, [\+] { 1 / ++(state ⏏$n) ** 2 } ... *; say @x.list.[1]␤␤»
TimToady gives up on the spamming for now 17:17
seems subscripting is not lazy, I guess
jnthn If you are doing deferal, and you do a callwith, then in the next one a callsame, is the "same" referring to the original argument list when you started off, or the "latest" one? 17:18
I can argue it both ways.
[Coke] ok. go. we'll let you know who wins. 17:19
17:19 mkramer joined
jnthn :P 17:19
masak jumps into the fray, just in case
jnthn Doing it with the oringal set is easier to implement, and fits well with the fact that a dispatcher commits to its candidate list at that point too.
That is, if you go callwith'ing through a set of multis, you'd better make sure you are passing along things that will work with the original candidate set that was picked. 17:20
TimToady or callwith could be considered a new dispatch 17:21
jnthn Similarly, if you're half way through a dispatch and you .add_method somewhere, it ain't going to see that new method within that dispatch.
moritz rakudo: say Str.new('foobar')
p6eval rakudo 72d158: OUTPUT«flattened parameters must be a hash or array␤ in main program body at line 22:/tmp/0cCSJ9lGxb␤»
jnthn TimToady: Doubtful.
moritz how do I box into a subclass of Str?
jnthn TimToady: You could potentially get yourself into an infinite loop then.
masak jnthn: I don't mind that too much. 17:22
jnthn Also "new dispatch" really doesn't work at all.
masak oh, ok. 17:23
jnthn I mean, we form a list of candidates and next/call just iterates them
If we do a "new dispatch" then it'd automatically take us right back to the start again, presumably
We don't really have a good way to know where to "restart"
TimToady I suspect the usual use case for callwith is that you have some very specific routine that you're aiming to get to with it 17:24
jnthn Yeah
TimToady and you could always just do a normal call to get the redispatch
jnthn Right
TimToady so presumably there's some Sekrit Gnawledge that the next candidate is the one you want
jnthn I think dispatchers commit fairly early to their candidate list 17:25
If not in the initial dispatch then certainly at the first deferal.
TimToady that seems to be sane from a non-pessimal point of view
jnthn (I suspect wrappers commit immediately, and method and multi at the first deferal.)
17:25 mkramer left 17:26 thou joined
jnthn In master we always work it out up front, which turned out to make every single method dispatch way more expensive for the sake of the few that did nextsame et al. 17:26
TimToady I always thought of the candidate list as lazy 17:27
jnthn I've tried to get that cost model righter in master.
Well, initial dispatches in nom mostly care about getting to where they're going as fast as possible. 17:28
Generally by hitting some kind of cache.
TimToady anyway, we can say that relying on lazy/eager candidate behavior is erroneous 17:29
jnthn Then if we turn out to be in a candidate list-y situation it's like "oh yeah, lemme sort that out"
17:29 impious joined
jnthn +1 17:29
Does that cover the "what capture does nextsame use" can I originally asked about? 17:30
*case
I can easily go either way on that one.
TimToady I must have missed that one 17:31
jnthn (e.g. it doesn't affect the model)
I do $foo.bar(1,2,3)
The place that initially goes does nextwith(4,5,6)
The place that goes does nextsame()
Does the next thing get 1,2,3 or 4,5,6?
TimToady oh, I though you were asking about something earler 17:32
*ier
17:32 impious left
TimToady well, nextwith and callwith should work the same. if we assume that the user is going to give a new argument list consistent with the original dispatch, then probably they're going to expect the new args to be available to all the rest of the candidates 17:36
just trying to see it from the user viewpoint
jnthn yeah, that feels more likely to do what the user expects.
TimToady so I'm inclined to say that the callsame/nextsame should use the new args
jnthn OK 17:37
masak +1
jnthn The other way is only marginally easier to implement anyway.
masak ENOTENOUGHTORMENT
TimToady SIGTICKLE xx *
diakopte1 giggles 17:38
moritz good that that's lazy :-)
jnthn masak: er, coming up with a sufficiently performant dispatcher implementation that'd unify all the types of dispatch we need was quite enough torment :P
17:38 diakopte1 is now known as diakopter
masak jnthn: orz 17:38
jnthn Took hours... :)
TimToady standard length of a crucifixion... 17:39
jnthn :P
TimToady niecza: constant @x = [\+] 0, { 1 / ++(state $n) ** 2 } ... *; say @x[1000] 17:40
p6eval niecza v7-21-gbcc1cf3: OUTPUT«Potential difficulties:␤ $n is declared but not used at /tmp/3qErYVZ8FO line 1:␤------> constant @x = [\+] 0, { 1 / ++(state ⏏$n) ** 2 } ... *; say @x[1000]␤␤1.64393456668156␤»
TimToady okay, that way works
PerlJam jnthn: be thankful you weren't scourged. :) 17:41
17:44 daxim left
masak rakudo: role R { method foo { say "R" } }; class C does R { method foo { callsame; say "C" } }; C.new.foo 17:48
p6eval rakudo 72d158: OUTPUT«C␤»
masak I guess this is by spec.
rakudo: role R { method foo { say "R" } }; class C does R { method foo { self.R::foo; say "C" } }; C.new.foo 17:49
p6eval rakudo 72d158: OUTPUT«R␤C␤»
masak oh, fair enough.
TimToady <masak> but they've now fixed it? 17:50
they can't make (state $) work
PerlJam masak: I don't understand the first one or maybe I don't understand callsame. Is it like a "goto"?
TimToady since $) is a valid variable name 17:51
masak PerlJam: more like a "gosub".
PerlJam: but it doesn't work, because R's .foo never ends up in C.
jnthn masak: correct
TimToady (in p5, we mean, for innocent bystanders who might think we're discussing p6)
masak TimToady: :P
PerlJam masak: aye, so what does "callsame" do in that instance? There's no "same" method, so it does nothing? 17:52
TimToady otoh p5 doesn't warn about unused var for (state $n)
masak PerlJam: correct.
PerlJam okay, got it. Thanks.
masak PerlJam: [next|call][same|with] pass the buck, but don't mind if there's nothing there to pass it to. 17:53
(making the layers of wrapping/inheritance uncoupled from each other)
TimToady well, if you want to go up a level, you have to use lastcall; nextsame 17:54
masak doesn't like that 17:55
jnthn TimToady: Am I right in thinking that nextsame et al really go looking for the first dispatcher in the dynamic scope that actually have some candidates to dispatch to?
masak afk &
TimToady they always go to the innermost, whether there are candidates or not
which is why we need lastcall 17:56
jnthn TimToady: wait...so...
17:56 envi left
jnthn TimToady: lastcall is more than "just set the candidate list for this dispatcher to empty"? 17:56
TimToady: I'd read the spec as lastcall making a dispatcher just as if it'd run out of candidates.
TimToady: If they always go for the innermost then lastcall; nextsame won't do anything 17:57
TimToady S12:937
I view it as lastcall throwing away the innermost dispatcher
jnthn ah 17:58
TimToady so there's a new innermost
jnthn yeah, OK, I musta mis-interpreted
dalek kudo/nom: da00ab7 | moritz++ | / (2 files):
Str.lines
TimToady it's an easy semantic ambiguity to fall into, Metaphors We Live By, and all that... 17:59
PerlJam jnthn: Just reading the paragraphs around the one TimToady just cited, I can see how it would be easy to make that interpretation.
(or misinterpretation)
TimToady well, my policy is to blame the writer :)
but it's clearer if you think of lastcall as a 'last' out of the dispatcher's implicit loop 18:00
though of course a real last wouldn't return after lastcall 18:01
18:03 zby_home joined
jnthn TimToady: OK, will have a crack at making that work :) 18:07
18:08 zby_home left
[Coke] hopes this doesn't mean jnthn's ... hours. of work are wasted. 18:11
jnthn [Coke]: Not at all 18:12
[Coke]: The underlying model is sound - there's multiple ways we can implement stuff around it.
18:28 mj41_nb left 18:38 jevin left 18:40 jevin joined 18:42 _jaldhar_ left
moritz rakudo: say 'abc'.substr(*-1) 18:43
p6eval rakudo 72d158: OUTPUT«maximum recursion depth exceeded␤ in 'Cool::Num' at line 1934:src/gen/core.pm␤ in 'Cool::Num' at line 1934:src/gen/core.pm␤ in 'Cool::Numeric' at line 1921:src/gen/core.pm␤ in 'Cool::Numeric' at line 1921:src/gen/core.pm␤ in 'Cool::Num' at line 1:src/gen/core.…
moritz nom: say 'abc'.substr(*-1)
p6eval nom: OUTPUT«No applicable candidates found to dispatch to for 'Numeric'. Available candidates are:␤:(Mu, Mu %_)␤␤current instr.: 'Numeric' pc 440865 (src/gen/CORE.setting.pir:115716) (src/gen/CORE.setting:314)␤»
dalek kudo/nom: 3d5e16b | jonathan++ | src/ (4 files):
Implement nextsame and callsame.
18:44
moritz nom: say 'abc'.substr(*-1, 1) 18:45
p6eval nom: OUTPUT«No applicable candidates found to dispatch to for 'Numeric'. Available candidates are:␤:(Mu, Mu %_)␤␤current instr.: 'Numeric' pc 440865 (src/gen/CORE.setting.pir:115716) (src/gen/CORE.setting:314)␤»
18:47 REPLeffect left, mberends left 18:51 Raynes_ is now known as Raynes, Raynes left, Raynes joined 19:07 soh_cah_toa joined 19:18 SHODAN joined 19:19 birdwindupbird joined
[Coke] jnthn: if I want to hack on rakudo on win7, what do you recommend? 19:23
19:23 cdarroch left
jnthn [Coke]: Toolchain wise? I build with msvc++ compiler and the associated toolchain. 19:28
[Coke]: If disk space etc aren't an issue, perhaps www.microsoft.com/visualstudio/en-u...pp-express is the easiest thing to install 19:29
[Coke]: I'd expect that will install all the relevant tools for the command line stuff too. You may need to fix up your path by hand. 19:30
[Coke] jnthn: is that a free download?
jnthn yeah
the express editions of VS are free 19:31
[Coke] heh. "free tools", right on the page, sorry. ;)
jnthn Stripped down IDE, but you ain't really after the IDE so much anyway I guess.
jnthn has the full blown ultimate edition thanks to $dayjob
[Coke] has'nt been paid for C++ in some time. ;) 19:32
hasn't, even.
jnthn Me either :)
Actually $dayjob give me VS licenses for .Net stuff, but the native stuff comes along too 19:33
Works for me. I get the nice profiling and debugging tools for use in Rakudo dev. :)
[Coke] did try out some official .NET stuff for .xlsx processing, but it turned out to be easier to roll my own XML. 19:34
anyhoo, thanks for the pointer. Having something to hack perl6 on that laptop will make certain travel times less boring.
sorear good * #perl6 19:37
masak \o sorear 19:38
Tene Bleh. I've never had good experiences with C++. I've been dealing with some as example code for some reading recently, and it's brought back nightmares.
jnthn Tene: Actually if it sees a .c extension it just treats the file as C89 19:40
Tene: So it works fine as a C compiler too.
Well, aside from not supporting C99 :)
Tene :)
jnthn I tend to be the person who screams if somebody commits something non-C89 19:41
sorear jnthn: niecza has NumericEnum and it works quite well (actually since roles are NYI it uses multiple inheritance instead, class "IntBasedEnum")
Tene jnthn: That wasn't a response to the compiler so much as a response to "* [Coke] has'nt been paid for C++ in some time. ;)"
jnthn Tene: ah, ok :)
sorear: Yeah, I was somewhat inspired by that part, though horrified by the MI ;)
Some days I'm not even sure I think inheritance is a good idea any more... :)
Tene I always suspect that I've somehow been doing something wrong to have such a bad experience with C++, considering that so many other people make such apparently-good use of it. 19:42
jnthn Tene: Heh. I went to uni at the same place Bjarne Stroustrup did. When I went to the Formal Semantics of Programming Languges lecture, the lecturer started off by explaining they introduced the course after they let somebody graduate without it and go on to produce C++. :) 19:43
Tene Hehe. :)
TimToady hides 19:45
jnthn heh :) 19:46
ooh, segfault 19:47
dalek ast: 32ed9ce | moritz++ | S06-signature/sub-ref.t:
[sub-ref.t] remove an outdated test (filling named param by position)
19:48
TimToady as long as it's a formal segfault, we're fine
jnthn It's a "Parrot Undef went where a 6model object should" segfault. Hm. 19:49
19:53 REPLeffect joined
dalek ast: d71768c | moritz++ | integration/99problems-01-to-10.t:
fudge and simplify 99problems-01-to-10.t
19:54
kudo/nom: 68a64d7 | moritz++ | t/spectest.data:
more passing test files
19:57
19:59 thou left 20:03 wolfman2000 left
sorear niecza: say 'abc'.substr(*-1) 20:05
p6eval niecza v7-21-gbcc1cf3: OUTPUT«Unhandled exception: Cannot use value like WhateverCode as a number␤ at /home/p6eval/niecza/lib/CORE.setting line 663 (CORE die @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 41 (CORE Any.Numeric @ 4) ␤ at line 0 (ExitRunloop @ 0) ␤ at /home/p6eva…
sorear huh? 20:06
niecza: say substr('abc',*-1,1)
p6eval niecza v7-21-gbcc1cf3: OUTPUT«c␤»
sorear niecza: say 'abc'.substr(*-1, 1)
p6eval niecza v7-21-gbcc1cf3: OUTPUT«c␤»
sorear TimToady: do you have any clue what's going on with your queries around 10:04? 20:08
TimToady dunno, was guessing at 10:17 20:10
I did fine a workaround, which I used on RC
(put the 0 inside the [+] instead of outside) 20:11
[\+] rather
in that particular RC entry, I didn't bother marking which ones work with rakudo, and which ones with niecza
since they're all supposed to work everywhere eventually :) 20:12
dalek kudo/nom: 0056aeb | jonathan++ | src/Perl6/SymbolTable.pm:
Avoid breaking encapsulation of Code objects in SymbolTable.pm.
20:13
kudo/nom: 6c57fa9 | jonathan++ | src/ (5 files):
Finish up (hopefully) dispatcher for multis, so we can [next|call][same|with] over those too. Makes the sub case work, which never did in master.
TimToady that RC entry is almost a little test suite of its own :)
that's rosettacode.org/wiki/Sum_of_a_series#Perl_6 for lazy historians 20:14
esp since they might not realize we reffed it via PDT :) 20:15
20:17 jferrero left 20:19 REPLeffect left, jferrero joined
dalek ecza: ce1bbd0 | sorear++ | lib/CORE.setting:
Fix "abc".substr(*-1)
20:19
sorear I love 0 ins 1 del patches that fix bugs
20:21 birdwindupbird left
masak :) 20:21
20:21 jaldhar joined
masak the little joys in life. 20:21
20:24 Kivutarrr joined 20:28 MayDaniel joined 20:33 lichtkind joined 20:34 im2ee left, im2ee joined
lichtkind TimToady++: seen your talk on asien YAPC with the rosetta code example and very liked it 20:34
20:35 Jackneill left 20:36 REPLeffect joined, ZaphrodZenovka left, ZaphrodZenovka joined 20:37 mberends joined 20:45 MayDaniel left
TimToady perl6: sub postfix:<⁻²> ($x) { 1 / ($x * $x) }; say [+] ($_⁻² for 1..1000); 20:45
p6eval rakudo 72d158: OUTPUT«1.64393456668156␤»
..niecza v7-22-gce1bbd0: OUTPUT«0␤»
..pugs: OUTPUT«decodeUTF8': bad data: '\8315'␤decodeUTF8': bad data: '\178'␤decodeUTF8': bad data: '\8315'␤decodeUTF8': bad data: '\178'␤*** ␤ Unexpected "for"␤ expecting operator or ")"␤ at /tmp/k2JsH_ZjYx line 1, column 56␤»
TimToady rakudo++ 20:46
masak pugs-- 20:47
TimToady we hadn't defined that to be a valid statement back in the pugs era
but it looks like it was already confused 20:48
now the real trick would be to get it to parse superscripts productively the way a mathematician would 20:49
the only problem being that Unicode superscripts are rather impoverished 20:50
narcolepticality & 20:53
masak ponders how to make the interface to a Towers of Hanoi subgame inside the text adventure game discoverable enough 20:57
jnthn ...how complex is this game?! 20:59
mberends could you play Hanoi with sets of differently coloured Russian dolls (babushkas)?
masak mberends: :P
jnthn: so far? to the tune of 591 LoC.
but I'm on the second-to-last room now :) 21:00
moritz jnthn: fwiw t/spec/S12-methods/defer-next.t dies after the first 9 tests
jnthn I'd not tried that yet...
jnthn wonders how it gies
*dies
moritz Not enough positional parameters passed; got 1 but expected 2
current instr.: 'doit' pc 4371 ((file unknown):1181) (t/spec/S12-methods/defer-next.t:33)
jnthn moritz: will look 21:01
moritz: Though note that semantics *have* changed
moritz: So it's also possible these tests need reviewing.
moritz jnthn: indeed. I haven't followed it all, but at a first glance the test seems saneish
21:03 simcop2387 left
jnthn moritz: In this case it looks like a bug, yeah 21:04
21:06 nnunley left
masak goes to bed, thinking about Towers of Hanoi 21:10
'night, #perl6
mberends masak: you could have the Hanoi disks as stackable weights that need to tip some kind of scale, and physical constraints to enforce the game rules. When the player first encounters a Hanoi subgame, generate towers with a height of 2. Next time, increment the height etc.
masak mberends: ooh.
mberends JIT IRC
masak mberends: at least the tipping scale is a very nice idea.
jnthn moritz: oh, it's nasty 21:11
masak there isn't really a "next time", though.
mberends++
'night (again)
21:11 masak left
jnthn o/ masak 21:11
mberends not jit irc
jnthn multi method doit(Int $num) {$.tracker ~= 'barint,'; nextwith(); $.tracker ~= 'ret2,'} 21:12
21:12 im2ee left
jnthn By the time we hit that nextwith we already comitted to the multi candidate list. 21:12
Which of course contains things that want an Int.
So we try to pass on an empty arg list.
But already comitted to a candidate list of things that need an arg. 21:13
I think I'm going to call bogus test on that one.
Sure, nextwith makes sure those are the active args for any future nextsame we do. 21:14
But it doesn't mean we re-assess the candidate list.
moritz right
jnthn Did it pass in master, ooc?
moritz seems like, yes 21:15
21:15 simcop2387 joined
jnthn OK 21:16
I think master did reassess candidate lists per inheritance level.
Which makes sense because it didn't have proto semantics like we now have.
sorear niecza: say [+] ($_ for 1..10)
p6eval niecza v7-22-gce1bbd0: OUTPUT«0␤»
jnthn nom: say [+] ($_ for 1..10) # fingers crossed... 21:17
p6eval nom: OUTPUT«55␤»
sorear niecza: say ($_ for 1..10)
p6eval niecza v7-22-gce1bbd0: OUTPUT«␤»
jnthn So, I'd say tests need updating. 21:18
21:19 colomon joined 21:21 kcwu left 21:22 thou joined 21:23 ZaphrodZenovka left 21:27 dorlamm joined 21:32 icwiener left, spq1 left 21:34 jevin left, simcop2387 left 21:36 simcop2387 joined, simcop2387 left, simcop2387 joined, jevin joined 21:38 thou left 21:39 y3llow_ joined, pothos_ joined 21:40 y3llow left, pothos left, y3llow_ is now known as y3llow, pothos_ is now known as pothos 21:41 mj41 left 21:43 Psyche^ joined 21:47 Patterner left, Psyche^ is now known as Patterner 21:50 SHODAN left 21:51 drbean joined 22:00 bluescreen10 left 22:03 ZaphrodZenovka joined 22:04 whiteknight joined 22:05 noganex left 22:06 noganex joined 22:11 dorlamm left
tadzik mberends: how about we give thou a commit bit for http-server-simple? He hacks on it for Web.pm and november 22:15
mberends tadzik: yes, definitely 22:17
tadzik I cannot do that, could you? 22:19
I just merged the new pull request 22:20
mberends what is thou's github id? it's not thou. 22:21
tadzik softmoth it is 22:22
mberends thanks, getting there 22:23
github doesn't know softmoth :( softants, maybe? 22:26
tadzik nowai
22:27 drbean left
tadzik itz him, look: github.com/mberends/http-server-si.../41fcbd070 22:27
mberends looks 22:28
added :-) (don't always trust the browser dropdown menus) 22:30
tadzik :) 22:31
mberends++
22:31 kaare_ left
felher rosettacode.org/wiki/Guess_the_numb...er)#Perl_6 22:38
22:47 Kivutarrr left 22:51 Transformer joined 22:53 Transformer left
flussence
.oO( suck moment of the day: debian makes urxvt's $TERM "rxvt-unicode-256color" and then patches their version of screen to not accept a string that long )
22:55
TimToady felher++ 22:56
22:56 sivoais left
felher TimToady: thnx :) 23:00
flussence: Yeah, i have this problem for quite a while on gentoo. :/
dalek kudo/podparser: 06f1c95 | tadzik++ | src/Perl6/ (3 files):
Get rid of table_row_notempty insanity
23:01
felher sleep &
TimToady o/
23:05 dayangkun joined 23:07 icwiener joined 23:18 wamba left, cxreg2 is now known as cxreg 23:30 orafu left 23:34 orafu joined 23:35 Chillance left 23:39 jevin left 23:41 jevin joined
TimToady perl6: say '42' ~~ 0..100 23:46
p6eval rakudo 72d158, niecza v7-22-gce1bbd0: OUTPUT«Bool::False␤»
..pugs: OUTPUT«␤»
TimToady hmm 23:47
23:48 envi joined 23:57 icwiener left