»ö« 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:05 wolfman2000 joined 00:06 lichtkind_ joined 00:07 lichtkind left, lichtkind_ is now known as lichtkind 00:09 lichtkind left 00:17 xinming left 00:18 xinming joined
sorear good * #perl6 00:24
moritz: What is the rationale for splitting out substr-rw?
araujo hello sorear o/ 00:31
sorear o/ araujo 00:36
geekosaur sorear, as I understand it, making substr work for both lvalue and rvalue means even the rvalue uses take a significant performance hit 00:39
00:47 tokuhirom joined, s1n left
colomon \o 00:54
colomon meant to port moritz++'s code to niecza, but is somewhat obsessed with his ABC bug at the moment. 00:59
01:01 scott_ joined 01:02 scott_ is now known as Guest90895
colomon "port" may mean cut-n-paste this time... 01:03
01:04 s1n joined 01:06 ispeak_ left 01:19 shinobicl left 01:22 replore joined
[Coke] # 05/15/2012 - rakudo++ (22162); niecza (91.96%); pugs (35.01%) 01:23
dalek blets: 977e2a1 | (Herbert Breunung)++ | docs/appendix-g-glossary.txt:
polish glosary
01:25
01:25 s1n left 01:29 adu joined
dalek blets: 28ddcbc | (Herbert Breunung)++ | docs/appendix-g-glossary.txt:
linking term operand
01:30
01:30 wolf2k_away joined, Tedd1 joined, wolfman2000 left, Tedd1^ left 01:32 benabik joined
adu ok I think I get it now 01:35
I need backtracking so I can't use tokens
r: my token char { <[\ ..~]> }; my token cd_start { '<![CDATA[' }; my token cd_data { <.char>* <?before ']]>'> }; my token cd_end { ']]>' }; my token cd_sect { <.cd_start> <cd_data> <.cd_end> }; say "<![CDATA[ hello ]]>" ~~ /^ <cd_sect> $/ 01:37
p6eval rakudo 22c12b: OUTPUT«#<failed match>␤»
adu my token char { <[\ ..~]> }; my token cd_start { '<![CDATA[' }; my regex cd_data { <.char>* <?before ']]>'> }; my token cd_end { ']]>' }; my token cd_sect { <.cd_start> <cd_data> <.cd_end> }; say "<![CDATA[ hello ]]>" ~~ /^ <cd_sect> $/
r: my token char { <[\ ..~]> }; my token cd_start { '<![CDATA[' }; my regex cd_data { <.char>* <?before ']]>'> }; my token cd_end { ']]>' }; my token cd_sect { <.cd_start> <cd_data> <.cd_end> }; say "<![CDATA[ hello ]]>" ~~ /^ <cd_sect> $/ 01:38
p6eval rakudo 22c12b: OUTPUT«=> <<![CDATA[ hello ]]>>␤ cd_sect => <<![CDATA[ hello ]]>>␤ cd_data => < hello >␤␤»
adu :) 01:39
colomon sorear: do you have any clue how I could be getting an action called over and over (infinite loop, it appears) on the same stretch of the matched grammar?
01:40 s1n joined
sorear colomon: outer rule is looping with <before> maybe? 01:41
NIECZA_TRACE=all might shed some light 01:42
colomon oooo
does that require a different build or anything?
I am seeing something weird in the backtrace when I insert a die. 01:44
"Unknown trace option on" 01:46
01:58 Guest50006 left 02:04 leprevost joined 02:05 leprevost left 02:07 leprevost joined
colomon sorear: also, one of these days we've got to run the niecza profiler on ABC -- it's taking a stupid long time running a part of the code I thought should be relatively straightforward. 02:12
sorear colomon: all, not on 02:16
colomon ooo, cool!
sorear niecza doesn't have anything I can fairly call a profiler 02:17
colomon trace is a LOT of information, yow 02:18
re profiling: I'd always assuming the grammar portion of things was slow, and converting the element array to lilypond was quick. But I added say statements, and it appears the second portion is the slow bit. 02:19
adu hmm 02:21
pastebin.com/raw.php?i=sHDAe3wP
how do I make it so that value => <z>?
or should that be in the Actions, not the Grammar? 02:22
colomon probably an action, I think? 02:26
02:27 orafu left 02:28 orafu joined 02:31 zhutingting joined
colomon sorear: is it possible that whatever endline my Mac is using is translating to two \v ? 02:34
02:34 tokuhirom left
sorear colomon: not impossible 02:35
Idon't think it's likely, but hey, if it's the last possibility left...
02:35 avar left, avar joined, avar left, avar joined
colomon If I use \v, it goes into an apparently endless loop 02:36
If I use \v+, it works fine
02:36 adu left 02:48 estrai left, araujo left 02:49 estrai joined
colomon may have a suitable workaround. :) 02:51
02:53 araujo joined, araujo left, araujo joined 02:56 shinobicl joined 03:01 zhutingting_ joined 03:04 zhutingting left, zhutingting_ is now known as zhutingting 03:05 ponbiki joined 03:07 adu joined 03:12 aloha left 03:18 shinobicl left 03:24 aloha joined
colomon maybe not. :( 03:26
aha! think I've finally got it worked out. 03:43
03:56 benabik left, ponbiki left 04:05 thou joined
moritz \o 04:10
sorear: re splitting substr and substr-rw, it's a way to make you pay only for what you use 04:11
04:12 [particle] left
adu what does this mean: 04:20
Method 'nqpattr' not found for invocant of class 'NQPRoutine'
04:24 derrazo_ joined
sorear are you using nqp? 04:28
adu no I'm using perl6 04:34
rakudo
anyways, I fixed the problem
I don't remember how
04:43 JCHEN joined
dalek p: b6d1a40 | moritz++ | tools/build/PARROT_REVISION:
bump parrot version to 4.4.0
04:49
adu oOo 04:50
sorear: are you interested in how I got that error? 04:52
04:55 derrazo_ left
moritz is 04:55
04:57 cognominal joined
sorear adu: No, I don't do rakudoguts 04:58
o/ cognominal
05:00 cognominal___ left 05:03 birdwindupbird joined
adu moritz: I'm pretty sure it's <element> and <contents> in this grammar: pastebin.com/raw.php?i=mHh03tLF 05:07
05:25 wolf2k_away left 05:30 cognominal left, cognominal joined 05:41 adu left 05:43 alim joined 05:47 wtw joined 05:49 [particle] joined 05:50 kaleem joined 05:54 adu joined 06:15 NamelessTee joined 06:21 quicoju left 06:23 quicoju joined 06:30 replore left 06:34 adu left 06:36 tyatpi left 06:37 tyatpi joined 06:52 lestrrat left 06:54 lestrrat joined 06:55 birdwindupbird left 06:57 mucker joined 07:01 birdwindupbird joined 07:03 brrt joined 07:09 NamelessTee left 07:12 fhelmberger joined 07:20 cognominal left 07:21 cognominal joined 07:23 alim left 07:27 havenn joined
mikec_ morning 07:46
sorear o/ 07:47
07:58 integral_ joined, integral_ left, integral_ joined 08:03 integral left, HarryS left, HarryS joined 08:04 goraki joined 08:17 mucker left 08:19 mucker joined
jnthn mornin' 08:21
moritz \o
08:23 sh0ne joined 08:24 sh0ne left
jnthn moritz: I recall you did some work on restricting how far the Rat denominator could grow? 08:28
moritz jnthn: yes 08:29
r: say (1/2**63).WHAT
p6eval rakudo 22c12b: OUTPUT«Rat()␤»
moritz r: say ((1/2**63) * (1/2**63)).WHAT
p6eval rakudo 22c12b: OUTPUT«Num()␤»
jnthn moritz: OK, thought so... 08:30
moritz but iirc it's not the constructor that checks it, but the DIVIDE_NUMBER routine in Rat.pm
lumi_ r: say("aaaa" ~~ /a ** {3}/)
p6eval rakudo 22c12b: OUTPUT«=> <aaaa>␤␤»
moritz the { } separator form is NYI
and it parses at as separated by a null string
known bug
lumi_ moritz: It's a separator? 08:31
moritz r: say 'a,b,c' ~~ / a ** ','/ 08:32
p6eval rakudo 22c12b: OUTPUT«=> <a>␤␤»
moritz hm
lumi_ moritz: I'm trying to do something like: / $<length>=[\d+] \s . ** $<length>/
moritz lumi_: that doesn't work
lumi_ moritz: I noticed :) Is there some other way to do it? 08:33
moritz (.+) <?{ +$<length> == $0.chars }>
08:37 sergot joined
sergot hi o/ ! 08:37
tadzik \o/ 08:38
08:44 dakkar joined
masak good prenoon. 08:51
08:53 thou left
sergot \o/ 08:55
tadzik shark 08:57
09:02 kresike joined 09:03 havenn left 09:15 jferrero joined
bbkr good morning p6 09:19
tadzik hey bbkr
moritz \o bbkr, tadzik, masak, sergot
09:20 aloha left, aloha joined
goraki bbkr: morning. 09:25
bbkr: remember that compile problem I had with nqp?
09:25 daxim joined
bbkr goraki: yes, what was the solution? 09:25
(if you found one)
goraki bbkr: It was a compile flag (which gets imported from parrot) causing an error in a 3rd party library (dyncall) that caused it. 09:26
-Werror=strict-prototypes
bbkr: you can avoid said problem if you just take the flag out of the Makefile in 3rdparty/dyncall 09:27
09:28 pmurias joined
masak <moritz> IMHO the only sane way is to make lvalue substr syntactic 09:29
+1
bbkr goraki: thanks for the info, i'll check if I can reproduce this error
moritz masak: I have since then changed my opinion 09:30
masak: because it would require to special-case all known lvalue operations
masak: now I think that the only sane way is to split normal and lvalue substr into different routines
masak: which I've done
goraki bbkr: if it's easier, you could just check with the dyncall library, I can reproduce with that if I manually add the flag after configure.
more details: github.com/perl6/nqp/issues/38 09:31
masak moritz: yeah, I'm quickly reading up here in the backlog. :)
not sure what I think right now.
I'm glad we have substr-rw functionality, but "substr-rw" is not a pretty name. :)
moritz but consistent with return-rw 09:32
09:33 lestrrat left 09:34 lestrrat joined
pmurias moritz: how does spliting substr into to routines help? 09:34
09:35 [particle]1 joined
moritz pmurias: we can return a Proxy object from return-rw 09:35
pmurias: we could just always do that, but it would be very costly for such a common (and rather low-level) operation
09:38 [particle] left
masak moritz: indeed. and take-rw. I don't like the look of either of them. OTOH, I don't have any better suggestion. :/ 09:38
tadzik couldn't optimizer resolve FETCH/STORE in compile time? 09:39
jnthn Not easily.
I mean, you're moving the problem, not solving it. 09:40
tadzik how so?
09:40 JCHEN left
jnthn In that you'd still need to do the l-value analysis you'd do if you were going to make substr(...) = ... syntactic. 09:40
Also, Proxy is a bit weird 09:41
It's a type that we don't really see
nom: my $x = 'hello'; say substr-rw($x, 2, 2).WHAT
p6eval rakudo 22c12b: OUTPUT«Str()␤»
moritz r: say substr-rw("foo", 1, 1).WHAT
p6eval rakudo 22c12b: OUTPUT«Str()␤»
jnthn It's in the same niche as Scalar.
tadzik ah 09:42
jnthn So the declared return type of substr-rw is...Str :)
masak it'd be totally fine with substr returning a Proxy only in the cases of '=' and '~~ s[] ='. that is, you can't store the thing in intermediate variables or anything.
and I'd like for the mechanism behind that to be generalized to spec, so that users can define routines that do this. 09:43
jnthn masak: And...a pony too?
masak pony-rw
jnthn doesn't have a problem with the -rw suffix
One immediate way to optimize if we *did* decide we can't live with it, though... 09:44
masak I think I simply dislike dashes in CORE names.
jnthn multi foo(Str $x is rw, ...) { ... } vs multi foo(Str $x, ...) { ... }
The latter never returns a Proxy 09:45
BUT it doesn't optimize most of the cases
masak why not? 09:47
and would my "immediate assignment" restriction above help? 09:48
I think passing around Proxies will be very rare. the thing you want rw substr for is doing an immediate action on a substring. 09:49
jnthn masak: Because often the thing you're substr-ing will come directly from a variable.
The immediate assignment restriction is kinda violating the way we view context in Perl 6. 09:51
masak agreed.
it feels like it reintroduces the context thing a bit again.
jnthn We don't pass context information down, we let things return objects that will do the right thing in the appropriate context.
09:51 tyatpi left
masak ok, so what I want seems self-contradictory. :/ 09:52
masak wisely avoids throwing a tantrum and saying "fine, I'll do my own language where I don't have to abide by the Law of the Excluded Middle!"
bbkr goraki: I cannot reproduce this error with strict-prototypes flag. HEAD rakudo builds just fine on 10.7.3 + Xcode 4.3.2 09:57
goraki well, that's really weird.
bbkr: can you do me a favour and check nqp/3rdparty/dyncall/Makefile for that flag (-Werror=strict-prototypes)? 09:58
Just in case it's not there (which would seem weird, but anyway) 09:59
09:59 kboga left
bbkr goraki: which one? I have Makefile.M Makefile.embedded Makefile.generic Makefile.psp 10:00
goraki bbkr: You don't just have a Makefile in there (no extension) after the configuration? 10:01
bbkr goraki: no 10:02
I have Nmakefile 10:03
Timbus doesnt xcode use clang instead of gcc? 10:04
bbkr and grep on strict-prototypes in all files returns nothing
goraki bbr: doh. 10:05
Timbus o. mystery solved
goraki it's the nqp/Makefile
Timbus: it uses llvm. 10:06
Timbus yeah
bbkr goraki: I have -Werror=strict-prototypes assigned to CFLAGS there
Timbus but llvm uses clang or gcc frontends
both of which have behaviour different to gcc! ;/
goraki Timbus: but I think (this may be made up) it's their own version, and using the gcc frontend.
in fact I think they both there. 10:07
Timbus it depends which option is selected i think
yea
bbkr I'll try another mac machine
goraki bbkr: and from the rakudo dir, does this work? 10:08
gcc -o atest.tmp -Werror=strict-prototypes nqp/3rdparty/dyncall/dyncallback/dyncall_thunk.c
(because if it does then you don't seem to have my problem (-: ) 10:09
bbkr it does not, returns nqp/3rdparty/dyncall/dyncallback/dyncall_thunk_x64.c:28: error: function declaration isn't a prototype
conclusion is that this file was not compiled during build process 10:10
goraki that's odd, it always compiles for me. what arch are you running? 10:11
10:12 alim joined
bbkr Darwin bbkr.org 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64 10:13
hackintosh with 64b extensions loaded, trying now on genuine mac... 10:14
goraki right, okay.
cheers. (-:
10:15 Guest90895 left
bbkr argh, this is sooo slow. /me dreams about Ivy Bridge macs 10:16
goraki bbkr: don't worry about it too much, I'm going to try and find another machine in my office that's got 10.7 + Xcode installed. 10:17
10:18 zhutingting left
bbkr another build successful. Darwin Pawels-iMac.local 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr 9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64 i386 10:24
goraki and the compiler is i686-apple-darwin11-llvm-gcc-4.2? 10:26
bbkr gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00) 10:40
10:46 jaldhar joined
goraki yep, same as me. 10:51
well, that's just weird.
bbkr++: Thanks for testing all this, no idea what's going on with my machine.
11:05 bacek joined 11:07 JimmyZ_ joined 11:16 pmurias left 11:18 pmurias joined 11:22 JimmyZ__ joined 11:24 JimmyZ_ left 11:28 JimmyZ_ joined
moritz r: class A { method foo() { }; method foo() { } } 11:28
p6eval rakudo 22c12b: OUTPUT«===SORRY!===␤Package 'A' already has a method 'foo' (did you mean to declare a multi-method?)␤»
dalek kudo/world-rethrow: c663f0f | moritz++ | src/ (2 files):
provide file and line number for method redeclaration errors
11:30
moritz this commit works, but feels borderline to the very hacky side
reviews and suggestions for improvements are very welcome 11:31
11:31 JimmyZ__ left
dalek blets: 02cf1e9 | (Herbert Breunung)++ | docs/index.txt:
polish comments in index
11:34
blets: 2fea6e8 | (Herbert Breunung)++ | docs/index.txt:
update status
jnthn moritz: Use HOP 11:36
moritz jnthn: a world method that takes a callable, and tries to execute it? 11:37
jnthn do_errorable(-> { $obj.HOW."$meta_method_name"($obj, $name, $code_object) });
JimmyZ_ r: rethrow
p6eval rakudo 22c12b: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&rethrow' called (line 1)␤»
jnthn And do_errorable (er, name it better :)) is used to wrap up all the things like this.
moritz: Basically, yeah. 11:38
moritz: Well, it can even be a sub.
moritz well, if we use it both from actions and the grammar, a method in World seems like the right thing to do
jnthn moritz: I know we're sometimes calling straight into code from the actions at compile time, but I see that as a bit on an anit-pattern. 11:39
*anti
*of
moritz :(
JimmyZ_ perl6 can't rethrow exception in CATCH block?
jnthn I'd rather all the boundary-crossing places happen in World.
moritz jnthn: Perl 6 can. NQP can not 11:40
erm, meant JimmyZ_
sorry
jnthn If that means a $*W.run_code($code_object), that's preferable to me.
Er, I guess it'd pass in $/ too :)
And the do_errorable probably needs $/ also. 11:41
JimmyZ_ hmm. I always think NQP code is Perl 6 code
moritz yes, the line number is the entire point :-)
jnthn Right :)
11:42 jaldhar left 11:44 JimmyZ__ joined 11:45 mucker left 11:47 JimmyZ_ left 11:48 JimmyZ__ left
moritz jnthn: how does Proxy gets its magic? 11:49
jnthn: I mean, what marks it as a container type?
11:50 JimmyZ_ joined
jnthn moritz: See its setup code in BOOTSTRAP 11:50
moritz: But basically, it gets a container spec.
moritz ah, the pir::set_container_spec__vPPsP 11:51
11:52 JimmyZ_ left 11:53 JimmyZ_ joined
jnthn moritz: Yes. 11:54
11:57 JimmyZ__ joined 12:01 JimmyZ_ left, fgomez left, fgomez joined 12:03 JimmyZ_ joined 12:05 JimmyZ__ left 12:06 JimmyZ_ left 12:07 JimmyZ_ joined
masak jnthn++ # knows many things about Rakudo internals 12:07
12:09 JimmyZ_ left 12:11 skids left 12:25 JimmyZ_ joined
flussence p6: class A { has %.b }; my $a = A.new(b => {foo => 1, bar => 2, baz => 3}); $a.b<foo baz> 12:33
12:33 plobsing left
p6eval pugs, rakudo 22c12b, niecza v17-4-ge5b869e: ( no output ) 12:33
flussence p6: class A { has %.b }; my $a = A.new(b => {foo => 1, bar => 2, baz => 3}); $a.b<foo baz>.perl.say
p6eval rakudo 22c12b, niecza v17-4-ge5b869e: OUTPUT«(1, 3)␤»
..pugs: OUTPUT«\(1, 3)␤»
flussence I just had to do that (obj-hashref-arrayslice) in $dayjob perl 5 code, and it never gets any easier to remember :) 12:34
12:35 crab2313 joined 12:37 crab2313 left
masak .oO( what's difficult about it, it's just $a->b()->{qw<foo baz>} ) 12:39
moritz don't you need an @ somewhere when you return a list?
eval: sub a() { {a => 1, b => 2 } }; my $obj = bless {}; [ $obj->a()->{qw/a b/} ] 12:40
buubot_backup moritz: [undef]
mikec_ hmm
moritz eval: sub a() { {a => 1, b => 2 } }; my $obj = bless {}; [ @{$obj->a()}{qw/a b/} ]
buubot_backup moritz: [1,2]
12:41 stepnem left 12:43 stepnem joined 12:45 pernatiy joined 12:48 ponbiki joined
lumi_ moritz: I still can't get .**$length (conceptually, actually using your suggecstion) to work 12:48
12:49 pmurias_ joined, pmurias_ left
moritz r: say '2 abcde' ~~ / (\d+) \s (.+) <?{ $1.chars == $0 }> / 12:50
p6eval rakudo 22c12b: OUTPUT«#<failed match>␤»
moritz r: say '2 abcde' ~~ / (\d+) \s (.+) <?{ say $/; $1.chars == $0 }> /
p6eval rakudo 22c12b: OUTPUT«=> <2 abcde>␤ 0 => <2>␤ 1 => <abcde>␤␤=> <2 abcde>␤ 0 => <2>␤ 1 => <abcde>␤␤=> <2 abcde>␤ 0 => <2>␤ 1 => <abcde>␤␤=> <2 abcde>␤ 0 => <2>␤ 1 => <abcde>␤␤=> <2 abcde>␤ 0 => <2>␤ 1 => <abcde>␤␤#<failed match>␤»
moritz r: say '2 abcde' ~~ / (\d+) \s (.+) <?{ say ~$/; $1.chars == $0 }> /
p6eval rakudo 22c12b: OUTPUT«2 abcde␤2 abcde␤2 abcde␤2 abcde␤2 abcde␤#<failed match>␤»
moritz oh, it seems that $/ isn't updated often enough 12:51
r: say '2 abcde' ~~ / (\d+) \s (.+) {} <?{ say ~$/; $1.chars == $0 }> /
p6eval rakudo 22c12b: OUTPUT«2 abcde␤2 abcde␤2 abcde␤2 abcde␤2 abcde␤#<failed match>␤»
moritz r: say '2 abcde' ~~ / (\d+) \s (.+) {} <?{ say ~$1; $1.chars == $0 }> / 12:52
p6eval rakudo 22c12b: OUTPUT«abcde␤abcde␤abcde␤abcde␤abcde␤#<failed match>␤»
12:52 pmurias left 12:53 PacoAir joined
lumi_ moritz: So it's not possible now? 12:58
moritz lumi_: I wouldn't know how 12:59
12:59 JimmyZ__ joined
lumi_ moritz: I'll give it up for now then 13:00
moritz lumi_: one more idea...
r: say '2 abcde' ~~ / (\d+) \s (.+) <at($0.to + 1 + $0)> / 13:01
p6eval rakudo 22c12b: OUTPUT«Method 'to' not found for invocant of class 'Any'␤ in regex <anon> at /tmp/Bn2Lao7Sxq:1␤ in method ACCEPTS at src/gen/CORE.setting:9245␤ in block <anon> at /tmp/Bn2Lao7Sxq:1␤␤»
moritz ok, not working either
13:02 JimmyZ_ left 13:03 [particle]1 is now known as [particle] 13:06 snearch joined, Psyche^ joined, crab2313 joined 13:09 Patterner left, Psyche^ is now known as Patterner
[Coke] ZOMG it's [particle]! 13:09
[particle] howdy, [Coke]! 13:10
colomon o/
moritz \o [particle]
PerlJam [particle]: greetings! how's life? 13:12
[particle] life is great, thanks for asking. 13:13
how's everyone here? it's been a long item.
13:13 crab2313 left
[particle] er... time. 13:13
13:13 JimmyZ_ joined
moritz same of faces, many new faces :-) 13:14
s/of/old/
and I still can't type properly :-)
[particle] i wouldn't know anything about that, myself :)
13:14 JimmyZ__ left
moritz and I have a local patch for the 'lazy' statement prefix here, but it seems to trigger evaluation in basically every possible situation :/ 13:15
[particle] so, not very lazy. 13:16
moritz what works is
my $x := lazy say 'foo';
# doesn't say foo
but if you use assignment, it does 13:17
and if you pass it to a routine, it does too, because the type check needs the actual value
13:19 JimmyZ_ left 13:20 grondilu joined
grondilu p6: say "ok" if (class Foo {}).bless([]) ~~ Foo; 13:21
p6eval niecza v17-4-ge5b869e: OUTPUT«ok␤»
..rakudo 22c12b: ( no output )
..pugs: OUTPUT«*** No such subroutine: "&class"␤ at /tmp/Hp0Kv1WWhR line 1, column 14-26␤»
moritz n: say "ok" if (class Foo {}).bless(1) ~~ Foo 13:22
p6eval niecza v17-4-ge5b869e: OUTPUT«ok␤»
moritz grondilu: I'd guess that niecza simply ignores the first argument to bless
grondilu Why? In Perl6 you can bless pretty much anything, can't you?
p6: say "ok" if (class Foo {}).bless(Mu) ~~ Foo; 13:23
p6eval niecza v17-4-ge5b869e: OUTPUT«Unhandled exception: Nominal type check failed in binding '' in 'Mu.bless'; got Mu, needed Any␤ at /home/p6eval/niecza/lib/CORE.setting line 0 (Mu.bless @ 1) ␤ at /tmp/eZXvQysiNg line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3842 (…
..rakudo 22c12b: ( no output )
..pugs: OUTPUT«*** No such subroutine: "&class"␤ at /tmp/jaPb2M5iJz line 1, column 14-26␤»
grondilu n: say "ok" if (class Foo {}).bless(Mu.new) ~~ Foo;
p6eval niecza v17-4-ge5b869e: OUTPUT«Unhandled exception: Nominal type check failed in binding '' in 'Mu.bless'; got Mu, needed Any␤ at /home/p6eval/niecza/lib/CORE.setting line 0 (Mu.bless @ 1) ␤ at /tmp/gh0RkMQUTW line 1 (mainline @ 4) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3842 (…
13:25 tokuhirom joined, snearch left
grondilu Not related to above: why can't packages do inheritance? I thought classes were for instanciation, but that I could use packages (or modules) for inheritance, just as in Perl 5. 13:25
masak grondilu: the first argument to bless is the "underlying storage" for the object. usually that's an opaque object, but I guess one could use hashes and arrays too, like in Perl 5. 13:26
grondilu: packages and subs don't have the mechanism for method resolution order that inheritance would require.
grondilu: you can always simulate inheritance in a package by wiring it up manually. 13:27
moritz what would inheritance in a package mean? 13:28
PerlJam kinda sounds like role composition without the conflict resolution 13:29
jnthn Maybe part of the confusion here is that in Perl 5 package really means "a thingy that holds symbols", whereas in Perl 6, the name of the package actually refers to a type object, and .WHO is more like the traditional Perl 5 meaning of package.
13:29 tokuhirom left
masak moritz: I guess it would mean that dispatch to any ('our') subs you didn't define in the package falls back to the package inherited from. 13:31
dalek kudo/lazy: 18f9e41 | moritz++ | / (5 files):
first shot at "lazy" statement prefix
13:31 tokuhirom joined
moritz importing and reexporting would do that 13:32
jnthn: I first experimented with making LazyScalar not inherit from Proxy, and instead install static FETCH/STORE methods and store the payload and the code object as attributs... looped infinitely, and I didn't manage to debug it 13:33
jnthn r: package Foo { our sub x() { say 1 } }; package Bar { our sub y() { say 2 } }; Bar.WHO does role { has $.prototype is rw; method at_key($key) { self.exists($key) ?? nextsame() !! $.prototype.WHO.at_key($key) } }; Bar.WHO.prototype = Foo; &Bar::x(); &Bar::y(); 13:36
p6eval rakudo 22c12b: OUTPUT«1␤2␤»
jnthn moritz: Will peek at the patch. 13:38
moritz: Though, probably I should glance the spec for lazy too...
grondilu come on guys, give inheritance to packages in the language instead of these obscure code tricks. 13:39
jnthn grondilu: You've totally missed the point.
grondilu ahh
sorry
jnthn Inheritance is not a property of "packages" in the sense that I think you're thinking about them :)
grondilu I meant: "like in Perl 5"
jnthn Inheritance is something classes do, and it's the meta-object that does it. 13:40
Yes, that's what I was trying to explain. Things in Perl 6 ain't like in Perl 5 in this area.
moritz S04-statements/lazy.t expects that passing around the result of a 'lazy' keeps it lazy. I don't see how that can work together with type checks
jnthn moritz: Me either. :)
moritz grondilu: if you want to inheritance like in perl 5, use classes.
grondilu well I thought instanciation was something classes do, not inheritance. Inheritance is not the main point.
moritz well, you can still use classes if you want inheritance, even if you don't want instantiation 13:41
grondilu but I'll have to use methods, and their syntax is a bit heavier.
:(
moritz then maybe what you want is importing with re-exporting 13:42
which is NYI, but probably not too hard to do
grondilu indeed this is missing too. 13:43
jnthn moritz: Passing a lazy somewhere that wants to type check is a fairly deep problem.
13:44 skids joined, tyatpi joined
grondilu r: package Foo { our sub talk { say "hi" } }; use Foo q(talk); 13:45
p6eval rakudo 22c12b: OUTPUT«===SORRY!===␤Could not find sub &talk␤»
grondilu r: package Foo { our sub talk { say "hi" } }; use Foo <talk>;
p6eval rakudo 22c12b: OUTPUT«===SORRY!===␤Could not find Foo in any of: /home/p6eval/.perl6/lib, /home/p6eval/nom-inst1/lib/parrot/4.3.0-devel/languages/perl6/lib␤»
grondilu r: module Foo { our sub talk { say "hi" } }; use Foo <talk>;
p6eval rakudo 22c12b: OUTPUT«===SORRY!===␤Could not find Foo in any of: /home/p6eval/.perl6/lib, /home/p6eval/nom-inst1/lib/parrot/4.3.0-devel/languages/perl6/lib␤»
grondilu ahh nevermind
moritz r: module Foo { sub talk is export { say 'hi' } }; import Foo; talk() 13:46
p6eval rakudo 22c12b: OUTPUT«hi␤»
grondilu I don't understand. So it is implemented, isnt'it? 13:48
moritz importing is implemented, yes
I did that two weeks ago, iirc
but what's not implemented is re-exporting
r: module A { sub talk is export { say 'hi' } }; module B { import A }; import B; talk 13:49
p6eval rakudo 22c12b: OUTPUT«===SORRY!===␤Method 'ast' not found for invocant of class 'Undef'␤»
moritz ooh, "fun"
grondilu r: module A { sub talk is export { say 'hi' } }; module B { import A }; import B; B::talk 13:50
p6eval rakudo 22c12b: OUTPUT«===SORRY!===␤Method 'ast' not found for invocant of class 'Undef'␤»
grondilu n: module A { sub talk is export { say 'hi' } }; module B { import A }; B::talk
p6eval niecza v17-4-ge5b869e: OUTPUT«===SORRY!===␤␤Action method statement_control:import not yet implemented at /tmp/qoG5fFEkHa line 1:␤------> ort { say 'hi' } }; module B { import A ⏏}; B::talk␤␤Unhandled exception: Unable to resolve method statement_lev…
moritz r: module A { sub talk is export { say 'hi' } }; module B { import A }; 13:52
p6eval rakudo 22c12b: OUTPUT«===SORRY!===␤Method 'ast' not found for invocant of class 'Undef'␤»
dalek ast: a2275c3 | moritz++ | S04-statements/lazy.t:
[lazy.t] make much more realisitic

  * if you want to carry stuff around without evaluating, you need binding
  * passing stuff to routines type-checks, thus cannot be lazy
13:53
lumi_ r: say("2 abcde" ~~ regex { (\d+)\s* :my $p; { $p = $/.CURSOR.pos} (\w *) <?at: $p+$0>}) 13:54
p6eval rakudo 22c12b: OUTPUT«=> <2 ab>␤ 0 => <2>␤ 1 => <ab>␤␤»
moritz lumi_++ 13:55
dalek kudo/lazy: e1b8b12 | moritz++ | / (3 files):
smally cleanups for "lazy"

  * do not evaluate the thunk when LazyScalar is being assigned to
  * update ChangeLog
  * run tests
13:56
lumi_ moritz: Thanks for the pointers :)
moritz lumi_: you're welcome. I really hope we'll support ** {} soon.
jnthn moritz++ # taking on lazy 13:57
lumi_ moritz: btw, ':my $p = $.pos' and basically every other variation I tried blows up weirdly
r: say("2 abcde" ~~ regex { (\d+)\s* :my $p = $.pos; (\w *) <?at: $p+$0>}) 13:58
p6eval rakudo 22c12b: OUTPUT«Method 'item' not found for invocant of class 'Integer'␤ in regex <anon> at /tmp/qo9_SvnVl0:1␤ in method ACCEPTS at src/gen/CORE.setting:9245␤ in block <anon> at /tmp/qo9_SvnVl0:1␤␤»
moritz lumi_: that doesn't quite surprise me
lumi_ I don't even understand what was trying to happen there 13:59
moritz $.pos is short for self.pos.item
but $.pos seems to return a parrot integer
so it blows up, because parrot's int doesn't know how to itemize itself in a Perl 6 way :-)
jnthn Missing perl6ize_type I guess 14:00
PerlJam why is ** {} not supported exactly? 14:01
moritz because nobody implemented it 14:02
I don't think there's a big blocker
PerlJam ok
as long as there are not archetectural changes that are required, I might see about implementing it later today. 14:03
s/not/no/
jnthn Step 1 is to rip out ** still supporting seperators :)
We've warned about that in multiple Star releases by now, so it's fine to remove. 14:04
moritz jnthn: fwiw I'm now confident that the 'lazy' implementation can't be made much more robust without huge changes; so if you're happy with the implementation, we can merge (but don't hurry) 14:05
14:05 benabik joined
tadzik release is tomorrow:) 14:06
jnthn moritz: I don't see the way you've done it disrupting anything else, it's sufficiently contained to merge.
moritz: I suspect we'll probably end up with some spec tweaks from TimToady++ on this at some point.
moritz: In the meantime, having at least a first guess at how it'll work is useful. 14:07
moritz which reminded me that I wanted to tweak substr/substr-rw in the specs
14:08 JimmyZ joined 14:12 grondilu left 14:13 b1rkh0ff joined 14:14 b1rkh0ff left 14:15 b1rkh0ff joined, b1rkh0ff left, b1rkh0ff joined
PerlJam Does nqp know about % in regex yet? 14:15
14:16 tokuhirom left
dalek kudo/nom: 18f9e41 | moritz++ | / (5 files):
first shot at "lazy" statement prefix
14:16
kudo/nom: e1b8b12 | moritz++ | / (3 files):
smally cleanups for "lazy"

  * do not evaluate the thunk when LazyScalar is being assigned to
  * update ChangeLog
  * run tests
