»ö« 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:00 tokuhiro_ joined 00:03 tokuhiro_ left 00:09 Circlepuller left 00:10 Circlepuller_ joined 00:27 simcop2387 left 00:29 simcop2387 joined 00:41 thou joined 00:45 cognominal__ joined 00:47 thou left 00:48 cognominal_ left, aharoni joined 01:06 aharoni left 01:09 cognominal__ left 01:18 whiteknight left 01:19 armitage81 joined 01:21 armitage81 left 01:26 armitage81 joined
[Coke] looking at nqp's src/NQP/Compiler.pm, I don't see where it's handling getting "foo.nqp" on the commandline. 01:32
01:32 armitage81 left 01:34 armitage81 joined
[Coke] ah. my MAIN signature was wrong. 01:38
01:41 armitage81 left 01:42 armitage81 joined 01:44 cognominal joined
[Coke] yay I can run 'make test' again. boo, everything fails. 01:46
01:47 cognominal_ joined 01:50 cognominal left 01:51 raiph left 01:54 HarryS left, HarryS joined 01:58 thou joined 02:01 cognominal_ left 02:03 cognominal_ joined 02:07 xdbr left 02:17 thou left 02:19 simcop2387 left 02:20 simcop2387 joined 02:25 cognominal_ left 02:27 cognominal_ joined 02:31 ServerSage left 02:36 ServerSage joined 02:38 cognominal_ left 02:39 orafu left 02:40 orafu joined 02:42 cognominal joined 02:50 cognominal left 02:57 thou joined 03:07 Circlepuller_ left 03:13 benabik left 03:20 benabik joined 03:50 kurahaupo left 03:52 will1309 joined 03:58 xinming joined 04:26 telex left 04:38 telex joined 04:43 preflex left 04:44 wamba joined 04:45 preflex joined 04:54 cognominal joined 04:59 cognominal_ joined 05:01 cognominal left 05:06 cognominal_ left 05:13 hash_table left 05:23 Playb3yond joined 05:36 mdupont left 05:39 mdupont joined 05:44 Playb3yond left 05:47 kaare__ joined 05:52 killbot joined 05:59 Celelibi left 06:07 wamba left 06:08 _jaldhar joined, jaldhar left
jnthn morning 06:08
06:24 fridim_ left 06:29 jevin left 06:44 mucker joined
moritz \o 06:53
07:18 rindolf joined
jnthn Hmm 07:19
I get a fail on test 50 of S02-names/pseudo.t
moritz oh, that might be my typed exception thingy 07:21
I'll investigate
jnthn ah, I think I see what's going on
X::NoSuchSymbol(symbol => $name).fail unless $thing.WHO.exists($_);
missing a .new
jnthn adds it and tests
moritz huh, I thought I had tested that case locally 07:22
jnthn I get some socket fails, but I guess that's because my Parrot is too new
moritz ah, I only tested one of the two
moritz--
or too old
jnthn yeah, adding the .new helps 07:23
dalek kudo/nom: e52612f | jnthn++ | src/core/operators.pm:
Fix an exception throw.
07:24
moritz jnthn++
dalek ast: 1baebc1 | moritz++ | S05-modifier/ii.t:
separate testing of :ii and that :ii implies :i
07:34
07:39 Su-Shee joined 07:41 Su-Shee_ left 08:04 flightrecorder joined 08:08 cognominal joined 08:10 leont joined 08:11 armitage81 left 08:14 cognominal left 08:22 wamba joined, GlitchMr joined 08:27 lcc left 08:33 SamuraiJack joined 08:34 mdupont left 08:35 mucker left
dalek p: f44a799 | jnthn++ | src/QRegex/P6Regex/Grammar.nqp:
Toss :PIR{{...}} parsing in P6Regex.

