»ö« 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:17 gongyiliao joined, PacoAir left, adu joined 00:18 nodmonkey left 00:19 thelazydeveloper left, spider-mario left 00:27 tokuhiro_ joined 01:01 benabik left 01:07 popl left 01:09 scott_ joined 01:10 scott_ is now known as Guest39520 01:21 thou left 01:22 Guest39520 left 01:25 benabik joined 01:30 scott__ joined 01:39 benabik left 01:43 sivoais left 01:44 benabik joined, sivoais joined 01:46 tokuhiro_ left 01:51 jaldhar left 01:59 adu left 02:12 leprevost joined 02:41 Patterner left 02:43 Psyche^ joined, Psyche^ is now known as Patterner 02:54 orafu left 02:56 orafu joined 03:01 jeffreykegler joined 03:05 jeffreykegler left 03:10 Woodi left 03:15 sftp left 03:16 localhost joined 03:19 adu joined 03:49 skids left 04:02 Chillance left 04:22 leprevost left 04:32 adu_ joined 04:33 adu left, adu_ is now known as adu
moritz \o 04:48
04:55 birdwindupbird joined
sorear o/ 05:11
05:11 GlitchMr joined 05:16 adu_ joined, adu left 05:21 adu_ is now known as adu 05:33 erkan left 05:41 SamuraiJack joined 05:45 awwaiid left 05:48 jdrab_ left 05:55 nodmonkey joined
dalek c: 53087db | moritz++ | lib/Attribute.pod:
document Attribute
06:08
06:19 nodmonkey left 06:20 quietfanatic left 06:25 awwaiid joined 06:49 jdrab joined 07:02 cognominal left, jdrab left, cognominal_ joined 07:03 GlitchMr left 07:06 kaleem joined 07:13 adu left, brrt joined
dalek kudo/nom: fefacce | moritz++ | src/core/IO.pm:
[IO::Path] fix handling of local paths in .new(Str)
07:15
tadzik fefacce 07:16
moritz r: say 0xfefacce 07:18
p6eval rakudo d9c09e: OUTPUT«267365582␤»
moritz r: say 0xfefacceF 07:19
p6eval rakudo d9c09e: OUTPUT«4277849327␤»
moritz ronja added that F :-)
\o tadzik 07:20
07:20 cotto left
tadzik o/ moritz 07:21
brrt \O ALL 07:22
... oopscaps
07:28 Timbus left 07:32 daniel-s left, colomon left, daniel-s joined 07:41 Timbus joined 07:42 mathw_ joined 07:43 moritz_ joined, kaleem left, mathw left, moritz left, Pleiades` left, rhr_ left, huf left, cxreg left, [particle] left, pjcj left, ranguard left, PerlJam left, Tene left, charsbar_____ left 07:44 cxreg joined 07:46 fhelmberger joined 07:51 hoelzro|away is now known as hoelzro 07:53 Timbus left, Timbus joined 07:54 cognominal__ joined 07:55 sudokode left 07:57 cognominal_ left 08:00 MayDaniel joined 08:11 kaleem joined, Pleiades` joined, rhr_ joined, huf joined, [particle] joined, pjcj joined, ranguard joined, PerlJam joined, Tene joined, charsbar_____ joined
dalek c: 73e7393 | moritz++ | htmlify.pl:
[htmlify] only write type graph images when necessary

