»ö« 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.
dalek p/ctmo: f35478c | jonathan++ | src/NQP/Actions.pm:
Oops, forgot to pass args along to MAIN.
00:03
p/ctmo: 42e8507 | jonathan++ | src/stage0/ (6 files):
Bootstrap with fixed @ARGS; need that for the compiler itself.
00:06 fisted_ is now known as fisted
dalek p/ctmo: 9179b83 | jonathan++ | src/NQP/Compiler.p (2 files):
Final switch over to having everything in Compiler.pm; toss Compiler.pir. For the first time, this means you can now write a compiler totally in NQP, without needing to write any PIR.
00:10
00:10 tyatpi_ left
jnthn ...which is good news given I've got a compiler writing talk to give in Taiwan in a couple of weeks. :) 00:10
ooh, less than that, akshually. :)
coldhead who is the audience? 00:20
jnthn coldhead: It'll be at osdc.tw/ 00:22
coldhead nice gig! that looks fun 00:24
jnthn Yes! Never went to Taiwan before. So pretty excited. :) 00:25
dalek p/ctmo: ca5da70 | jonathan++ | build/Makefile.in:
Fix make bootstrap-files.
p/ctmo: 162e287 | jonathan++ | src/stage0/ (6 files):
Update bootstrap with fully-NQP NQP.pbc (mostly just to make sure it works ;-)).
00:27 tyatpi_ joined 00:32 Chillance left 00:34 risou left
jnthn Phew. Looks like there's only one of the NQP PBCs that will not be able to become fully processed by the NQP compiler. That'll greatly reduce the pain of the GLOBAL transition. 00:35
00:35 risou joined
jnthn sleep & 00:35
00:36 gimix left 00:50 woosley joined 00:59 tyatpi_ left 01:03 Intensity left 01:14 jaldhar left 01:20 Intensity joined 01:22 jaldhar joined 01:24 tom_tsuruhara joined 01:25 c1sung joined 01:33 takadonet1 left 01:34 Holy_Cow joined 01:51 awj left 01:53 awj joined 01:59 Holy_Cow left 02:02 whiteknight left 02:04 noganex left 02:05 noganex joined 02:06 tom_tsuruhara left 02:07 icwiener left 02:10 _twitch joined 02:17 fith joined
flussence_ takadonet: ping 02:18
I'm pretty much finished with Text-Tabs-Wrap now, gonna push it if there's no objections soon :) 02:20
colomon push!
flussence_ done :) 02:21
colomon \o/ 02:28
02:38 gdey joined 02:45 takadonet1 joined
takadonet1 flussence_: you called? 02:45
flussence_: good job sir :) 02:53
03:01 agentzh joined
takadonet1 flussence_++ 03:04
sorear hello takadonet1
takadonet1 sorear: yo
03:11 donri left
takadonet1 sleep & 03:28
03:28 takadonet1 left 03:31 tyatpi_ joined 03:35 risou_ joined 03:36 risou left 03:51 fith left 04:08 jaldhar left, jaldhar joined 04:25 Bzek left 04:26 Bzek joined 04:36 risou joined 04:38 risou_ left 04:45 kuzuha joined 04:48 justatheory left 04:54 nymacro joined 05:07 tyatpi_ left 05:12 risou_ joined 05:15 risou left 05:21 satyavvd joined, satyavvd left, satyavvd joined 05:39 satyavvd left, jaldhar left, noganex left, Intensity left, mtk left, [particle] left, lue left, Tedd1 left, shachaf left, aindilis left, flatwhatson_ left, eternaleye left 05:41 orafu left 05:42 orafu joined 05:56 satyavvd joined, jaldhar joined, noganex joined, Intensity joined, mtk joined, [particle] joined, lue joined, Tedd1 joined, shachaf joined, aindilis joined, flatwhatson_ joined, eternaleye joined, ponbiki joined, jevin joined, Eevee joined, tadzik joined, jdhore joined, cibs joined, JodaZ joined 06:03 mberends left 06:11 starcoder left 06:13 starcoder joined 06:15 awwaiid left 06:27 awwaiid joined
moritz_ good morning 06:29
sorear HELLO MORITZ
moritz_ covers his ears... still early in the morning here :-) 06:30
06:30 xinming_ joined 06:33 xinming left 06:36 awwaiid left 06:38 kaare_ joined 06:42 awwaiid joined 06:47 wtw joined 06:51 cjk101010 joined 06:58 cjk101010 left
moritz_ nqp: my $x; pir::set__ip($x, 3.5); say($x) 06:58
p6eval nqp: OUTPUT«sh: ./nqp: not found␤»
sorear nqpnet: my $x; say($x) 06:59
p6eval nqpnet: OUTPUT«(timeout)access in find_method('compile')␤current instr.: 'main' pc 91202 (gen_grammar.pir:1151)␤make: *** [NQPSetting.dll] Error 1␤»
sorear yapsi: say 5
p6eval yapsi: OUTPUT«===SORRY!===␤Unable to find module 'Yapsi' in the @*INC directories.␤(@*INC contains:␤ lib␤ /home/p6eval/.perl6/lib␤ /home/p6eval//p2/lib/parrot/3.1.0-devel/languages/perl6/lib␤ .)␤»
sorear mildew: say(5) 07:00
p6eval mildew: OUTPUT«sh: /home/mildew/perl5/perlbrew/bin/perl: not found␤»
sorear partcl: print 5
p6eval partcl 3977a9: OUTPUT«invalid command name "print"␤ while executing␤HLL::Compiler::eval␤ (file "<unknown file>" line 151)␤PCT::HLLCompiler::evalfiles␤ (file "<unknown file>" <unknown line>)␤PCT::HLLCompiler::command_line␤ (file "<unknown file>" <unknown line>)␤main␤ (file "<unknown
..file>"…
sorear partcl: puts 5 07:03
07:03 kuzuha left
p6eval partcl 3977a9: OUTPUT«5␤» 07:03
sorear perlesque: say(5)
p6eval perlesque: OUTPUT«5␤»
sorear star: say 5
p6eval star 2010.09: ( no output )
sorear alpha: say 5
p6eval alpha : OUTPUT«5␤»
sorear nqprx: say(5) 07:04
p6eval nqprx: OUTPUT«5␤»
sorear pugs: say 5
p6eval pugs: OUTPUT«5␤»
sorear yapsi: say 5
p6eval yapsi: OUTPUT«===SORRY!===␤Unable to find module 'Yapsi' in the @*INC directories.␤(@*INC contains:␤ lib␤ /home/p6eval/.perl6/lib␤ /home/p6eval//p2/lib/parrot/3.1.0-devel/languages/perl6/lib␤ .)␤»
moritz_ elf: say 5
sorear elf is commented out
moritz_ zwölf: say 5
*SCNR*
sorear of the non-commented-out implementations, yapsi, star, mildew, nqpnet, and nqp are broken 07:05
moritz_ I'm currently doing an upgrade in the chroot
sorear I'm amazed pugs still works
moritz_ to be able to install perl-doc
which nqp needs for compilation (?)
07:05 cjk101010 joined
sorear out 07:06
07:08 vert2 left, vert2 joined
moritz_ nqp: my $x; pir::set__ip($x, 3.5); say($x) 07:12
p6eval nqp: OUTPUT«The opcode 'set_i_p_p' (set<3>) was not found. Check the type and number of the arguments␤current instr.: 'nqp;HLL;Compiler;evalpmc' pc 30577 (gen/hllgrammar-grammar.pir:2153)␤»
moritz_ nqp: my $x; pir::set__pi($x, 3.5); say($x) 07:13
p6eval nqp: OUTPUT«The opcode 'set_p_i_i' (set<3>) was not found. Check the type and number of the arguments␤current instr.: 'nqp;HLL;Compiler;evalpmc' pc 30577 (gen/hllgrammar-grammar.pir:2153)␤»
moritz_ nqp: my $x; $x = pir::set__pi(3.5); say($x)
p6eval nqp: OUTPUT«Assignment ("=") not supported in NQP, use ":=" instead at line 1, near " pir::set_"␤current instr.: 'nqp;HLL;Grammar;panic' pc 17577 (gen/hllgrammar-grammar.pir:5028)␤»
moritz_ nqp: my $x; $x := pir::set__pi(3.5); say($x)
p6eval nqp: OUTPUT«Null PMC access in set_integer_native()␤current instr.: '_block11' pc 17 (EVAL_1:28875782)␤»
moritz_ nqp: my $x = 2; $x := pir::set__pi(3.5); say($x)
p6eval nqp: OUTPUT«Assignment ("=") not supported in NQP, use ":=" instead at line 1, near " 2; $x := "␤current instr.: 'nqp;HLL;Grammar;panic' pc 17577 (gen/hllgrammar-grammar.pir:5028)␤»
moritz_ nqp: my $x := 2; $x := pir::set__pi(3.5); say($x)
p6eval nqp: OUTPUT«Null PMC access in set_integer_native()␤current instr.: '_block11' pc 17 (EVAL_1:1086)␤»
moritz_ how do I coerce to integer in nqp?
07:22 risou_ left 07:23 risou joined
TiMBuS erm, 07:23
nqp: my $x := 2; $x := pir::set__ip(3.5); say($x);
p6eval nqp: OUTPUT«3␤»
TiMBuS im not sure if thats what you wanted 07:24
07:26 sftp left 07:31 fhelmberger joined 07:33 mtk left 07:38 risou_ joined 07:40 risou left 07:41 mtk joined 07:43 risou joined 07:47 risou_ left
moritz_ it is 08:02
TiMBuS++
nqp: my $d := 5; $d := pir:.set__ip($d / 2); say($d) 08:06
p6eval nqp: OUTPUT«Confused at line 1, near "$d := pir:"␤current instr.: 'nqp;HLL;Grammar;panic' pc 17577 (gen/hllgrammar-grammar.pir:5028)␤»
moritz_ nqp: my $d := 5; $d := pir::set__ip($d / 2); say($d)
p6eval nqp: OUTPUT«2␤»
08:09 ymasory left
moritz_ nqp: map({$_ + 1}, [1, 2, 3]) 08:10
p6eval nqp: OUTPUT«Symbol '$_' not predeclared in <anonymous>␤current instr.: 'nqp;PCT;HLLCompiler;panic' pc 146 (compilers/pct/src/PCT/HLLCompiler.pir:107)␤»
moritz_ nqp: map(-> $_ {$_ + 1}, [1, 2, 3])
p6eval nqp: OUTPUT«Could not find sub map␤current instr.: '_block11' pc 70 (EVAL_1:30)␤»
jnthn morning o/ 08:29
08:30 mj41_nb joined
moritz_ \o 08:30
dalek p/ctmo: 1308785 | moritz++ | src/HLL/Actions.pm:
get rid of a Q:PIR block that is available as a pir:: primitive
p/ctmo: 43a41af | moritz++ | src/HLL/Actions.pm:
convert string_to_int to nqp
p/ctmo: ea95252 | moritz++ | src/HLL/Actions.pm:
rewrite ints_to_string in nqp
p/ctmo: 7046f2c | moritz++ | src/stage0/ (6 files):
update bootstrap, just to show that it still works :-)
08:31 Mowah joined
dalek p/ctmo: 9e6576b | moritz++ | src/HLL/Actions.pm:
remove the last Q:PIR from HLL::Actions
08:32
jnthn moritz_: nqp needs perldoc to compile?
moritz_ jnthn: to configure, it seems 08:33
jnthn: I was rather surprised
jnthn: I have a few hacking hours allocated today and tomorrow, if you find new LHFs I'm happy to pick them 08:34
jnthn moritz_: One LHF is to make P6Regex.pir go away :) 08:36
Should be easy
See how I got rid of NQP's Compiler.pir.
moritz_ will do 08:38
jnthn HLL.pir can also eventually go but that's some more steps and a little trickier. 08:39
But may be possible to make some steps towards that.
moritz_ if in doubt I'll comb the sources for Q:PIR blocks and try to rewrite them in nqp
jnthn Regex.pir is chock full of PIR code so I think that one has to stay. 08:40
moritz_ not all are LHFs, but many are managable
jnthn Basically my aim is that NQP "manages" the compilation of as many of the modules as possible.
A bit of Q:PIR is nice to remove but not a problem for that.
It's to do with making it easier to do the new package var handling, GLOBAL merging etc. 08:41
moritz_ do I need to worry about P6Regex.pir being in the 'nqp' HLL? 08:42
jnthn No (more) 08:43
The compiler emits a bunch of stuff now like .HLL and the various .loadlib, and other setup bits
It's got a lot better at generating code that Just Works :) 08:44
moritz_ so I'll just try the simplest thing that could possibly work
and investigate if it fails
jnthn :) 08:53
mathw Morning 08:54
moritz_ nqp: class Test is HLL::Compiler { } 09:05
p6eval nqp: ( no output )
moritz_ nqp: class Test is HLL::Compiler { }; my $t = HLL::Compiler.new()
p6eval nqp: OUTPUT«Assignment ("=") not supported in NQP, use ":=" instead at line 1, near " HLL::Comp"␤current instr.: 'nqp;HLL;Grammar;panic' pc 17577 (gen/hllgrammar-grammar.pir:5028)␤»
moritz_ nqp: class Test is HLL::Compiler { }; my $t := HLL::Compiler.new()
p6eval nqp: ( no output )
jnthn nqp: class Test is HLL::Compiler { }; my $t := HLL::Compiler.new(); say($t.WHAT) 09:07
p6eval nqp: OUTPUT«Compiler()␤»
jnthn nqp: class Test is HLL::Compiler { }; my $t := Test.new(); say($t.WHAT) 09:08
p6eval nqp: OUTPUT«Test()␤»
moritz_ $ wc -l src/stage1/gen/p6regex-compiler.pir 09:10
166 src/stage1/gen/p6regex-compiler.pir
I have a backtrace containing
src/stage1/gen/p6regex-compiler.pir:28683368
:-)
mathw oh no it's a backtrace from the future 09:11
when p6regex-compiler.pir contains a complete AI
(which is really good at compiling regexes) 09:12
moritz_ hopes tardis can travel that far into the future
09:20 Bzek left 09:22 Mowah left
dalek p/ctmo-no-p6regex.pir: b33dc05 | moritz++ | / (3 files):
first shot at removing P6Regex.pir. Diws with "Can only use get_how on a RakudoObject"
09:27
jnthn moritz_: That could happen if you try to inherit from something that's not found, or some such. 09:36
09:38 risou_ joined 09:40 Mowah joined 09:41 risou left 09:46 tzhs joined 09:51 dakkar joined
moritz_ jnthn: curiously it even happens if I do not inherit at all 09:54
09:54 woosley left
jnthn Well, there are other ways it can happen... 09:58
It's almost always unloaded/missing dependency
10:09 tzhs left 10:19 daxim joined 10:27 tzhs joined 10:32 fisted_ joined 10:33 fisted left 10:39 risou joined, toebu joined 10:40 risou_ left 10:54 jww joined 11:39 risou left, risou joined 11:55 fhelmberger_ joined, fhelmberger left 12:01 bbkr_ left 12:02 bbkr_ joined
[Coke] . 12:06
moritz_ .? 12:11
12:19 leprevost joined 12:25 bluescreen10 joined, tzhs left 12:44 coldhead left
cognominal cognominal wonders what is the purpose of all the branches created by jnthn in nqp 12:49
just a way to prod jnthn to blog more :) 12:51
12:51 wtw left 12:54 pyrimidine joined
moritz_ created at least two of them, and never finished them :( 12:55
cognominal to bad git does not oblige to specify the purpose of a branch when created
moritz_ ctmo = compile-time meta objects 12:57
that's the msot active branch right now
cognominal I suppose the goal is to solve an chicken egf problem 12:58
*egg
what we call bootstrapping :)
jnthn I may merge ctmo soonish. It didn't achieve its goals but it's a bad name for what needs to happen next... :) 13:00
And it has some nice improvements in, and doesn't regress anything.
13:06 Holy_Cow joined 13:08 satyavvd left 13:11 [particle] left 13:12 [particle] joined
flussence_ std: enum WordWrap is export <wrap overflow die>; 13:14
p6eval std 4608239: OUTPUT«ok 00:01 118m␤»
flussence_ rakudo: enum WordWrap is export <wrap overflow die>;
p6eval rakudo 592e29: OUTPUT«Could not find sub &export␤ in main program body at line 22:/tmp/mH_xYojS5s␤»
flussence_ rakudo: enum WordWrap <wrap overflow die>;
p6eval rakudo 592e29: ( no output )
flussence_ rakudo: enum WordWrap <wrap overflow die>; say 'alive';
p6eval rakudo 592e29: OUTPUT«alive␤»
flussence_ hm 13:15
colomon std: enum WordWrap <wrap overflow die>;
p6eval std 4608239: OUTPUT«ok 00:01 118m␤»
takadonet flussence_: you really love that module :)
flussence_ if it's worth doing it's worth doing right :)
(and I need the practice so I can go finish .indent) 13:16
13:17 icwiener joined
jnthn is export doesn't yet work on as many things as it should. I'll try and fix it in the not too distant future. 13:19
13:22 MayDaniel joined 13:26 mtk left 13:32 mtk joined 13:39 MayDaniel left 13:40 sftp joined 13:49 mj41_nb left 13:50 donri joined
flussence_ enum-inside-module doesn't seem to work :( 13:51
14:01 kaare_ left 14:07 alester joined 14:08 tyatpi_ joined 14:09 agentzh left 14:11 plainhao joined 14:25 mj41_nb joined 14:28 pmurias joined 14:35 kaare_ joined 14:40 plainhao left 14:41 plainhao joined 14:45 Lorn left 14:51 amkrankr1leuen is now known as amkrankruleuen, amkrankruleuen left, amkrankruleuen joined 14:56 tzhs joined 15:00 tervo joined
tervo hi 15:00
is there a cleaner way to do this regex
$regsubex($regsubex($regsubex($regsubex($regsubex($regsubex($regsubex($regsubex($$1,/([\[\]{}()\\|^$?*+.])/g,\\1),/([A-Z][A-Z]+)/g,[A-Z]+),/([A-Z])(?!-|\])/g,[A-Z]),/([a-z][a-z]+)/g,[a-z]+),/([a-z])(?!-|\])/g,[a-z]),/(\d\d+)/g,\d+),/(\d)(?!\+)/g,\d),/(_+)/g,_+)
thanks for an yusggestions
moritz_ tervo: since you are in #perl6: use Perl 6 regexes, and write a proper grammar 15:01
tervo what would be the perl6 version of that?
15:01 Helios` joined
tervo havent tried perl6 yet 15:01
moritz_ what is in $regesubex?
15:01 dip joined 15:02 dip is now known as Guest48312
tervo regex substitution 15:03
15:03 Guest48312 left, dipthegeezer joined
moritz_ my $regesubex = 'regex substitution'; or what? 15:03
tervo [A-Z][a-z]+\d+ :: [A-Z][a-z]+\d+
15:03 PacoLinux joined
tervo /say $pattern.regex(Floodbot32834) :: $pattern.regex(Floodbot234356) 15:03
$pattern.regex(gfdkjaht64373) :: $pattern.regex(yiuyf435) 15:04
[a-z]+\d+ :: [a-z]+\d+
15:04 gdey left
tervo and again it automatically morphs itself to any randomzied pattern 15:04
clonesx proxy floods, the bots are all forced to use the same pattern
moritz_ that $$1 confuses me 15:05
tervo the nicks are usually read from file
moritz_ that's parsed as $ (end of line) and then $1 (interpolation of $1 from previous regex match), right?
tervo yes correct 15:06
15:07 pmurias left
moritz_ I guess you need to assign that to another variable first in perl 6, because $0, $1 etc. refer to the current captures 15:07
see perlcabal.org/syn/S05.html for the details
moritz_ thinks his sanity is too precious to disset that regex, and rewrite it in Perl 6
twinshadow ha ha. Yeah... It really should be split into qr// variables, but my guess is that it's copied from JAPH script 15:11
tervo you mean i copeied it? 15:12
twinshadow Well... are you implying you actually _typed_ that? 15:13
tervo yes not here but yes i made that rgeex
15:15 timbunce joined
twinshadow In perl5, you can use $var = qr/regex/; to hold regex strings you can use in another regex like this: $foo =~ /$bar::$baz/; 15:15
read perlop for more about qr//
15:16 timbunce left 15:18 gbacon joined
tervo does freenode use dyanmic regexing to combat flooders, spammers? 15:35
moritz_ has no idea 15:37
15:44 gdey joined 15:51 leprevost left
flussence_ I'd imagine freenode does simple behavioural analysis to catch misbehaving clients 15:53
tervo heh anyhow 15:56
15:56 tervo left
flussence_ is still unsure which side of the fence that guy's on 15:57
sorear good * #perl6 16:09
16:12 leprevost joined 16:15 Patterner left 16:16 leprevost left 16:18 leprevost joined, justatheory joined 16:21 plobsing left 16:23 Axius joined, leprevost left 16:27 bluescreen10 left 16:28 Psyche^ joined, Psyche^ is now known as Patterner, cjk101010 left 16:30 Axius left 16:32 mj41_nb left 16:39 _twitch left 16:40 risou left, risou joined 16:43 bluescreen10 joined
awwaiid anyone see my blog on Whatever-Star? I'm feeling in need a good boy head-pat. 16:47
awwaiid should probably just transcend such desires 16:48
16:50 tzhs left 16:51 cdarroch joined, cdarroch left, cdarroch joined
takadonet awwaiid: url? 16:51
awwaiid blogs.perl.org/users/awwaiid_brock_...-star.html 16:53
:) 16:54
16:57 Lorn joined
jnthn hugme: hug awwaiid 16:58
hugme hugs awwaiid
jnthn Good blog post ;)
16:59 plobsing joined
[Coke] I read that one the other day, awwaiid++ ; # formatting looks a tad off in IE8, though. 17:08
17:24 wooden joined, wooden left, wooden joined 17:26 fhelmberger_ left 17:27 MayDaniel joined 17:37 kp joined 17:42 risou_ joined, kp left 17:43 risou left 17:47 MayDaniel left
donri If you wanted an attribute of a method, you'd need parenthetic &()? 17:51
17:54 Su-Shee joined
Su-Shee good evening. 17:54
17:57 dakkar left, daxim left, masak joined
masak hello all cats, zebras, and butterflies. 17:57
jnthn is a human and feels left out 17:58
TimToady donri: you need some way of naming it. &foo only works if the name 'foo' is in scope though, so you might need to use Foo.^methods to get at the method object
masak jnthn: lolcats are a subgroup of cats ;)
jnthn oh, phew!
donri rakudo: say &(1.sqrt).WHAT 18:01
p6eval rakudo 592e29: OUTPUT«Num()␤»
TimToady rakudo: 1.can('sqrt).WHAT
p6eval rakudo 592e29: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤» 18:02
TimToady rakudo: 1.can('sqrt').WHAT
p6eval rakudo 592e29: ( no output )
TimToady rakudo: 1.can('sqrt').WHAT.say
p6eval rakudo 592e29: OUTPUT«Method()␤»
TimToady or that
donri what does .can mean?
TimToady it means if found a method of that name, and returned it
*it
donri yea but does it actually mean the english word 'can'? :) 18:03
TimToady yes, in a boolean sense
donri i first seeing it thought it was some kind of interface-checking thingy
which i guess it kinda is, in a ducktypy way
TimToady a 1 can sqrt
diakopter it sqrtable
TimToady interface checking is .does
say Int does Numeric 18:04
rakudo: say Int.does(Numeric)
p6eval rakudo 592e29: OUTPUT«1␤»
diakopter perl6: say Int.does Numeric
TimToady ttiar
p6eval niecza v3-72-g543ebb3: OUTPUT«===SORRY!===␤␤Any()Confused at /tmp/6s_uOixrt6 line 1:␤------> say Int.does ⏏Numeric␤␤Undeclared name:␤ 'Int' used at line Any()1␤␤Parse failed␤␤»
..rakudo 592e29: OUTPUT«===SORRY!===␤Confused at line 22, near "say Int.do"␤»
..pugs: OUTPUT«*** ␤ Unexpected "Numeric"␤ expecting operator, ":" or ","␤ at /tmp/jAwWhBh7nQ line 1, column 14␤»
donri rakudo: say Int.does: Numeric
p6eval rakudo 592e29: OUTPUT«1␤»
donri ;)
why not a bool? 18:05
jnthn rakudo: say Int does Numeric # mixin :P
p6eval rakudo 592e29: OUTPUT«Attempt to use rebless_subclass where the new class was not a subclass␤ in 'infix:<does>' at line 7535:CORE.setting␤ in 'infix:<does>' at line 604:CORE.setting␤ in main program body at line 22:/tmp/rDvdkV9j1G␤»
jnthn bwaha :)
donri does the number returned mean something, like inheritance depth or something?
jnthn donri: Suspect it should be a bool.
Though things get a tad circular there. :) 18:06
donri rakudo: say 1 ~~ Numeric
jnthn Bool probably isn't defined at the point that method gets defined... :)
p6eval rakudo 592e29: OUTPUT«Bool::True␤»
donri rakudo: say "foo" ~~ Numeric
TimToady but pretty much anything can be *used* for a bool in Perl 6, so it doesn't much matter
jnthn Can be fixed.
p6eval rakudo 592e29: OUTPUT«Bool::False␤»
TimToady it only matters if you want of feed it to another type-based dispatch
donri in which case you can use prefix:<?> 18:07
or .so, or ~~, ... ;)
TimToady or you can bug the implementors to fix the return type :)
donri or hug them when they fix it 18:08
hugs are better than bugs
but pugs are good too
TimToady the two are not mutually exclusive
s/two/three
donri of course if you by bug mean camelia, i'm not sure which is better!
jnthn I'd love it if somebody gave me a hug every time I fixed a bug, but if they gave me a pug every time I fixed a bug my appartment would get crowded. :) 18:09
TimToady you'd have to flea
jnthn :D
Su-Shee that was very pugs punny. ;) 18:11
TimToady cringes
[Coke] ... ugh.
Su-Shee \o/ :)
jnthn TimToady: Does Foo::Bar::Baz desugaring to Foo.WHO.<Bar>.WHO.<Baz> strike you as problematic in any sense? My scribbles and thoughts on packagey stuff so far seem to point to it as being sane... :)
TimToady takes the reference to large incisors personally, having broken his front tooth (again) yesterday 18:12
jnthn I'm happy for us to realize it's wrong later down the line, but I'd rather not try implemeting at all it if it's ruled insane before I even try. :)
...oh wow, I at word order failed.
Su-Shee TimToady: ouch. :/
18:13 ymasory joined, plobsing left
TimToady maybe we should rename .WHO to .WHO'S-WHO 18:13
Su-Shee .DOCTORWHO? 18:14
diakopter .HORTONHEARSA
18:15 stkowski joined
TimToady jnthn: I don't see much problem with translating '::' to .WHO, offhand 18:15
donri minimum, we need a Dr type
jnthn TimToady: OK. I'll give it a go. :)
donri Dr.WHO #= Dr (duh!)
jnthn TimToady: Just gotta get a few other yaks shaved before I can attempt it. :) 18:16
donri nowait .WHO isn't .WHAT, what is who? :P
masak donri: I wondered that today too :) 18:17
donri: .WHO gives you a Stash of 'our'-scoped variables for a package or similar. 18:18
TimToady rakudo: 1.WHO.keys.Str
p6eval rakudo 592e29: OUTPUT«Method 'keys' not found for invocant of class 'Int'␤ in main program body at line 22:/tmp/K0DRbpeLkR␤»
TimToady ooh, bug
masak donri: (a Stash is basically a hash)
TimToady: the fact that Int.WHO is Int?
jnthn TimToady: Rakudo never really did .WHO properly so far...
TimToady yes, it should be a stash
masak submits TODO rakudobug
[Coke] .THIRDBASE #IDK 18:20
18:27 bluescreen10 left 18:33 plobsing joined 18:34 mkramer1 joined, synple joined, jaldhar left 18:35 jaldhar joined 18:37 synple left 18:38 synple joined 18:40 fisted_ left 18:42 impious joined 18:44 mj41_nb joined 18:48 fisted joined, bluescreen10 joined 18:50 vert2 left 18:51 vert2 joined
diakopter [Coke]: lol 18:57
18:59 mberends joined
masak TimToady: gist.github.com/869659 19:02
or anyone else who might be curious about Perl 6 DBC, of course. 19:03
19:05 nymacro left
[Coke] diakopter: thank. Tough room! 19:07
*thank you
19:07 zby_home_ joined
masak [Coke]: forgive me -- I smiled the first time, but that was a couple of years ago ;) 19:09
[Coke] and here I thought it was original. ah well. 19:10
masak with this crew, and the macros named .WHO, .WHAT and .WHY? not a chance :)
[Coke] challenges someone to do a parody of WHO's on first for YAPC::NA 19:11
(lightning talk)
masak ooh 19:12
explaining the Perl 6 metamodel, of course.
"Then you do $fido.WHO" "What?" "No, .WHAT was for debugging." 19:13
19:13 synple left, cogno joined, xinming_ is now known as xinming 19:16 MayDaniel joined 19:17 mkramer1 left 19:22 cogno left 19:23 cogno joined 19:28 risou_ left
TimToady masak: "all the appropriate" is the set of assertions attach to the object's current class or any of its parents, so B's set of assertions is smaller than C's 19:37
you can't enforce constraints on pieces of an object that don't exist, obviously 19:38
19:38 Holy_Cow left
TimToady it's a little odd to be using PRE to enforce argument validation when it's primarily for looking at the object's current state 19:39
19:39 hercynium joined 19:44 MayDaniel left 19:48 plobsing left 19:49 cogno left 19:51 Rotwang joined 19:53 cogno joined 19:58 Chillance joined
masak TimToady: "B's set of assertions is smaller than C's" -- did you mean some other set of letters? both B and C inherit from A, but not one from the other. 20:04
oh, and I know the example was contrived. I'm just assuming that a more realistic example will have similar problems. 20:06
20:16 plobsing joined
TimToady in that case neither B nor C do the other's assertions, but they share A's assertions 20:18
masak right. that was the intent. 20:19
TimToady well, that's the only thing that makes sense
masak now, how can B.foo and C.foo share A.foo's assertion when they don't share lexpads/signatures?
I don't understand.
TimToady it has nothing to do with either lexpads or signatures 20:20
masak A.foo's pre contains an $x.
TimToady that's why PRE is supposed to be testing the object, not the parameters 20:21
but yes, in general it doesn't make sense to be testing lexicals
masak I understand, but given that one can write like this, what does it *do*? 20:22
TimToady blow up, one would hope
masak because B.foo doesn't contain an $x?
TimToady because the lexical scope of $x is missing 20:23
masak I've now established conclusively that I don't yet grok PRE/POST. they're weirder than I thought. 20:24
and to the extent that I understand, it doesn't sound terribly sane. 20:25
TimToady they are for testing object invariants; the object is the only thing you can guarantee is there
masak right. so, testing against attributes. gotcha.
but PRE/POST outside of objects are more general than that. they can test loop invariants, for example.
moritz_ /me thought that PRE primarily tested arguments and object state, and POST mostly object state and return values 20:26
TimToady how can the argument be tested if the method itself hasn't been called yet?
masak the method hasn't been called? where does the spec say that?
TimToady or if some other subclass's method with a different sig has been called 20:27
masak 'at every block entry'.
TimToady S04:1464
step 5, "call the method call itself"
masak fairynuff. 20:28
20:28 tyatpi_ left
TimToady of course, defining methods with conflicting signatures is asking for trouble to begin with 20:29
flussence_ std: sub foo($match where Regex|Str) { ... } # any way I can improve on that, or is the | the best I can do? 20:33
p6eval std 4608239: OUTPUT«Potential difficulties:␤ $match is declared but not used at /tmp/Jh9WAkP7fa line 1:␤------> sub foo(⏏$match where Regex|Str) { ... } # any wa␤ok 00:01 123m␤»
flussence_ well, minus the error part.
Tene flussence_: depends on the details of what you want to do. 20:34
phenny Tene: 12 Mar 23:49Z <jnthn> tell Tene See 82145f5 in nqp reop, and gist.github.com/867713
Tene: 12 Mar 23:49Z <jnthn> tell Tene will be able to optimize it a bit more in the future too, but this should serve as a decent start.
Tene flussence_: you could define a pair of multis, one for each type. 20:35
flussence_ $match ends up in a m[<$match>] thing somewhere and that's about it.
(and I'm not sure if it'd even work with a Str, this is ported from perl5...) 20:36
github.com/flussence/Text-Tabs-Wra...rap.pm#L40
I'm trying to put those globals into the function as named params, basically
20:36 y3llow_ joined 20:37 pothos_ joined
flussence_ where $break becomes :$match and so on 20:37
20:38 pothos left, pothos_ is now known as pothos, y3llow left, y3llow_ is now known as y3llow
masak TimToady: sometimes I dream of a 'use Liskov;' pragma, which enforces things like contravariant signatures and covariant return declarations... 20:39
moritz_ be Liskov; 20:45
20:46 fisted left
Tene rakudo: my $s = '\d'; my $m = '3foo\d' ~~ m/$s/; say $m; 20:51
p6eval rakudo 592e29: OUTPUT«\d␤»
Tene rakudo: my $s = '\d'; my $m = '3foo\d' ~~ m/<$s>/; say $m;
p6eval rakudo 592e29: OUTPUT«3␤»
Tene flussence_: which of these behaviours do you want?
If someone passes in the *text* '\s+', should that be interpreted as literal text to match, or as a regex? 20:52
20:53 fisted joined
Tene flussence_: If you want it interpreted as a string literal, my first pass would be a multi variant for non-regex that wraps it in a regex and passes it back in. 20:53
multi sub foo(Regex $break) { ... }; multi sub foo($break as str) { foo(m/$break/) }; 20:54
oslt
That's a bad option if you have multiple parameters that can vary like that, though. 20:55
donri what does 'as' do?
Tene also, if you *want* it to be interpreted as a regex, then you *don't* want to do that, as you'd just call it the same way regardless.
donri: casting
donri or is it fictional?
20:55 coldhead joined
Tene rakudo: sub foo($n) { say $n.WHAT }; sub bar($n as Str) { say $n.WHAT }; foo(1); bar(1); 20:56
p6eval rakudo 592e29: OUTPUT«Int()␤Str()␤»
20:56 gdey left
donri Tene: what does it do for multis if the cast is not possible? 20:57
simply not match that variant?
jnthn as-ability doesn't influence the dispatch 20:58
It's part of the signature bind after we decide what to call.
donri by design?
ah
hm how the heck *do* you check for castability?
jnthn I don't think the spec says that it implies a constraint of any kind.
donri rakudo: say 1.can(Str), 1.does(Str) 20:59
jnthn Well, casting to T is just a method clal .T
p6eval rakudo 592e29: OUTPUT«0␤»
jnthn So it's just .can
donri rakudo: say 1.can(Str), 1.does(Str)
p6eval rakudo 592e29: OUTPUT«0␤»
donri rakudo: say 1.can(Str) # argh
20:59 mberends left
p6eval rakudo 592e29: OUTPUT«␤» 20:59
donri rakudo: say 1.can(Str).perl 21:00
p6eval rakudo 592e29: OUTPUT«Nil␤»
donri jnthn: ^
flussence_ (actually, I think I'll just make this take a Regex and do something about it if someone complains...) 21:01
Tene rakudo: say 1.can('Str')
p6eval rakudo 592e29: OUTPUT«Str␤»
jnthn rakudo: say ?1.can('Str') 21:02
p6eval rakudo 592e29: OUTPUT«Bool::True␤»
donri oh, duh
jnthn rakudo: say ?1.can('Lolcat')
p6eval rakudo 592e29: OUTPUT«Bool::False␤»
jnthn The return value of .can is...hazy. :)
21:02 mberends joined
jnthn It's meant to do everything. :) 21:02
donri we discussed it earlier 21:03
i forget duck typing is string programming *wink wink*
21:03 Mowah left 21:05 tyatpi_ joined 21:10 ymasory left 21:11 fisted left 21:24 MayDaniel joined 21:38 cogno left 21:39 bluescreen10 left, kaare_ left
masak so the PRE in a method is triggered after it's made clear that the method's signature matches, but before the signature's parameters have been bound...? 21:40
21:53 plainhao left
sorear good * #perl6 21:57
masak: the initial steps of method binding don't seem to make a whole lot of sense; I'm already struggling with default values
sub foo($x, $y = EXPR, $z) # EXPR needs to see $x but not $z 21:58
in particular, sub foo($foo = $*BAR) { my $*BAR; ... }
jnthn: still here? 22:00
masak sorear: that last example surprises me too. 22:02
sorear: in general nowadays, I tend to see the signature as declarations that are part of the routine body's scope. it's not exactly true, but it helps in understanding things. 22:03
sorear: i.e. my $x; my $y = EXPR; my $z; # EXPR sees $x but not $z
jnthn sorear: yes
sorear jnthn: Your .WHO model is one of the ones I tried and rejected for Niecza. I was having many issues, especially with our constants (Bool::True) 22:04
jnthn sorear: Why didn't it work out?
sorear I'd like to know how you made it work, because it's more elegant than what I settled on :)
jnthn I only made it work in my brane so far. :P
Tene masak: if the PRE is before signature binding, what does the PRE have access to to make decisions?
jnthn Not sure I see the issue with constants off hand...I may be missing something. What was the specific issue there? 22:05
If you can remember, anyways. :)
sorear That's always the kicker...
Tene ahh, PRE/POST are for methods, and have access to the invocant.
22:07 wallberg joined
sorear looks through the git log starting at d75ad08 trying to remember 22:07
22:08 justatheory left
Tene S06 has some confusing wording, saying that the precondition is met "if "all" of the parent classes' preconditions are met" 22:08
But this seems to be talking about preconditions for methods, not for classes. 22:09
22:09 mtk left
Tene Maybe it just means "preconditions for methods of the same name in parent classes"? 22:09
sorear masak: you doing DBC... in yapsi ?
22:09 MayDaniel left
masak sorear: not yet. but I'm looking ahead, trying to understand things. 22:10
sorear: will soon be doing some phasers in Yapsi.
sorear masak: classes, though?
masak classes are still some time away :) 22:11
want to get subs sorted first.
but my plan is to do classes in a fairly p5-y, Moose-y way, with hashes as reprs.
tadzik DBC? 22:12
Tene design-by-contract
masak tadzik: "Design by "... what Tene said.
sorear masak: I think the only implementation that doesn't do that is nqpnet
masak tadzik: introduced by Bertrand Meyer and Eiffel, IIUC.
Tene (I just barely figured it out; earlier when he was talking about it, I thought it was something related to DBI, and was very confused)
sorear niecza, rakudo, and alpha certainly do.
tadzik yeah, I think so
sorear pugs: class A { has $!x; method foo() { $!x++ } } 22:13
p6eval pugs: ( no output )
masak sorear: eh? surely Rakudo uses opaque objects?
sorear pugs: class A { has $!x; method foo() { $!x++ } }; class B { has $!x; method bar() { $!x++ } }; my $k = B.new; say B.foo; say B.bar
p6eval pugs: OUTPUT«*** No such method in class B: "&foo"␤ at /tmp/_AQMHtSSsb line 1, column 110-115␤»
jnthn It's opaque, but it's are still very hashish.
sorear pugs: class A { has $!x; method foo() { $!x++ } }; class B { has $!x; method bar() { $!x++ } }; my $k = B.new; say $k.foo; say $k.bar
p6eval pugs: OUTPUT«*** No such method in class B: "&foo"␤ at /tmp/fqd4QNA4v4 line 1, column 110-116␤»
sorear pugs: class A { has $!x; method foo() { $!x++ } }; class B is A { has $!x; method bar() { $!x++ } }; my $k = B.new; say $k.foo; say $k.bar
p6eval pugs: OUTPUT«0␤1␤»
sorear rakudo: class A { has $!x; method foo() { $!x++ } }; class B is A { has $!x; method bar() { $!x++ } }; my $k = B.new; say $k.foo; say $k.bar
p6eval rakudo 592e29: OUTPUT«Any()␤1␤» 22:14
sorear perl6: class A { has $!x; method foo() { $!x++ } }; class B is A { has $!x; method bar() { $!x++ } }; my $k = B.new; say $k.foo; say $k.bar
p6eval rakudo 592e29, niecza v3-72-g543ebb3: OUTPUT«Any()␤1␤»
..pugs: OUTPUT«0␤1␤»
jnthn nqp: say("alive?")
p6eval nqp: OUTPUT«alive?␤»
Tene Oh, S02 mentions PRE/POST on class blocks that are evaluated PRE and POST every method invocation in the class.
sorear I'd demo nqpnet, but it doesn't work :(
22:14 Intensity left
jnthn nqp: nqp: class A { has $!x; method foo() { $!x := $!x + 1 } }; class B is A { has $!x; method bar() { $!x := $!x + 1 } }; my $k = B.new; say $k.foo; say $k.bar 22:15
p6eval nqp: OUTPUT«Confused at line 1, near "nqp: class"␤current instr.: 'nqp;HLL;Grammar;panic' pc 17577 (gen/hllgrammar-grammar.pir:5028)␤»
jnthn nqp: class A { has $!x; method foo() { $!x := $!x + 1 } }; class B is A { has $!x; method bar() { $!x := $!x + 1 } }; my $k = B.new; say $k.foo; say $k.bar
p6eval nqp: OUTPUT«Assignment ("=") not supported in NQP, use ":=" instead at line 1, near " B.new; sa"␤current instr.: 'nqp;HLL;Grammar;panic' pc 17577 (gen/hllgrammar-grammar.pir:5028)␤»
jnthn nqp: class A { has $!x; method foo() { $!x := $!x + 1 } }; class B is A { has $!x; method bar() { $!x := $!x + 1 } }; my $k := B.new; say $k.foo; say $k.bar
p6eval nqp: OUTPUT«Confused at line 1, near "say $k.foo"␤current instr.: 'nqp;HLL;Grammar;panic' pc 17577 (gen/hllgrammar-grammar.pir:5028)␤»
jnthn heh
sorear say()
jnthn nqp: class A { has $!x; method foo() { $!x := $!x + 1 } }; class B is A { has $!x; method bar() { $!x := $!x + 1 } }; my $k := B.new; say($k.foo); say($k.bar)
p6eval nqp: OUTPUT«Multiple Dispatch: No suitable candidate found for 'add_int', with signature 'PIP->P'␤current instr.: 'nqp;A;foo' pc 284 (EVAL_1:20683868)␤»
jnthn blech :) 22:16
sorear nqp: my $x; say($x // 0)
p6eval nqp: OUTPUT«0␤»
22:16 whiteknight joined
jnthn nqp: class A { has $!x; method foo() { $!x := ($!x // 0) + 1 } }; class B is A { has $!x; method bar() { $!x := ($!x // 0) + 1 } }; my $k := B.new; say($k.foo); say($k.bar) 22:16
p6eval nqp: OUTPUT«1␤1␤»
jnthn There ya go :)
sorear nqpnet: say("Hello, world")
jnthn nqpnet: say("broken?") 22:17
aww
p6eval nqpnet: OUTPUT«(timeout)access in find_method('compile')␤current instr.: 'main' pc 91202 (gen_grammar.pir:1151)␤make: *** [NQPSetting.dll] Error 1␤»
nqpnet: OUTPUT«(timeout)»
22:17 mtk joined
Tene nqpnet: say ?(P == NP) 22:17
p6eval nqpnet: OUTPUT«(timeout)»
Tene Very clever, nqpnet.
sorear star: say "Hello world" 22:18
p6eval star 2010.09: ( no output )
sorear yapsi: say "Hello world"
p6eval yapsi: OUTPUT«===SORRY!===␤Unable to find module 'Yapsi' in the @*INC directories.␤(@*INC contains:␤ lib␤ /home/p6eval/.perl6/lib␤ /home/p6eval//p2/lib/parrot/3.1.0-devel/languages/perl6/lib␤ .)␤»
jnthn nqpnet does same as nqp (phew!)
1
:)
(The same code worked too.) 22:19
jnthn refrains from trying nqpjvm :)
22:19 zby_home_ left 22:27 rgrau joined 22:29 gdey joined 22:31 justatheory joined, mj41_nb left 22:35 hercynium left 22:39 stkowski left 22:48 fisted joined 22:55 fisted left 23:05 gfldex joined
sorear jnthn: there's no nqpjvm on p6eval 23:09
jnthn sorear: I know, I meant that I could try it locally.
It just won't handle running that example yet, though. 23:10
23:10 justatheory left
sorear Why not? 23:11
jnthn sorear: Last I checked, it didn't compiler NQPClassHOW yet. 23:14
*compile
Which is a pre-req for having working classes ;)
masak but won't they revolt? 23:26
masak hides
sjohnson heh 23:27
jnthn gives masak no marx for that pun :P 23:28
masak it was a revolting pun, I know... 23:29
'night, #perl6. 23:31
23:31 masak left 23:35 wallberg left 23:36 fisted joined 23:40 rgrau left 23:41 fisted left, aloha left 23:42 fisted joined 23:44 arnsholt left 23:46 Rotwang left 23:50 fisted left 23:55 justatheory joined
dalek p/ctmo-no-p6regex.pir: aa87ead | jonathan++ | src/Regex/P6Regex/Grammar.pm:
Need to still use the HLL library; was missed when removing the P6Regex PIR file.
23:58
p/ctmo-no-p6regex.pir: 1eb4e1b | jonathan++ | build/Makefile.in:
Another round of Makefile changes to work towards getting things working again after removing P6Regex.pir.
p/ctmo-no-p6regex.pir: 9ace6d6 | jonathan++ | src/Regex/P6Regex/ (2 files):
Need to use block form of packages when there's multiple in a file.
p/ctmo-no-p6regex.pir: d014f94 | jonathan++ | src/Regex/P6Regex/Compiler.pm:
Work around a MAIN bug.
p/ctmo-no-p6regex.pir: 4460cea | jonathan++ | src/Regex/P6Regex/Compiler.pm:
Move regex compiler init to the right place; now all tests pass that pass in the ctmo branch.
p/ctmo-no-p6regex.pir: 9cdb417 | jonathan++ | src/NQP/Actions.pm:
Fix MAIN bug.
p/ctmo-no-p6regex.pir: e3036b0 | jonathan++ | src/stage0/ (6 files):
Update bootstrap with MAIN fix and P6Regex.pir gone.
p/ctmo-no-p6regex.pir: 749d34c | jonathan++ | src/Regex/P6Regex/Compiler.pm:
Toss workaround for MAIN bug.
23:59 aloha joined