Legacy, and didn't even have an action method so couldn't possibly have been being used.
08:48
p: e349cb6 | jnthn++ | src/ (4 files):
Basic implementation of :dba(...).
kudo/nom: 59fc70a | jnthn++ | tools/build/NQP_REVISION:
Bump NQP_REVISION for :dba(...).
kudo/nom: 88a9ba4 | jnthn++ | src/Perl6/Grammar.pm:
Uncomment and add some :dba(...).
moritz database administrators in Rakudo \o/ 09:12
jnthn :P
moritz jnthn: I guess all the 'in PMC' in nqp_bigint.ops could just as well be 'invar PMC', right? 09:16
jnthn moritz: Yes
moritz then I'll do that
r: say 9737 / 3343 # size reduction of src/ops/nqp_bigint_ops.c
p6eval rakudo 88a9ba: OUTPUT«2.912653␤» 09:17
dalek p: 30b8883 | moritz++ | src/ops/nqp_bigint.ops:
[bigint ops] s:g/in PMC/invar PMC/
jnthn Wow 09:19
moritz I'm not sure there's any practical benefit from it
maybe reduced size of binary
but it feels good :-) 09:20
dalek p: 47593ca | jnthn++ | src/QRegex/P5Regex/Actions.nqp:
Respect (?i) when compiling charclasses.
09:22
moritz jnthn: is :dba used in error messages already? 09:25
jnthn r: my @a; @a[393mnd3!.]
p6eval rakudo 88a9ba: OUTPUT«===SORRY!===␤Unable to parse expression in subscript; couldn't find final ']' at line 2, near "393mnd3!.]"␤»
jnthn Yes ;)
09:27 wamba left
moritz \o/ 09:29
r: 1[1 1] 09:30
p6eval rakudo 88a9ba: OUTPUT«===SORRY!===␤Unable to parse expression in subscript; couldn't find final ']' at line 2, near "1 1]"␤»
moritz I think the old one was just "Confused"
jnthn++
jnthn A small, but nice error reporting improvement.
moritz nqp: my int $i; say($i) 09:34
p6eval nqp: OUTPUT«0␤»
09:36 thou left 09:40 wamba joined 09:56 spider-mario joined 10:01 grondilu left
dalek ast: 69befed | moritz++ | S0 (2 files):
unfudge some tests for rakudo
10:01
kudo/nom: 46b8eb8 | moritz++ | src/Perl6/Actions.pm:
sprinkle some native types into Actions.pm
10:02
jnthn yay, I fixed that annoying subcapture bug in the regex compiler...
10:05 SamuraiJack left
dalek p: 8b5a7a0 | jnthn++ | src/QAST/Compiler.nqp:
Fix subcapture compilation.

We have to ensure $!pos gets updated appropriately, since it is used by
  !cursor_capture. Fixes much in m:P5/.../ spectests, but could also be a
bug in normal Perl 6 regexes too.
10:07
moritz jnthn: that's good to hear
p: a1c54d8 | jnthn++ | t/p5regex/rx_captures:
Untodo a P5Regex test.
10:08 SamuraiJack joined
dalek kudo/nom: afb8a63 | jnthn++ | tools/build/NQP_REVISION:
Bump NQP_REVISION for regex improvements.
10:18
kudo/nom: e644792 | jnthn++ | t/spectest.data:
Run S05-modifier/perl5_4.t.
ast: 8d44d1c | jnthn++ | S05-modifier/perl5_4.t:
Fudge S05-modifier/perl5_4.t for Rakudo.
ast: b27262e | jnthn++ | S05-modifier/perl5_ (2 files):
Rakudo unfudging.
10:21 leont left
dalek kudo/nom: d3de02f | moritz++ | src/Perl6/Actions.pm:
more native types for Actions.pm
10:32
10:35 grondilu joined
grondilu rn: say so True|False 10:35
p6eval rakudo 46b8eb, niecza v22-7-g7df6137: OUTPUT«True␤»
grondilu r: my $x = True|False; say $x ~~ Bool; 10:40
p6eval rakudo 46b8eb: OUTPUT«False␤»
10:40 cognominal joined 10:54 MayDaniel joined 10:55 FROGGS joined 10:57 topo_ joined 11:00 topo left 11:02 topo_ is now known as topo 11:05 Su-Shee_ joined
nyuszika7h r: my $x = True&False; say $x ~~ Bool; 11:08
p6eval rakudo 46b8eb: OUTPUT«False␤»
nyuszika7h rn: say so True&False
p6eval rakudo 46b8eb, niecza v22-7-g7df6137: OUTPUT«False␤»
11:09 Su-Shee left 11:10 MayDaniel left 11:13 mucker joined
grondilu I'm actually fine with True|False not matching Bool. It fits my particular need. 11:14
jnthn r: say True|False ~~ Junction 11:16
p6eval rakudo 46b8eb: OUTPUT«True␤»
GlitchMr perl6: say True|False ~~ Bool 11:21
p6eval rakudo d3de02, niecza v22-7-g7df6137: OUTPUT«False␤»
11:21 aharoni joined
grondilu In case you wonder, I used that to fix my endianness issue earlier. 11:22
r: constant little-endian = True|Fase; CHECK { little-endian ~~ Bool or die "please set little-endian constant in source code" } 11:23
p6eval rakudo d3de02: OUTPUT«===SORRY!===␤Could not find sub &Fase␤»
grondilu r: constant little-endian = True|False; CHECK { little-endian ~~ Bool or die "please set little-endian constant in source code" }
p6eval rakudo d3de02: OUTPUT«===SORRY!===␤please set little-endian constant in source code␤»
11:26 MayDaniel joined 11:27 whiteknight joined 11:30 gugod joined, wtw joined 11:39 birdwindupbird joined
moritz r: say (False|True).WHAT 11:44
p6eval rakudo d3de02: OUTPUT«Junction()␤»
moritz r: say Junction ~~ Bool
p6eval rakudo d3de02: OUTPUT«False␤»
12:11 PacoAir joined 12:23 wamba left 12:35 rindolf left, rindolf joined 12:36 cognominal_ joined 12:38 cognominal left 12:41 flightrecorder left 12:42 FROGGS left 12:46 wamba joined 12:48 grondilu left 12:57 Celelibi joined 13:17 Chillance left 13:26 rindolf left 13:27 rindolf joined 13:38 Coleoid left, birdwindupbird left, Coleoid joined 13:40 birdwindupbird joined 13:43 aharoni left 13:46 birdwind1pbird joined 13:48 birdwindupbird left 13:56 rindolf left 13:57 rindolf joined
dalek Heuristic branch merge: pushed 30 commits to nqp/kill-nqpattr by jnthn 14:00
14:04 arlinius left 14:30 cognominal_ left 14:32 spider-mario left 14:38 cognominal joined
[Coke] I just saw a video of masak! 14:40
timotimo_ whoa 14:41
moritz wow
flussence he exists?!?
timotimo_ was it some dope skateboard trick collage?
moritz masak is currently in .cn, I believe
mucker [Coke]: link 14:46
tadzik masak doing skateboard tricks in .cn? :)
14:46 leprevost joined 14:47 rindolf left 14:48 leprevost left
dalek p/kill-nqpattr: 8a899d4 | jnthn++ | src/NQP/Actions.pm:
Simplify some code.
14:48
p/kill-nqpattr: 7db86ab | jnthn++ | src/core/NQPRoutine.pm:
Flesh out NQPRegex a bit.