It takes quite a while, and is only necessary once in a while. The heuristic isn't perfect, which is why you can force the generation with a command line option.
08:22
08:27 MayDaniel left
jnthn morning o/ 08:28
moritz_ \o jnthn
jnthn Short backlog... 08:29
08:29 MayDaniel joined 08:30 [hds] joined 08:40 [hds] left 08:53 MayDaniel left
masak morning, #perl6 08:56
08:57 nwc10 joined
moritz_ .. is short 08:57
\o jnthn, masak
nwc10 how goes the awesome?
masak the proceedings are proceeding. 08:58
jnthn oh my, the proceedings...
masak .oO( proceed; succeed; ) 08:59
jnthn
.oO( but don't break )
masak breaks are obsolete.
sorear masak: proceedings? 09:05
masak sorear: YAPC::Europe speakers are given the chance to send in proceedings for their talks. 09:06
this year I decided to take that chance. the deadline is tomorrow.
sorear :|. time, a-slipping. sleep& 09:07
masak phenny: en fr "time, a-slipping"? 09:12
phenny masak: "le temps , une - glissement" (en to fr, translate.google.com)
masak :P 09:13
moritz_ it's the 21st century, and machine translation still sucks.
bonsaikitten because it's a darn hard problem 09:15
moritz_ jnthn++ # decreased resource usage makes hacking on rakudo much more fun
09:15 brrt left
jnthn moritz_: Builds faster/with less hassle now? 09:15
moritz_ jnthn: yes, a lot (compared to before QAST, mostly) 09:17
09:17 moritz_ is now known as moritz
nwc10 moritz: did your machine used to swap? If not, I'd guess that more of it fits in the L2 cache more of the time 09:18
09:23 MayDaniel joined
moritz nwc10: I've disabled swap space on my machine :-) 09:24
nwc10: but I used to shut down firefox before compiling the setting. Not necessary anymore :-)
arnsholt Still having trouble with stubbing classes :/ 09:25
moritz with 3GB memory, you usually want a process to die rather than to thrash everything :-)
arnsholt: in p6 land?
arnsholt Yeah
See gist.github.com/3283766
bonsaikitten moritz: ulimit to the rescue 09:26
arnsholt I can't do the stubbing without keeping all the class defs in a single file, which is going to be really annoying
bonsaikitten (but you already knew that, right?)
nwc10 yes, this reminds me of an ex emplyer
systems explain that some CGI scripts are coredumping at 16G (or something)
moritz bonsaikitten: switching off swap space has helped to
nwc10 and I ask "why are they allowed to get that big before being killed?" 09:27
never got a good answer, let alone a fix
moritz arnsholt: try to "use B"; in A, instead of stubbing it
bonsaikitten nwc10: even more fun if you use cgroups so that all cgi scripts together can't grow over $size
but that'd be, like, lame 09:28
moritz hm
arnsholt moritz: Nope. That just moves the problem from A.pm complaining about B not being defined to B complaining about A not being defined
09:28 huf left
moritz arnsholt, jnthn: I came up with gist.github.com/3283800 yesterday 09:30
but it complains about some access to Undef
while building
the idea is to handle mutually recursive 'use' statements at the Rakudo level
arnsholt Yeah, that makes sense 09:31
It seems circular HAS-A relations aren't terribly supported yet
jnthn moritz: huh, that's gonna catch *any* kind of module loading failure? 09:32
Anyway, the reason the original thing didn't work is that modules should really compile completely given a "blank slate". That's the whole separate compilation thing. 09:35
moritz jnthn: oh, I didn't mean to catch, just to clean and rethrow. Guess I forgot the rethrow part :( 09:36
jnthn moritz: Oh...then I understand better
moritz nqp: nqp::die("foo"); CATCH { say($_); nqp::rethrow($_) }
p6eval nqp: OUTPUT«foo␤foo␤current instr.: '_block1000' pc 115 ((file unknown):109) (/tmp/FVh092sy3A:1)␤»
moritz anyway, it dies with 09:37
get_attr_str() not implemented in class 'Undef'
current instr.: 'nqp;Perl6;World;load_module' pc 6160 (src/gen/perl6-symboltable.pir:2402) (src/Perl6/World.pm:216)
that line is return pir::getattribute__PPs($module, 'lex_pad');
jnthn Probably because of the last statement of load_module or so
Right
Well, if you aren't throwing out of there, then it expects to have a return value.
moritz but 09:38
even before my patch
there was a line after the load_bytecode
DEBUG("done loading ", %chosen<load>) if $DEBUG; 09:39
why does adding a CATCH after that change the return value?
jnthn moritz: If the CATCH handles the exception rather than rethrowing it, then $module will be empty 09:41
And then it tries to find the lexpad.
moritz jnthn: but there shouldn't even be an exception in the case of compiling the setting, no? 09:43
jnthn I hope not 09:44
oh, that broke setting compilation?
moritz yes
oh, I now see
it's the pir::load_bytecode that sets $*MAIN_CTX; 09:45
09:45 jaldhar joined
moritz which means that now I have no idea how to fix it :( 09:46
jnthn moritz: What are you trying to fix, exactly? 09:47
moritz jnthn: I want to make mutual recursive "use" statements not loop infinitely 09:48
jnthn By detecting them and explaining what's going on?
Or by trying to make it somehow work?
09:48 spider-mario joined
masak it should work. 09:48
moritz by making it work somehow
jnthn It can't work. 09:49
masak ok, it should not hang.
it also should not bail.
jnthn Explain to me how it's meant to work.
aloha positive: nothing; negative: nothing; overall: 0.
masak aloha: shut. up.
jnthn fuck off, aloha
jnthn almost reaches for his op bit to kick it
moritz starts to see how it doesn't work
arnsholt Yeah, it probably can't. But my code in gist.github.com/3283766 should be possible I think 09:50
masak jnthn: A.pm contains 'use B;', B.pm contains 'use A;'. when I compile/run either file, nothing happens. no error, nothing.
09:50 huf joined
moritz my initial idea was to do the same caching that causes multiple 'use A;' statements not to reread the file each time 09:50
masak right. 09:51
I guess Perl 5 does something like this.
moritz but the problem is that the cache entry for that can only be written once A has finished loading
masak well, you can say "A.pm has been entered" early.
moritz but A can't finish loading, because it uses B, which uses A
jnthn Let's walk through this.
module A;
use B;
moritz doesn't have its cache entry written yet
jnthn B.new();
module B;
use A;
A.new() 09:52
So, two modules
You do "use A"
It in turn does "use B"
In parsing module B we then encounter "use A" again.
The proposal seems to be "well, we just cope"
So, let's suppose we say "OK, I won't load A again"
We go ahead and parse module B 09:53
masak right.
jnthn We encounter the symbol "A"
Which we compile as a list-op
Because we have no idea it's a type yet because we didn't yet parse mdoule A
See the problem?
masak std: A.new; class A {}
p6eval std f43a358: OUTPUT«===SORRY!===␤Illegally post-declared type:␤ 'A' used at line 1␤Check failed␤FAILED 00:00 40m␤»
masak then you get this error.
not an infinite use loop.
I see the problem. I don't disagree at all. 09:54
jnthn I'm not saying it should loop
But you seem to want it to work out somehow.
Which I'm saying "it can't because one-pass parsing"
arnsholt jnthn: But how to do an A that has a B while B has an A, and keeping A and B is separate source files?
masak it's not "it" that can't work. it's assumptions related to doing mutual 'use' statements.
but given that that is so, maybe it would actually make sense to detect 'use' cycles and fail on them? 09:55
jnthn I'm not even sure we can produce that erorr STD does because it does it at CHECK time. Which happens *per module*, and at no point during the compilation of B do we encounter the post-declaration.
moritz masak: that's something I might manage to do :-) 09:56
masak \o/
jnthn arnsholt: I think one-pass parsing implies that you cannot; maybe consider collecting the data structures that the other modules both want access to together in a source file? 09:57
moritz++
arnsholt Right. That's annoying, but oh well 09:58
This is going to be a great big source file, but that's livable I guess
jnthn can't help but suspect that circular dependencies are more annoying in the long run. 09:59
moritz note that we have lots of circular dependencies in CORE
and we manage them just fine
jnthn Yes, which is one compilation unit :)
moritz module BOOTSTRAP.pm
jnthn BOOTSTRAP.pm only gets away with what it does because it's piecing things together at the MOP level 10:00
You can do the same in Perl 6 code if you wish, but it means you're exporting uncomposed types. 10:01
Which can hurt.
(You may remember some of the nasty bugs when a type was stubbed in BOOTSTRAP.pm and then not finished up in CORE.setting) 10:02
masak rn: say (1356 / 2874 * 100).fmt("%5.2f") 10:03
p6eval rakudo fefacc, niecza v19-15-g051783d: OUTPUT«47.18␤»
tadzik rakudo fefacc :P 10:04
I can't wait for rakudo deadbeef
masak (percentage of rakudobugs that I submitted)
jnthn huh, I thought it may be over 50%
:)
masak resolves to work harder
jnthn :P 10:05
nwc10 surely resolving to resolve harder is most useful? :-)
masak people are good at different things. 10:06
my special skill seems to be creating RT tickets. ;)
jnthn As the bug gets weirder, the resolving gets trickier. :)
masak I sometimes dabble in resolving tickets, or writing tests... but somehow that doesn't "do it for me" in the same way.
it's just a lot of work. :) 10:07
whereas bug submitting sneaks in as something that my brain considers to be "zero work".
moritz $ perl6 -I. test.pl 10:08
===SORRY!===
Recursive module loading detected involving module 'A'
masak moritz: "Mutually recursive", perhaps?
moritz masak: not necessarily
masak or does this go even for 'use A' in A.pm?
carry on, then :)
mhasch how wbout circular
masak yeah. 10:09
masak prefers "circular"
jnthn Yeah, circular is clearer to me too
moritz spectests
masak mhasch++ 10:10
tadzik circular logic is the best kind of logic
moritz :-)
10:11 scott__ left
masak tadzik: BECAUSE IT'S CIRCULAR! \o/ 10:12
r: say ((2874 - 621) / 2874 * 100).fmt("%5.2f") # percentage of closed perl6 tickets in RT 10:17
p6eval rakudo fefacc: OUTPUT«78.39␤»
jnthn ooh 10:18
masak r: say ((1356 - 342) / 1356 * 100).fmt("%5.2f") # percentage of closed perl6 tickets submitted by me
p6eval rakudo fefacc: OUTPUT«74.78␤»
masak hrm. :) 10:19
10:19 daxim joined
moritz masak: so your average ticket is slightly nastier than usual :-) 10:19
masak wonders why
man, I really need a mirror of RT that I can do time-based statistics on. 10:21
masak puts it on the long TODO list
10:21 crab2313 joined
masak I guess the above number is quite sensitive to how "caught up" we are on the queue. people have been diligent in closing tickets recently, so that probably plays in. 10:22
jnthn aye 10:25
dalek ast: 7c3f87a | moritz++ | S (2 files):
RT #114394, type captures and containers
jnthn wonders how long the testneeded queue is
masak huh!
jnthn heh, moritz++ just made it one shorter :)
masak irclog.perlgeek.de/perl6/2012-04-22#i_5477831
when I re-read this it seems the numbers are roughly similar then and now, and I just made the *opposite* conclusion then that I should've. :( 10:26
moritz fwiw the testneeded numbers are notoriously unreliable
masak *sob*, my tickets are statistically significantly *worse* than general tickets :/
jnthn That's curious in so far as they tend to be well formed.
moritz worse? 10:27
jnthn moritz: Less likely to be fixed.
masak I guess my tickets are often difficult to fix.
jnthn That doesn't mean the ticket's worse in so far as the ticket itself is to blame though.
masak even if they are well-formed.
jnthn It may mean that it's worse for whoever has to fix it :P
(As in, harder problem.)
masak that's a slight comfort :)
r: say 100 - 23.56; say 100 - 28.71 10:28
p6eval rakudo fefacc: OUTPUT«76.44␤71.29␤»
masak good news is that since April, the proportion of fixed tickets has gone up by two or three percentage points.
dalek ast: 2eb9d53 | moritz++ | S14-roles/basic.t:
RT #114380, type attributes in roles
10:30
10:30 brrt joined
moritz another masakneededbug down :-) 10:30
masak \o/ 10:31
10:31 nodmonkey joined
dalek kudo/nom: 78c5c17 | moritz++ | / (2 files):
Detect and carp at circular module loading
10:33
moritz r: say (1, 2).classify: -> $x { 1|2 } 10:34
p6eval rakudo fefacc: OUTPUT«Cannot assign to a readonly variable or a value␤ in sub infix:<=> at src/gen/CORE.setting:11393␤ in method push at src/gen/CORE.setting:1193␤ in sub AUTOTHREAD_METHOD at src/gen/CORE.setting:1863␤ in <anon> at src/gen/Metamodel.pm:2296␤ in method classify at s…
moritz r: my %h = a => 1; %h{1|2} = 3; say %h.perl 10:35
p6eval rakudo fefacc: OUTPUT«No such method 'STORE' for invocant of type 'Any'␤ in sub AUTOTHREAD_METHOD at src/gen/CORE.setting:1863␤ in <anon> at src/gen/Metamodel.pm:2296␤ in block at /tmp/EBzmMuG96g:1␤␤»
10:36 seldon joined
moritz nr: say $*IN.eof 10:41
p6eval niecza v19-15-g051783d: OUTPUT«Unhandled exception: Unable to resolve method eof in type TextReader␤ at /tmp/aT95qt9SrY line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3929 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3930 (module-CORE @ 564) ␤ at /…
..rakudo fefacc: OUTPUT«False␤»
10:43 wtw joined
moritz resolves the longest-standing open masakbug 10:44
r: try eval q[class B0rk { has $.a } ]; say $!.perl 10:45
p6eval rakudo fefacc: OUTPUT«Any␤»
moritz r: [class B0rk { has $.a }
p6eval rakudo fefacc: OUTPUT«===SORRY!===␤Redeclaration of symbol B0rk␤at /tmp/pnZJfuYO6m:1␤»
moritz r: class B0rk { has $.a }
p6eval rakudo fefacc: ( no output )
moritz r: class B0rk { say $.a }
p6eval rakudo fefacc: OUTPUT«===SORRY!===␤Variable $.a used where no 'self' is available␤at /tmp/XvOn8_HDZ5:1␤»
moritz r: try eval q[class B0rk { say $.a } ]; say $!.perl 10:46
p6eval rakudo fefacc: OUTPUT«X::Syntax::NoSelf.new(variable => "\$.a", filename => "eval_0", line => 1, column => Any, modules => Array.new())␤»
moritz nr: class A { my $.x = 7; say $.x } 10:47
p6eval niecza v19-15-g051783d: OUTPUT«===SORRY!===␤␤Variable $.x used where no 'self' is available at /tmp/5Ev8FoOooo line 1:␤------> class A { my $.x = 7; say ⏏$.x }␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 14…
..rakudo fefacc: OUTPUT«===SORRY!===␤Variable $.x used where no 'self' is available␤at /tmp/t26m2_VAsf:1␤»
dalek ast: b3c2006 | moritz++ | S32-exceptions/misc.t:
RT #59118
moritz closes the longest standing open ticket in the perl6 queue 10:48
tadzik \o/
dalek ast: 59ded64 | moritz++ | S32-list/reduce.t:
RT #66352, List.reduce and multi subs
10:56
moritz this one was a bug submitted by ruoso++ 10:57
nwc10 masak resolves to work harder, moritz works to resolve harder
moritz r: say ([X] <a b c> xx 2).perl 11:01
p6eval rakudo fefacc: OUTPUT«((ListIter.new(),),).list␤»
moritz r: say ([X] <a b c> xx 2).tree.perl
p6eval rakudo fefacc: OUTPUT«(["a", "b", "c", "a", "b", "c"],).list␤»
11:04 crab2313 left 11:07 JimmyZ_ joined 11:10 fridim_ joined
masak nwc10: and jnthn just works harder :P 11:14
nwc10 although I suspect that he's working on paid work today (yesterday, and tomorrow) 11:15
jnthn Taking care of some $dayjob bits, yeah. 11:16
The more I take care of in the summer, the less snowed-under I am in the autumn. :)
moritz does it really work like that? 11:17
usually I'm always snowed-under 11:18
there's just an infinite amount of work to be done
in good approximation
r: 0 but last; say 'alive' 11:19
p6eval rakudo 78c5c1: OUTPUT«===SORRY!===␤Method 'has_compile_time_value' not found for invocant of class 'Undef'␤»
moritz that one is curious
jnthn Compiler fail 11:20
moritz r: sub f() { }; 1 but last() 11:22
p6eval rakudo 78c5c1: OUTPUT«===SORRY!===␤Method 'has_compile_time_value' not found for invocant of class 'Undef'␤»
moritz r: sub f() { }; 1 but f()
p6eval rakudo 78c5c1: OUTPUT«===SORRY!===␤Method 'has_compile_time_value' not found for invocant of class 'Undef'␤»
moritz might know how to fix it 11:23
jnthn OK...guess --ll-exception is informative
lemme know if not...I'll have some Perl 6 tuits this afty.
moritz it's $rhs[0] that's Undef 11:24
for a zero-arg call
so, just don't try to be all fancy for zero-arg calls, and everything should be fine
yes, --ll-exception is informative 11:25
11:27 mucker joined 11:30 UncleFester6 left 11:45 fridim_ left
dalek kudo/nom: 34e8d4d | moritz++ | src/Perl6/Actions.pm:
guard infix:<but> against zero-arg calls on the RHS