rakudo/nom: a6515f0 | moritz++ | / (7 files):
rakudo/nom: Merge branch 'lazy' into nom
moritz PerlJam: I think qregex knowss about it
jnthn PerlJam: yes
Well, what moritz said
NQP itself doesn't
QRegex implements it
PerlJam gotcha
jnthn NQP will know it after qbootstrap is done.
14:17 REPLeffect left, tokuhirom joined
PerlJam looks to me like ** grokking separators is because it inherits that behavior from qregex. If I remove that from qregex is there anything special I need to do for rakudo to use it other than just recompiling nqp/rakudo? 14:20
("it" == "the modified qregex") 14:21
moritz well, if you want to support ** { 2..3 } and the block is parsed as a Perl 6 block, you'll get a Perl 6 range back
you won't teach nqp how to handle Perl 6 ranges
so you'll need some work on the rakudo end too
jnthn Aye 14:22
PerlJam aye.
jnthn Just the removal should not need any Rakudo work though, afaik.
PerlJam removing **<sep> looks simple enough that I may just do that now :) 14:23
14:29 PacoAir left
PerlJam Just to make sure I'm not crazy: gist.github.com/2710781 14:31
Looks good?
tests all seem to pass (aside from the bigint tests that always seem to fail)
14:32 kaleem left
moritz looks reasonable 14:32
dalek p: 7df35de | duff++ | src/QRegex/P6Regex/ (2 files):
Remove **<sep>
14:33
14:35 plutoid joined
moritz t/qregex/01-qregex.t (Wstat: 0 Tests: 707 Failed: 6) Failed tests: 212-214, 216-218 14:38
not ok 212 - ** with a term 14:40
# ERROR: Quantifier quantifies nothing at line 1, near " \\,$"
PerlJam huh .. how did you run that test? Does not "make test" run them all?
moritz PerlJam: I think it only runs them all if the previous tests succeeded :/ 14:41
PerlJam: but 'make qregex-test' should get you there
PerlJam yeah, already figured that out :)
moritz but it's a simple enough patch, one can simply remove the lines from t/qregex/rx_quantifiers 14:42
PerlJam yep
Ulti neat rakudo 2011.07 is on Ubuntu 12.04 14:43
moritz that's the last release before nom
Ulti yeah :/
moritz PerlJam: wanna do it, or should I? 14:46
dalek p: ee757db | duff++ | t/qregex/rx_quantifiers:
Remove regex tests for **<sep>
PerlJam :-)
(I was busy making sure I ran *all* of the tests this time) 14:47
moritz :-)
dalek p: 3196005 | moritz++ | t/qregex/rx_modifiers:
untodo passing qregex tests
14:48
lumi_ github.com/lumimies/git-fe-parser -- That's what I was making
masak lumi_: nice! lumi_++ 14:51
14:53 xinming left
PerlJam What does "perl6_type_check_return_value" do exactly? Or how does it work? 14:56
(I'm trying to figure out how to guarantee the return value of the block is either an Int or a Range)
14:57 alim left
jnthn PerlJam: It's the thing we call at the end of a block to chekc the thing it's about to return is of teh right type. 14:57
PerlJam: It's not what you're looking for. 14:58
PerlJam: You want to just do a normal type check for that.
PerlJam What does a "normal type check" look like in Actions.pm ? 14:59
call isa?
I mean, would I insert PAST::Ops to call isa to check either Int or Range? 15:00
jnthn :pirop('type_check__IPP') 15:01
First child is the thing you have, second is the type
Get the type with $*W.get_ref($*W.find_symbol(['Int']))
PerlJam nqp::istype :-)
15:01 benabik left
jnthn Yes, it's what nqp::istype compiles down to. 15:01
PerlJam is slowly getting it. 15:02
jnthn But...is the block not evaluated at runtime?
x ** { Bool.pick ?? 10 !! 5..42 } /
PerlJam right, which is why I was thinking I'd need to insert PAST ops to do the type check
jnthn Yes :) 15:03
15:05 NamelessTee joined, plutoid left
sergot nom: say [x] 1, 2, 2; 15:06
p6eval rakudo 22c12b: OUTPUT«1111␤»
15:07 wtw left
masak nom: sub multiply(Int $a, Int $b) { (1 x $a x $b).chars }; say multiply 4, 5 15:08
p6eval rakudo 22c12b: OUTPUT«20␤»
masak :P
tadzik aah :)
sergot :)
tadzik it's like finding prime numbers with regexes
PerlJam you could really confuse people by making that first number 0 instead of 1 ;) 15:10
15:10 s1n left
masak I thought of making it "X" or the Unicode character for a chicken or something. 15:10
PerlJam .u chicken 15:11
phenny PerlJam: Sorry, no results for 'chicken'.
PerlJam My incredulty was justified
sergot brb 15:12
15:12 sergot left
tadzik phenny: en pl "incredulty"? 15:12
phenny tadzik: "incredulty" (en to pl, translate.google.com)
masak PerlJam: phenny doesn't do recent Unicode versions. 15:14
tadzik FRONT FACING BABY CHICK
15:14 sergot joined
masak tadzik: "incredulity" jest wtedy, gdy coś nie wierzę 15:14
tadzik ha, that makes sense :) 15:15
phenny: "niewiarygodne"?
phenny tadzik: "incredible" (pl to en, translate.google.com)
masak "credo" is Latin for "I believe"
tadzik phenny: "nie do wiary"?
phenny tadzik: "unbelievable" (pl to en, translate.google.com)
tadzik somewhat
15:17 skids left 15:18 skids joined
daxim plus.google.com/108373812962355405...t5tdx8iTh4 15:23
15:23 benabik joined 15:25 birdwindupbird left 15:26 s1n joined 15:31 JimmyZ left, thou joined 15:36 REPLeffect joined 15:39 KyleHa joined
KyleHa Hello #perl6. 15:40
masak KyleHa! \o/ 15:41
KyleHa Hiya Masak!
I'm looking at S04 and wondering what a "control exception" is that the the CONTROL block catches. Is it just whatever "warn" spits out, or is there more to it than that? 15:42
15:42 s1n left
moritz return, next, redo, last all work through control exceptions 15:45
KyleHa So if I'm using a CONTROL block to catch warnings, I could catch more than that? How can I tell what I'm intercepting? 15:46
moritz I haven't done any work on control exceptions, so there's no nice interface for it 15:47
though src/core/Exceptions.pm does some catching and inspecting of them at a low level
15:50 spider-mario joined 15:57 s1n joined 15:58 REPLeffect left, mikemol joined 15:59 REPLeffect joined 16:00 alim joined 16:02 s1n left 16:05 alim left 16:08 brrt left
masak blog post! \o/ strangelyconsistent.org/blog/t4-hex-puzzle 16:11
16:17 s1n joined 16:18 pernatiy left 16:19 leprevost left, derrazo joined 16:20 derrazo left
jnthn masak: Looks like a little mojibake in strangelyconsistent.org/p6cc2011/t4/edgar/ 16:21
16:21 icwiener joined
masak indeed. must be the encoding of the HTML that's wrong. checking. 16:26
16:28 s1n left
geekosaur interestingly, the second file is correct, it's only the first that has the iso8859 vs. utf8 weirdie in the name 16:28
16:30 birdwindupbird joined
masak yeah. that's probably a clue to what's going on. I remember utf-8-converting both, though. 16:30
TimToady "Here's an example:" used to show unbalanced html with a .png, now I just get a blank space without a pic 16:38
16:39 tokuhirom left
TimToady nevermind, ^R fixed it 16:40
16:41 kresike left 16:43 daxim left, flussence left 16:44 s1n joined
masak yeah, I did some klutz updates before doing the correct one. 16:45
16:46 PacoAir joined
masak moritz++ for prodding me along on this one. it's taken some time due to $work and a wish for complete cover of all the things. 16:48
16:52 ponbiki left
masak encoding bug fixed in strangelyconsistent.org/p6cc2011/t4/edgar/ -- jnthn++ for reporting. 16:53
that file had simply been converted from latin-1 to utf8 twice by some overzealous p6cc organizer.
16:55 s1n left
moritz "doppelt hält besser" 16:55
16:57 derrazo joined
masak :P 16:58
17:02 birdwindupbird left, goraki left 17:03 birdwindupbird joined 17:05 dakkar left, crab2313 joined, kboga joined 17:09 s1n joined
sorear good * #perl6 17:14
17:15 birdwindupbird left 17:17 birdwindupbird joined, thelazydeveloper joined, s1n left
colomon \o 17:18
17:20 fgomez left 17:31 s1n joined
pmichaud good afternoon, #perl6 17:34
17:35 Chillance joined
pmichaud what in the world is a "lazy scalar"? 17:35
PerlJam one that lays around all day doing nothing
[Coke] ho, pmichaud. 17:36
moritz pmichaud: it's what the 'lazy' statement prefix returns 17:37
pmichaud why doesn't the 'lazy' prefix simply return a list?
moritz because it doesn't preserve the return type 17:38
pmichaud I don't understand.
PerlJam sounds like a thunk
moritz r: my $x := lazy 'foo'; say $x.WHAT 17:39
p6eval rakudo a6515f: OUTPUT«Str()␤»
moritz if it returned a List, that wouldn't say Str()
pmichaud when would a Str() be lazy?
moritz it's not the Str that is lazy 17:40
it's the container
pmichaud why are containers lazy? is there some discussion on this I should read in backscroll?
moritz r: my $x := lazy { say 'not yet executed'; "foo" }; say 1; say $x
p6eval rakudo a6515f: OUTPUT«1␤not yet executed␤foo␤»
pmichaud oh, that's .... wrong.
at least that looks really wrong to me. 17:41
masak r: my $lazy-scalar = gather take foo; sub foo { say "OH HAI"; take 42 }; say "look, it's lazy!"; say $lazy-scalar
p6eval rakudo a6515f: OUTPUT«look, it's lazy!␤OH HAI␤42 0␤»
masak oops
r: my $lazy-scalar = gather take foo; sub foo { say "OH HAI"; 42 }; say "look, it's lazy!"; say $lazy-scalar
p6eval rakudo a6515f: OUTPUT«look, it's lazy!␤OH HAI␤42␤»
pmichaud that looks like a "thunk" to me, not laziness.
moritz what's the difference?
pmichaud laziness has always been (to my mind) something associated with list evaluation 17:42
moritz but it doesn't need to
in haskell, laziness isn't limited to lists
geekosaur ...laziness *is* a thunk, last I checked
pmichaud I think what has been defined here is a conflation of two separate concepts.
geekosaur sounds to me like the mis-conflation is lists = laziness 17:43
pmichaud what really annoys me about the above is that it looks like I'm binding to a closure, and the closure is being automatically evaluated even though I haven't used .()
TimToady that is precisely the point
moritz pmichaud: it's not any different than other phaser
compare BEGIN foo() and BEGIN { foo() }
do you expect tha latter to return a closure? 17:44
jnthn o/ pmichaud
moritz ok, s/phaser/statement prefix/
pmichaud that's because BEGIN automatically turns its argument into a closure.... and it's CAPS to indicate that this is what should happen.
fsvo of "argument"
moritz pmichaud: would it please you if we did s/lazy/LAZY/? 17:45
PerlJam heh, I was just about to ask that
jnthn Another real problem with lazy trying to be a scalar container is that as soon as you need to type check, it has to evaluate the thing. So you can't pass it around.
pmichaud since we already have a 'lazy' defined (and I've thought of it as being something somewhat different), LAZY would definitely make me feel better. But "thunk" might be more descriptive.
TimToady that end is just syntax 17:46
moritz but "thunk" is something that compiler writers use, not users (usually)
TimToady the point is that FETCH calls it, not .()
jnthn TimToady: Had you envisioned it as being container-y?
TimToady I just envision it as being more haskelly, where P6 doesn't default scalars to lazy 17:47
but it seems to be working out containerly
moritz well, it seems to work out only partially
pmichaud I don't mind if there's a statement prefix that creates a LazyScalar thingy that does something like this; but if the statement prefix is 'lazy' I don't understand how that relates to lazy context and lists. 17:48
moritz (fwiw I won't be mad at anyone if we reject it in the end; I'm not attached to the concept)
pmichaud: I must admit that I didn't think about that at all, just implemented what the tests wanted
dalek ast: 644e553 | moritz++ | S05- (2 files):
rakudo refudging
17:49
pmichaud yes, I'm only concerned about the collision with the synopses already-defined 'lazy' operator
moritz speaking of which, how does that work?
TimToady doing it the haskell way probably implies static type checking, so maybe it's kind of a "native container" notion
pmichaud moritz: to me, 'lazy' just creates a list that refuses to do any advanced reification -- it reifies things only when it's forced to do so 17:50
TimToady any kind of pointer indirection ends up hoisting type info up the pointer sequence
17:51 derrazo left
TimToady pmichaud: other FP languages do not make this distinction 17:51
pmichaud moritz: that might end up being a little naive interpretation of 'lazy', but it's been my mental working model for now
TimToady: when it comes to lists and containers, Perl 6 is definitely not (to my mind) FP though :) 17:52
TimToady but it might be that we require stronger typing for use of scalar laziness
or stronger non-typing :)
pmichaud indeed, much of what we've had to do with containers and lists and evaluation and the like has been because of P6's non-FP-ness, I think.
PerlJam TimToady: seems like type-inference would help if P6 could do it (like Haskell) 17:53
TimToady I think this is an inaccurate view of FP, insofar as all FP implementations have to do things like this underneath
17:53 fhelmberger left
pmichaud TimToady: that's a good point. 17:53
17:53 spider-mario left
moritz so, short term ruling, s/lazy/LAZY/ ? 17:53
17:54 mucker joined
moritz before people get used to the current usage 17:54
pmichaud anyway, my objection is only to the fact that 'lazy' as defined in the recent commit doesn't seem to have anything to do with the _many_ mentions of the word 'lazy' in the synopses. Either a unification needs to take place (perhaps only in my understanding of the term), or we need a different term.
TimToady maybe we should rename it to "promise" or some such 17:55
and allow a return type
pmichaud I'd also prefer something other than "LazyScalar", for the same reason. :-) 17:56
17:57 sftp left 17:58 sftp joined, NamelessTee left
pmichaud afk for a bit, errands 17:59
PerlJam The synopses do seem to almost always talk about laziness with respect to listy things (at least in my quick ack) 18:00
I guess I never noticed that before.
Until now I'd been thinking of laziness in perl more as "generic laziness" kind of like haskell does it. 18:01
moritz PerlJam: fwiw your NQP patch does have a bit of fallout in rakudo land
PerlJam moritz: more broken test?
er tests 18:02
moritz PerlJam: because the unsupported <term> ** {closure} form had previously been (falsly) recognized as <term> ** <sep>
PerlJam: yes, 4 test files. I'm working on fudging them
PerlJam moritz++
afk, meeting. I should have time later tonight (maybe sooner if I'm lucky) to hack on **{} 18:03
18:04 cognominal_ joined 18:05 birdwindupbird left
moritz man, S05-mass/rx.t is a huge PITA to fudge 18:05
first, it's big and slow. Second, the line numbers between the fudged file and the .t file differ quite a bit 18:06
18:07 cognominal left
dalek ast: 1e5917a | moritz++ | S05-metasyntax/single-quotes.t:
simplify a regex test
18:08
18:09 fgomez joined
KyleHa How hard would it be to make "fudge" retain line numbering? 18:12
moritz dunno; usually it does
18:15 s1n left, NamelessTee joined 18:18 icwiener left
moritz fwiw I sometimes get some weird race conditions 18:22
when I save a .t file and immediately after that I run fudge, the test file is gone from the disc
dunno if vim screws up somehow, but it has only ever happened in connection with fudge/fudgeall to me 18:23
pmichaud phenny: tell tadzik if possible, check with me before doing the May release; I'm expecting to land some regex engine patches later today. kthx 18:24
phenny pmichaud: I'll pass that on when tadzik is around.
dalek ast: 149135c | moritz++ | S05-mass/rx.t:
refudge rx.t for rakudo
moritz oooh, ++pmichaud
diakopter heh 18:25
pmichaud afk, lunch 18:27
dalek kudo/nom: 2b96819 | moritz++ | / (2 files):
rename "lazy" to "LAZY" to avoid confusion with lazy lists

this might not be the final name either
18:28
18:28 fgomez left, fgomez joined
KyleHa Lay Zae 18:28
18:30 icwiener joined, s1n joined 18:32 bluescreen10 joined 18:39 s1n left
dalek kudo/nom: b390e8b | moritz++ | src/Perl6/Actions.pm:
[LAZY] fix the name in the actions too
18:45
colomon likes this line: $title .=subst('"', "'", :g); 18:51
18:54 flussence joined, alester joined
masak heh :) 18:54
I might've used q[] for both strings in such a case.
because it makes the insides of the strings a bit clearer.
18:54 s1n joined
masak .=subst(q["], q['], :g) 18:54
18:54 goraki joined
colomon masak++ 18:55
though it's pretty easy to read with a sufficiently big fixed-width font.
18:55 cognominal_ left
moritz would have suggested .=subst(:g, q["], q[']) 18:55
I like regex adverbs on the front 18:56
18:57 leprevost joined
colomon wasn't even aware that was an option. are there tests for it? 18:57
18:58 cognominal joined, thelazydeveloper left
moritz for mixing positionals and named? I'm quite sure yes 18:59
colomon mind you, I'm not sure why I didn't think that was an option. But I've always putted named arguments last. 19:01
moritz well, in signatures that's mandatory
19:01 colomon left
moritz but on the caller side, the whole point of using names is that the position doesn't matter :-) 19:01
19:02 fibo joined
dalek ast: 8fb35f5 | moritz++ | S0 (2 files):
simplify subrule.t a bit
19:02
19:06 snearch joined 19:11 mdupont joined 19:23 leprevost left 19:26 fgomez left 19:28 fgomez joined
masak r: class A { has @.channels = [] }; say A.new.channels.elems 19:31
p6eval rakudo b390e8: OUTPUT«1␤»
masak Timbus: this bug remains in your Net::IRC::Bot code. I can send you a pull request to fix it if you want. 19:32
19:33 KyleHa left 19:35 leprevost joined
masak ok, let's sort this out once and for all. 19:38
.* only does the MRO thing, right?
meaning, it traverses up the class hierarchy, calling all applicable candidates. 19:39
if a class has candidates, but none are applicable, the dispatch fails. correct?
jnthn Yes, that's how it's implemented, and what makes sense to me. 19:40
masak r: class A { multi method foo($x where 42) { say "OH HAI" } }; A.new.*foo(5)
p6eval rakudo b390e8: OUTPUT«Cannot call 'foo'; none of these signatures match:␤:(A , $x, Mu *%_)␤␤ in method foo at src/gen/CORE.setting:310␤ in method dispatch:<.*> at src/gen/CORE.setting:839␤ in block <anon> at /tmp/x4Bypvlxy7:1␤␤»
jnthn It used to be different because we used to flatten the two types of dispatch.
masak right.
now.
jnthn Now we have protos. We method dispatch to the proto. That in turn invokes the multiple dispatch. 19:41
Do the method dispatcher, the proto is opaque.
masak what's the syntax for saying, "for all these objects some of which may have foo methods with signatures matching my arguments, call those and don't worry so much if things fail"?
moritz s/Do/To/
masak there's no MRO or inheritance involved here. 19:42
just a bunch of objects. how do I do that?
moritz $obj.map: { $_.?foo(yourparcel) } ?
masak s/things fail/binding on particular candidates fails/
jnthn er, .? is about MRO too
masak so, `$_.?foo(parcel) for @objs` should work? 19:43
jnthn .? is about MRO too
Not about multi-dispatchers.
masak yeah, but here there's no inheritance.
jnthn There's till an MRO!
masak but .? is silent if it fails, right? 19:44
oh well. that's why I'm asking. how *do* I do the above?
jnthn If it fails on the *method* dispatch.
Failure to bind the signature isn't a failed method dispatch.
moritz r: class A { method foo(Int) { } }; A.?foo(Str)
p6eval rakudo b390e8: OUTPUT«Nominal type check failed for parameter ''; expected Int but got Str instead␤ in method foo at /tmp/nKREDdimd5:1␤ in block <anon> at /tmp/nKREDdimd5:1␤␤»
jnthn Right.
19:44 goraki left
jnthn So... :) 19:45
masak I know I have all the pieces of the puzzle, MROs, multis, signatures, blablabla.
but I don't grok. :/
jnthn To solve masak's problem...
masak how *do* I... oh good, here it comes.
diakopter tries to even understand the problem
masak diakopter: it's Net::IRC::Bot. it's built on the user hooking up the bot with a bunch of modules, each one containing multi methods doing pattern matching in their signatures. 19:46
diakopter: if a multi doesn't bind, it's meant to skip that call and just move on.
diakopter: now, .* used to do that when Timbus++ wrote it, but the semantics changed. 19:47
jnthn r: class A { multi method foo(Int) { }; multi method foo(Str) { } }; my @args = 42; A.^find_method('foo').candidates_matching(|@args)>>.(|@args)
p6eval rakudo b390e8: ( no output )
jnthn r: class A { multi method foo(Int) { say 1 }; multi method foo(Str) { say 2 } }; my @args = 42; A.^find_method('foo').candidates_matching(|@args)>>.(|@args)
p6eval rakudo b390e8: ( no output )
jnthn hm :/
r: class A { multi method foo(Int) { say 1 }; multi method foo(Str) { say 2 } }; my @args = 42; A.^find_method('foo').candidates_matching(|@args).perl.say 19:48
p6eval rakudo b390e8: OUTPUT«()␤»
jnthn r: class A { multi method foo(Int) { say 1 }; multi method foo(Str) { say 2 } }; my @args = 42; A.^find_method('foo').candidates_matching(Int).perl.say
p6eval rakudo b390e8: OUTPUT«()␤»
jnthn r: class A { multi method foo(Int) { say 1 }; multi method foo(Str) { say 2 } }; my @args = 42; A.^find_method('foo').candidates_matching(A, Int).perl.say
p6eval rakudo b390e8: OUTPUT«(method foo(A , Int , Mu *%_) { ... },)␤»
jnthn aha!
masak :)
jnthn r: class A { multi method foo(Int) { say 1 }; multi method foo(Str) { say 2 } }; my @args = 42; A.^find_method('foo').candidates_matching(A, |@args).perl.say
p6eval rakudo b390e8: OUTPUT«(method foo(A , Int , Mu *%_) { ... },)␤»
jnthn r: class A { multi method foo(Int) { say 1 }; multi method foo(Str) { say 2 } }; my @args = 42; A.^find_method('foo').candidates_matching(A, |@args)>>.(|@args)
p6eval rakudo b390e8: OUTPUT«Nominal type check failed for parameter ''; expected A but got Int instead␤ in method foo at /tmp/4jIrDluqmJ:1␤ in sub METAOP_HYPER_CALL at src/gen/CORE.setting:11142␤ in block <anon> at /tmp/4jIrDluqmJ:1␤␤»
jnthn oh heh
Anyway, I think you can see how to build something on this :)
masak yes. 19:49
thank you.
jnthn Though for the IRC bot, you may want to try { ... } the whole thing anyway.
diakopter wonders how much more/less efficient being explicit about the candidate searching is
masak jnthn: under perlcabal.org/syn/S12.html#Calling_...of_methods , the first sentence is "For any method name, there may be some number of candidate methods that could handle the request: typically, inherited methods or multi variants." 19:51
jnthn: problem with doing `try` on the call is that it masks other errors. so I'd have to do a CATCH and let non-binding errors through. 19:52
but that should work, OTOH.
r: class A { multi foo(Int) {} }; try A.new.foo("OH HAI"); say $!
p6eval rakudo b390e8: OUTPUT«Method 'foo' not found for invocant of class 'A'␤ in block <anon> at /tmp/shUxIafdC7:1␤␤»
masak r: class A { multi foo(Int) {} }; try A.new.foo("OH HAI"); say $!.^name
p6eval rakudo b390e8: OUTPUT«X::AdHoc␤»
masak AdHoc? :)
diakopter hm, what's an easy way to time things in rakudo
moritz r: say now - now 19:53
p6eval rakudo b390e8: OUTPUT«-0.04258100␤»
masak r: say time
p6eval rakudo b390e8: OUTPUT«1337198003␤»
diakopter now and time are seconds?
masak r: say now R- now
p6eval rakudo b390e8: OUTPUT«0.02353280␤»
moritz masak: any exception that isn't explicitly typed is X::AdHoc 19:54
diakopter: now has sub-second resolution
r: say time - time
p6eval rakudo b390e8: OUTPUT«0␤»
diakopter ok
thx
masak moritz: so if I want to match on it, I match on the text?
jnthn masak: Yeah. That bit of the spec has been there before any of the proto stuff. 19:55
masak: Well, current proto stuff.
moritz masak: or you patch rakudo to throw a typed exception :-)
masak r: class A { multi foo(Int) {} }; try A.new.foo("OH HAI"); say $! ~~ /'Method ' \'\w+\' ' not found'/
p6eval rakudo b390e8: OUTPUT«Method 'substr' not found for invocant of class 'X::AdHoc'␤ in method Str at src/gen/CORE.setting:9032␤ in method Stringy at src/gen/CORE.setting:695␤ in method gist at src/gen/CORE.setting:9088␤ in sub say at src/gen/CORE.setting:6765␤ in block <anon> at /tmp…
masak ehm.
moritz $!.payload or $!.message 19:56
masak yeahbut
moritz do you think X::AdHoc is Cool?
I thought about it
masak I guess I assument the moral equivalent of that, yeah.
at least that it pretends to be stringish if you try to match a regex against it. 19:57
moritz but I don't want exceptions to be accidentally used as strings
masak yeah, I guess I see the risk.
jnthn
.oO( does anybody ever assume the immoral equivalent? )
moritz and in the long run we want to discourage string matching
masak r: class A { multi foo(Int) {} }; try A.new.foo("OH HAI"); say $!.message ~~ /'Method ' \'\w+\' ' not found'/
p6eval rakudo b390e8: OUTPUT«=> <Method 'foo' not found>␤␤»
masak r: class A { multi foo(Int) {} }; try A.new.foo("OH HAI"); say ?$!.message ~~ /'Method ' \'\w+\' ' not found'/
p6eval rakudo b390e8: OUTPUT«#<failed match>␤»
masak r: class A { multi foo(Int) {} }; try A.new.foo("OH HAI"); say so $!.message ~~ /'Method ' \'\w+\' ' not found'/ 19:58
p6eval rakudo b390e8: OUTPUT«True␤»
masak "in the long run we want to discourage string matching" is a bad argument for not making it convenient to do so when you need it.
moritz aye
masak though I agree with your other points. 19:59
r: class A { multi method foo(Int) {} }; try A.new.foo("OH HAI"); say so $!.message ~~ /'none of these signatures match'/ 20:05
p6eval rakudo b390e8: OUTPUT«True␤»
masak I keep forgetting to put 'method' on multi methods... :/
TimToady: S12 is out-of-date with how Rakudo handles .* 20:15
TimToady: also, since .* does much less than it used to, there's now no easy way to call a set of same-named multi methods in a class, some of which may bind. 20:16
dalek href="https://perl6.org:">perl6.org: 1d5f762 | (Filip Sergot)++ | source/fun/index.html:
[source/fun/index.html] fixed broken link.
20:24
moritz masak: I'm curious, what's your use case for matching "method 'foo' not found" errors? 20:25
masak moritz: Net::IRC::Bot
moritz: trying to fix it up.
it builds on the old .* semantics.
moritz I'm pretty sure that such a fix is wrong, in the sense of also catching such errors from inside such a call 20:26
masak today's autopun: twitter.com/sixthformpoet/status/20...8356379648
moritz ie the call that you want to catch actually succeeds, but the method then tries to call another method, which fails 20:27
20:27 cognominal left 20:28 cognominal joined 20:31 mucker left
masak moritz: yes. 20:32
moritz: so maybe jnthn's proposed introspection way is cleaner.
jnthn Well, it's not really introspection so much as just a longer syntax for dispatch :) 20:34
diakopter that's what makes me curious about the efficiency 20:35
jnthn I was gonna say you miss the multi-dispatch cache, but then if you're asking it for all candidates, you're gonna anyway. 20:36
As the cache only covers "give me THE best one"
masak hm. 20:37
20:38 flussence left
moritz ok, stupid question. Why must it be multi methods? 20:39
masak in case you want to match several different things for a given method name in the same class, I guess. 20:40
I haven't seen a case where that's actually done, but I imagine it happens.
20:40 snearch left
masak like, several .said methods matching different expressions. 20:40
moritz but those have pretty much the same signature each, just different where-blocks, right? 20:41
masak yes... 20:42
moritz in that case I'd add a proto method said($str) {*}
hm
20:42 birdwindupbird joined
moritz or an only-method, that uses some other dispatch mechanism 20:42
or pharsed ifferently, I think you're spending much energy on a mechanism that could much simpler if you remove some not-quite-needed generality 20:43
*phrased
masak I can see an argument being made for the having to write a proto creating extra work (and extra clutter) for the IRC bot module writer. 20:44
20:44 crab2313 left
masak ("I just wanted to get it to do these things, why do I have to worry about protos?") 20:44
currently, the nice thing about those module classes is that they basically contain just the methods for the Net::IRC::Bot framework to hook into.
20:45 cognominal left, goraki joined
moritz yes, I can see the point for preserving that 20:45
20:45 cognominal joined
masak if you read S12 it feels pretty great. you just use .* for this. 20:46
but we've lost that, and jnthn thinks that's right. and I won't argue with that.
but we don't have that feature anymore.
dalek kudo/method-not-found: 65f9d95 | moritz++ | src/core/Exception.pm:
avoid some boxing in print_control
20:47
kudo/method-not-found: 8254a60 | moritz++ | src/core/Exception.pm:
typed exception for "method not found" error
moritz CATCH { given X::Method::NotFound { handle method-not-found case } } 20:48
masak moritz++ 20:49
moritz: but that turned out to be not the exception I got. I only got that when I forgot to put 'method' after 'multi' :/ 20:50
moritz: the real exception was 'none of these signatures match:'
moritz masak: that one is a bit tricker to "type", though we do support some typed exception from C land now 20:52
moritz -> sleep 20:53
masak 'night, moritz. dream of beautifully typeable excpetions. 20:54
goraki guten nacht
21:05 mikemol left, skids left 21:10 ispeak joined 21:22 s1n left 21:26 jferrero left 21:27 b1rkh0ff left 21:30 b1rkh0ff joined 21:34 birdwindupbird left 21:35 wolfman2000 joined 21:37 s1n joined 21:38 thou left 21:39 benabik left
masak 'night, #perl6 21:42
21:45 s1n left
jnthn 'night, masak 21:45
21:47 derrazo joined, derrazo left
dalek p: 45ed99f | (Gerhard R)++ | 3rdparty/dyncall/GNUmakefile:
fixes #38