Gives it methods and attributes that will store the captures and NFAs.
p/kill-nqpattr: e212a96 | jnthn++ | src/QRegex/NFA.nqp:
Add a way to persist an NFA to a data structure.

This will (eventually) be used to serialize the NFA instead of using the nqpattr hack.
14:48 rindolf joined, leprevost joined
[Coke] mucker: www.youtube.com/watch?feature=playe...JwlCzW5O_Q 14:51
(has several #perl6 people, actually.)
14:52 Psyche^ joined 14:53 birdwind1pbird left 14:55 Patterner left, Psyche^ is now known as Patterner 14:58 xdbr joined 15:02 leprevost left, integral left, integral joined, integral left, integral joined 15:10 hash_table joined 15:17 flussence left, flussence joined 15:23 rindolf left 15:24 rindolf joined
jnthn in Perl 5 regex, what does the ? mean in /(a(?(1)\1)){4}/ ? 15:29
GlitchMr (?(1)\1) appears to be "if capturing group 1 captures something" capture backreference 1 15:31
This is conditional
But I don't think it's neccessary in this case - simple \1 should be enough
jnthn Yeah, it's from a test :) 15:32
found it in perlre 15:33
(1) (2) ...
Checks if the numbered capturing group has matched something.
GlitchMr This is one of those things that nearly nobody uses
(but perhaps I'm wrong)
code.google.com/codesearch#search/...mp;type=cs 15:34
Apperently, it is used
But rarely 15:35
jnthn Yeah, it's the (first) blocker on running S05-modifier/perl5_5.t
jnthn is doing some gentle m:P5/.../ hacking while he de-lags :)
GlitchMr Should I make "explain regexp" tool? 15:36
jnthn std: m:P5/(a(?(1)\1)){4}/
p6eval std 77327a4: OUTPUT«ok 00:00 49m␤»
GlitchMr /^(a(?(1)\1)){4}$/
Should be identical to /^(a){4}/ in that case
Backreference is used before it was catched 15:37
jnthn *nod* 15:38
jnthn tries to work out how STD_P5 parses that one
15:40 benabik left
jnthn std: m:P5/(?a)/ 15:41
p6eval std 77327a4: OUTPUT«ok 00:00 49m␤»
15:41 benabik joined
jnthn Hm, wonder why that doesn't trigger "quantifier quantifies nothing" 15:42
felher Is there a way to tell my grammar that it should never match any of \v? So that even . doesn't match \v anymore. Or this best done with a pre-check before using the grammar? 15:46
15:47 xinming left
jnthn felher: What are you trying to do, exactly? 15:47
r: say ' ab ' ~~ /\V+/
p6eval rakudo d3de02: OUTPUT«「 ab 」␤␤»
jnthn er
r: say " ab\n" ~~ /\V+/ 15:48
p6eval rakudo d3de02: OUTPUT«「 ab」␤␤»
jnthn There's that for matching anything put \v
Do you want to use rule but have its whitespace handling never match \v? If so just override ws.
*anything but 15:49
15:51 nodmonkey joined
GlitchMr ok, I still cannot remove service hook on glitchmr.github.com. 15:51
But I can change it, so I've changed it to example.com/... hope it will work
felher jnthn: I'm just don't write \V anywhere for one i'm lazy and two its kinda error prone :) This grammar only should parse single lines, and I wonder whats the best way to do it :)
GlitchMr Oh... I was supposed to click (remove), not clear the URL lol 15:52
Anyways, now the information shouldn't appear on this channel
15:52 sudokode is now known as phrik 15:53 phrik left
felher while i sure can say something along the lines of: 'die "can not have newlines" unless $string ~~ /\v/; return grammar.parse($string, $actions)' its harder to get useful error-messages when i want to know in what subrule that '\v' appeared :) 15:53
15:53 sudokode joined
felher *if $string ~~ ... 15:54
jnthn felher: Well, a <before \V+ $> at the start of the regex is one way 15:55
But yeah, that won't tell you where it is
<before (\V+) [ $ || { die "Vertical whitespace after $1" }> # maybe 15:56
er, I missed a ] :)
GlitchMr Shouldn't I name my program to explain regexpes "regexplain"?
s/n't//
jnthn GlitchMr: Cute name :)
felher GlitchMr: yeah, sounds good :) 15:57
GlitchMr I originally wanted to name it "explain-regexp" but word games are nice ;-). 15:58
felher jnthn: thats better than a simple test, yes. But i think i will just write \V* instead of .* and <-[\:\V]> instead of <-[\:]> and such :)
jnthn: thanks :)
*<-[\:\v]>
GlitchMr It's going to be like YAPE::Regex::Explain, except supporting modern RegExp constructions 15:59
felher doesn't know YAPE::Regex::Explain, but it sounds like a good idea :) 16:00
16:00 rindolf left
GlitchMr felher: search.cpan.org/~pinyan/YAPE-Regex-...Explain.pm 16:01
16:01 Su-Shee joined
GlitchMr Except I think I'll write that in JavaScript 16:01
16:03 Su-Shee_ left, cognominal left
felher GlitchMr: a JavaScript-Script to explain perl6 regexes? 16:04
GlitchMr: to build it into a website? 16:05
GlitchMr Well, most likely yes
But that will support Perl 5... Perl 6 will be later
felher GlitchMr: ah, okay :) 16:06
GlitchMr Perl 5 regexpes are simpler, but the architecture will be extensible, so Perl 6 would be possible too
felher GlitchMr++ :)
GlitchMr Or perhaps rather - like YAPE::Regex::Explain or RegexBuddy 16:10
/(?:\\\W|[^\\\[(){^$.|+*?]|\{(?!\d+(?:,\d*)?\}))+(?![?*+]|\{\d+(?:,\d*)?\})/ 16:16
This is regexp to match literal characters
(without /x modifier activated)
mucker goes unconscious
GlitchMr If I would want to parse RegExp with /, I also would have to notice spaces and # 16:17
s/\//\/x/
16:20 xinming joined
GlitchMr /(?:\\\W|[^\\\[#(){^$.|+*?]|\{(?!\d+(?:,\d*)?\}))+(?![?*+]|\{\d+(?:,\d*)?\})|(?:\\\W|[^\\\[#(){^$.|+*?]|\{(?!\d+(?:,\d*)?\}))/ 16:39
When you through it couldn't be worse
Hmmm... but I could shorten THAT 16:40
[Coke] is glad jnthn is back hacking on nqp and friends. 16:44
GlitchMr /#[ \t]*(.*?)[ \t]*$/m 16:46
Ok :-)
felher :D 16:52
GlitchMr /(?:([+*?])|\{(\d+)(?:(,)(\d*))?)([?+])?/ 16:53
This is going to be fun
Make cryptic regexpes in JavaScript to match RegExp parts
[Coke] where are methods available on the compiler/grammar in nqp defined? 16:56
16:56 brrt joined
[Coke] (I'm trying to get the parse tree, add stuff to it, then compile it.) 16:56
brrt hi #perl6 16:57
i have thought about it
and i have decided
i hate your damn calling conventions 16:58
but i can implement them just the same :-)
16:59 fridim_ joined 17:07 silug left 17:14 _edwin joined 17:16 cognominal joined
moritz [Coke]: in HLL::Compiler 17:23
17:26 grondilu joined
grondilu rn: class Foo is Str { method bar { self ~= "bar" } }; my Foo $x; say $x.bar;' 17:26
p6eval niecza v22-7-g7df6137: OUTPUT«===SORRY!===␤␤Bogus statement at /tmp/0_REinksgN line 1:␤------> elf ~= "bar" } }; my Foo $x; say $x.bar;⏏'␤␤Parse failed␤␤» 17:27
..rakudo d3de02: OUTPUT«===SORRY!===␤Confused␤at /tmp/PHJjMML_2K:1␤»
17:27 cognominal_ joined
grondilu How would you write something like that? It should be easy, shouldn't it? 17:28
17:29 cognominal left
grondilu I just want a class that extends Str and adds a method that puts something at the end. 17:29
GlitchMr use MONKEY_PATCHING 17:31
... oh, extending
rn: class Foo is Str { method bar { self ~= "bar" } }; my Foo $x; say $x.bar;
p6eval niecza v22-7-g7df6137: OUTPUT«Unhandled exception: Writing to readonly scalar␤ at /tmp/pSzB8Exlx0 line 1 (Foo.bar @ 4) ␤ at /tmp/pSzB8Exlx0 line 1 (mainline @ 6) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4198 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4199 (modul…
..rakudo d3de02: OUTPUT«Cannot assign to a non-container␤ in block at src/gen/CORE.setting:12006␤ in method bar at /tmp/H0v68N1GZv:1␤ in block at /tmp/H0v68N1GZv:1␤␤»
GlitchMr Well, strings aren't mutable
So you cannot do that so easily 17:32
17:32 _jaldhar left
sorear good * #perl6 17:33
brrt rn: class Foo is Str { method bar { self ~ "bar" } }; my Foo $x; say $x.bar
p6eval niecza v22-7-g7df6137: OUTPUT«bar␤»
..rakudo d3de02: OUTPUT«use of uninitialized value of type Foo in string context in method bar at /tmp/sqbenEQ5fj:1␤␤bar␤»
grondilu n: class Foo is Str { method bar { self ~ "bar" } }; my Foo $x; say $x.bar
p6eval niecza v22-7-g7df6137: OUTPUT«bar␤»
17:33 cognominal__ joined
grondilu n: class Foo is Str { method bar { self ~ "bar" } }; my Foo $x; $x.bar; say $x; 17:33
p6eval niecza v22-7-g7df6137: OUTPUT«Foo()␤»
brrt rn: class Foo is Str { method bar { self ~ "bar" } }; my Foo $x = ""; say $x.bar 17:34
p6eval niecza v22-7-g7df6137: OUTPUT«Unhandled exception: Nominal type check failed for scalar store; got Str, needed Foo or subtype␤ at /tmp/VC34uo3MNC line 1 (mainline @ 4) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4198 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4199 (…
..rakudo d3de02: OUTPUT«Type check failed in assignment to '$x'; expected 'Foo' but got 'Str'␤ in block at /tmp/d4T_teVTcI:1␤␤»
GlitchMr This is Str, not Foo.
brrt fine
role Foo { method bar { self ~ "bar" } }; my $x does Foo = "foo"; say $x.bar 17:35
GlitchMr I've no idea how to make Str without literals or .Str method that isn't empty
17:35 jaldhar joined
GlitchMr Hmmm... perhaps hax will work 17:35
17:36 cognominal_ left
GlitchMr > $str ~~ s/<?>/hello world!/ 17:36
Type check failed in assignment to '$str'; expected 'Foo' but got 'Str'
No...
brrt rn: role Foo { method bar { self ~ "bar" } }; my $x does Foo = "foo"; say $x.bar 17:38
p6eval niecza v22-7-g7df6137: OUTPUT«===SORRY!===␤␤Trait does not available on variables at /tmp/GB_FfiUtF5 line 1:␤------> bar { self ~ "bar" } }; my $x does Foo ⏏= "foo"; say $x.bar␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CO…
..rakudo d3de02: OUTPUT«No such method 'bar' for invocant of type 'Str'␤ in block at /tmp/ssrNUVOF4C:1␤␤»
grondilu I want bar to mutate Foo. 17:40
I mean to mutate the calling instance.
jnthn That's not so much mutation as returning a concatenated thing though
r: my $x = "foo" but role { method bar { self ~ "bar" } }; say $x.bar 17:41
p6eval rakudo d3de02: OUTPUT«foobar␤»
grondilu Yeah that's why I tried =~ in the first place.
sorry: ~=
r: my $x = "foo" but role { method bar { self ~= "bat" } }; say $x.bar; 17:42
p6eval rakudo d3de02: OUTPUT«Cannot assign to a non-container␤ in block at src/gen/CORE.setting:12006␤ in method bar at /tmp/sDRDqDulN6:1␤ in block at /tmp/sDRDqDulN6:1␤␤»
jnthn Str isn't mutable, so extending it isn't likely to go well
Delegation would probably work out better. 17:43
grondilu I don't get it.
jnthn You can't change the value a given Str has. They are imutable.
grondilu but I can instantiate a Str in something mutable, can't I? 17:44
jnthn sure
that's what I was suggesting
grondilu r: my Str $x = "foo"; say $x ~= "bar";
p6eval rakudo d3de02: OUTPUT«foobar␤»
jnthn sureRight, the second thing produces a new Str and assigns it to $x
grondilu That's a weird logic, imho. 17:45
jnthn r: class Foo { has Str $.value handles *; method bar() { $!value ~= "bar" } }; my $x = Foo.new(value => 'blah'); say $x.bar; # is more what I meant 17:46
p6eval rakudo d3de02: OUTPUT«blahbar␤»
17:47 brrt1 joined
grondilu jnthn: that's encapsulation, not extension. 17:47
17:48 brrt left, brrt1 is now known as brrt
grondilu Yet I admit I did not know about this "handles" modifier. Seems handy. 17:48
Why is Str immutable anyway? Not all strings are litterals, are they? 17:55
17:56 mucker left
grondilu I mean, whatever $x is does when I type ' $x ~= "bar" ', I should be able to do it inside a method. 17:57
s/is does/does/
thus my 'self ~= "bar"' attempt. 17:58
jnthn ah, I see 17:59
18:00 rindolf joined
jnthn Well, self strips away any container 18:00
But you can do something like:
r: my $x = "foo" but role { method bar($invocant is rw:) { $invocant ~= "bar" } }; $x.bar; say $x;
p6eval rakudo d3de02: OUTPUT«foobar␤»
jnthn That is, you explicitly say "I want to modify the invocant"
(can call $invocant whatever you like)
grondilu I'm surprised this work. What makes $invocant the invocant and not a method argument? 18:01
jnthn The colon 18:02
grondilu ok. Well, that solves the issue indeed. Thanks.
18:03 cognominal__ left
grondilu r: class Foo is Str { method bar($me is rw:) { $me ~= "bar" } }; my Foo $x; $x.bar; say $x; 18:03
p6eval rakudo d3de02: OUTPUT«Type check failed in assignment to '$x'; expected 'Foo' but got 'Str'␤ in block at src/gen/CORE.setting:12006␤ in method bar at /tmp/gr2MIfQ3jS:1␤ in block at /tmp/gr2MIfQ3jS:1␤␤»
grondilu Do I really need to use a role? 18:04
18:05 FROGGS joined, flightrecorder joined
jnthn The code you wrote there never makes an instance of Foo 18:07
grondilu r: class Foo is Str { method bar($me is rw:) { $me ~= "bar" } }; my Foo $x .= new; $x.bar; say $x;
p6eval rakudo d3de02: OUTPUT«Type check failed in assignment to '$x'; expected 'Foo' but got 'Str'␤ in block at src/gen/CORE.setting:12006␤ in method bar at /tmp/fmSRayl0Zu:1␤ in block at /tmp/fmSRayl0Zu:1␤␤»
18:08 spider-mario joined
jnthn Now you get that but the concatenation operator returns a Str as its result, not a Foo 18:08
18:08 aharoni joined 18:09 crab2313 joined
grondilu But shouldn't the concatenation operator take into account that it is called by a child class of Str, and thus return an instance of this child class? 18:10
moritz no
we've had that with Int
and somebody did, in essense, (1 but "1") + 2 18:11
and printed it
and was surprised that the result was "1", not "3"
GlitchMr That's obvious. He modified integerish value, not stringy value
moritz because the type of the LHS was (Int but "1"), and the + operator took taht for the result 18:12
GlitchMr Also...
> (1 but "1") + 2
3
jnthn Well, yeah. Thing here is that "bar" is a Str, so how would it decide between the two types.
GlitchMr perl6: say (1 but "1") + 2
moritz yes, I've fixed infix:<+>(Int, Int) to always return exactly Int
p6eval rakudo d3de02, niecza v22-7-g7df6137: OUTPUT«3␤»
jnthn (even if it was going to do that)
moritz there's no sanity down that road 18:13
18:13 cognominal__ joined
grondilu can't I bless "bar" into Foo or something, then? 18:13
moritz r: class Foo is Str { }; given Foo.new("bar") { .say; say .WHAT } 18:14
grondilu I don't quite get how blessing works in Perl6, though.
p6eval rakudo d3de02: OUTPUT«Default constructor only takes named arguments␤ in method new at src/gen/CORE.setting:659␤ in block at /tmp/3yGb1S0HVj:1␤␤»
moritz I guess that should be made to work
r: class Foo is Str { }; given nqp::box_s(Foo, "bar) { .say; say .WHAT }
p6eval rakudo d3de02: OUTPUT«===SORRY!===␤Unable to parse expression in argument list; couldn't find final ')' at line 2, near "\"bar) { .s"␤»
moritz r: class Foo is Str { }; given nqp::box_s(Foo, "bar") { .say; say .WHAT } 18:15
p6eval rakudo d3de02: OUTPUT«Cannot unbox a type object as a native str␤ in any at src/gen/BOOTSTRAP.pm:655␤ in block at /tmp/ZTR6Xwa_yF:1␤␤»
moritz r: class Foo is Str { }; given nqp::box_s("bar", Foo) { .say; say .WHAT }
p6eval rakudo d3de02: OUTPUT«bar␤Foo()␤»
moritz that's how you can do it in Rakudo today, though the boxing is non-standard
18:25 xinming_ joined
grondilu bty I've just realized I can make a role in a whole file, as I would do with a class or module. I tried that once with no success. 18:25
So I'll use a role then, I guess. 18:26
18:27 fglock joined
grondilu I'm confused. It works with grammars as well? 18:28
18:28 xinming left
dalek p: 9e503bd | jnthn++ | src/QRegex/P5Regex/ (2 files):
Toss some P6Regex code that's ported.
18:28
p: 5591588 | jnthn++ | src/QRegex/P5Regex/Actions.nqp:
Handle quantification of vanishing things.
p: 3442c18 | jnthn++ | src/QRegex/P5Regex/ (2 files):
Implement lookbehind.
p: b8ad051 | jnthn++ | src/QRegex/P5Regex/Grammar.nqp:
Parse 's' mod (though NYI).
jnthn grondilu: A grammar is just a funny kind of class
brrt sub foo ($x) { say $x; }; my @a = 1,2,3; foo(|@a); 18:29
r: ub foo ($x) { say $x; }; my @a = 1,2,3; foo(|@a);
p6eval rakudo d3de02: OUTPUT«===SORRY!===␤Variable $x is not declared␤at /tmp/6ehoJHL83m:1␤»
grondilu yeah but I thought the syntax 'class MyClass;' on the beginning of the file was only for modules and classes.
jnthn No, it's for any package. 18:30
grondilu Ok. Good to know.
moritz
.oO( more general than you thought )
jnthn Grrr. /a(?#xxx){3}c/
The {3} here would appear to apply to the a in P5 regex... 18:31
18:31 armitage81 joined
brrt p6: ub foo ($x) { say $x; }; my @a = 1,2,3; foo(|@a); 18:32
p6eval rakudo d3de02: OUTPUT«===SORRY!===␤Variable $x is not declared␤at /tmp/NpxJtdEfXF:1␤»
..niecza v22-7-g7df6137: OUTPUT«===SORRY!===␤␤Variable $x is not predeclared at /tmp/Xku2uAvVWS line 1:␤------> ub foo (⏏$x) { say $x; }; my @a = 1,2,3; foo(|@a)␤␤Unexpected block in infix position (two terms in a row, or previous statement missing sem…
brrt dammit
p6: sub foo ($x) { say $x; }; my @a = 1,2,3; foo(|@a);
p6eval rakudo d3de02: OUTPUT«Too many positional parameters passed; got 3 but expected 1␤ in sub foo at /tmp/1kgVQEZVq3:1␤ in block at /tmp/1kgVQEZVq3:1␤␤»
..niecza v22-7-g7df6137: OUTPUT«Unhandled exception: Excess arguments to foo, used 1 of 3 positionals␤ at /tmp/Mfa6XCqved line 0 (foo @ 1) ␤ at /tmp/Mfa6XCqved line 1 (mainline @ 6) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4198 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.settin…
brrt p6: sub foo ($x,$y, $z) { say $x; }; my @a = 1,2,3; foo(|@a);
p6eval niecza v22-7-g7df6137: OUTPUT«Potential difficulties:␤ $y is declared but not used at /tmp/Of8eWuU18i line 1:␤------> sub foo ($x,⏏$y, $z) { say $x; }; my @a = 1,2,3; foo(␤ $z is declared but not used at /tmp/Of8eWuU18i line 1:␤------> sub foo ($x,$y, ⏏[3…
..rakudo d3de02: OUTPUT«1␤»
jnthn eval 'aaac' =~ /a(?#xxx){3}c/; $0 18:33
eval: 'aaac' =~ /a(?#xxx){3}c/; $0
ah, no buubot 18:34
also, $0 doesn't do that :)
brrt my @a = 1..Inf; sub foo($x) { say $x; }; foo(|@a); 18:36
r: my @a = 1..Inf; sub foo($x) { say $x; }; foo(|@a); 18:38
p6eval rakudo d3de02: OUTPUT«Not enough positional parameters passed; got 0 but expected 1␤ in sub foo at /tmp/rUitvBYgCX:1␤ in block at /tmp/rUitvBYgCX:1␤␤»
18:38 crab2313 left 18:40 brrt1 joined 18:42 brrt left 18:44 brrt1 left 18:47 ingy left, ingy joined 18:49 birdwindupbird joined
ingy hi jnthn o/ 18:51
jnthn o/ ingy 18:53
Good journey back?
ingy jnthn: oui. uneventful == good 18:55
jnthn Indeed. 18:56
ingy you back too?
jnthn yeah
Also uneventfully.
ingy ah, the boring life! so grand
18:56 fridim_ left 19:00 wooden left 19:01 armitage81 left, z-b is now known as zb, armitage81 joined 19:02 wooden joined, grondilu left, armitage81 left 19:03 armitage81 joined, armitage81 left, armitage81 joined 19:04 thou joined 19:05 GlitchMr left
dalek p: f982b88 | jnthn++ | src/QRegex/P5Regex/ (2 files):
Revise whitespace and comment handling.

This makes whitespace significant by default, requiring (?x) to make it insignificant again, as is the Perl 5 default. Also implements the (?#xxx) comment syntax.
19:21
p: 08e45ac | jnthn++ | t/p5regex/rx_metachars:
Update tests for whitespace semantics.
p: 28bf11c | jnthn++ | src/QRegex/P5Regex/Actions.nqp:
Implemnt (?m).
p: cd58c13 | jnthn++ | src/QRegex/P5Regex/Actions.nqp:
Give . Perl 5 semantics; honor (?s).
p: 5238d7b | jnthn++ | t/p5regex/rx_metachars:
Correct a test for Perl 5 semantics.
kudo/nom: cc92def | jnthn++ | tools/build/NQP_REVISION:
Get latest P5Regex improvements.
19:26
kudo/nom: 870d189 | jnthn++ | t/spectest.data:
Run S05-modifier/perl5_5.t.
ast: 289e708 | jnthn++ | S05-modifier/perl5_5.t:
Fudge S05-modifier/perl5_5.t for Rakudo.
ast: 903d08b | jnthn++ | S05-modifier/perl5_ (2 files):
Rakudo unfudging.
19:32 fgomez left 19:36 PacoAir left 19:38 PacoAir joined, PacoAir left 19:39 armitage81 left 19:40 PacoAir joined, PacoAir left 19:45 leont joined 19:51 rindolf left, PacoAir joined, rindolf joined 19:59 _edwin left 20:01 PacoAir left, PacoAir joined 20:02 erkan joined, erkan left, erkan joined 20:04 SamuraiJack left 20:07 kaare__ left 20:09 cognominal joined, fglock left 20:10 cognominal__ left 20:14 benabik left 20:15 nlpplz joined 20:18 birdwindupbird left 20:20 benabik joined 20:22 MikeFair left 20:24 birdwindupbird joined 20:30 MikeFair_ joined, aindilis left, birdwindupbird left 20:31 fgomez joined 20:33 nodmonkey left 20:44 rindolf left 20:45 rindolf joined 20:56 bruges_ joined 20:57 raiph joined 20:58 bruges left
jnthn sleep & 21:00
raiph sleep well and dream of large mops
may i bring a bot (alpha status) that has nothing directly to do with perl 6 on to this channel? 21:02
21:02 LlamaRider joined 21:03 cognominal left 21:04 cognominal joined 21:12 fgomez left 21:13 Coleoid left 21:14 raiph left 21:16 LlamaRider left 21:18 cognominal_ joined 21:19 cognominal left 21:27 fgomez joined 21:45 cognominal__ joined 21:47 cognominal_ left 21:52 cognominal__ left 22:01 PacoAir left 22:28 MayDaniel left 22:30 erkan left 22:31 erkan joined, erkan left, erkan joined 22:35 fridim_ joined 22:39 spider-mario left 22:45 cognominal__ joined 22:48 fgomez left 22:50 cognominal__ left 22:59 rindolf left 23:00 rindolf joined 23:21 flightrecorder left, FROGGS left 23:28 fgomez joined 23:31 leont left 23:37 doy_ is now known as doy 23:38 rindolf left 23:41 wamba left 23:44 aharoni left 23:53 grondilu joined
grondilu off topic: spaceX is about to launch: www.spacex.com/webcast/ 23:53