closes RT #73990
11:49
11:50 MayDaniel left
dalek ast: a0df9db | moritz++ | S14-roles/mixin.t:
RT #73990, "1 but last"
11:55
12:04 gongyiliao left
lumi_ I'm having trouble building nqp 12:06
12:08 mtk joined, tokuhiro_ joined
lumi_ parrot segfaults while generating stage1/nqpmo.pbc (if I'm reading this right) 12:10
12:27 colomon joined
arnsholt lumi_: That sounds bad. Could you give some more details? 12:31
jnthn: Have you looked at github.com/jnthn/zavolaj/pull/8 ? 12:32
lumi_ arnsholt: I'm investigating, it seems I had earlier trouble building parrot, that was masked because we moved back from 4.5 to 4.4
arnsholt: So my new complaint is that I can't build parrot :P
arnsholt Right. Try wiping out nqp/install (assuming you're doing --gen-parrot)
lumi_ arnsholt: Yep, except I'm actually building rakudo. So wipe out rakudo/install? 12:33
arnsholt Yeah 12:34
12:35 sivoais left
lumi_ OK 12:35
daxim pugs, say "echo echo hilight daxim" 12:36
pugs: say "echo echo hilight daxim" 12:37
p6eval pugs: OUTPUT«echo echo hilight daxim␤»
12:37 sivoais joined
[Coke] aloha: msg bacek to please disable the "explain" command in #perl6, as well as its reaction to negative karma. Thanks. 12:39
or did someone already boot it? 12:41
jnthn resisted the temptation to :) 12:42
arnsholt: Yeah. moritz++'s comment is valid.
arnsholt: Also I wasn't entirely sure on the name.
arnsholt Yeah, me too 12:43
I was thinking perhaps is native($libname, $realname)
jnthn is_symbol($realname) also works
er
is symbol
It kinda refers to dlsym 12:44
arnsholt Right. Was about to say that
Yeah, I like symbol as well
JimmyZ_ is native($realname, :$symbol? )
jnthn I don't think doing that with is native is a good idea
Because what if you are doing the "is native" with no arg trick for current assebly?
*assembly 12:45
JimmyZ_ likes is symbol too
arnsholt is native(Mu, $symbol) would work I guess, but looks a bit clunky 12:46
jnthn Yeah, I don't like that.
arnsholt Cool. is symbol it is 12:47
12:48 atrodo joined
lumi_ arnsholt: Everything works now, arnsholt++ :) 12:50
arnsholt Excellent! 12:51
dalek volaj: eb3e3d8 | duff++ | / (2 files):
Add a way to name native routines

Sometimes the names used in a particular native library may not mesh well with their usage in Perl. Rather than force our Perl subroutines to have the same name as their native counterparts, we provide a way to specify the name of the routine in the native library that our arbitrarily- named Perl subroutine maps to.
volaj: 4af0a9a | (Arne Skjærholt)++ | / (2 files):
Merge pull request #8 from perlpilot/master

Provide a way to use a different name in your Perl than the native library
volaj: bc26b5e | (Arne Skjærholt)++ | / (4 files):
Clean up pull request. As discussed on #perl6.