use explicit -Wno-strict-prototypes instead of -w, which is ignored by gcc 4.2 only necessary on OS X, which comes with a broken version of GNU make
21:51
21:51 leprevost left 21:52 sisar joined
sergot good night o/ 21:54
21:54 sergot left
sisar 'night 21:54
21:55 mdupont left, goraki left 21:56 lestrrat left 21:57 lestrrat joined 22:00 s1n joined, Araq joined 22:02 not_gerd joined
not_gerd phenny: tell flussence could you please verify that NQP still builds on the machine that got you gist.github.com/2050618 22:03
phenny not_gerd: I'll pass that on when flussence is around.
Woodi there is at least one protocol (LDAP) where rfc says that errors should be differentiated by numbers and error "textual form" is implementation dependent. maybe same is for HTTP... 22:04
22:06 alester left
geekosaur I think most of them do that now. SMTP is an exception but sprouted a modified text form with standardized errors to compensate in a backward compatible way 22:06
22:08 mdupont joined 22:10 bluescreen10 left
Woodi HTTP have "classes" of errors (3xx or 4xx), and probably only few numbers are in common use 22:12
tadzik good evening
phenny tadzik: 18:24Z <pmichaud> tell tadzik if possible, check with me before doing the May release; I'm expecting to land some regex engine patches later today. kthx
Woodi hallo tadzik today :)
geekosaur the classes of errors thing is a very longstanding thing
tadzik oh, so it's "good morning" already? :)
Woodi tadzik: is there a NEWS or Changelog file for new Star to look at maybe ? 22:16
tadzik Woodi: well, it's not Star coming out tomo...today 22:17
it's an ordinary compiler release, and yes, there's a Changelog in the repo
see github.com/rakudo/rakudo/blob/nom/.../ChangeLog 22:18
Woodi I hoped for star :) ok, looking.
22:21 not_gerd left
Woodi and I was thinked do we can call Star a 'stable' distro but probably it will mess with Perl6 state to much in users eyes... 22:21
22:21 PacoAir left
Woodi and what is short-circuit ? :) 22:22
tadzik haha, I passed the SE exam \o/
Woodi gratz :) early session ?
geekosaur users mostly think perl6 is dead in the water :/ so messing with that is a good thing
tadzik Woodi: nah, just a Kolokwium
but one of those "pass or die" ones 22:23
Woodi it's required to pass :)
tadzik aye
gosh, I won't have an easy job writing a gist of this month's changelog... 22:25
"Teh cool stuff. You can has it" 22:26
22:26 bluescreen10 joined
Woodi you sure all entries from changelog belongs to Perl6 compiler ? :) roundrobin, chmod... :) 22:28
tadzik yes 22:29
I remember moritz++'s patches for those two recently :) 22:30
22:31 fgomez left
tadzik btw, Woodi, did you look at your Redis driver recently? 22:31
Woodi not in last 8 months... becouse I had problems with compiling Star on my small server. but it changed yesterday :) 22:32
22:33 fgomez joined
tadzik ha, great :) 22:33
I was looking forward to building some useful webapp using this Redis and Bailador
Woodi and I was trying to do more on Redis topic
tadzik there is now a working DBI too, but I wanted to look at this Redis thing anyway 22:34
Woodi I will try do things tom^Hday :) 22:35
tadzik :) 22:36
sisar are you guys talking about this Redis redis.io/ ? 22:37
Woodi yes
22:37 NamelessTee left
Woodi it is simple protocol so pure perl implementations can be done 22:37
but using C bindings always will be better. maybe later someone do this 22:39
sisar i don't get it... what is Rdeis? The Introduction to Redis page does not help much.
tadzik should be possible as long as we don't go asynchronous
sisar *Redis
Woodi sisar: it is memcache with disk persistence
22:40 cognominal left, cognominal joined
sisar looks up memcache and disk persistence 22:40
:)
Woodi and many data types :) and methods on them
sisar: it is next NoSQL database :) 22:41
sisar oh, so its a database? or it will replace databases ?
Woodi no
tadzik yes; no 22:42
I think :)
sisar ah
Woodi it is like cache with safety on disk. not quite intented as full db
sisar .oO ( there is so much to learn ! ) 22:43
.oO ( which is a good thing :) )
.oO ( i guess ? )
Woodi but it can be used as full db :)
sisar Woodi++ thanks for explaining. I do have a faint idea now :) 22:44
Woodi sisar: yes, learning is good thing :)
but working must follow it in some point :) 22:45
sisar not the learning, the 'amount' of learning blows my mind sometimes
Woodi heh :)
there will be more in the future :)
22:46 REPLeffect left
sisar and right now i'm just a sophomore teenager ! 22:46
Woodi choose subset you like :)
sisar you mean *subject ? 22:47
Woodi learn until your mind is like sponge :)
sisar aye
tadzik time for me, *yawn*. Goodnight #perl6 22:48
sisar 'night
Woodi gn tadzik
22:50 REPLeffect joined
Woodi sisar: I once hear that numbers things are easier before 30 year of life, so if you consider some philospohy it can wait till 40 year :) 22:50
sisar hehe
22:51 b1rkh0ff left
Woodi ok, I will go now too 22:51
sisar bye
Woodi g * everyone :)
22:51 whiteknight joined 22:52 whiteknight is now known as Guest1540 22:54 icwiener left 22:58 flussence joined 23:09 estrai left 23:10 estrai joined
jnthn 'night, #perl6 23:10
23:11 Araq left, cognominal left, cognominal joined 23:16 cognominal left, cognominal joined, thou joined 23:18 bluescreen10 left 23:21 fgomez left, fgomez joined 23:25 cognominal left, cognominal joined, thou left 23:30 cognominal_ joined, cognominal left
[Coke] (redis) oooh. we're using redis/jedis for a work project. having a p6 port would be a nice alternative. 23:30
guten abend, perl 6. 23:31
23:37 cognominal_ left 23:38 cognominal joined 23:41 aloha left 23:52 aloha joined