Renames is named trait to is symbol, use defined-or instead of boolean-or when checking return value of native_symbol (moritz++). Add basic test to make sure it works.
13:01
colomon oooo, sounds nice 13:02
arnsholt There. Now the only open Zavolaj issues are actual issues 13:05
jnthn \o/
arnsholt++
arnsholt tries to figure out how to detect OS compile-time 13:06
hoelzro that change makes me want to learn Perl 6 even more in depth =)
13:10 xinming left
moritz arnsholt: same as run time, but in a BEGIN block 13:10
r: say $*OS 13:11
arnsholt moritz: In C =)
p6eval rakudo 34e8d4: OUTPUT«linux␤»
arnsholt Sorry, was too far into my own brain =)
moritz :(
jnthn arnsholt: What do you really need?
Feature detection tends to beat OS detection...
13:11 xinming joined
arnsholt I'd like to add a fallback for OS X when library loading fails 13:11
jnthn Is there something you can rely on being #define'd when on OS X? 13:12
arnsholt Not sure :/
13:12 fgomez left
arnsholt (Or, more specifically I think I want to test for Mach, since that's where the .bundle/.dylib distinction comes from) 13:12
moritz stackoverflow.com/questions/6802903...x-question
hoelzro arnsholt: __APPLE_CC__ will be defined in C on OS X 13:13
sourceforge.net/apps/mediawiki/pred...ng_Systems
arnsholt Nifty! Thanks
Although, looking at NativeCall.pm6 again, the appending of the extension is done in Perl 13:14
arnsholt ponders 13:17
13:19 Chillance joined
jnthn arnsholt: One option may be that we pass the C code an array of symbol names to try rather than just one name. 13:20
(nqp::list(...) of them, that is)
Then we can construct the possibles in order in Perl 6 land.
arnsholt Yeah, that's probably the most extensible 13:21
13:21 skids joined
arnsholt I'm considering just using PARROT_LOAD_EXT from parrot/config.h as well 13:21
13:23 tokuhiro_ left
dalek ast: 4adc21e | moritz++ | S12-attributes/instance.t:
RT #74636, flattening of array attributes
13:23
arnsholt How attached are we to ``$libname ~~ /\.\w+$/ ?? $libname !! "$libname$*VM<config><load_ext>";''? 13:24
jnthn I'm rather open to the idea that there's a better way :) 13:25
arnsholt What I'm thinking of is dropping that bit, which means that we'll lose the ability to load libs with weird extensions 13:26
Not sure it's very important though
13:26 bluescreen10 joined
arnsholt And then first try loading "$lib . PARROT_LOAD_EXT", and if that fails try "$lib . PARROT_SHARE_EXT" before giving up 13:27
That way we'll work on OS X, without any extra OS detection shenanigans (but we'll try loading the same library twice on linux since both _LOAD_EXT and _SHARE_EXT is .so there) 13:28
jnthn We'll only try twice if it fails
Can always do a quick compare of them also
arnsholt Indeed 13:29
I guess the simplest would actually be strcmp()ing the two defines
jnthn yeah 13:30
moritz r: say $*VM<config><load_ext>
p6eval rakudo 34e8d4: OUTPUT«.so␤»
moritz r: say $*VM<config><share_ext>
p6eval rakudo 34e8d4: OUTPUT«.so␤»
pmichaud good morning, #perl6 13:34
jnthn hi, pmichaud o/
JimmyZ_ good morning, pm
colomon o\
moritz good am, pm
\o JimmyZ_, colomon
std: 1.>>.uc
p6eval std f43a358: OUTPUT«ok 00:00 40m␤»
moritz r: 1.>>.uc
p6eval rakudo 34e8d4: OUTPUT«===SORRY!===␤Confused␤at /tmp/bta8JrKH1K:1␤»
JimmyZ_ \o/ moritz 13:35
13:36 jerome joined
masak pmichaud! \o/ 13:37
13:39 jaldhar left 13:41 cognominal joined 13:45 cognominal__ left, cognominal left, cognominal joined
dalek ast: db2d40c | moritz++ | S32-exceptions/misc.t:
RT #75776, correct syntax error for missing block
13:46
13:49 thou joined
moritz r: my @a; say @a.^methods.elems 13:50
p6eval rakudo 34e8d4: OUTPUT«68␤»
moritz r: my @a; say @a.^methods.sort.elems 13:51
p6eval rakudo 34e8d4: OUTPUT«68␤»
masak phew :)
jnthn Those...once gave different answers?
moritz not selvfølgelig
rt.perl.org/rt3/Ticket/Display.html?id=76918
jnthn ah 13:53
moritz I guess that were parrot multis
somehow
jnthn perhaps that yes
masak phenny: no de "selvfølgelig"?
phenny masak: "natürlich" (no to de, translate.google.com)
masak well, yeah, but no. 13:54
moritz phenny: de nb "selbstverständlich"?
phenny moritz: "selvfølgelig" (de to nb, translate.google.com)
masak loves how that ticket was submitted by "shirtless" :P
13:55 sftp joined
moritz r: my Array $a; $a[0] = 3; say $a.perl 13:59
p6eval rakudo 34e8d4: OUTPUT«[3]␤»
13:59 daxim left 14:00 fhelmberger left 14:02 Tedd1^ left, Tedd1 joined
dalek ast: 5436ea7 | moritz++ | S02-types/autovivification.t:
RT #77048, autovivification of Array-typed scalars
14:06
moritz std: say :a<> 14:08
p6eval std f43a358: OUTPUT«Potential difficulties:␤ Pair with <> really means a Nil value, not null string; use :a('') to represent the null string,␤ or :a() to represent Nil more accurately at /tmp/z3fifA_HRD line 1:␤------> say :a<>⏏<EOL>␤ok 00:00 41m␤»
14:08 MayDaniel joined
moritz r: say :a<> 14:08
p6eval rakudo 34e8d4: OUTPUT«===SORRY!===␤Unsupported use of <>; in Perl 6 please use lines() to read input, ('') to represent a null string or () to represent an empty list␤at /tmp/79p_AxbTUU:1␤»
masak std: :a<> 14:10
p6eval std f43a358: OUTPUT«Potential difficulties:␤ Pair with <> really means a Nil value, not null string; use :a('') to represent the null string,␤ or :a() to represent Nil more accurately at /tmp/RutkWhB4Ud line 1:␤------> :a<>⏏<EOL>␤ok 00:00 40m␤»
pmichaud r: say (:a<hello>)
p6eval rakudo 34e8d4: OUTPUT«"a" => "hello"␤»
pmichaud r: say (:a<>)
p6eval rakudo 34e8d4: OUTPUT«===SORRY!===␤Unsupported use of <>; in Perl 6 please use lines() to read input, ('') to represent a null string or () to represent an empty list␤at /tmp/3l7AwI4fL2:1␤»
pmichaud I'm afk for a while 14:11
14:14 jaldhar joined, leprevost joined 14:22 wtw left 14:23 JimmyZ_ left 14:26 kaare_ joined
moritz phenny: tell [Coke] can you please check on your 32bit system if the tests in S03-operators/overflow.t that are skipped as "fails on 32bit" still fail? 14:39
phenny moritz: I'll pass that on when [Coke] is around.
moritz r: 1 = 2 14:49
p6eval rakudo 34e8d4: OUTPUT«Cannot assign to a non-container␤ in block at /tmp/UBt68fMHur:1␤␤»
dalek ast: 16bb6f8 | moritz++ | S32-exceptions/misc.t:
unfudge rakudo tests for RT #113534
14:51
14:52 SamuraiJack_ joined 14:53 SamuraiJack left 15:01 adu joined 15:03 GlitchMr joined 15:07 jaldhar left
moritz r: class A { }; try A.foo; say $!.perl 15:08
p6eval rakudo 34e8d4: OUTPUT«X::Method::NotFound.new(method => "foo", typename => "A", private => Bool::False)␤»
masak that is so cool.
moritz closes a ticket with it :-) 15:09
perl6: sub foo { my $s; for 1..3 { $s += $_ } } ; say foo()
p6eval rakudo 34e8d4: OUTPUT«6 6 6␤»
..niecza v19-15-g051783d: OUTPUT«Use of uninitialized value in numeric context␤ at /home/p6eval/niecza/lib/CORE.setting line 1272 (warn @ 5) ␤ at /home/p6eval/niecza/lib/CORE.setting line 296 (Any.Numeric @ 8) ␤ at <unknown> line 0 (ExitRunloop @ 0) ␤ at /tmp/343rO3NQJL line 1 (foo @ …
moritz perl6: sub foo { my $s = 0; for 1..3 { $s += $_ } } ; say foo() 15:10
p6eval niecza v19-15-g051783d: OUTPUT«Nil␤»
..rakudo 34e8d4: OUTPUT«6 6 6␤»
moritz masak: yes, I'm a bit proud on the X::Method::NotFound one; it took some evil hackery to get there 15:11
masak moritz++
the above looks... right. 15:12
6 6 6
unless things from a for loop should be decontainerized.
moritz rt.perl.org/rt3/Ticket/Display.html?id=77334
jnthn Blocks don't normally decont.
masak right.
jnthn It's routines
masak hm, pmichaud says it should in that ticket. 15:13
not the 'for', though, so much as the 'for' body block.
15:15 kaleem left
jnthn Hm, that'd imply that we make blocks decont their results also. 15:16
Which we can I guess...it just means if you don't want that you have to write "also is rw;" or something
moritz note that pmichaud's last comment was from 2010 15:17
our understanding of containers might have changed since then
jnthn ah, true :)
moritz nr: say .Str for ('ab' ~~ /<alpha>+/)<alpha> 15:20
p6eval niecza v19-15-g051783d: OUTPUT«a b␤»
..rakudo 34e8d4: OUTPUT«a␤b␤»
moritz rt.perl.org/rt3/Ticket/Display.html?id=77340 argues for rakudo's current behavior 15:21
rakudo: use Test; eval_lives_ok '1<&1' 15:27
p6eval rakudo 34e8d4: OUTPUT«use of uninitialized variable $v of type Any in numeric context in block at eval_0:1␤␤ok 1 - ␤»
jnthn r: $*LOL-I-DON'T-EXIST 15:34
p6eval rakudo 34e8d4: ( no output )
jnthn r: say $*LOL-I-DON'T-EXIST
p6eval rakudo 34e8d4: OUTPUT«Dynamic variable $*LOL-I-DON'T-EXIST not found␤ in method gist at src/gen/CORE.setting:9659␤ in sub say at src/gen/CORE.setting:7046␤ in block at /tmp/svLnxXABOi:1␤␤»
jnthn r: say $*LOL-I-DON'T-EXIST.WHAT
p6eval rakudo 34e8d4: OUTPUT«Failure()␤»
15:36 sudokode joined
[Coke] moritz: you could trigger a run yourself by just unskipping them and seeing if I complain. ;) 15:45
phenny [Coke]: 14:39Z <moritz> tell [Coke] can you please check on your 32bit system if the tests in S03-operators/overflow.t that are skipped as "fails on 32bit" still fail?
[Coke] (i'll run 'em shortly.)
15:47 brrt left
[Coke] moritz: how recent a rakudo do I need? is yesterday's ok? 15:47
15:49 thelazydeveloper joined
[Coke] moritz: yup, tests pass. 15:49
want me to commit the unfudge?
dalek ast: f66dad4 | coke++ | S03-operators/overflow.t:
rakudo unfudge
15:51
[Coke] curses.
dalek p/toqast: 6849356 | jnthn++ | / (2 files):
Add QAST::VarWithFallback, a way to give a handful of variables a fallback way to do a lookup should the initial lookup return null. For use of things like contextuals, or when the fallback is to throw an error.
15:52
p/toqast: 43dfb24 | jnthn++ | src/QAST/Compiler.nqp:
Compilation of QAST::VarWithFallback.
p/toqast: e714e6e | jnthn++ | src/QAST/Compiler.nqp:
Corrections to contextual scope compilation.
p/toqast: 64f922a | jnthn++ | src/NQPQ/Actions.pm:
Get a basic cut of contextuals working again. Fixes the contextuals tests entirely plus another test file that depended on them.
masak ooh, QAST::VarWithFallback 15:54
15:57 skids left, hoelzro is now known as hoelzro|away 15:59 nodmonkey left
TimToady_ wonders whether there's any reason we can't support closures on the right side of X, so that we could have 100..999 X { $_ .. 999 } 16:09
kind of a pity that 100..999 X *..999 doesn't work out
jnthn The compiler already has to thunk it.
oh, wait
that's the LHS
moritz no, LHS of xx
jnthn oh
...that also 16:10
jnthn shuts up and continues compiler hacking :)
16:10 skids joined
TimToady_ still wonders whether *..999 could turn into something like -> $_ = -Inf { $_ .. 999 }, that just defaults to the infinity in question 16:12
PerlJam TimToady_: I've occasionally wanted a version of X that passed its results through a closure en passant, but then I just use map ;-)
16:13 nodmonkey joined
TimToady_ nr: say (* ... 999).WHAT 16:13
p6eval rakudo 34e8d4, niecza v19-15-g051783d: OUTPUT«List()␤»
TimToady_ hmm
maybe we should force that to be a WhateverCode 16:14
moritz that's going to be a "bit" confusing
considering that it explicitly doesn't autocurry on the RHS 16:15
nwc10 jnthn++ # continuing compiler hacking 16:17
:-)
16:21 birdwindupbird left 16:23 brrt joined
dalek p/toqast: 207256a | jnthn++ | src/QAST/ (2 files):
Add a (per-HLL configurable) to do positional and associative lookup/binding using a QAST::Var. This may mean that even Rakudo can use this approach for its array/hash accesses, by configuring them to call the appropriate methods. Doing things that way come in highly useful with analysis/optimization of native array accesses.
16:29
p/toqast: 90adf5a | jnthn++ | src/NQPQ/Actions.pm:
Fix array and hash indexing; wins back some more tests.
jnthn er, way to do...
brrt leto: thanks for your mail 16:30
16:34 simcop2387 left 16:39 simcop2387 joined, simcop2387 left 16:41 simcop2387 joined, mucker left 16:45 benabik left
dalek p/toqast: 0143bc0 | jnthn++ | src/NQPQ/ (2 files):
Assorted fixes to package scoped things. Fixes our subs amongst other things.
16:46
16:47 benabik joined
jnthn 35 out of 60 test files pass with nqpq (NQP with QAST) now 16:47
(that's tests from t/nqp)
16:49 spider-mario left 16:51 spaceships left 16:52 spaceships joined
dalek p/toqast: 50bb7ae | jnthn++ | src/NQPQ/Actions.pm:
Eliminate a few more viviself usages and remove vivitype. These updates fix a few more package scoping issues, winning a couple more test files back.
16:55
16:58 brrt left 16:59 colomon left 17:02 SamuraiJack_ left
[Coke] +S14-roles/mixin.niecza aborted 32 test(s) 17:08
dalek rl6-roast-data: c7782d5 | coke++ | / (4 files):
today
17:09
sorear good * #perl6
diakopter sorear: howdy 17:11
[Coke] ingy, au, masak: pugs is over 40.89% of max spec tests and dropping. We'll drop below 40 again if moritz keeps adding tests. ;)
sorear, colomon: niecza has dropped below 90% of rakudo (89.58%). 17:12
n: say 22997*.9-20601 17:13
p6eval niecza v19-15-g051783d: OUTPUT«96.3␤»
17:13 SamuraiJack joined
[Coke] p: say abs(22997*.4-9404) 17:13
p6eval pugs: OUTPUT«205.2␤»
[Coke] p: 9404/.4 -22997 # whoops, wrong way 17:14
p6eval pugs: ( no output )
[Coke] p: say 9404/.4 -22997 # whoops, wrong way
p6eval pugs: OUTPUT«513␤»
[Coke] ok, still have a little time there. ;)
17:14 _fall0ut_ is now known as driador 17:15 driador left, driador joined
dalek p/toqast: 3f525aa | jnthn++ | t/nqp/38-quotes.t:
Update a pir:: op in a test to the appropriate nqp:: one.
17:23
p/toqast: eeeaea0 | jnthn++ | src/NQPQ/Actions.pm:
Fix array constructor.
p/toqast: 2524810 | jnthn++ | t/nqp/40-lists.t:
Update a test to not use pir:: ops.
p/toqast: 4660299 | jnthn++ | src/ (2 files):
Add an nqp::ishash.
17:24 SamuraiJack left 17:25 skids left 17:26 sirrobert joined, colomon joined
sirrobert where does panda install things by default? 17:26
masak ~/.perl6/lib, methinks. 17:31
sirrobert yep, that's it; thanks =)
masak yep: github.com/tadzik/panda/blob/maste.../panda#L72 17:32
17:37 fridim_ joined 17:38 PZt left
PerlJam arnsholt++ ("is symbol" is much better) 17:39
17:41 skids joined, ashleyde1 is now known as ashleydv, ashleydv is now known as ashleydev
ingy [Coke]: tests++ :) 17:51
masak tests. they rock.
tadzik arduino. It rocks 17:52
www.youtube.com/watch?v=PiU0KI9sxas \o/ 17:53
now I need a Perl 6 compiler for that :)
mhasch nqp might be a tad more realistic... :-) 18:00
tadzik probably 18:02
I need to find mberends' code, we started Perlduino iirc
18:05 fridim_ left 18:06 kcwu_ left 18:08 PZt joined 18:11 kcwu joined 18:14 crab2313 joined 18:21 SamuraiJack joined
masak today's mini-challenge: test whether an integer is a perfect square. try to be fast and/or to avoid floating-point math. 18:24
diakopter masak: :S 18:25
18:25 sporous left, SamuraiJack left, sporous joined, SamuraiJack joined
masak diakopter: why the wry face? 18:26
colomon masak: that's easy. $n == one((1..*).map({ $_ * $_}))
masak haha 18:27
it returns true or doesn't halt. I like your style. :)
benabik 1..$n or 1..($n/2) is probably better
colomon it clearly avoids floating-point math. And it must be fast, because it uses quantum mechanics! ;)
jnthn Now you just need to wrap it in something that decides whether it halts or not.
colomon jnthn: that's an exercise left for the reader. I'm on vacation. 18:28
diakopter just stop when it's greater than n
18:28 fhelmberger joined
sorear masak: !($n +& 2). Nice quick way to eliminate half of non-perfect squares, but sadly does not quite get all of them 18:29
masak sorear: cool. 18:30
the SO thread I'm reading talk about analyzing the last 6 bits for quick elimination.
it also talks about the John Carmack hack.
colomon link for the lazy?
masak stackoverflow.com/questions/295579/...an-integer 18:31
colomon masak++ 18:33
PerlJam Seems like that should be a rosetta code entry if it's not already 18:38
sorear all I can come up with atm is quadratic reciprocity
masak never heard of it. 18:39
ooh. 18:40
there's so much math out there... :)
18:41 SamuraiJack left
PerlJam masak: It's the closest we get to programming the universe 18:41
dalek p/toqast: 737fd97 | jnthn++ | / (4 files):
Get ++ and -- back in place; since we don't have a container model, it really maps down to binding and stuff. Dubious, but removing it will probably cause riots...
18:44
jnthn 41/60 of t/nqp pass now. :) 18:45
nwc10 first goal is 60/60 ?
then you start seeing how well NQP does on actually compiling Rakudo?
18:45 SamuraiJack joined
nwc10 with suitable breaks for "drink beer" on the way? 18:45
18:45 fhelmberger left 18:46 benabik left, benabik_ joined
masak sounds like a full evening! :) 18:47
sorear MATH 18:48
18:48 benabik_ left 18:49 benabik joined
masak pictures sorear jumping in through the window of a math conference, shouting "MATH" and running off 18:49
jnthn I...probably should work on my proceedings thing rather than hack on this all evening :)
masak oh right! les proceedings!
[Coke] wonders if y'all are just making up papers to go with the talks and calling them proceedings. 18:50
PerlJam masak: ETOOMUCHXKCD
[Coke] PerlJam: ... I don't have that error on my system. huh.
masak PerlJam: I'm not sure what you mean by "too much"... :P
[Coke] in an academic setting, the proceedings would be actual pre-existing work like a thesis, no? 18:51
PerlJam [Coke]: Depends.
[Coke]: many times you just have to submit an abstract to get a talk accepted. The actual paper doesn't have to exist until just before the conference
nwc10 "conference driven development" 18:52
masak absolutely.
[Coke] PerlJam: ah. Thanks.
[Coke] will miss yapc::eu, but is going to a work-hosted "agile" developer conference at disney this month. 18:53
I will attempt to bring up perl at least once. ;) 18:54
nwc10 but not in the way that Pythonista bring up Perl? :-)
PerlJam "at disney"? Will Mickey Mouse host? ;-)
colomon is missing all perl conferences this year, but will hopefully get to stay up until 1am playing music in a bar every night this week.
18:54 thou left
jnthn
.oO( Disney Agile: keep the development cycles Minnie )
18:55
nwc10 groans
masak .oO( Donald Duck typing )
PerlJam nwc10: creativity requires sacrifices sometiems.
sorear colomon: is that a sarcastic 'get' ? 18:56
colomon sorear: it is not
sorear in that case, \o/
PerlJam colomon: Playing covers or originals?
colomon PerlJam: Irish traditional, so all covers unless I sneak in one of my own. but then no one else would know how to play along, and what would be the fun of that? 18:57
PerlJam ah
I was hoping you'd say "some originals" so that we could compose and ode to Perl 6 or something :) 18:58
s/and/an/
colomon well, there always is the "Star of Rakudo". ;)
19:00 GlitchMr left 19:01 SamuraiJack left
colomon We're here for celticfestival.ca/fr_celticcollege.cfm -- my wife is taking classes all day while I watch our three-year-old, and then once he's in bed at night I get to go out and hit the bars to play music with the teachers and students. Only problem with this approach is I'm now about four hours behind on my sleep... 19:03
PerlJam colomon: doesn't your 3 year old take naps? Seems like a handy way you could catch up too :-) 19:08
colomon PerlJam: he never naps. 19:09
PerlJam then you aren't running him hard enough when he's awake ;)
colomon on the rare occasions he does nap, he then invariably stays up at least three hours past his bedtime -- usually pretty cranky the entire time, too. 19:10
sorear On the bright side, in less than a year you won't have a 3-year-old to worry about. 19:17
19:17 birdwindupbird joined 19:18 quietfanatic joined
PerlJam yeah, but in about 10 years you'll have a teenager to worry about 19:18
[Coke] (disney) just using a conf. room at one of the resorts. 19:25
19:26 cotto joined 19:27 seldon left 19:35 ilogger2 joined, ChanServ sets mode: +v ilogger2 19:47 fgomez joined 19:51 seldon joined 19:54 brrt joined, fgomez left 20:02 thou joined
sirrobert Is there a way to scan the loaded packages in a process? 20:18
just another quick ping =) Is there a way to see the classes/modules/packages that have been loaded? 20:31
tadzik hm. I think Perl 5 has something which shows loaded files, maybe Perl 6 has is too 20:32
[Coke] do we have %INC?
tadzik yeah, %INC
r: say %*INC.perl
p6eval rakudo 34e8d4: OUTPUT«Failure.new(exception => X::AdHoc.new(payload => "Dynamic variable \%*INC not found"))␤»
tadzik apparently not
n: say %*INC.perl 20:33
p6eval niecza v19-15-g051783d: OUTPUT«Any␤»
[Coke] n: use Test; say %*INC.perl;
p6eval niecza v19-15-g051783d: OUTPUT«Any␤»
jnthn If you just care about "what do we have", you can look in places like GLOBAL and :: 20:34
r: use Test; say GLOBAL::.keys
p6eval rakudo 34e8d4: OUTPUT«Test␤»
sirrobert ok
I didn't know about GLOBAL
thanks =)
jnthn note that
sorear except that loaded modules only go into GLOBAL if they are declared 'our'
or have a double colon in the name
jnthn r: use Test; say ::.keys
p6eval rakudo 34e8d4: OUTPUT«&isa_ok &ok &dies_ok &nok &lives_ok &is GLOBALish &eval_dies_ok &isnt EXPORT &eval_lives_ok &is_approx $?PACKAGE &is_deeply &todo ::?PACKAGE &done_testing &skip $_ &done $/ &skip_rest $=pod $! &diag !UNIT_MARKER &plan &flunk &pass␤»
[Coke] pugs: use Test; say ::.keys 20:35
p6eval pugs: OUTPUT«pugs: *** Unsafe function 'use' called under safe mode␤ at /tmp/55tFahu1ED line 1, column 1␤»
[Coke] O_o
sirrobert r: class Foo { }; say Global::.keys; 20:36
p6eval rakudo 34e8d4: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&Global' called (line 1)␤»
sirrobert r: class Foo { }; say GLOBAL::.keys;
p6eval rakudo 34e8d4: OUTPUT«Foo␤»
sorear r: my class Foo { }; say GLOBAL::.keys;
p6eval rakudo 34e8d4: OUTPUT«␤»
sirrobert that's cool
sorear r: class Foo::Bar { }; say GLOBAL::.keys;
p6eval rakudo 34e8d4: OUTPUT«Foo␤»
sorear r: my class Foo::Bar { }; say GLOBAL::.keys;
p6eval rakudo 34e8d4: OUTPUT«␤»
sirrobert r: class Foo { }; class Bar::Baz { }; say GLOBAL::; 20:37
sorear name handling for stuff with :: in the name is quite an embarrasment now
p6eval rakudo 34e8d4: OUTPUT«("Foo" => Foo, "Bar" => Bar).hash␤»
sorear probably an embarrassment we'll not be able to fix before 6.0
sirrobert well, presumably you have to dig into it ...? 20:38
jnthn sorear: The rule in Rakudo with my and multi-jointed things is "it means put the top-level thing in the lexical scope only"
sirrobert hrm
sorear it still breaks in quite a few ways 20:39
r: use Test; my class Test::More { }
p6eval rakudo 34e8d4: ( no output )
sorear r: my class Test::More { }; use Test
p6eval rakudo 34e8d4: ( no output ) 20:40
sirrobert how do I make this dwim?
r: class F::B { }; say GLOBAL::; for GLOBAL::.keys -> $space { say GLOBAL::$space::}; }
p6eval rakudo 34e8d4: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 2, near "say GLOBAL"␤»
jnthn GLOBAL::{$space}
sirrobert r: class F::B { }; say GLOBAL::; for GLOBAL::.keys -> $space { say GLOBAL::{$space}::}; }
p6eval rakudo 34e8d4: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 2, near "say GLOBAL"␤»
sirrobert r: class F::B { }; say GLOBAL::; for GLOBAL::.keys -> $space { say GLOBAL::{$space}}; }
p6eval rakudo 34e8d4: OUTPUT«===SORRY!===␤Confused␤at /tmp/ZEYxBd7AZk:1␤»
sorear for GLOBAL::.kv -> $space, $obj { say $obj.WHO.keys }
sirrobert hmmm... haven't used WHO before ... reading =)
jnthn It's just like a hash. 20:42
sirrobert interesting
it's a Stash() =) 20:43
sorear the combination of the hash, the serialization on precompilation, and the ways Perl 6 tries to enforce lexical scope everywhere it can makes for interactions that break my head
sirrobert r: my $f; say $f.WHO.WHAT;
p6eval rakudo 34e8d4: OUTPUT«Stash()␤»
sorear what you are seeing there is that WHO means .WHAT.WHO 20:44
you're seeing the symbol table Any::
r: our sub Any::moo() { }; my $f; say $f.WHO.keys
p6eval rakudo 34e8d4: OUTPUT«␤»
sorear r: sub Any::moo() { }; my $f; say $f.WHO.keys 20:45
p6eval rakudo 34e8d4: OUTPUT«␤»
sorear r: use MONKEY_TYPING; augment class Any { our sub moo() { }; }; my $f; say $f.WHO.keys
p6eval rakudo 34e8d4: OUTPUT«&moo␤»
sorear does Rakudo not implement sub Foo::bar syntax?
jnthn Hm...I'm guessing not.
jnthn wonders if anybody has ever wanted it :)
nwc10 Perl 5 has to be better for something :-) 20:46
sorear Niecza uses it to hide setting subs
like sub Niecza::GENERATE-SERIES ...
jnthn ah
sorear feels like jnthn has a much better grasp on Perl 6's maze of confusing scope logic 20:48
jnthn still feels like he's missing some pieces 20:49
sirrobert if I have something like $foo = Foo; $bar = $bar; 20:50
how do I access $foo::$bar as an object?
err $bar = Bar
tadzik ::($foo)::$bar I think
but... Why? :P 20:51
sirrobert plugins, etc. =)
sorear ::($foo) is a *symbolic* reference, which requires $foo to contain a string 20:52
I think you wanted:
n: class Foo { class Bar { method hi() { say "hello world"; }; }; my $foo = $foo.new; $foo.WHO<Bar>.hi; 20:53
p6eval niecza v19-15-g051783d: OUTPUT«===SORRY!===␤␤Unable to parse block at /tmp/v3R82exUU4 line 1:␤------> class Foo {⏏ class Bar { method hi() { say "hello wo␤Couldn't find final '}'; gave up at /tmp/v3R82exUU4 line 1 (EOF):␤------> my $foo = $foo…
sorear n: class Foo { class Bar { method hi() { say "hello world"; }; }; }; my $foo = $foo.new; $foo.WHO<Bar>.hi;
p6eval niecza v19-15-g051783d: OUTPUT«Unhandled exception: Unable to resolve method hi in type Any␤ at /tmp/ofWdEv9qi2 line 1 (mainline @ 7) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3929 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3930 (module-CORE @ 564) ␤ at /home/p6e…
sorear n: class Foo { our class Bar { method hi() { say "hello world"; }; }; }; my $foo = $foo.new; $foo.WHO<Bar>.hi;
p6eval niecza v19-15-g051783d: OUTPUT«Unhandled exception: Unable to resolve method hi in type Any␤ at /tmp/Mq6gjvQ0jE line 1 (mainline @ 7) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3929 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3930 (module-CORE @ 564) ␤ at /home/p6e…
sorear n: our class Foo { our class Bar { method hi() { say "hello world"; }; }; }; my $foo = $foo.new; $foo.WHO<Bar>.hi;
p6eval niecza v19-15-g051783d: OUTPUT«Unhandled exception: Unable to resolve method hi in type Any␤ at /tmp/pytWUJeCBJ line 1 (mainline @ 7) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3929 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3930 (module-CORE @ 564) ␤ at /home/p6e…
sorear n: our class Foo { our class Bar { method hi() { say "hello world"; }; }; }; my $foo = Foo.new; $foo.WHO<Bar>.hi;
p6eval niecza v19-15-g051783d: OUTPUT«hello world␤» 20:54
20:57 brrt left 20:58 sftp joined
masak r: multi detect(Str $foo where { /O/ }) {}; detect "O" 21:06
p6eval rakudo 34e8d4: OUTPUT«No such method 'match' for invocant of type 'Any'␤ in method Bool at src/gen/CORE.setting:9912␤ in sub detect at /tmp/5xYZYnV9gY:1␤ in block at /tmp/5xYZYnV9gY:1␤␤»
masak r: multi detect(Str $foo where /O/) {}; detect "O"
p6eval rakudo 34e8d4: ( no output )
masak r: multi detect(Str $foo where /O/) { say "OH HAI" }; detect "O" 21:07
p6eval rakudo 34e8d4: OUTPUT«OH HAI␤»
masak r: sub detect(Str $foo where { /O/ }) {}; detect "O"
p6eval rakudo 34e8d4: OUTPUT«No such method 'match' for invocant of type 'Any'␤ in method Bool at src/gen/CORE.setting:9912␤ in sub detect at /tmp/M9N_VOniLZ:1␤ in block at /tmp/M9N_VOniLZ:1␤␤»
jnthn Oh...is that a sink context oopsie?
masak r: subset Ostring of Str where { /O/ }; say "O" ~~ Ostring
p6eval rakudo 34e8d4: OUTPUT«No such method 'match' for invocant of type 'Any'␤ in method Bool at src/gen/CORE.setting:9912␤ in any accepts_type at src/gen/Metamodel.pm:2443␤ in method ACCEPTS at src/gen/CORE.setting:562␤ in block at /tmp/9k10u4Evhm:1␤␤»
masak seems so.
jnthn Not surprising given we don't really do sink context properly yet. 21:08
A curious place for it to fall out though
masak updates the ticket 21:09
r: say "O" ~~ { /O/ }
p6eval rakudo 34e8d4: OUTPUT«␤»
moritz I guess the problem is that at the point where the regex is evaluated in boolean context, $_ isn't bound to 'O' 21:10
benabik r: "O" ~~ { .say } 21:11
p6eval rakudo 34e8d4: OUTPUT«O␤»
21:11 cognominal_ joined
pmichaud I see no sink context there, fwiw. 21:19
jnthn pmichaud: There shouldn't be one.
pmichaud r: say "0" ~~ { /0/.Bool } 21:20
p6eval rakudo 34e8d4: OUTPUT«True␤»
masak rn: sub foo(:$) {}; say &foo.signature.perl 21:21
p6eval niecza v19-15-g051783d: OUTPUT«===SORRY!===␤␤Abbreviated named parameter must have a name at /tmp/BAHjOlMIKM line 1:␤------> sub foo(:$⏏) {}; say &foo.signature.perl␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting l…
..rakudo 34e8d4: OUTPUT«:()␤»
masak sorear: no, it mustn't. where did you read that?
pmichaud I don't understand the ticket, then.
masak maybe it's a non-bug.
masak re-opens rt.perl.org/rt3/Ticket/Display.html?id=69492 21:22
pmichaud I somewhat agree that 'no such method 'match' for invocant isn't quite right.
moritz r: m/a/
p6eval rakudo 34e8d4: OUTPUT«No such method 'match' for invocant of type 'Any'␤ in block at /tmp/jtiiOpmO2H:1␤␤»
pmichaud r: sub detect(Str $foo where /O/) {}; detect "O";
p6eval rakudo 34e8d4: ( no output )
sorear std: sub foo(:$) { } 21:23
p6eval std f43a358: OUTPUT«ok 00:00 41m␤»
sorear masak: please explain to me how a named parameter without a name makes any sense at all.
r: sub foo(:$) {}; say &foo.signature
p6eval rakudo 34e8d4: OUTPUT«:()␤» 21:24
sorear r: sub foo(:$) {}; say &foo.signature.params
p6eval rakudo 34e8d4: OUTPUT«Parameter<-1329049004>␤»
sorear r: sub foo(:$) {}; say &foo.signature.params[0].perl
p6eval rakudo 34e8d4: OUTPUT«␤»
sorear r: sub foo(:$) {}; say &foo.signature.params[0].name.perl
p6eval rakudo 34e8d4: OUTPUT«""␤»
sorear r: sub foo(:$) {}; say &foo.signature.params[0].named.perl
p6eval rakudo 34e8d4: OUTPUT«Bool::True␤»
moritz r: sub foo(:$) { say 'lol' }; foo |{ '' => 42} 21:25
p6eval rakudo 34e8d4: OUTPUT«lol␤»
moritz r: sub foo() { say 'lol' }; foo |{ '' => 42}
p6eval rakudo 34e8d4: OUTPUT«Unexpected named parameter '' passed␤ in sub foo at /tmp/IAcMaG3QFH:1␤ in block at /tmp/IAcMaG3QFH:1␤␤»
masak sorear: it does make sense. the name is ''
like moritz++ just showed.
sorear masak: '' isn't a valid identifier
masak right.
so what?
pmichaud r: sub foo(*%named) { say %named{''} }; foo |{ '' => 42 }
p6eval rakudo 34e8d4: OUTPUT«42␤»
masak moritz++ also showed that you can pass by hash.
$ is a valid *variable* declaration. 21:26
sorear it's still confusing and wrong
21:26 spider-mario joined
masak it's confusing but not wrong. 21:26
it's a very valid corner case.
this happened to me in actual code at one point.
with multis and sublasses and stuff.
subclasses*
pmichaud r: sub foo(*%named) { say %named{42} }; foo |{ 42 => 'bar'}; # not a valid identifier but still valid
p6eval rakudo 34e8d4: OUTPUT«bar␤»
sorear it's a dubiously valid corner case that I'm going to rule illegal until I see a non-contrived use case
pmichaud hmm, I always thought that Perl tended to not rule corner cases illegal until there was a clear reason to do so. 21:27
masak sorear: ok. I'm not going to push it. just noting that there's nothing in principle to prevent it from working out.
sorear I would really like a general way to define parameters with non-identifier names
moritz fwiw non-identifier named args might be useful for HLL interop
sorear exactly
in particular this came up while I was working with Tk and blizkost 21:28
pmichaud since STD.pm6 feels that :$ is a valid parameter name, I think compilers should honor that
sorear std: $::::
p6eval std f43a358: OUTPUT«ok 00:00 40m␤»
sorear but, masak, if you have a legit use, I don't think adding :$ will break anthing 21:29
moritz std: :(:$::::)
p6eval std f43a358: OUTPUT«===SORRY!===␤Invocant is too exotic at /tmp/GVY608xYbs line 1:␤------> :(:$⏏::::)␤Cannot put required parameter after variadic parameters at /tmp/GVY608xYbs line 1:␤------> :(:$:::⏏:)␤Check failed␤FAILED 00:00 4…
moritz "too excotic"++ 21:30
r: :(:$::::)
p6eval rakudo 34e8d4: OUTPUT«===SORRY!===␤Cannot use :: as a type name at line 2, near ":)"␤»
sorear n: $::::
p6eval niecza v19-15-g051783d: OUTPUT«===SORRY!===␤␤Name component may not be null at /tmp/Zg0XyhRUGp line 1:␤------> $::⏏::␤␤Parse failed␤␤»
sorear n: $::::x
p6eval niecza v19-15-g051783d: OUTPUT«===SORRY!===␤␤Name component may not be null at /tmp/c48WLdSwax line 1:␤------> $::⏏::x␤␤Parse failed␤␤» 21:31
moritz p6: say "foo" & "a nice old foo" ~~ /foo/ 21:43
p6eval niecza v19-15-g051783d: OUTPUT«all(#<match from(0) to(3) text(foo) pos([].list) named({}.hash)>, #<match from(11) to(14) text(foo) pos([].list) named({}.hash)>)␤» 21:44
..rakudo 34e8d4: OUTPUT«This type cannot unbox to a native string␤ in any <anon> at src/gen/BOOTSTRAP.pm:104␤ in any !cursor_init at src/stage2/QRegex.nqp:487␤ in method ACCEPTS at src/gen/CORE.setting:9889␤ in block at /tmp/8_WHndcNAF:1␤␤»
moritz p6: say so 'u ' ~~ /<.ws>.$/ 21:45
p6eval rakudo 34e8d4, niecza v19-15-g051783d: OUTPUT«False␤»
masak sorear: I don't have a legit use offhand. I don't think I retain the code where this happened. it's also possible that what I had in that code was an anon positional parameter, and that made me think of anon named parameters.
moritz why doesn't that regex match? 21:46
is it because <.ws> doesn't backtrack?
masak p6: say so '' ~~ /<.ws>/
p6eval rakudo 34e8d4, niecza v19-15-g051783d: OUTPUT«True␤»
masak p6: say so 'u' ~~ /<.ws>./ 21:47
p6eval rakudo 34e8d4, niecza v19-15-g051783d: OUTPUT«True␤»
masak moritz: yeah, I think it's because <.ws> doesn't backtrack.
moritz but why not? I thought it was the regex that calls it that controls the backtracking
maybe I'm wrong though; it's late here, and the whole backtracking thing was never transparent to me 21:49
nr: say so ' ' ~~ /\s* . $/
p6eval rakudo 34e8d4, niecza v19-15-g051783d: OUTPUT«True␤»
moritz nr: say so ' ' ~~ /[:r \s*] . $/
p6eval rakudo 34e8d4, niecza v19-15-g051783d: OUTPUT«False␤»
moritz I guess that's the same principle 21:50
pmichaud I tend to think of <.ws> as being defined as a token, not a regex. 21:51
masak meaning that it doesn't backtrack.
pmichaud Certainly STD.pm6 defines 'ws' as a token. 21:52
moritz ok
moritz rejects ticket
pmichaud one can always define a custom ws that backtracks, though. 21:53
sorear masak: I think the logic I was using was something like 'it doesn't make sense for, out of the infinity of non-identifiers, only one of them be allowed as a parameter name'
*shrug* it's not a big deal to me
masak not to me either. 21:54
but I agree with pmichaud: Perl generally doesn't prohibit corner cases "just because". 21:55
rather, it tends to allow corner cases "just because" :)
moritz goes to bed, "just because" :-)
masak moritz: goodnight, just because :P 21:56
22:13 spaceships joined
TimToady_ rosettacode.org/wiki/Odd_word_problem#Perl_6 22:15
masak that is the weirdest problem I've seen on Rosetta Code. 22:20
anyway, nice solution.
felher TimToady++ # odd word problem :) 22:22
22:32 fridim_ joined 23:00 fridim_ left 23:01 quietfanatic_ joined
masak '♞, »ö« 23:03
23:05 benabik joined 23:10 gongyiliao joined
timotimo { [ ow(in), .print ][0]; } <- this is a cute trick to do A, then B and return the value of B, i must say. 23:20
r: sub yoink() { say "whoa"; BEGIN { say "yay!" } }; say "the return value of yoink is:", yoink 23:21
p6eval rakudo 34e8d4: OUTPUT«yay!␤whoa␤the return value of yoink is:True␤»
timotimo ah, so BEGIN blocks will return True on success and False on failure or something similar? 23:22
r: sub yoink() { say "whoa"; CHECK { say "yay!" } }; say "the return value of yoink is:", yoink
p6eval rakudo 34e8d4: OUTPUT«yay!␤whoa␤the return value of yoink is:True␤»
timotimo or maybe that's the return value of say?
r: say (say "hello")
p6eval rakudo 34e8d4: OUTPUT«hello␤True␤»
timotimo indeed it is
r: sub yoink() { say "whoa"; 9; CHECK { say "yay!"; 5 } }; say "the return value of yoink is:", yoink
p6eval rakudo 34e8d4: OUTPUT«yay!␤whoa␤the return value of yoink is:5␤»
timotimo using that would be cute, too :D 23:23
but probably unnecessarily complicated
23:33 benabik left 23:51 crankin joined, crankin left 23:52 fgomez joined 23:53 benabik joined