Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2010-04-26

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:07 ruoso joined #perl6
00:17 Spreadsheet_ left #perl6
00:17 colomon joined #perl6
00:22 yinyin joined #perl6
00:33 REPLeffect joined #perl6
00:36 k23z__ joined #perl6
00:39 pugssvn r30477 | colomon++ | [t/spec] Add more tests using the base argument.
00:42 sundar joined #perl6
01:04 CokeBot9000 question - P6Role doesn't implement HOW; it's parent is Role, which doesn't implement HOW either. How does .HOW work on a p6role?
01:05 CokeBot9000 *its parent
01:05 CokeBot9000 I suspect the answer used to be "by shoving a HOW method into a namespace somewhere"... which doesn't work after the fix for TT #389 landed.
01:06 sorear .HOW is theoretically supposed to be special syntax, not a method
01:06 sorear a predefined macro or grammar rule
01:06 CokeBot9000 sorear: I'm talking about rakudo, not "the spec"
01:07 takadonet left #perl6
01:07 CokeBot9000 (I'm pretty sure that rakudo is treating all the macros as methods atm for convenience.)
01:10 * CokeBot9000 guesses src/class/Role.pir ?
01:11 CokeBot9000 no, that's Perl6Role, no P6Role.
01:16 CokeBot9000 phenny: hepl?
01:16 CokeBot9000 phenny: help?
01:16 phenny CokeBot9000: Hi, I'm a bot. Say ".commands" to me in private for a list of my commands, or see http://inamidst.com/phenny/ for more general details. My owner is sbp.
01:28 CokeBot9000 msg jnthn : immutable strings branch is failing not because of immutable strings, but because of TT #389 - reverse parrot r45827 and it builds fine; something seems to be relying on the old NS behavior. Has something to do with how 'HOW' is supposed to end up a method on the p6role PMC's parent.
01:29 CokeBot9000 tell jnthn : immutable strings branch is failing not because of immutable strings, but because of TT #389 - reverse parrot r45827 and it builds fine; something seems to be relying on the old NS behavior. Has something to do with how 'HOW' is supposed to end up a method on the p6role PMC's parent.
01:29 CokeBot9000 phenny: tell jnthn immutable strings branch is failing not because of immutable strings, but because of TT #389 - reverse parrot r45827 and it builds fine; something seems to be relying on the old NS behavior. Has something to do with how 'HOW' is supposed to end up a method on the p6role PMC's parent.
01:29 phenny CokeBot9000: I'll pass that on when jnthn is around.
01:29 CokeBot9000 (ugh)
01:29 CokeBot9000 Sorry about the repeat-o-spam. =-)
01:35 hicx174 joined #perl6
01:46 alester joined #perl6
01:52 colomon rakudo: say Int ~~ Cool
01:52 p6eval rakudo e393c7: OUTPUT«1␤»
01:56 diakopter rakudo: say Nil ~~ Cool
01:56 p6eval rakudo e393c7: OUTPUT«1␤»
01:58 Psyche^ joined #perl6
02:07 JimmyZ joined #perl6
02:09 ruoso joined #perl6
02:30 ruoso joined #perl6
02:47 meppl joined #perl6
02:52 cosimo joined #perl6
02:56 JimmyZ joined #perl6
03:00 bradb joined #perl6
03:21 SmokeMachine joined #perl6
03:40 meppel joined #perl6
04:03 fridim joined #perl6
04:14 orafu joined #perl6
04:26 s1n joined #perl6
05:02 ReiniUrban joined #perl6
05:15 Dunearhp joined #perl6
05:16 diakopter hi
05:16 molaf joined #perl6
05:18 yinyin joined #perl6
05:34 sorear hello
05:36 sorear diakopter: CLR uses a single unified namespace, right?  So DateTime in Perl6-land is identical with DateTime in C# and Java?
05:52 uniejo joined #perl6
06:02 eiro left #perl6
06:20 am0c joined #perl6
06:40 moritz_ good morning
06:40 sorear indeed
06:41 yves__ joined #perl6
06:42 moritz_ I've just checked my log files, and nearly fell over - typically 300 to 800 visitors per day, yesterday 8800
06:42 moritz_ mostly due to http://www.reddit.com/r/programming/comments/bvtbt/you_are_good_enough_contributing_to_a_compiler/ it seems
06:44 sorear Personally I thought compilers being easy was self-evident
06:44 sorear moritz++ being better at psychology
06:47 viklund joined #perl6
06:47 sorear nqp: 0 ?? say("Oops!") !! say("Good")
06:47 p6eval nqp: OUTPUT«Good␤»
06:47 sorear hello viklund
06:48 viklund hello
06:49 moritz_ hi
06:58 sorear nqp: my %x; %x<a> = 1; for %x { say($_); }
06:58 p6eval nqp: OUTPUT«Assignment ("=") not supported in NQP, use ":=" instead at line 1, near " 1; for %x"␤current instr.: 'parrot;HLL;Grammar;panic' pc 500 (src/cheats/hll-grammar.pir:197)␤»
06:58 sorear nqp: my %x; %x<a> := 1; for %x { say($_); }
06:58 p6eval nqp: OUTPUT«a␤»
06:58 sorear rakudo: my %x; %x<a> = 1; for %x { say($_); }
06:58 p6eval rakudo e393c7: OUTPUT«a  1␤␤»
06:58 sorear :/
06:59 sorear use of hashes in interlanguage APIs considered ridiculous
06:59 JimmyZ joined #perl6
06:59 sorear Hello JimmyZ
06:59 JimmyZ hello
07:00 moritz_ so nqp just iterates over the keys?
07:00 sorear well, it's a function of the PMC
07:00 yves__ joined #perl6
07:00 sorear parrot;Hash just iterates over the keys
07:00 sorear perl6;Hash iterates over both
07:00 sorear you have to know what language %foo came from if you want to iterate over it
07:02 moritz_ maybe it's saner to copy foreign hashes onto Perl 6 hashes before using
07:03 sorear That doesn't help - the only way to copy hashes is to iterate over them
07:03 moritz_ oh.
07:03 sorear The current HLLCompiler interface is specced to return a hash of exports
07:04 sorear rakudo: my %x; %x<a> = 1; for %x { say(~$_); }
07:04 p6eval rakudo e393c7: OUTPUT«a  1␤␤»
07:07 sorear rakudo: my %x; %x<a> = 1; for %x { say(pir::isa__IP($_,'Pair') ? $_.key : $_); }
07:07 p6eval rakudo e393c7: OUTPUT«Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
07:07 sorear rakudo: my %x; %x<a> = 1; for %x { say(pir::isa__IP($_,'Pair') ?? $_.key !! $_); }
07:07 p6eval rakudo e393c7: OUTPUT«a  1␤␤»
07:08 sorear rakudo: my %x; %x<a> = 1; for %x { say(pir::isa__ips($_,'Pair') ?? $_.key !! $_); }
07:08 p6eval rakudo e393c7: OUTPUT«a  1␤␤»
07:09 XaeroOne joined #perl6
07:10 spinclad nqp: my %x; %x<a> := 1; for %x.keys { say($_, "\t", %x{$_}); }
07:10 p6eval nqp: OUTPUT«Method 'keys' not found for invocant of class 'Hash'␤current instr.: '_block11' pc 0 (EVAL_1:5)␤»
07:10 spinclad rakudo: my %x; %x<a> = 1; for %x.keys { say($_, "\t", %x{$_}); }
07:10 p6eval rakudo e393c7: OUTPUT«a  1␤»
07:11 sorear ok, easy fix: I'm going to respec HLLCompiler to always return a hash implementation that iterates keys
07:11 sorear for export methods.
07:12 sorear nqp: pir::undef // 1
07:12 p6eval nqp: OUTPUT«error:imcc:syntax error, unexpected '\n', expecting '('␤     in file 'EVAL_1' line 5␤error:imcc:syntax error, unexpected '\n'␤   in file 'EVAL_1' line 6␤Could not find non-existent sub undef␤current instr.: '_block11' pc 0 (EVAL_1:5)␤»
07:12 sorear nqp: pir::undef__p() // 1
07:12 p6eval nqp: OUTPUT«error:imcc:syntax error, unexpected PREG, expecting '(' ('$P14')␤    in file 'EVAL_1' line 5␤Could not find non-existent sub undef␤current instr.: '_block11' pc 0 (EVAL_1:5)␤»
07:12 sorear nqp: pir::null__p() // 1
07:12 p6eval nqp:  ( no output )
07:12 sorear nqp: say(pir::null__p() // 1)
07:12 p6eval nqp: OUTPUT«1␤»
07:14 spinclad nqp could at least get a .keys method added to its hashes in util/, i suppose; then iterating .keys would be common...
07:15 sorear no
07:15 spinclad though i don't know what sort of thing parrot;Hash is, and how that constrains you
07:16 sorear nqp doesn't have its own hashes
07:16 sorear say() is basically the extent of the NQP RTS
07:16 sorear say(), ok(), and plan()
07:17 Xaero joined #perl6
07:17 spinclad are you constrained from adding to those in util/ ?
07:19 sorear there is no util/
07:19 sorear there is only src/cheats/nqp-builtins.pir
07:19 spinclad i misremembered then, sry
07:20 spinclad check with parrot's Plumage project, i thought it was being more flexible about a RTLib for NQP code
07:21 japhb *rez*
07:21 japhb Huhwhat?
07:21 spinclad hi japhb
07:21 japhb o/
07:21 spinclad Plumage is your project, yes
07:21 japhb Ah, asking about runtime libraries for NQP?
07:21 spinclad ?
07:22 japhb spinclad, yes
07:22 spinclad yes
07:22 japhb There are a couple different offerings.
07:23 japhb Plumage includes Plumage::NQPUtil
07:23 japhb There's also Kakapo.
07:23 japhb NQP can build hashes with a tiny bit of help by tricking the calling conventions into doing all the work.
07:24 japhb Extracting keys and values takes only slightly bigger chunks of code.
07:24 XaeroOne joined #perl6
07:24 iblechbot joined #perl6
07:25 japhb http://gitorious.org/parrot-plumage/parrot-plumage/trees/master/src/lib/Plumage/NQPUtil.nqp
07:25 spinclad is a parrot;Hash the sort of thing you can 'augment' (by some means) with new methods?  eg .keys, .kv
07:26 japhb spinclad, yup.
07:26 japhb Just do:
07:27 japhb module Hash {
07:27 japhb method foo () { ... }
07:27 japhb method bar () { ... }
07:27 japhb }
07:27 japhb And now Parrot Hashes have two new methods.  :-)
07:29 spinclad sorear, ^^   would this help?
07:31 spinclad nqp: module Hash { method keys () { say('hi'); }; }; my %h; %h<a> := 1; for %h.keys { say('what?'); }
07:31 p6eval nqp: OUTPUT«hi␤get_iter() not implemented in class 'Integer'␤current instr.: '_block11' pc 0 (EVAL_1:5)␤»
07:32 spinclad that looks about the right error for this stage of mockup, anyway
07:33 japhb nqp: module Hash { method keys () { say('hi'); }; }; my %h; %h<a> := 1; %h.keys();
07:33 p6eval nqp: OUTPUT«hi␤»
07:33 japhb Your %h.keys wasn't returning anything iterable.  :-)
07:33 spinclad nqp: module Hash { method keys () { say('hi'); return [1, 2]; }; }; my %h; %h<a> := 1; for %h.keys { say('what?'); }
07:33 p6eval nqp: OUTPUT«hi␤what?␤what?␤»
07:33 spinclad ha! there she be!
07:34 japhb The real version of that is really simple:
07:34 * japhb hacks your example ...
07:35 japhb nqp: module Hash { method keys () { my @keys; for self { @keys.push($_.key); } @keys; }; }; my %h; %h<a> := 1; for %h.keys { say('what?'); }
07:35 p6eval nqp: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 1␤current instr.: 'parrot;Regex;Cursor;FAILGOAL' pc 1664 (src/Regex/Cursor-builtins.pir:179)␤»
07:35 sorear spinclad: Absolutely not.
07:35 japhb nqp: module Hash { method keys () { my @keys; for self { @keys.push($_.key); }; @keys; }; }; my %h; %h<a> := 1; for %h.keys { say('what?'); }
07:35 p6eval nqp: OUTPUT«what?␤»
07:35 sorear spinclad: My problem is not NQP.
07:35 japhb nqp: module Hash { method keys () { my @keys; for self { @keys.push($_.key); }; @keys; }; }; my %h; %h<a> := 1; for %h.keys { say($_); }
07:35 p6eval nqp: OUTPUT«a␤»
07:35 sorear spinclad: My problem is that iterating over hashes is undefined behavior in Parrot.
07:36 japhb No its not.
07:36 spinclad (as long as you get every key exactly once...)?
07:36 japhb (Well, I suppose, order is undefined, but that's what hashes do)
07:37 japhb iterating over a hash gives you key/value "pair-like" objects, each with two methods: .key and .value.
07:37 sorear japhb: Except that's not true.
07:37 sorear Iterating over a Rakudo hash, sure
07:37 sorear Try that with a native Parrot hash and you'll just get the keys, not pair objects.
07:38 sorear Try that with any other language and there's no telling what you'll get.
07:38 sorear There's no telling you'll get anything at all, because the PDDs don't actually specify how you remove values from iterators
07:39 spinclad nqp: my %h; %h<a> = 1; for %h { say(%_.key); say(%_.value); }
07:39 japhb sorear, talk to bacek.  As I recall, this was his refactoring.
07:39 p6eval nqp: OUTPUT«Assignment ("=") not supported in NQP, use ":=" instead at line 1, near " 1; for %h"␤current instr.: 'parrot;HLL;Grammar;panic' pc 500 (src/cheats/hll-grammar.pir:197)␤»
07:39 spinclad nqp: my %h; %h<a> := 1; for %h { say(%_.key); say(%_.value); }
07:39 p6eval nqp: OUTPUT«Symbol '%_' not predeclared in <anonymous>␤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 137 (compilers/pct/src/PCT/HLLCompiler.pir:101)␤»
07:39 japhb $_
07:39 spinclad nqp: my %h; %h<a> := 1; for %h { say($_.key); say($_.value); }
07:39 p6eval nqp: OUTPUT«a␤1␤»
07:39 sorear japhb: I did.  He's the one who told me that the iterator interface was unspecified.
07:40 spinclad yes, the pair prints as its key
07:40 japhb Sheesh.  He's the one IIRC who pushed it through, because of the performance difference!
07:40 spinclad sorear: that's why it looked like you were only getting the keys
07:41 japhb Yes, the pairs stringify as a key, for backwards compatibility.
07:41 japhb nqp: my %h; %h<a> := 1; for %h { say($_.key); say($_.value); say(~$_);}
07:41 p6eval nqp: OUTPUT«a␤1␤a␤»
07:44 spinclad thanks, japhb. i think i've done what i can here;  /me -> bed &
07:44 japhb spinclad, np, sleep well.
08:02 pencilk joined #perl6
08:17 kaare joined #perl6
08:29 dakkar joined #perl6
08:35 mdxi joined #perl6
08:35 clintongormley joined #perl6
08:37 sorear ok, coding done, now I need to find a good way to test this
08:39 * sorear make src/gen/perl6.pbc  #is there a better way?
08:40 arnsholt If you've edited parts of the source, just say make
08:40 arnsholt That will compile all the modified files and the files that depend on them
08:40 sorear Yes
08:40 sorear But that takes a long time
08:40 arnsholt If you've added stuff, you'll have to tweak buils/Makefile.in
08:40 sorear about 15 minutes
08:40 sorear because it has to recompile the entire setting
08:40 Psyche^ joined #perl6
08:41 arnsholt Yeah, that's an unfortunate side-effect =)
08:41 sorear but I'm hacking on the compiler proper, and I want rapid turnaround
08:41 arnsholt Compiler proper?
08:41 sorear src/Perl6/**
08:42 sorear I have a first implementation of use :from<perl5> in Perl6::Module::Loader.  I'm certain it won't work.
08:42 jonasbn joined #perl6
08:45 arnsholt Yeah, if you're hacking on that you'll probably have to recompile the whole shebang, due to how the build process works
08:45 sorear Which is why I want to only build the stage1 compiler.
08:45 sorear I don't think I actually need the setting to play with use
08:46 arnsholt Well, you need to build the whole thing, to make sure the generated compiler is able to compile itself, and so on
08:46 sorear there, changed Loader, rebuilt stage1 in - 15 seconds
08:46 arnsholt (Compilers are a bit nasty like that)
08:46 sorear arnsholt: I do that AFTER I have the stage1 working
08:46 arnsholt Ah, right
08:49 sorear and good, since it doesn't work
08:50 sorear What does stringifying a match do?
08:51 mathw gives you the matched text, I believe
09:01 sorear huh, our current grammar requires no space in use CGI:from<perl5>;
09:02 vorner joined #perl6
09:10 moritz_ I think the :from<perl5> is part of the name
09:15 Tene at's right.  Part of the name, no space allowed.
09:27 jnthn o/
09:27 phenny jnthn: 01:29Z <CokeBot9000> tell jnthn immutable strings branch is failing not because of immutable strings, but because of TT #389 - reverse parrot r45827 and it builds fine; something seems to be relying on the old NS behavior. Has something to do with how 'HOW' is supposed to end up a method on the p6role PMC's parent.
09:27 * jnthn half suspected that
09:27 JimmyZ jnthn: there is patch http://nopaste.snit.ch/20371
09:28 jnthn JimmyZ: Does that fix everything in Rakudo?
09:28 moritz_ this looks only half right
09:28 jnthn Or just that particular build issue?
09:30 sorear jnthn: I've managed to convince Rakudo to stub symbols for perl5
09:30 jnthn sorear: \o/
09:30 JimmyZ jnthn: Nope, I don't know how to fix setprop null access error
09:31 bbkr joined #perl6
09:31 sorear there has got to be a simpler way to do this, though
09:31 sorear I want to patch a foreign namespace into Rakudo-space
09:31 sorear but... there's no set_hll_namespace opcode
09:32 JimmyZ sorear: send request to parrot-dev maillist
09:34 avar sorear: If you need some help with perl5 guts I might be able to help.
09:34 sorear oh wait, I can just use set_hll_global
09:35 sorear avar: *laughs* I jumped on this bandwagon specifically because jnthn was asking for perl5 guts experts
09:35 sorear as of a month ago, I had no knowledge of Parrot or Perl6
09:35 sorear but it sounded fun
09:35 avar ah, so maybe not then:)
09:36 * moritz_ hopes it's still fun, at least most of it :-)
09:37 sorear it's not always fun, but it is extremely rewarding
09:41 sorear there, fixed the stupid bug that was keeping coloned modules from working
09:43 bacek sorear, (Parrot hashes) japhb was right. Iterating over Hash in parrot yields HashIteratorKey with C<key> and C<value> methods.
09:44 sorear yes
09:44 sorear I see that now
09:44 sorear and learn new things!
09:50 avar sorear: where are you working on this?
09:51 avar i.e. repo
09:51 sorear avar: local.  I don't have a PCA so I'll be submitting patches
09:52 avar Are the patches to rakudo or parrot or something else?
09:52 sorear rakudobuild memory usage seems to have gone up a bit; it's at 345 now
09:52 sorear was 261 peak immediately after chromatic++'s leakhunt
09:52 sorear avar: right now, I'm just patching rakudo
09:53 sorear I've already had the necessary Parrot patch applied
09:53 sorear (both figures MiB)
09:58 sorear > use Text::LevenshteinXS:from<perl5>; say distance("apple", "ogle")
09:58 sorear 3
09:59 sorear in rakudo master + my working patch
09:59 jnthn oh wow!
09:59 jnthn sorear++
10:00 sorear I've got a couple infelicities left on the Rakudo side - foreign import is only supported for subs, and it's not possible to make qualified references to non-imported modules (Tk API needs this)
10:01 sorear OO modules won't currently work due to a design decision I reversed while implementing the Rakudo stub and haven't propagated to blizkost yet
10:01 jnthn OK.
10:01 masak joined #perl6
10:02 sorear hey masak
10:02 avar sorear: do you have a branch of github? I'd like to monitor it and maybe send patches:)
10:02 masak oh hai
10:02 phenny masak: 25 Apr 16:40Z <colomon> tell masak Good catch!
10:02 masak colomon: once bitten... :P
10:02 avar s/of/on/
10:04 jnthn yayitsmasakonmonday!
10:07 pjcj joined #perl6
10:07 sorear so, who wants to look over http://pastie.org/935206
10:07 masak got a comment from chip on an old blog post of mine: http://use.perl.org/comments.pl?sid=44169&amp;cid=71922
10:09 sorear masak: you just missed it, I have use Module:from<perl5> working in rakudo master now \o/
10:09 masak sorear++ \o/
10:09 masak sorear: that's awesome!
10:10 masak sorear: is there a correspondingly awesome use case yet? something like a bit of code pulling in DBI or something?
10:10 JimmyZ sigh, GFW blocked pastie.org
10:10 IllvilJa joined #perl6
10:11 masak hugme: hug JimmyZ
10:11 * hugme hugs JimmyZ
10:12 masak JimmyZ: pastie.org contains petty-borgeois propaganda! it must be resisted!
10:12 masak :P
10:15 JimmyZ use Java:from<java>
10:16 masak JimmyZ: that'll have to wait until we can import grammar mods :)
10:16 jnthn use YourGrandfathersParentheses:from<lisp>;
10:16 masak 'from a more noble age...'
10:21 IllvilJa \action \o
10:22 * IllvilJa rereads docs on how to use 'action' in my IRC client...
10:22 sorear masak: Well, that doesn't work yet :/
10:22 sorear also, "SCALAR" is false.
10:22 sorear WTF?
10:23 masak IllvilJa: forward slash?
10:24 IllvilJa masak: I know.  Has  happened before that I write '\action' instead of '/action'.  Good way to establish a 'leet IRC image'... not!
10:25 IllvilJa Otherwise, I liked chromatic's article on the value of being civil in chats.
10:25 jnthn IllvilJa: Yeah you fail it!
10:25 jnthn oh, wait...
10:25 jnthn :-)
10:25 masak IllvilJa: whatever, n00b!
10:25 masak oh, right...
10:25 masak :)
10:26 bbkr rakudo: sub foo { my class X; return X.new; }; sub bar { my class X; return X.new; }; print foo() === bar();
10:26 p6eval rakudo e393c7: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expected␤current instr.: 'perl6;Failure;new' pc 15013 (src/builtins/Seq.pir:115)␤»
10:26 jnthn I suspect the parser should whine at you for that.
10:26 jnthn std:  sub foo { my class X; return X.new; };
10:26 p6eval std 30477: OUTPUT«ok 00:01 109m␤»
10:26 jnthn :/
10:27 jnthn std:  sub foo { class X; return X.new; };
10:27 p6eval std 30477: OUTPUT«ok 00:01 107m␤»
10:27 jnthn Heh. I thought a class decl with a ; had to be the first statement in the file?
10:27 jnthn bbkr: Anyways, use my class X { } form.
10:27 bbkr rakudo: sub foo { my class X {}; return X.new; }; sub bar { my class X {}; return X.new; }; print foo() === bar();
10:27 p6eval rakudo e393c7: OUTPUT«0»
10:28 jnthn Two different Xs. :-)
10:28 bbkr looks correct, class names are the same, but they were defined in different scopes.
10:28 jnthn *nod*
10:28 jnthn Yes, that's what I'd expect.
10:28 IllvilJa Heh. Regarding ppl complaining that Perl 6 takes over ten years to get 'ready': The hubble space telescope had it's mirror ground and polished in 1979 but the telescope itself were not launched until 1990.  And now, after 20 years of service (and 5 maintenance visits by humans) Hubble is expected to CONTINUE to do marvellous work for the next 5 to 10 years.
10:29 IllvilJa Cool stuff don't always gets completed in a fortnight.
10:29 viklund didn't the Hubble telescope take really bad pictures in the beginning as well
10:29 * araujo tests how long takes to build rakudo with his new laptoppy
10:30 * IllvilJa makes a bet it takes less than ten years...
10:30 jnthn viklund: Yes, and then they patched it.
10:30 bbkr it will take few minutes. i was building Rakudo with full spectest on netbook this weekend :)
10:31 moritz_ IllvilJa: and I think originally planned life time was < 10a, right?
10:31 arnsholt viklund: Yes. The equation describing the mirror's curvature was wrong
10:31 viklund wikipedia: "the fact that the mirror had been ground so precisely to the wrong shape led to the design of new optical components with exactly the same error but in the opposite sense"
10:31 viklund famtastoc
10:31 dalek rakudo: f6ec0aa | (Solomon Foster)++ | src/core/ (4 files):
10:31 dalek rakudo: Rework log methods for Numeric.
10:31 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/f6ec0aa6d558fc21c55a33a98b5f5d63c7de1060
10:32 arnsholt They couldn't check that it was ground correctly, but they didn't think to check the equation ^^
10:32 viklund I like the "so precisely to the wrong shape" part...
10:32 arnsholt Well, it's right. It's ground extremely precisely, according to the wrong specification =D
10:33 sorear I /now/ have use POSIX:from<perl5> working
10:33 IllvilJa moritz_: I think so.  Hopefully we can get Perl6 to get a life time like the Mars rovers: Opportunity is still rolling, lasting ca 20 times it's expected lifetime.
10:33 sorear that's a *lot* of new functionality for us to play with
10:33 moritz_ sorear++
10:34 colomon sorear++
10:34 IllvilJa (Or if it were Perl5 that happened to be like the mars rovers... manage to keep rolling loooong time after perl6 starts to be ready :-) )
10:34 JimmyZ rakudo: loop { sorear++; }
10:34 p6eval rakudo e393c7: OUTPUT«Could not find sub &sorear␤current instr.: '_block46' pc 323 (EVAL_1:142)␤»
10:34 sorear the rovers are more a case of THIS WILL NOT DIE.
10:35 JimmyZ rakudo: say say++;
10:35 p6eval rakudo e393c7: OUTPUT«␤Cannot assign to readonly value␤current instr.: '&die' pc 17354 (src/builtins/Junction.pir:393)␤»
10:35 JimmyZ rakudo: say say2++;
10:35 p6eval rakudo e393c7: OUTPUT«Could not find sub &say2␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
10:35 sorear rakudo: " rakudo++" x 50
10:36 p6eval rakudo e393c7:  ( no output )
10:36 sorear rakudo: say " rakudo++" x 50
10:36 p6eval rakudo e393c7: OUTPUT« rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++ rakudo++
10:36 p6eval ..rakudo++ ra…
10:36 sorear rakudo: say " rakudo--" x 50
10:36 p6eval rakudo e393c7: OUTPUT« rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo-- rakudo--
10:36 p6eval ..rakudo-- ra…
10:39 meppl joined #perl6
10:42 araujo 4m30.225s
10:42 araujo not bad i guess.....
10:47 masak not sure what rakudo did to deserve so much neg karma... :/
10:47 sorear it was a momentary quantum fluctuation in karma levels
10:47 * sorear wonders how hard it would be to implement psuedo packages
10:58 masak rakudo: use MONKEY_TYPING; class A {}; class B { augment class B is A {} }
10:58 p6eval rakudo e393c7: OUTPUT«Could not build C3 linearization: ambiguous hierarchy␤current instr.: 'parrot;P6metaclass;add_parent' pc 224 (runtime/parrot/library/P6object.pir:232)␤»
10:58 masak should this be allowed? is masak evil? discuss.
10:58 viklund are the two statements exclusive?
10:58 masak not at all.
10:58 cognominal :)
10:59 viklund good
10:59 jnthn You get exactly what you deserved for trying.
10:59 masak how does C3 get into it?
10:59 jnthn Hell knows
11:00 masak how do you know that I got exactly what I deserved if you don't know what caused the error? :)
11:00 jnthn Because you're doing something silly. :-)
11:00 masak now look here.
11:00 masak what I did above may be silly, but I found myself doing something quite similar in real code...
11:01 jnthn Seriously though...I suspect that it's ended up tyring to construct the class twice at the same time or something.
11:01 masak namely, add methods using 'augment class' from within the scope of a class.
11:01 masak that worked, by the way. jnthn++
11:01 jnthn I'm...surprised. :-)
11:01 jnthn Oh
11:02 cognominal rakudo: say Mu == Mu
11:02 jnthn That said:
11:02 p6eval rakudo f6ec0a: OUTPUT«No applicable candidates found to dispatch to for 'infix:<==>'. Available candidates are:␤:(Num $a, Num $b)␤:()␤:(Date $a, Date $b)␤:(Real $a, Real $b)␤:(Any $a, Any $b)␤␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
11:02 jnthn rakudo: use MONKEY_TYPING; class A {}; class B { }; augment class B is A { };
11:02 masak jnthn: it happens in this snippet: http://gist.github.com/378420
11:02 p6eval rakudo f6ec0a: OUTPUT«Could not build C3 linearization: ambiguous hierarchy␤current instr.: 'parrot;P6metaclass;add_parent' pc 224 (runtime/parrot/library/P6object.pir:232)␤»
11:02 jnthn Heh
11:02 masak (of which I'm otherwise quite proud, by the way :) )
11:02 * masak submits rakuodbug
11:02 jnthn It's nothing to do with the (peverse) nesting.
11:02 masak jnthn: good catch :)
11:03 jnthn Changing the inheritance hieraarchy in augment is just...nasty.
11:03 masak why?
11:04 jnthn Well, consider the above example. You're now multiply inheriting.
11:05 jnthn If it worked, from Any and then form A.
11:05 jnthn With Any taking precedence.
11:05 masak aye.
11:05 jnthn Also though, don't expect this to get fixed any time soon.
11:05 jnthn I'll put in a nice error saying it's not allowed to do this yet.
11:05 masak it's not a priority :)
11:05 masak jnthn++
11:05 jnthn But the deeper issue is that Parrot classes don't allow you to modify the inheritance hierarchy post-instantiation.
11:06 masak ah.
11:11 jnthn We should be moving away from those after R *.
11:11 XaeroOne joined #perl6
11:18 cognominal Rakudo closure? :)
11:27 masak Rakudo continuation...
11:33 sjohnson joined #perl6
11:33 araujo $!a , inside a class, is like a self.a equivalent?
11:35 masak $.a always goes through a method.
11:35 masak $!a always goes directly to the 'storage location'.
11:35 masak so $.a could be seen as 'third person' and $!a as 'internal'.
11:36 masak use of the former is encouraged in methods, and the latter in submethods, IIUC.
11:37 moritz_ I'd put it another way
11:37 moritz_ whenever you want to use the external API from within a calls, you use $.a
11:37 moritz_ whenever you want raw storage access (for example for writing) you use $!a
11:38 moritz_ btw completely off-topic, but very hilarious: http://www.csua.berkeley.edu/~ranga/humor/500_mile_email.txt
11:39 moritz_ actually when I read it, I suspected something similar to the actual problem described later on
11:42 IllvilJa When updating my rakudo source from git and then running configure with the flag to update and rebuild parrot from SVN (when needed) I sometimes run into the situation that the parrot build fails.  Only workaround is to delete entire parrot subdir and redo the parrot generation (which the works).
11:42 IllvilJa Is it just me or does someone else run into this at times?
11:43 IllvilJa (I mean, the workaround does work, but it is inelegant)
11:43 moritz_ running 'make realclean' in the parrot dir should also help
11:43 IllvilJa moritz_: txh for tip
11:43 moritz_ I have a different setup, where I have a git clone of parrot in the parrot/ dir
11:43 IllvilJa Aha.
11:44 moritz_ I usually use 'git clean -xdf' to remove all files that are not checked in
11:44 moritz_ that guarantues a clean building environment (but if you have patches lying around, it also deletes those)
11:45 moritz_ so it's not a recommened setup, unless you know exactly what you're doing
11:49 am0c joined #perl6
11:49 orafu joined #perl6
11:55 sundar_afk joined #perl6
11:56 araujo thanks masak :)
11:56 araujo & moritz_
11:57 masak moritz_: S12: 'Reference to the internal storage location via C<$!foo> should generally be restricted to submethods. Ordinary methods should stick to the C<$.foo> form.'
11:57 masak (not saying I agree with this practice, let alone follow it, but it's in there in S12)
11:57 renormalist joined #perl6
11:58 moritz_ well
11:58 moritz_ so only submethods should change attributes?
11:58 masak that doesn't follow.
11:58 masak if the $.a is rw, you can change it with a method, too.
11:58 moritz_ yes, but you don't always want that
11:59 masak I know.
11:59 masak but I'd need a concrete use case, I think.
11:59 araujo there exist a link or document where I can check the current libraries/modules available for rakudo?
11:59 masak araujo: proto's projects.list
12:01 gfldex joined #perl6
12:01 araujo by the way, how do i test if a file name is a directory?
12:01 masak ~~ :d
12:02 moritz_ by newest spec $filename.IO ~~ :d
12:02 masak araujo: http://github.com/masak/proto/blob/master/projects.list
12:02 moritz_ but rakudo doesn't implement that yet
12:02 takadonet joined #perl6
12:02 takadonet morning all
12:02 masak araujo: but note that most of those were written for alpha, and haven't taken the jump yet.
12:02 masak takadonet: \o
12:03 XaeroOne joined #perl6
12:03 araujo moritz_, oooh
12:03 araujo masak, ooh,  i see
12:13 masak blog post idea: 10 really appealing use cases with things that can be done with Rakudo today. title "You don't have to wait for Perl 6".
12:13 masak sort of a condensed version of jnthn++'s "Solved in Perl 6".
12:14 snarkyboojum masak o/
12:14 masak snarky!
12:14 snarkyboojum sounds good
12:14 moritz_ masak: did you read my blog series idea in the backlog?
12:14 masak moritz_: the one about weekly updates?
12:14 moritz_ masak: weekly contributions
12:15 masak moritz_: I think weekly updates are very much worth having. I also know they're a lot of work. maybe distributing the workload is a solution.
12:15 moritz_ masak: that's why I'm looking for more people to help (hint, hint) :-)
12:16 masak moritz_: I'll think about it. my first reaction is that I'd rather spend as much writing efforts on the book as possible, and that weekly updates would detract from that for me.
12:17 masak snarkyboojum: I have an unpushed commit where blocks mostly work. Saturday is release day. how does your schedule look?
12:17 moritz_ masak: quite understandable
12:17 snarkyboojum masak: I have free time this week
12:17 masak \o/
12:18 masak snarkyboojum: in that case, I might push what I have now so that you can (1) help bash it into shape, and (2) wire up tardis :)
12:18 snarkyboojum read through your commits on the block branch
12:18 snarkyboojum masak: sounds fun :0
12:20 constant joined #perl6
12:20 constant joined #perl6
12:20 masak two commits pushed to the 'blocks' branch. one tiny one and one huge one.
12:21 masak http://github.com/masak/yapsi/commits/blocks
12:21 bluescreen joined #perl6
12:21 masak that branch now handles 'my $a = 42; { say my $a }' correctly.
12:22 CokeBot9000 sorear++ # blizkost hacking!
12:22 snarkyboojum masak++ o/
12:23 masak with a bit of luck, we can make if statements and while loops land before release, too.
12:23 CokeBot9000 was jimmyz's patch helpful on the immutable strings branch?
12:24 dual joined #perl6
12:24 moritz_ CokeBot9000: helpful, but didn't bring us all the way
12:24 moritz_ Null PMC access in setprop()
12:24 moritz_ current instr.: 'perl6;Callable[::T];' pc 13098 (src/builtins/Num.pir:167)
12:24 avar why work of the pre-refactor version?
12:24 avar *off
12:24 CokeBot9000 is it applied?
12:24 moritz_ while compiling the setting
12:24 snarkyboojum masak: looks great.. be back in a bit
12:24 CokeBot9000 er, pushed?
12:25 moritz_ CokeBot9000: I haven't pushed it on the branch, but I can do it
12:25 jnthn Please don't apply that patch.
12:25 moritz_ ok
12:25 jnthn It doesn't solve the underlying issue.
12:25 CokeBot9000 k. I didn't even look at it.
12:25 jnthn Probably we need a change in P6Object.
12:29 iblechbot joined #perl6
12:29 CokeBot9000 jnthn: ahh. "add_method" in p6object is just shoving it into a namespace, not calling "add_method()"
12:30 CokeBot9000 testing...
12:31 colomon Just got some sort of rakudo error/issue e-mailed to me from Github?!?
12:31 moritz_ colomon: there's a bug tracker on github
12:32 colomon and someone entered a bug for us?
12:32 moritz_ colomon: somebody submitted a bug there. I commented that he should please use RT
12:32 colomon moritz_++
12:33 moritz_ phenny: tell pmichaud to please disable the bug tracker on github/rakudo/rakudo (Admin -> Features -> tick off "Issues")
12:33 phenny moritz_: I'll pass that on when pmichaud is around.
12:34 smash_ joined #perl6
12:34 smash_ hello everyone
12:34 masak smash_: \o
12:37 takadonet smash_: how are you ?
12:38 moritz_ \o/ in 2.5 hours the accepted gsoc proposals will be announced
12:38 takadonet !!
12:38 smash_ takadonet: i'm fine, thank you
12:38 smash_ moritz_: great, where ?
12:39 moritz_ smash_: not sure, but probably a link will show up on http://socghop.appspot.com/
12:40 smash_ moritz_: ok, thks
12:42 CokeBot9000 ok. looking at p6o will take more cycles than I have to spare atm.
12:42 CokeBot9000 it is suspiciously looking at at the namespace when dealing with methods in add_parent, though.
12:48 JimmyZ joined #perl6
12:52 masak on #perl, a guy just tried to show a problem in his code by picking out the parts that he thought were relevant and [...]-abbreviating the rest.
12:53 masak mst++ told him to show the whole code, runnable code.
12:53 frettled heh
12:53 masak one thing that we do well here on #perl6 is that we often focus code discussions around lines of p6eval code.
12:53 frettled How many swearwords were there?
12:53 masak none.
12:53 frettled wow
12:53 jnthn Holy shit!
12:53 moritz_ is mst ill?
12:54 IllvilJa is mst here?
12:54 jnthn ;-)
12:54 frettled Has someone taken over his computer?
12:54 masak mst only swears when there's any need.
12:54 CokeBot9000 masak: how much of that is due to the average size of runnable p6?
12:54 masak CokeBot9000: well, cue the second part of the discussion.
12:55 IllvilJa It IS a bit frustrating when people demand you to show ALL code when you at the point in time is fine just discussing stuffs and errors at a higher level (and then dive down in the gory code yourself afterwards).
12:55 masak I said that I often tried to minimize/golf things so they'd be easier to digest.
12:55 masak at the same moment, the guy with the nopaste said he'd do the same thing.
12:55 IllvilJa I actually stay away from #perl...
12:56 frettled masak: yep, and extracting the essential code also sometimes solves the entire problem
12:56 moritz_ IllvilJa: well, it's ok to only show part if you actually observe the problems in the reduced, runnable code
12:56 masak http://www.shadowcat.co.uk/blog/matt-s-trout/show-us-the-whole-code/
12:56 ruoso joined #perl6
12:56 frettled masak: On another note, I had a chat with a dear friend who's also a Java guru-ish person regarding class variables.
12:56 masak ooh!
12:57 masak what'd e say.
12:57 IllvilJa masak and moritz_: I know about that article :-).
12:57 frettled masak: I asked if he had a non-contrived example, and incidentally that was exactly the example that I thought up and thought was stupid, hee-hee.
12:58 frettled masak: He first said that having to use a class variable is probably a sign that you've done something wrong in the first place.
12:58 masak aye.
12:58 frettled masak: The stupid example (which may not be entirely stupid, but I thought there ought to be better ways around the problem) is…
12:58 frettled Web services in a multi-threaded environment
13:00 * masak doesn't get it
13:00 frettled Let's say that you handle incoming requests, and need to somehow separate incoming sessions intelligently, even if they all come from the same IP address.  In that case, you _might_ use a class variable to count things and keep them in a somewhat sane, "global" datastructure.
13:00 masak urk.
13:01 moritz_ well, you need a database :-)
13:01 masak badly :)
13:01 frettled moritz_: yep, that's what I think may be one of the better ways around it
13:02 ReiniUrban joined #perl6
13:02 ingy joined #perl6
13:03 jnthn Or you could still use a lexical hash and write an accessor if you're really desperate.
13:03 jnthn (for that case)
13:03 moritz_ the most sensible use i've seen for global variables is a $DEBUG flag
13:05 moritz_ which is only sensible because it's not worth coming up with a more compilicated facility, at least for simple programs
13:05 pmichaud good morning, #perl6
13:05 phenny pmichaud: 12:33Z <moritz_> tell pmichaud to please disable the bug tracker on github/rakudo/rakudo (Admin -> Features -> tick off "Issues")
13:05 XaeroOne joined #perl6
13:05 colomon o/
13:05 moritz_ good morning
13:06 jnthn morning, pmichaud
13:06 pmichaud moritz_: done.
13:06 masak mornin', pm
13:06 moritz_ pmichaud: thanks
13:07 moritz_ \o/ yesterday's blog post got about 12k visits so far
13:08 colomon moritz_++
13:09 masak moritz_: good blog post, by the way. moritz_++
13:09 moritz_ thanks masak
13:09 colomon well-deserved visitors, it was a great post.
13:11 masak perl6advent.wordpress.com still pulls in about ~80 viewers a day.
13:11 masak there was a peak on the 20th, for some reason.
13:12 colomon madelbrot maybe?
13:12 masak quite possibly.
13:12 constant joined #perl6
13:12 constant joined #perl6
13:13 colomon I linked to that page again, anyway.
13:13 colomon around then.
13:13 colomon afk
13:15 Xaero joined #perl6
13:16 SmokeMachine joined #perl6
13:20 frettled Hot-diggety-bleep, I haven't gotten around to reading moritz_' new blog entry.
13:21 moritz_ frettled: when you do I'll get another visit :-)
13:21 masak 12k1 :)
13:22 masak CONGRATULATION YOU ARE THE TWELVE THOUSAND AND FIRST VISITOR
13:22 frettled heh
13:22 pmichaud masak: maybe let the npw organizers know (if they don't already) that August 7-8 might stomp on YAPC::EU a bit for some folks?
13:22 moritz_ you have won that pretty hat, which you know have to wear
13:22 masak pmichaud: did already.
13:22 pmichaud okay
13:22 frettled moritz_: maybe you will, maybe you won't, that depends on how much I get to read in Google Reader :D
13:22 [particle] joined #perl6
13:22 moritz_ frettled: I put the full posts into the RSS
13:22 masak moritz_++
13:22 pmichaud I'd love to come to npw again this year -- wasn't going to be able to make it in may but august may be Very Doable.  :)
13:23 frettled There's an NPW again this year?  :D
13:23 masak seems the organizers are now aware of the semi-collision and are open for other dates.
13:23 moritz_ yes, in Iceland
13:24 frettled woot
13:24 frettled So we actually managed to bully Iceland into hosting that!
13:24 frettled I can see my vacation savings fund diminishing rapidly.
13:24 moritz_ which currently has some travelling restrictions, it seems :-)
13:25 jnthn Yeah, seems NPW is postponed.
13:25 constant joined #perl6
13:25 constant joined #perl6
13:25 masak :(
13:25 frettled You just need to follow these instructions carefully: http://linselyst.files.wordpress.com/2010/04/island-slar-til-igjen1.jpg
13:25 jnthn :-(
13:26 jnthn frettled: lol!
13:26 jnthn "And we screw off the volcano"? :-)
13:26 frettled switch off, but yes
13:26 masak frettled: lol!
13:27 * masak feels better now
13:27 rgrau_ joined #perl6
13:29 envi^home joined #perl6
13:29 M_o_C joined #perl6
13:33 CokeBot9000 pmichaud: morning.
13:39 REPLeffect joined #perl6
13:41 XaeroOne joined #perl6
13:54 xinming joined #perl6
14:01 slavik joined #perl6
14:02 REPLeffect joined #perl6
14:07 rv2733 joined #perl6
14:18 alester joined #perl6
14:23 nihiliad joined #perl6
14:29 colomon occurred to me after I started my walk that more realistic ideas for what caused the perl6advent bump last week were Hacker News Perl 6 article or maybe the big perl monks thread.
14:30 takadonet colomon: you are probably right
14:57 PacoLinux joined #perl6
14:58 XaeroOne joined #perl6
14:59 isBEKaml joined #perl6
15:01 molaf joined #perl6
15:01 moritz_ don't underestimate the number of readers of planetsix :-)
15:02 moritz_ I've 10k refferals from planetsix, and that doesn't include those who read the articles directly on the planetsix page, or via rss
15:03 moritz_ so it's easily 200 readers for any blog post on there, probably much more
15:03 moritz_ I mean it's not a huge number compared to other blogs, but it was still surprising me when I found out first
15:04 moritz_ end enough to cause a spike in  p6advent stats
15:05 IllvilJa joined #perl6
15:05 XaeroOne joined #perl6
15:06 isBEKaml hey guys, can you tell me why there are multiple implementations of the P6 spec? I mean, Rakudo, Pugs, Parrot? If I'm not wrong, they look like VMs, reminding me of the java ecosystem.
15:07 moritz_ isBEKaml: there are several answers to that question...
15:07 [particle] isBEKaml: parrot is a virtual machine designed to run dynamic languages, not an implementation of perl 6. more at http://parrot.org
15:07 moritz_ isBEKaml: first of all the implementations explore different areas of the spec first
15:08 [particle] rakudo is an implementation of perl 6 running on parrot, more at http://rakudo.org
15:08 pmurias joined #perl6
15:08 [particle] rakudo is largely written in perl 6
15:08 moritz_ isBEKaml: for example smop/mildew focus on the meta object protocol
15:08 moritz_ a second answer is that people just start a new compiler because they have an idea they like better than the existing compilers
15:08 jnthn Rakudo these days borrows increasingly from smop too. :-)
15:09 [particle] c has many compilers, for example msvc, gcc, icc, cc, etc
15:09 jnthn (In terms of ideas rather than implementation.)
15:09 moritz_ and we can't tell people to abandon their efforts and join another project - volunteer work doesn't work that way
15:09 [particle] s/compilers/implementations/
15:09 masak isBEKaml: multiple implementations are the natural result when you leave Perl 5's "this implementation is normative" way of doing things and say that a spec is normative instead.
15:09 [particle] more on that in S01
15:10 isBEKaml I see, so when we see ends to be integrated, won't that lead to lot of confusion?
15:10 isBEKaml [particle]: SO1?
15:10 masak isBEKaml: well, we tend to send people towards Rakudo, since that's what most newcomers want.
15:10 [particle] http://perlcabal.org/syn/S01.html
15:10 masak it being the currently most advanced and most worked-on implementation.
15:10 moritz_ isBEKaml: well, we have a test suite to ensure that all compilers implement the same language :-)
15:11 masak isBEKaml: but yes, in general it's slightly more tricky for an outsider to keep track of all the new names when there are multiple implementations than when there's only one. :)
15:11 isBEKaml nice... I was looking at perl6.org, and then at Rakudo, one of the links pointed to perlmonks and that's where I tried to grok things.. ;)
15:12 masak isBEKaml: have you found perl6advent yet?
15:12 isBEKaml but,yes, I'm a lot more confused with all these answers - enough to give me some time to read up on them. :)
15:12 isBEKaml masak: not yet..
15:12 masak it's nice.
15:12 masak find it :)
15:12 moritz_ isBEKaml: if you have suggestions on how to make perl6.org clearer (without making it too verbose), we're open for suggestions
15:13 [particle] camelia appreciates your help and enthusiasm
15:13 pmurias joined #perl6
15:14 isBEKaml moritz_: perl6.org is indeed very clear. One thing, I would suggest is making it explicit  in one of the doc pages there.
15:14 isBEKaml In fact, I like the design of perl6.org much better than learn.perl.org
15:14 isBEKaml :)
15:14 masak \o/
15:15 moritz_ YaY, somebody likes it :-)
15:15 isBEKaml we need more docs, I just downloaded the perl6book from github. :)
15:15 moritz_ well, we're working on it
15:15 CokeBot9000 moritz_: one down, several 100K to go. =-)
15:15 masak and on Rakudo, so it'll be ready for the book.
15:16 * masak whispers 'named enums!'
15:16 isBEKaml moritz_, masak: from what I can see, I'm not a perl programmer,( though I can do baby talk in perl) :)
15:16 isBEKaml will that impede me from learning perl6 and be upto speed?
15:16 masak not really.
15:17 masak it helps to know Perl 5 already, but it's not a requirement.
15:17 masak do read the book, but I think going through perl6advent might teach you more right now.
15:17 moritz_ isBEKaml: the book is targeted at people who already know most programming concepts. But no prior Perl knowledge required
15:17 isBEKaml masak: I can understand perl5 concepts, if not, I've got perldoc in my linux box to help. ;)
15:18 masak isBEKaml: also, downloading Rakudo and playing around with it is often very instructive.
15:18 masak it's also possible to play around here on-channel (in moderation, of course).
15:18 isBEKaml masak: I'll try that sometime.
15:18 masak rakudo: say "OH HAI, isBEKaml!"
15:18 p6eval rakudo f6ec0a: OUTPUT«OH HAI, isBEKaml!␤»
15:19 masak rakudo: say Date.today
15:19 p6eval rakudo f6ec0a: OUTPUT«2010-04-26␤»
15:19 isBEKaml masak: nice. what are those terminators in the output?
15:19 isBEKaml -04-26NL
15:19 masak moritz_: Date.today reads very well :)
15:19 moritz_ sub karma-up($whom) { print "$whom++" }; karma-up("isBEKaml")
15:19 isBEKaml NL something symbol?
15:19 masak isBEKaml: those are the characters for line endings.
15:19 moritz_ right
15:19 pmurias diakopter: sprixel fails to build on my box
15:19 moritz_ you need proper UTF-8 support in you IRC client
15:20 isBEKaml NL! newline, I see..
15:20 moritz_ otherwise it will be displayed as mojibake
15:20 diakopter pmurias: error?
15:20 pmurias pasting...
15:20 CokeBot9000 moritz++ # my new japanese word of the day.
15:20 isBEKaml moritz_: I can understand perl code. I went up to perl objects and gave up! :(
15:21 masak isBEKaml: then we have good news for you :)
15:21 isBEKaml they seem very raw..
15:21 masak rakudo: class A { method foo { say "lol I am an object" } }; A.new.foo
15:21 p6eval rakudo f6ec0a: OUTPUT«lol I am an object␤»
15:21 lisppaste3 the build error pasted "untitled" at http://paste.lisp.org/display/98381
15:22 diakopter pmurias: svn up # I just commited :)
15:22 pmurias diakopter: just noticed it
15:22 isBEKaml masak: nice. how does scoping behave here? I mean, in java, we have protected scopes to go down the line with inheritance.
15:22 ruoso joined #perl6
15:22 masak isBEKaml: things are private by default. but methods inherit, so you'd mostly go through them.
15:22 moritz_ isBEKaml: attributes are private, methods are public by default
15:23 diakopter pmurias: tho hang on; it's still broke
15:23 masak the more I look at Perl 6 OO, the more I realize that public methods are often the solution.
15:24 diakopter pmurias: fixing..
15:24 isBEKaml masak: A.new.foo, that's public. What if I want to have some methods that are only specific to the class they belong to?
15:24 isBEKaml won't private methods work?
15:24 masak isBEKaml: sounds like a submethod.
15:24 jnthn method !i-am-private() { ... }
15:24 diakopter pmurias: ha! this is almost the identical error I created when parameterizing patterns in jsmeta!
15:24 masak isBEKaml: there's more on the topic in S12.
15:25 diakopter lol
15:25 jnthn ! before the name indicates a "private".
15:25 moritz_ isBEKaml: btw when we use short names like S12, you can go to the IRC logs on irc.pugscode.org, they are turned into links there
15:25 jnthn You can't call them with normal method syntax
15:25 isBEKaml moritz_: S for specs?
15:26 diakopter pmurias: fixed now.  you may be interested in the diff
15:26 moritz_ isBEKaml: spec or "synopsis"
15:27 isBEKaml jnthn: I see. thanks.
15:28 pmurias diakopter: why does sprixel abort after processing a file
15:28 diakopter pmurias: I made BuildStatementList a parameterized pattern-generator-generator, so when using the parameters, if they're used more than once in the body, all but one of them need to be regenerated so their goto labels aren't duplicated.
15:28 diakopter abort?
15:29 isBEKaml masak, moritz_, jnthn: I'll be away for a while looking through docs/links that you had pointed to. Join back on the fun in sometime. :)
15:29 moritz_ have fun!
15:29 masak and welcome back!
15:29 * moritz_ takes the bike home
15:29 lisppaste3 pmurias pasted "result of running a test" at http://paste.lisp.org/display/98383
15:29 jiing joined #perl6
15:30 diakopter pmurias: o_O
15:30 pmurias to the tests pass for you?
15:30 diakopter looks like another bug for #mono
15:31 diakopter pmurias: what version of mono?
15:31 pmurias 2.6.3?
15:31 pmurias s/?//
15:32 christine joined #perl6
15:33 diakopter pmurias: they work on the .NET CLR; I haven't tried them on mono lately
15:34 diakopter I reported it to #mono on gimpnet
15:37 kaare_ joined #perl6
15:38 colomon have the gsoc announcements come in yet?
15:40 diakopter the apps are all still pending
15:42 constant joined #perl6
15:42 [particle] joined #perl6
15:42 ingy joined #perl6
15:42 s1n joined #perl6
15:42 cognominal joined #perl6
15:42 lisppaste3 joined #perl6
15:42 elmex joined #perl6
15:42 sorear joined #perl6
15:42 Trey joined #perl6
15:42 yahooooo joined #perl6
15:42 opx^away joined #perl6
15:42 Woody2143 joined #perl6
15:44 TPF|Coke 195 minutes remaining on GSOC announcements.
15:44 masak exciting!
15:44 colomon :)
15:49 diakopter pmurias: could you perhaps svn bisect it?
15:50 pmurias what would be the right way to solve such problems would be to have something like taptinder
15:51 pmurias diakopter: see failing test for a bug in the comments parsing i found
15:51 diakopter ok
15:52 diakopter pmurias: I don't get any SIGABRT when running run_tests.sh on mono 2.6.3 on linux..
15:53 diakopter any SIGABRT that prove doesn't hide, I mean
15:54 pmurias diakopter: does prove give you a red 2 tests passed message?
15:54 diakopter fixed
15:55 diakopter all ok for me
15:55 diakopter green All tests successful
15:56 diakopter do you have 32-bit linux or 64-bit
15:56 pmurias 32bit
15:56 diakopter ah. mine is 64bit
15:56 diakopter are you still getting a SIGABRT?
15:56 pmurias yes
15:57 pmurias but the comments test runs now
15:57 diakopter what do you run to get the SIGABRT?
15:58 diakopter (what's the command line)
15:58 ash__ joined #perl6
15:58 pmurias mono bin/Release/Sprixel.exe t/if.t
15:58 diakopter weird.
15:58 diakopter mine works.
15:59 justatheory joined #perl6
16:00 pmurias it seems like a strange 32bit vs 64bit memory error
16:01 pmurias diakopter: do you have access to a box where we could ran smolder on?
16:01 diakopter sure, the p6eval box
16:01 _jaldhar joined #perl6
16:03 diakopter but it's 64-bit :P
16:04 diakopter so it wouldn't catch this error
16:04 diakopter oh, smolder, the test result server
16:05 _jaldhar joined #perl6
16:06 isBEKaml_ joined #perl6
16:07 bradb joined #perl6
16:13 gurjeet joined #perl6
16:13 diakopter afk&
16:16 Guest40234 joined #perl6
16:21 cognominal joined #perl6
16:28 isBEKaml_ alright, guys, I really want to try out perl6 on my pc. Looking at Rakudo tells me that I have to have ICU. Is that mandatory?
16:29 ash__ no, ICU is only required if you want full unicode support
16:29 isBEKaml_ masak: I now understand what you meant by p6advent. :)
16:29 masak isBEKaml_: \o/
16:30 isBEKaml_ masak: I'm now ready to undertake the 24 day walk up the hill, for the fresh mountain air! yay for perl6!
16:30 szabgab joined #perl6
16:30 isBEKaml_ ash__: that means I can still compile Rakudo ?
16:30 masak isBEKaml_: good luck!
16:30 masak swimming &
16:30 ash__ yeah, you can still compile rakudo without icu
16:30 moritz_ isBEKaml_: you can. But having ICU is nicer
16:30 moritz_ isBEKaml_: what OS do you use?
16:30 slavik icu?
16:31 isBEKaml_ moritz_: slackware.
16:31 ash__ ICU lets you use: «» for instance
16:31 ash__ or ¢ even
16:31 moritz_ slavik: http://site.icu-project.org/
16:31 slavik how would I enter it on an american keyboard?
16:31 moritz_ isBEKaml_: I'm sure icu is packaged for slackware, though since I'm not a slackware user I don't know the details
16:31 isBEKaml_ slavik: I would guess, altGR+X or Z, however it suits you.
16:31 cotto_work joined #perl6
16:31 slavik oh god
16:32 colomon slavik: I've programmed my text editor so that if I hit >>[tab], it generates a »
16:32 ash__ i have no idea, i am on a mac, so it would be different
16:32 moritz_ slavik: or compose<<
16:32 slavik colomon: nice, what text editor?
16:32 colomon TextMate
16:32 colomon though you can also just use << or >> instead.
16:32 colomon (I mean, in Perl 6.)
16:32 moritz_ in vim it's Ctrl+k < <
16:32 isBEKaml_ moritz_: I don't know if that's packaged for slackware(I haven't looked around yet). But the site shows ICU for C and java?
16:33 ash__ colomon: you can use Option+| (bar) to get « and Shift+Option+| to get »
16:33 colomon «» You're right!
16:33 colomon ash__++
16:34 ash__ in OS X just hold Option and most keys become unicode
16:34 moritz_ http://sotirov-bg.net/slackpack/pack.cgi?id=627
16:34 moritz_ isBEKaml_: you'd need the C version
16:34 colomon ash__: usually I just get accidental greek characters that way.  ;)
16:34 moritz_ (if there's a distinction - could be one package for both)
16:35 ash__ colomon: well, some of them like Option+e then another character (like e again) will add the ` on top of the e: éóí     Option+u does the dot dot on top:  ë
16:35 isBEKaml_ moritz_: Ah, thanks. I can build a slackware package from the build script. I just need the source. That's what slackware is about. ;)
16:36 moritz_ pmichaud, jnthn, colomon: I'd like to start putting the name of all contributors in rakudo releases, just like perl 5 does it nowadays - I can write some perl scripts to sift through the commit messages to auto-generate that
16:37 moritz_ any opinions?
16:37 isBEKaml_ moritz_: I'll go few days without sugar (ICU, :) ) and tehn try the sugar coating. :)
16:37 moritz_ isBEKaml_: I'm spoiled by Debian - sudo aptitude install libicu-dev # and you're done :-)
16:37 moritz_ sure, whatever you prefer
16:38 colomon moritz_: all contributors ever, or since the last release?
16:38 isBEKaml_ moritz_: I have used Debian too! :) Right, now I'll go build Rakudo from source without sugar....
16:38 moritz_ colomon: since the last release
16:38 colomon and just to the source, or to the source plus spec plus test suite?
16:39 moritz_ colomon: good question... no idea
16:39 moritz_ maybe just rakudo now
16:39 moritz_ we can extend it later on :-)
16:39 ash__ you could have categories, say rakudo contributors, testing contributors ? and make note of the spec somewhere else?
16:39 colomon I'm just trying to think it through.  :)
16:40 ash__ in my mind, the spec is someone independent of rakudo, even though they are highly related
16:40 colomon I like promoting contributors, just don't want to leave out people who are making a difference.
16:40 isBEKaml_ ash__: why differentiate between contributors? They are contributors, after all..
16:41 ash__ yeah, but then you can tell what they did, plus it makes it easier to figure out what to put where, just check commits in the /t folder for the tests, and things in src are rakudo contributors
16:41 ash__ although one big list isn't hard either, but still
16:42 colomon It would be interesting to see how long the lists are, actually.  :)
16:42 isBEKaml_ ash__: I figure some Rakudo contributors would also be test contributors since I believe they want it to run free of burdens. ;)
16:42 moritz_ there are some intersections, yes :-)
16:43 jnthn Quite a sizable one, I'd say. :-)
16:43 colomon isBEKaml: It would be unusual for any Rakudo contributors to not also be test contributors.
16:43 * jnthn is even known to write tests once in a while. :-)
16:43 * colomon needs to write a bunch of tests for log and exp -- many combinations of different Numeric / Real types to see how the interactions work now.
16:43 isBEKaml_ colomon: that's what I thought too..
16:45 moritz_ 13 commit authors in the last 31 days
16:45 * isBEKaml_ is building Rakudo without ICU for his early learning
16:45 moritz_ that doesn't include those mentioned in the commit messages, which I'd like to parse too
16:45 ash__ isBEKaml_: are you going to go through the advent calendar?
16:46 moritz_ like people being ++'ed or appear afer a "courtesy by"
16:46 takadonet moritz_: I would be on that list !
16:46 isBEKaml_ ash__: yes, the 24 day walk up the hill. :)
16:46 colomon BTW, (off current topic), prototyping geometry code in Perl 6 continues to be full of awesome.  Perl 6 makes it very easy to express fairly complicated ideas, and Rakudo is working fine for me at the moment.
16:47 moritz_ \o/
16:47 ash__ sweet
16:48 colomon I'm using sort and min and pairs pretty heavily at the moment, and I shudder to think how much more work it would be to write this in C++.
16:49 ash__ i wonder how it will handle matrix stuff
16:49 colomon I'm also toying with a new (at least to me) idiom:
16:49 colomon (1 ..^ +@.points).grep({ @.points[$_ - 1] < $u < @.points[$_]; })
16:51 colomon oh wait, I see a bug in that particular instance.  :)
16:51 moritz_ rakudo: say <a b c>.pairs.perl
16:51 p6eval rakudo f6ec0a: OUTPUT«(0 => "a", 1 => "b", 2 => "c")␤»
16:51 isBEKaml_ moritz_: pairs wil only do numbers to strings? Can I do a rot13 pair matching? :)
16:52 moritz_ isBEKaml_: pairs give array index + array item
16:52 moritz_ rakudo: say <foo bar baz>.pairs.perl
16:52 p6eval rakudo f6ec0a: OUTPUT«(0 => "foo", 1 => "bar", 2 => "baz")␤»
16:52 colomon isBEKaml_: when used on an array, moritz_ means.
16:52 moritz_ isBEKaml_: it's usually more useful on hashes
16:52 colomon but you can say something like
16:52 jnthn rakudo: say (a..z Z=> (n..z,a..o)).perl
16:52 p6eval rakudo f6ec0a: OUTPUT«Could not find sub &a␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
16:53 colomon rakudo: say ('a' .. 'z' Z=> 'b'..'z', a).perl
16:53 p6eval rakudo f6ec0a: OUTPUT«Could not find sub &a␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
16:53 jnthn rakudo: say ('a'..'z' Z=> ('n..z','a..o')).perl
16:53 p6eval rakudo f6ec0a: OUTPUT«("a" => "n..z", "b" => "a..o")␤»
16:53 colomon rakudo: say ('a' .. 'z' Z=> 'b'..'z', 'a').perl
16:53 p6eval rakudo f6ec0a: OUTPUT«("a" => "b", "b" => "c", "c" => "d", "d" => "e", "e" => "f", "f" => "g", "g" => "h", "h" => "i", "i" => "j", "j" => "k", "k" => "l", "l" => "m", "m" => "n", "n" => "o", "o" => "p", "p" => "q", "q" => "r", "r" => "s", "s" => "t", "t" => "u", "u" => "v", "v" => "w", "w" => "x",
16:53 p6eval .."x" =…
16:53 jnthn grr
16:53 moritz_ :-)
16:53 isBEKaml_ :)
16:53 jnthn colomon++
16:54 colomon rakudo: say ('a' .. 'z' Z=> 'n'..'z', 'a'..'m').perl
16:54 p6eval rakudo f6ec0a: OUTPUT«("a" => "n", "b" => "o", "c" => "p", "d" => "q", "e" => "r", "f" => "s", "g" => "t", "h" => "u", "i" => "v", "j" => "w", "k" => "x", "l" => "y", "m" => "z", "n" => "a", "o" => "b", "p" => "c", "q" => "d", "r" => "e", "s" => "f", "t" => "g", "u" => "h", "v" => "i", "w" => "j",
16:54 p6eval .."x" =…
16:54 colomon is that rot13
16:54 colomon ?
16:54 isBEKaml_ $colomon++
16:54 jnthn Yes.
16:54 iblechbot joined #perl6
16:54 isBEKaml_ :)
16:54 colomon TimToady++ for thinking up Zop.  :)
16:55 jnthn Indeed.
16:55 moritz_ rakudo: my %r = ('a' .. 'z' Z=> 'n'..'z', 'a'..'m'); say 'hello'.comb.map( { %r{$_} }).join
16:55 p6eval rakudo f6ec0a: OUTPUT«uryyb␤»
16:55 colomon does .trans work yet?
16:55 isBEKaml_ Zop's a map?
16:55 moritz_ colomon: nope
16:55 jnthn isBEKaml_: Z is a meta-operator.
16:55 jnthn isBEKaml_: => is the pair constructor in Perl 6
16:56 jnthn so 'a' => 'n' makes a pair.
16:56 jnthn If you put a Z before it it means "apply it to each thing in the list either side"
16:56 jnthn So we make a list of pairs out of two other lists.
16:56 jnthn :-)
16:56 jnthn But you can put any operator there.
16:57 isBEKaml_ what if I were to say: 'a' .. 'z' => 'n' .. 'z' ?
16:57 colomon rakudo: say ('a' .. 'z' «=>» 'n'..'z', 'a'..'m').perl
16:57 p6eval rakudo f6ec0a: OUTPUT«(["a" => "n", "b" => "o", "c" => "p", "d" => "q", "e" => "r", "f" => "s", "g" => "t", "h" => "u", "i" => "v", "j" => "w", "k" => "x", "l" => "y", "m" => "z", "n" => "z", "o" => "z", "p" => "z", "q" => "z", "r" => "z", "s" => "z", "t" => "z", "u" => "z", "v" => "z", "w" => "z",
16:57 p6eval .."x" …
16:57 cdarroch joined #perl6
16:57 cdarroch joined #perl6
16:57 jnthn isBEKaml_: It'll terminate when the shortest list hits its end.
16:57 colomon oh, the hyper op also can do that.  :)
16:57 isBEKaml_ jnthn: Oh, the zipper. sweet..
16:58 jnthn Yeah, it's Zip.
16:58 colomon (hyper can also make a list of pairs.  It actually cannot terminate when the shortest list hits its end.)
16:58 jnthn Right.
16:58 jnthn Hypers give you more checking / control over that.
16:59 isBEKaml_ colomon: so the other elements on the longer list be undefs? Does Perl6 have undef?
16:59 colomon looking back at my results, the hyper version actually missed the second range.
16:59 moritz_ it has many undefs :-)
16:59 jnthn colomon: That may be a precedence issue.
16:59 colomon isBEKaml_: hyper either extends with the last element in the list or fails outright.
16:59 jnthn colomon: In that hypers have transparent precedence.
16:59 jnthn Alternatively, it could be a bug.
16:59 isBEKaml_ moritz_: yeah. :D
17:00 colomon jnthn: nah, probably precedence.
17:02 _jaldhar joined #perl6
17:05 isBEKaml_ colomon: looking at your code, does p6 have something like <=> operator to apply both ways? say: 'a' .. 'z' <=> 'n' .. 'za' .. 'm' ?
17:05 isBEKaml_ I understand that's what Zop does.
17:05 ash__ <=> is in perl6
17:06 colomon <=> does numeric comparison
17:06 jnthn It's a comparsion operator, though.
17:06 colomon you want to build a list of pairs going one way and a list of pairs going the other way?
17:06 isBEKaml_ ash__: I merely thought it would look appropriate for the Zop.
17:06 isBEKaml_ colomon: something like it. :)
17:07 isBEKaml_ I'm trying to learn as my poor old machine's building Rakudo in the background. :-)
17:07 xalbo left #perl6
17:08 isBEKaml_ colomon: numeric comparison? in what way?
17:08 ash__ isBEKaml_: you can always use p6eval here, just say rakudo: in a msg
17:08 isBEKaml_ rakudo: 77 <=> 9
17:08 p6eval rakudo f6ec0a:  ( no output )
17:09 ash__ > is numeric and gt is strings, most operators are for a single type of value
17:09 ash__ rakudo: say 77 <=> 9
17:09 p6eval rakudo f6ec0a: OUTPUT«1␤»
17:09 colomon rakudo: my %encode = 'a'..'z' Z=> 'n'..'z', 'a'..'m'; my %decode = %encode.invert; say %decode.perl
17:09 p6eval rakudo f6ec0a: OUTPUT«{"a" => "n", "b" => "o", "c" => "p", "d" => "q", "e" => "r", "f" => "s", "g" => "t", "h" => "u", "i" => "v", "j" => "w", "k" => "x", "l" => "y", "m" => "z", "n" => "a", "o" => "b", "p" => "c", "q" => "d", "r" => "e", "s" => "f", "t" => "g", "u" => "h", "v" => "i", "w" => "j",
17:09 p6eval .."x" =…
17:09 ash__ rakudo: say 9 <=> 77
17:09 p6eval rakudo f6ec0a: OUTPUT«-1␤»
17:09 ash__ rakudo: say 'a' leg 'b'
17:09 p6eval rakudo f6ec0a: OUTPUT«-1␤»
17:09 colomon isBEKaml_: as ash__ is demonstrating, <=> works like strcmp does in C.
17:10 ash__ rakudo: say 'b' leg 'a'
17:10 p6eval rakudo f6ec0a: OUTPUT«1␤»
17:10 colomon returns -1 for less than, 0 for equal, 1 for greater than
17:10 ash__ leg is <=> for strings
17:10 ash__ rakudo: say 'a' cmp 'b'
17:10 p6eval rakudo f6ec0a: OUTPUT«-1␤»
17:11 isBEKaml_ hmmm, when used on strings, it does in dictionary comparison. when used on numbers it gives -/+1 instead of having to use > or <
17:11 isBEKaml_ yes, i thought of strcmp.
17:11 ash__ cmp is also simillar
17:11 ash__ really, <=> is the same as +$a cmp +$b
17:11 isBEKaml_ +$?
17:11 ash__ and leg is the same as ~$a cmp ~$b
17:11 ash__ +$a turns $a into a Num
17:12 colomon +$a means "treat $a like a number"
17:12 ash__ and ~$a turns $a into a string
17:12 colomon ash__: a Numeric, actually, could also be an Int.
17:12 isBEKaml_ ah, I see..
17:12 colomon rakudo: say (+"4/5").WHAT
17:12 p6eval rakudo f6ec0a: OUTPUT«Num()␤»
17:12 ash__ ah, oops, yeah, it could be any Numeric type object, so Int, Rat, Num, etc.
17:12 colomon Not sure if that is supposed to work or not.
17:12 colomon rakudo: say (+"4/5")
17:12 p6eval rakudo f6ec0a: OUTPUT«4␤»
17:13 ash__ rakduo: say +"1.25".WHAT
17:13 colomon But if $a is already a Rat, say, +$a should leave it a Rat.
17:13 isBEKaml_ colomon: looking at your code for encode and decode. is it possible to view the full output?
17:14 colomon isBEKaml_: I don't think so on here, but you can use Rakudo to do it:
17:14 ash__ not on the evalbot, i don't think
17:14 isBEKaml_ Rat? as in rational? is that a native type on p6?
17:14 colomon isBEKaml_: as in Rational, and yes.
17:14 colomon > my %encode = 'a'..'z' Z=> 'n'..'z', 'a'..'m'; my %decode = %encode.invert; say %decode.perl
17:14 colomon {"a" => "n", "b" => "o", "c" => "p", "d" => "q", "e" => "r", "f" => "s", "g" => "t", "h" => "u", "i" => "v", "j" => "w", "k" => "x", "l" => "y", "m" => "z", "n" => "a", "o" => "b", "p" => "c", "q" => "d", "r" => "e", "s" => "f", "t" => "g", "u" => "h", "v" => "i", "w" => "j", "x" => "k", "y" => "l", "z" => "m"}
17:15 colomon usually when you see something like that posted on #perl6 (code that starts with a "> ") that means someone ran it on their local Rakudo and posted it here.
17:16 colomon rakudo: say (4/5 + 2/7).perl
17:16 p6eval rakudo f6ec0a: OUTPUT«38/35␤»
17:16 colomon rakudo: say 4/5 + 2/7  # by default Rats print as decimals
17:16 p6eval rakudo f6ec0a: OUTPUT«1.08571428571429␤»
17:17 ash__ aren't we changing how to write Rat literals?
17:17 araujo joined #perl6
17:17 colomon ash__: those aren't Rat literals, if that's what you mean.
17:17 colomon it
17:17 ash__ ah
17:17 colomon it's just 4 divided by 5 and 2 divided by 7
17:18 ash__ <4/3> is the literal form right?
17:18 colomon rakudo: say (0.8 + 2/7).perl
17:18 p6eval rakudo f6ec0a: OUTPUT«38/35␤»
17:18 ash__ rakudo: say <4/2>.WHAT
17:18 p6eval rakudo f6ec0a: OUTPUT«Str()␤»
17:18 isBEKaml_ rakudo: say (4/2).WHAT
17:18 p6eval rakudo f6ec0a: OUTPUT«Rat()␤»
17:18 colomon I don't think <4/3> works in Rakudo yet.
17:18 jaffa4 How to write -e in Perl 6?
17:18 colomon and I think it's supposed to be both a Str and a Rat?
17:19 ash__ jaffa4: its still -e
17:19 colomon jaffa4: on the command line or as a file op?
17:19 jaffa4 file op
17:19 ash__ oh, lol good question, i was thinking the command line
17:19 ash__ so, no i am wrong, sorry
17:19 colomon ~~ :e
17:19 colomon like "file" ~~ :e
17:19 jaffa4 ok
17:19 colomon but I don't know if that one is implemented yet.
17:19 ash__ rakudo: say "/etc/hosts" ~~ :e
17:20 colomon rakudo: say "/etc/passwd" ~~ :e
17:20 p6eval rakudo f6ec0a: OUTPUT«0␤»
17:20 p6eval rakudo f6ec0a: OUTPUT«1␤»
17:20 kensanata joined #perl6
17:21 jaffa4 what is not -e?
17:21 colomon guess it is implemented, then.
17:21 ash__ !~~ :e
17:21 ash__ can you use them as junctions yet?
17:21 colomon ash__: try it and see?  I'm guessing no...
17:22 isBEKaml_ file op? the -f switch in shell builtins?
17:22 ash__ rakudo: say '/etc/passwd' ~~ :e, :w, :f
17:22 p6eval rakudo f6ec0a: OUTPUT«2 unexpected named parameters passed (f, w)␤current instr.: 'say' pc 369645 (src/gen/core.pir:28584)␤»
17:22 ash__ oops
17:22 ash__ rakudo: say '/etc/passwd' ~~ :e & :w & :f
17:22 p6eval rakudo f6ec0a: OUTPUT«Method 'w' not found for invocant of class 'Perl6Str'␤current instr.: 'perl6;Enum;ACCEPTS' pc 500437 (src/gen/core.pir:76927)␤»
17:22 ash__ nope, not yet
17:23 mikehh joined #perl6
17:23 colomon rakudo: say '/etc/passwd' ~~ :e & :e
17:23 p6eval rakudo f6ec0a: OUTPUT«1␤»
17:23 ash__ isBEKaml_: http://perlcabal.org/syn/S32/IO.html#Other_things is what we are talking about
17:23 colomon I think :w isn't implemented yet, maybe?
17:23 colomon rakudo: say '/etc/passwd' ~~ :e & :f
17:23 p6eval rakudo f6ec0a: OUTPUT«1␤»
17:23 ash__ guess not
17:23 ash__ yeah, seems to be :w
17:23 colomon rakudo: say '/etc' ~~ :e & :f
17:23 p6eval rakudo f6ec0a: OUTPUT«0␤»
17:23 colomon rakudo++
17:23 isBEKaml_ as in:  if [ -f "/etc/passwd" ]; then echo "true"; else echo "false"; fi
17:24 ash__ yeah thats what :f does
17:24 ash__ there are a bunch, in the spec you can see the full list
17:24 colomon but only a very limited subset of them are implemented so far.
17:25 ash__ rakudo: say '/etc' ~~ :d
17:25 p6eval rakudo f6ec0a: OUTPUT«1␤»
17:27 isBEKaml_ ash__: I'm reading the spec slowly. Just gotten to S02. :)
17:28 ash__ thats fine, just showing you where the section is for what we were talking bout
17:28 ash__ s/bout/about/
17:30 XaeroOne joined #perl6
17:32 XaeroOne joined #perl6
17:42 isBEKaml_ when I say: say (4/2).WHAT, why is the returned type marked like a method and not show just what it is, a native type?
17:42 isBEKaml_ Rat()?
17:43 cognominal use WHAT.perl to avoid the parenthese.
17:43 isBEKaml_ rakudo: say (15/14).WHAT.perl
17:43 p6eval rakudo f6ec0a: OUTPUT«Rat␤»
17:44 isBEKaml_ cognominal: what's the difference? .perl pretty prints? :)
17:46 cognominal you can feed the output of .perl to the interpretor
17:47 isBEKaml_ hmm, thanks cognominal
17:47 cognominal On the other hand .WHAT is not intended to be used in a string context. The parentheses are a way to warn of that.
17:48 cognominal I can't remember the exact rationale
17:48 cognominal oops, no pun intended
17:49 isBEKaml_ my thinking was .WHAT was a way of getting the type of the variable, why would we show it with () as if it were a sub or a method?
17:51 cognominal I share your perplexity on that one.
17:51 uniejo joined #perl6
17:52 * TPF|Coke tries to figure out how to google for ".WHAT" in the syn.
17:54 ash__ http://perlcabal.org/syn/S12.html#Introspection
17:54 ash__ is where they talk about .WHAT some
17:54 isBEKaml_ http://perlcabal.org/syn/S29.html, something about ref()
17:54 japhb joined #perl6
17:55 cognominal http://irclog.perlgeek.de/perl6/2010-04-23#i_2257610  # I asked the same question answered by TimTaody
17:58 ash__ what does *$a mean in a paremeter? like: sub foo(*$a) { } ?
17:59 ash__ i know *@a is a splury of all the additional arguments, and *%a would be a slupry of keyword args, but whats *$a?
17:59 ash__ std: sub foo(*$a) { }
17:59 p6eval std 30477: OUTPUT«ok 00:01 110m␤»
18:00 ash__ also, what would *&a mean?
18:00 ash__ hmm
18:02 cognominal hum, I think you can slurp block, like in a multicriteria sort
18:04 cognominal S32-setting-library/Containers.pod:301: our Array multi method sort( @values: *&by )
18:04 cognominal S32-setting-library/Containers.pod:335: our multi method min( @values: *&by )
18:04 cognominal S32-setting-library/Containers.pod:359: our multi method max( @values: *&by )
18:04 ash__ rakudo: sub foo(*$a, *@b) { say($a, @b); }; foo(1, 2, 3);
18:04 isBEKaml_ cognominal: I'm even more confused. S12 and S29 tell me .WHAT is a form of a ref(), but TimToady says there could be a string hidden in them?
18:04 p6eval rakudo f6ec0a: OUTPUT«123␤»
18:04 ash__ rakudo: sub foo(*$a, *@b) { say "a: ", $a, " b: ", @b); }; foo(1, 2, 3);
18:05 p6eval rakudo f6ec0a: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
18:05 ash__ rakudo: sub foo(*$a, *@b) { say "a: ", $a, " b: ", @b; }; foo(1, 2, 3);
18:05 p6eval rakudo f6ec0a: OUTPUT«a: 1 b: 23␤»
18:05 jnthn .WHAT gives you the type object.
18:05 ash__ interesting...
18:05 jnthn This happens to stringify to the name of the type.
18:05 jnthn (Just like any other object can choose how it stringifies.)
18:07 isBEKaml_ jnthn: whatever I throw at it, it just pops back I_entered_This()
18:07 isBEKaml_ jnthn: is that an object type?
18:08 isBEKaml_ rakudo: say I_throw_this_at_you.WHAT
18:08 p6eval rakudo f6ec0a: OUTPUT«Could not find sub &I_throw_this_at_you␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
18:08 jnthn isBEKaml_: Well, you have to give it a type name that is declared.
18:08 isBEKaml_ rakudo: say MyVar.WHAT
18:08 p6eval rakudo f6ec0a: OUTPUT«Could not find sub &MyVar␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
18:08 jnthn Otherwise it assumes what you have is a subroutine and tries to call it.
18:09 jnthn MyVar.WHAT is like (MyVar()).WHAT
18:09 jnthn OTOH
18:09 jnthn rakudo: class Beer { }; say Beer.WHAT
18:09 p6eval rakudo f6ec0a: OUTPUT«Beer()␤»
18:09 TPF|Coke rakudo : say Role.WHAT
18:09 ash__ rakudo: say Role.WHAT
18:09 p6eval rakudo f6ec0a: OUTPUT«Role()␤»
18:09 ash__ rakudo: say WHAT Role
18:09 p6eval rakudo f6ec0a: OUTPUT«Role()␤»
18:09 TPF|Coke (didn't like the space.)
18:10 jnthn But you can aactally use it to make a new one too.
18:10 jnthn rakudo: class Beer { }; my $pint = Beer.new; my $type = $pint.WHAT; say $type.new.WHAT;
18:10 p6eval rakudo f6ec0a: OUTPUT«Beer()␤»
18:12 ash__ you can just do $pint.new too
18:12 isBEKaml_ jnthn: Ah, I get it now. when you say $type, the compiler doesn't mistake it to be a stringified form of type - I now see what TimToady meant! :)
18:12 jnthn Yeah, types are just objects. :-)
18:12 jnthn First class and all that lot.
18:16 isBEKaml_ objects are first class citizens, great!
18:16 * isBEKaml_ perl6 built now, finally!
18:16 ash__ everything is first class, except when its not...
18:16 ash__ regex's are first class
18:17 isBEKaml_ ash__: regexes too? no, no, not on the first day! ;) Though I can look at regexes and tell their purpose to some extent, just not now. :)
18:18 stephenlb joined #perl6
18:23 ShaneC joined #perl6
18:23 ShaneC left #perl6
18:23 ash__ rakudo:  my $reg = /(\d+) { $0 < 128 or fail }/; say '123' ~~ $reg, '129' ~~ $reg;
18:23 p6eval rakudo f6ec0a: OUTPUT«123»
18:24 avar is there an API for match objects yet?
18:25 avar I.e. for writing your own regex matchers as *normal* subs
18:25 ash__ like tokens?
18:25 ash__ or do you mean extending the regex grammar?
18:25 moritz_ avar: not quite... there's something going on with subclassing Cursor, but I don't know the details
18:26 ash__ can't you extend the regex grammar though?
18:27 avar I'm mainly interested in writing a perl5 re::engine::*, but I was always blocking on match objects being "who knows" :)
18:28 moritz_ avar: so are you looking for an API for matcher rules, or for objects of type Match?
18:29 colomon rakudo: say ~(2..4)
18:29 p6eval rakudo f6ec0a: OUTPUT«2 3 4␤»
18:32 lisppaste3 avar pasted "I wanted to be able to write perl5-matcher subs like this" at http://paste.lisp.org/display/98390
18:33 avar but afaikt there's no spec for the methods on $matcher and there was no p6 regex engine that allowed easy introspection like that.
18:33 moritz_ avar: that would be cursors, not match objects
18:34 dual joined #perl6
18:34 moritz_ avar: that's what the unfinished match objects are called like
18:34 moritz_ if you look into STD.pm6, that's what's stored in $¢
18:34 moritz_ but I don't know how much of it is API
18:35 lisppaste3 avar pasted "more specifically, to rewrite the subs to perl5 like this" at http://paste.lisp.org/display/98391
18:35 avar moritz_: ah..
18:37 ash__ rakudo: use MONKEY_TYPING; augment grammar Regex::P6Regex::Grammar
18:37 p6eval rakudo f6ec0a: OUTPUT«Malformed package declaration at line 11, near ""␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
18:37 ash__ rakudo: use MONKEY_TYPING; augment grammar Regex::P6Regex::Grammar { };
18:37 p6eval rakudo f6ec0a: OUTPUT«Method 'compose' not found for invocant of class ''␤current instr.: 'perl6;Regex;P6Regex;Grammar;!class_init_11' pc 352 (EVAL_1:161)␤»
18:37 ash__ thats no good
18:37 moritz_ rakudo: Grammar
18:37 p6eval rakudo f6ec0a:  ( no output )
18:38 avar is there a perl6 example of extending a grammar with plain perl subs?
18:38 avar i.e. 'sub' instead of 'regex/token/rule'
18:38 avar since they're just regular subs with the same calling conventions, or so I thought
18:38 moritz_ avar: I don't know such an example... maybe pmichaud does
18:39 moritz_ (and they are methods in Perl 6, not subs)
18:39 avar right, terminology:)
18:39 moritz_ but that won't make much of a difference in Perl 5 anyway :-)
18:39 avar I'd need some vague example of how it's done "right" in p6 as well as some engine I could embed in p5
18:40 ash__ i am not sure what your trying to do avar, what exactly do you mean to accomplish?
18:41 avar write a plugin to bring grammars to perl5
18:41 moritz_ you do know of Regexp::Grammar though, I guess?
18:41 ash__ oh, for perl5?
18:41 moritz_ erm, Regexp::Grammars
18:41 moritz_ yes
18:42 ash__ makes sense now, my bad
18:42 * ash__ wonders how gimme5 does it...
18:42 moritz_ with Cursor.pmc
18:45 avar moritz_: Yeah I've seen Regexp::Grammar. I don't think it cuts it by a long shot
18:45 avar I'm interested in something that seemlessly uses perl5 method calling conventions
18:46 moritz_ maybe you can make any sense of the compiled version of STD.mp6
18:46 avar anyway, I'll check out this cursor stuff
18:46 moritz_ *pm6
18:49 * TPF|Coke wonders how long until sorear's work is checked in so others can play.
18:49 finanalyst joined #perl6
18:49 jnthn TPF|Coke: I'll give the patch a look in an hour or two.
18:49 hercynium joined #perl6
18:49 hercynium joined #perl6
18:50 colomon rakudo: say (1, 3, 6, 3, 4, 2, 1231, -32).minmax(-> $a, $b { $a <=> $b };).perl
18:50 p6eval rakudo f6ec0a: OUTPUT«Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
18:50 colomon rakudo: say (1, 3, 6, 3, 4, 2, 1231, -32).min(-> $a, $b { $a <=> $b };).perl
18:50 p6eval rakudo f6ec0a: OUTPUT«Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
18:50 moritz_ colomon: no ; after }
18:50 colomon rakudo: say (1, 3, 6, 3, 4, 2, 1231, -32).min(-> $a, $b { $a <=> $b }).perl
18:50 colomon moritz_++
18:50 p6eval rakudo f6ec0a: OUTPUT«-32␤»
18:51 colomon rakudo: say (1, 3, 6, 3, 4, 2, 1231, -32).minmax(-> $a, $b { $a <=> $b }).perl
18:51 p6eval rakudo f6ec0a: OUTPUT«Method 'minmax' not found for invocant of class 'Parcel'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
18:51 colomon think I'll have to fix that....
18:51 jnthn :-)
18:52 * jnthn afk for a little bit
18:52 colomon errr... wait, minmax is an operator?
18:52 moritz_ yes
18:53 colomon is there a reason there isn't a minmax method as well?
18:53 colomon (just like we have the min operator and the min method?)
18:53 moritz_ no idea
18:55 colomon where's TimToady when you need him?  :)
18:55 isBEKaml_ hey, are there any environment variables I need to set up, apart from appending the path to perl6 binary?
18:56 ash__ PERL6LIB is checked isn't it? (i think it defaults to ~/.perl6/lib
18:56 ash__ )
18:57 ash__ if you want to start writing your own libraries and storing them in that folder
18:57 moritz_ isBEKaml_: you need to 'make install' rakudo to use it outside of its source dir
18:57 isBEKaml_ no PERL6LIB
18:57 ruoso joined #perl6
18:58 colomon moritz_: better forgiveness than permission, right?  :)
18:58 moritz_ colomon: aye... what are you planning? :-)
18:59 colomon just adding a minmax method which is exactly analogous to the existing min and max methods, and the output of the minmax operator.
19:00 colomon first implementation is compiling now, and I'm getting ready to add spectests.
19:01 isBEKaml_ moritz_: Ah, missed that. I just did gmake. :s
19:01 colomon > say (1, 3, 6, 3, 4, 2, 1231, -32).minmax(-> $a, $b { $a <=> $b }).perl
19:01 colomon (-32, 1231)
19:07 colomon rakudo: say (1..10).map({ ($_-3) * ($_-5) }).perl
19:07 p6eval rakudo f6ec0a: OUTPUT«(8, 3, 0, -1, 0, 3, 8, 15, 24, 35)␤»
19:13 ruoso joined #perl6
19:13 _jaldhar joined #perl6
19:14 ash_ joined #perl6
19:19 * moritz_ congratulates masak++ and pmurias++ to their accepted gsoc proposals
19:19 colomon \o/
19:19 colomon that's fantastic news!
19:20 moritz_ masak's project: adding binary data to Rakudo
19:20 ash_ cool
19:20 moritz_ pmurias' project: releasing SMOP to the CPAN
19:20 spinclad \o/ \o/
19:20 ash_ adding binary data to rakudo?
19:20 spinclad Bug
19:20 colomon ash_: Buf
19:20 spinclad *Buf
19:20 ash_ ooh, got ya
19:20 ash_ cool
19:20 moritz_ Buf, .encode, .decode, IO
19:21 ash_ like opening a file in binary mode
19:21 colomon I don't know the proposal details, but it will be great to finally have that stuff.
19:21 PerlJam + pack/unpack
19:21 moritz_ see http://socghop.appspot.com/gsoc/program/list_projects/google/gsoc2010 for the full list - don't know if it's publicly visible
19:21 ash_ i wonder if any of that will fall back into parrot...
19:21 colomon moritz_: you're mentoring him, yes?
19:22 moritz_ colomon: nope, jnthn++ does
19:22 colomon ah, cool.
19:23 [particle] spinclad: i kinda like Bug.  my Bug $x; # easy to find trouble later...
19:24 moritz_ accepted parrot proposals: hybrid threads for parrot; a PAST optimization framework; an instrumentation framework (kinda like dtrace, if I understood correctly); NFG strings; NCI system and LLVM stack builder
19:25 * moritz_ hopes the proposals are public
19:25 ash_ i can send you a link to mine if you want to see it, its in a google doc
19:26 colomon oh wow, those are great parrot proposals, too!  this is really exciting.
19:27 moritz_ ash_: I'm a (possible) mentor, I can see them anyway... the general public might not
19:27 moritz_ oh, just tried in another browser -- can the the abstract and title there
19:28 colomon I couldn't find masak on the list in my browser.  :(
19:28 moritz_ colomon: search for Rakudo in the project title
19:28 moritz_ colomon: I can't find him by name either - weird
19:28 colomon I don't get rakudo either, actually.
19:28 colomon I wonder if I'm just not seeing the entire list.
19:29 ash_ its a big list
19:29 colomon parrot stuff comes up...
19:29 ash_ it took a while for it to load for me
19:29 ash_ (its loading via javascript)
19:29 diakopter you have to scroll to the bottom several times
19:29 diakopter it loads another 250 each time you scroll to the very bottom
19:29 TPF|Coke if you click on teh search icon, you can do that before the whole list loads.
19:29 diakopter there are 1025 total
19:30 TPF|Coke I do that and search for rakudo, I see one from masak.
19:30 diakopter yes
19:30 colomon ah, if I enter masak under student I get his.
19:30 moritz_ dukeleto++
19:30 moritz_ [particle]++
19:31 colomon Currently in Rakudo (the most actively developed Perl 6 implementation), when you try to open a file which happens to contain non-UTF-8 data, it dies with "Malformed UTF-8 string". The project aims to fix this, as well as add support for the Buf type to Rakudo. The Buf type in Perl 6 is slated to be able to hold arbitrary binary data.
19:31 moritz_ TPF|Coke++
19:31 * TPF|Coke sighs.
19:32 * TPF|Coke wonders if he can get "coke" on this server. :P
19:33 diakopter http://pastebin.com/gJetFy3t
19:33 diakopter ordered by project/organization
19:33 diakopter 33 for Python
19:34 moritz_ not surprising; google is a python shop
19:34 diakopter 15 for wordpress
19:34 moritz_ still I think 10 for perl is not bad at all
19:34 [particle] it's better than the 5 we had last year
19:35 [particle] slot allocation is partially based on previous year's success
19:35 diakopter 50 for kde
19:35 diakopter lol; 4 for freedroid
19:36 [particle] tpf has been doing well, growing #mentors, #students, #applications, %successful projects, and perception in gsoc community
19:36 ash_ oh, neat another one for the perl foundation, someone is implementing Ctypes for perl5, which would be cool
19:37 moritz_ with rurban++ as mentor, iirc
19:37 diakopter I suspect a good strategy to accumulate more slots is to submit more applications
19:37 PerlJam ash_: can you explain to me why you  think that would be cool?
19:37 ash_ because you could have less XS stuff
19:37 moritz_ because writing XS sucks?
19:37 PerlJam ash_: I read it but couldn't get excited about it.  It seems like just another interface.
19:38 PerlJam maybe I haven't written enough XS to reach the pain threshhold
19:38 ash_ it makes calling C code native to perl5, so you don't have to drop into XS to make calls to libraries like mysql or something
19:39 PerlJam ash_: you mean like http://search.cpan.org/~gaal/FFI-1.04/FFI.pm ?
19:39 PerlJam :)
19:39 ash_ so, say you have a new library someone just came out with that can calculate pi, you don't need a new XS module written from scratch, you just use libffi or w/e it will be called, then say it takes a C int, and a C double as the two parameters for the function call, then you just call it like normal perl
19:40 ash_ yeah, thats the one I have seen in the past
19:41 PerlJam I guess I really couldn't get excited because we already have FFI.  What does ctypes bring to the table that FFI doesn't?
19:42 gurjeet left #perl6
19:43 ash_ nothing, ctypes is libffi
19:44 ash_ they are the same thing, but i don't think that FFI module is really maintained, at least it didn't work last time i checked
19:47 plobsing looking over the FFI.pm doc, it uses libffcall, not libffi. Also it's support for pointer types looks a bit weak.
19:50 ash_ plobsing: my llvm stack frame project was accepted into the GSoC, so you know, it listed you as my mentor
19:52 plobsing yes, I saw
19:52 plobsing I'm look forward to seeing how that turns out
19:52 plobsing s/look/looking/
19:56 colomon ash_++
19:58 nihiliad joined #perl6
20:01 dalek rakudo: 8098bf9 | (Solomon Foster)++ | src/core/Any-list.pm:
20:01 dalek rakudo: Add Any.minmax.
20:01 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/8098bf99504475cc8444ae19664905c82225bed8
20:01 pugssvn r30478 | colomon++ | [t/spec] Add tests for method form of minmax.
20:02 * jnthn back
20:05 colomon jnthn: yay for gsoc!
20:05 jnthn Yes! :-D
20:06 cognominal http://martinfowler.com/snips/201004261601.html  # may interest some people here
20:11 diakopter perlesque: my $*PHRASE = 'hello'; sub foo() { say($*PHRASE); return 1 }; sub bar() { my $*PHRASE = 'world'; foo(); return 1 }; foo(); bar()
20:11 p6eval perlesque: OUTPUT«hello␤world␤»
20:11 diakopter whee.
20:12 diakopter now to add the reverter line to the exit point of all blocks...
20:15 * colomon just realized he's been writing { $^a <=> $^b } when &[<=>] is less typing and probably more efficient.  Win!
20:15 moritz_ of &infix:«<=>» for that matter
20:15 [particle] that's very pointy, don't drop it!
20:15 colomon moritz_: sure enough.  though that's a lot of tricky typing.  :)
20:15 gruotr joined #perl6
20:16 moritz_ rakudo: <a b 1 2 -5 8>.sort(&[<=>]).perl.say
20:16 p6eval rakudo f6ec0a: OUTPUT«("-5", "a", "b", "1", "2", "8")␤»
20:16 moritz_ rakudo++
20:16 gurjeet joined #perl6
20:17 jnthn That short form is cute. :-)
20:18 ash_ rakudo: say <1/2> * 2; say "1/2" * 2; say 1/2 * 2;
20:18 p6eval rakudo 8098bf: OUTPUT«2␤2␤1␤»
20:18 moritz_ rakudo doesn't understand literals in <...> yet
20:18 ash_ but the "1/2" still wasn't right either...
20:19 ash_ or is that also not expected to pass?
20:19 moritz_ it numifies to 1
20:19 moritz_ at least I think so
20:19 ash_ rakudo: say +"1/2", +"0.5";
20:19 p6eval rakudo 8098bf: OUTPUT«10.5␤»
20:20 ash_ thats 1 and 0.5 not 10.5
20:20 ash_ should of added a space i guess
20:22 ash_ so, right now its doing more like /\d+ [ \. \d+ ]?/ when it should maybe be more like /\d+ [ \.|\/ \d+]?/ maybe?
20:24 moritz_ depends on what you mean by "should"
20:25 ash_ just trying to figure out how you could match against fractions and decimals
20:25 ash_ i am also assuming 1/2/2/3 isn't a fraction, and you can't do 1/1.5
20:26 ash_ which i probably shouldn't assume
20:27 REPLeffect joined #perl6
20:33 colomon ash_: not sure the context (just sat back here again after an exciting diaper change) but 1/2/2/3 and 1/1.5 should be both be Rats in Rakudo.
20:33 colomon rakudo: my $a = 1/2/2/3; say $a.WHAT; say $a.perl
20:33 p6eval rakudo 8098bf: OUTPUT«Rat()␤3/4␤»
20:33 colomon rakudo: my $a = 1/1.5; say $a.WHAT; say $a.perl
20:33 p6eval rakudo 8098bf: OUTPUT«Confused at line 11, near "my $a = 1/"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
20:33 colomon rakudo: my $a = 1 / 1.5; say $a.WHAT; say $a.perl
20:34 p6eval rakudo 8098bf: OUTPUT«Rat()␤2/3␤»
20:34 colomon think that first is a Rakudobug, actually.
20:34 diakopter rakudo: my $*PHRASE = 'hello'; sub foo() { say($*PHRASE); return 1 }; sub bar() { my $*PHRASE = 'world'; foo(); { my $*PHRASE = 'sign'; foo() }; return 1 }; foo(); bar(); foo()
20:34 p6eval rakudo 8098bf: OUTPUT«hello␤world␤sign␤hello␤»
20:34 diakopter perlesque: my $*PHRASE = 'hello'; sub foo() { say($*PHRASE); return 1 }; sub bar() { my $*PHRASE = 'world'; foo(); { my $*PHRASE = 'sign'; foo() }; return 1 }; foo(); bar(); foo()
20:34 p6eval perlesque: OUTPUT«hello␤world␤sign␤hello␤»
20:34 diakopter yay.
20:35 diakopter (finally)
20:36 ash_ colomon: i am talking about string to num conversions
20:36 ash_ rakudo: say +"1/2";
20:36 p6eval rakudo 8098bf: OUTPUT«1␤»
20:36 ash_ rakudo: say +"1/2" == 1/2;
20:36 p6eval rakudo 8098bf: OUTPUT«0␤»
20:37 SmokeMachine joined #perl6
20:39 diakopter rakudo: say +"1/2" - 1/2;
20:39 p6eval rakudo 8098bf: OUTPUT«0.5␤»
20:39 pmurias joined #perl6
20:39 diakopter pmurias: yo.
20:40 ash_ "1/2" gets converted to 1, (i think its just the first digit it sees) when it should be 1/2
20:41 pmurias diakopter: hello
20:41 pmurias my proposal got accepted ! :)
20:41 moritz_ pmurias: congratulations! Time for community bonding :-)
20:43 REPLeffect joined #perl6
20:47 pmurias moritz_: do to get the perlesque mildew backend to work to bond with diakopter
20:47 pmurias ;)
20:47 diakopter whee
20:48 diakopter perlesque:  # pmurias: this is cool: ␤my $*PHRASE = 'hello'; sub foo() { say($*PHRASE); return 1 }; sub bar() { my $*PHRASE = 'world'; foo(); { my $*PHRASE = 'sign'; foo() }; return 1 }; foo(); bar(); foo()
20:48 p6eval perlesque: OUTPUT«hello␤world␤sign␤hello␤»
20:49 diakopter perlesquel: .
20:49 p6eval perlesquel: OUTPUT«hello␤world␤sign␤hello␤real 0.13␤user 0.02␤sys 0.02␤»
20:49 diakopter perlesquel: .
20:49 p6eval perlesquel: OUTPUT«hello␤world␤sign␤hello␤real 0.04␤user 0.03␤sys 0.01␤»
20:49 colomon pmurias++
20:51 diakopter perlesque: my $a = BigInteger.Create("335722"); $a += 357389; say($a)
20:51 p6eval perlesque: OUTPUT«693111␤»
20:52 diakopter o_O I didn't realize "+" would work with BigInteger and int
20:52 diakopter of course it won't work the other way
20:57 isBEKaml_ Alright, wow, I didn't realise perl6 was actually this much fun. Sure, I'll be back again tomorrow for more fun! :) Btw, congratulations to pmurias and masak for their accepted gsoc proposals. :)
20:57 isBEKaml_ g'nite folks..
20:57 jnthn night o/
20:57 isBEKaml_ left #perl6
21:01 ReiniUrban joined #perl6
21:11 pmurias diakopter: could you check why http://pastie.org/936229 fails
21:11 pmurias ?
21:15 cdarroch joined #perl6
21:15 cdarroch joined #perl6
21:17 rurban Ctypes just uses the more liberal libffi, and adds a heafder parsr
21:17 rurban Ctypes just uses the more liberal libffi, and adds a header parser. Otherwise it's the same old FFI as the other 5.
21:18 rurban (just saw this discussion)
21:22 dalek rakudo: 9fbb25c | jonathan++ | src/Perl6/Compiler/Role.pm:
21:22 dalek rakudo: Implement lexical roles. Also, allow roles of all scopes to be used as r-values.
21:22 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/9fbb25c693ef2de6ccd657ecb910e4cba6a24613
21:22 dalek rakudo: ef4e74f | jonathan++ | src/Perl6/ (2 files):
21:22 dalek rakudo: Add anon scope declarator so it's possible to declare anonymous named things.
21:22 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/ef4e74f0033d7c757a45ce04e2075dd25939b231
21:42 Juerd Anonymous named things? Oh my god this language is powerful!
21:42 Juerd I hope it's not like PHP's create_function, though
21:43 Juerd Which is cleverly documented as "Creates an anonymous function from the parameters passed, and returns a unique name for it."
21:44 Juerd Of course, PHP's create_function creates named anonymous things, not anonymous named things.
21:44 Juerd Or something. I'm confused :(
21:44 jnthn no, it's not that nasty. :-)
21:45 Juerd Of course it's not. I firmly believe that Perl 6 developers are incapable of writing anything that's that nasty.
21:46 jnthn rakudo: my $x = anon class Foo { }; say $x
21:46 p6eval rakudo 8098bf: OUTPUT«Could not find sub &anon␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
21:46 Juerd They keep things free of nastiness or go WELL beyond PHP's standards for it.
21:46 jnthn Ah, not updated yet.
21:46 jnthn anyway
21:46 jnthn > my $x = anon class Foo { }; say $x
21:46 jnthn Foo()
21:46 jnthn The idea is that there's no Foo installed anywhere, but the thing still knows its name.
21:47 Juerd Reminds me of http://search.cpan.org/~xmath/Sub-Name-0.04/lib/Sub/Name.pm
21:47 Juerd Ewwwwwww. The tap water smells funny and looks yellowish.
21:48 Juerd I think I'll boil it and have tea instead.
21:48 jnthn Eww!
21:49 PerlJam sulphuric tea
21:50 jnthn Tastes like ash!
21:52 diakopter pmurias: I think the sub needs a name
21:53 diakopter either that or method calls don't yet accept more than 1 argument :)
21:54 diakopter hm, they do.
21:54 diakopter so, I think the sub needs a name
21:54 frettled U984?
21:56 Spreadsheet_ joined #perl6
21:56 Spreadsheet_ joined #perl6
21:56 Spreadsheet_ joined #perl6
21:56 Spreadsheet_ Does Perl 6 have a variable for the last evaluated value?
21:56 Spreadsheet_ Like ML's "it"
21:56 diakopter not that I know of
21:56 Spreadsheet_ So I call subroutine "foo", which evaluates to 42. I can access it by getting "it"
21:57 Spreadsheet_ I think it would be useful
21:57 frettled Why, when you can store the result in a variable?
21:57 Spreadsheet_ I think it has to do something with currying.. let me read this blog post
21:59 frettled Like this, you mean?  http://blogs.gurulabs.com/stephen/2008/12/currying-in-perl-6.html
21:59 arnsholt frettled: The most compelling use of it I saw was anaphoric macros in Lisp
22:00 frettled arnsholt: Yes, that's about it.
22:00 arnsholt So you do if foo($bar, $blech) && $it + 42 > 100 { ... }
22:02 diakopter perlesque: say("foo'" == 'foo\'')
22:02 p6eval perlesque: OUTPUT«False␤»
22:03 diakopter forgot to unescape things
22:04 arnsholt Shouldn't it be eq, rather than ==?
22:04 frettled arnsholt: but mostly, you can just assign and test at the same time and get away with it.
22:05 arnsholt frettled: Yeah, but you can bet people are going to ask for soemthing that lets them get away with not typing the assignment =)
22:05 frettled I think we just saw that.
22:05 Spreadsheet_ Ok I think this is what they are trying to say
22:05 pmurias diakopter: it would be helpfull if when adding features you added tests so i could see what's supported
22:05 Spreadsheet_ I'll paste it
22:06 frettled In Perl 5, I'm happy with some of the implicit $_ magic, but I don't think that it's necessarily obviously good.
22:06 frettled Spreadsheet_: on paste.lisp.org/new/perl6?
22:06 Spreadsheet_ Yes
22:06 arnsholt Yeah, I think the way is to make it some kind of magic added by a module
22:06 christine joined #perl6
22:06 arnsholt But I'm not entirely sure how to implement it. The only implementation I've seen was with macros in CL, but those were unhygienic macros
22:08 REPLeffect joined #perl6
22:09 frettled It sort of reminds me of certain kinds of assembly programming.
22:09 lichtkind joined #perl6
22:10 frettled It also reminds me of shortcut-ternary ?:, which can be found in some languages.  That's kindof neat.  Didn't someone add a mechanism like that to P6, BTW?
22:11 Spreadsheet_ joined #perl6
22:11 Spreadsheet_ Back
22:14 frettled Perhaps it could be solved with a sequential junction?
22:15 Spreadsheet_ wow, I can't think of why an "it" variable would be useful
22:16 frettled :)
22:16 Spreadsheet_ I got it from http://www.svendtofte.com/code/curried_javascript/
22:19 Juerd I've sometimes wanted a "that" variable, that would refer to the value of the last boolean :)
22:19 Juerd s/boolean/condition/
22:19 Spreadsheet_ Apparently "it" is only useful in an interactive environment
22:19 * jnthn remembers it from his ML days
22:20 jnthn It was nice in a REPL.
22:20 Juerd if (something) { print that }
22:20 stepnem joined #perl6
22:20 jnthn Juerd: if something -> $that { print $that }
22:20 Infinoid joined #perl6
22:20 Juerd jnthn: Of course, but the magic of not having to write the variable name twice is of course what makes magic so cool.
22:21 jnthn True. :-)
22:21 Juerd Note that I'm not at all convinced that it would be a good idea.
22:21 jnthn Yeah
22:21 jnthn Feels a bit *too* magical for me.
22:21 ash_ what about $_
22:21 ash_ $_ is rather magical sometimes
22:22 Juerd ash_: How useful would $_ still be if it were changed with every conditional? :)
22:22 Juerd for (@foo) { if (/.../) { argh! } }
22:22 ash_ no, i am not saying update $_, i was just commenting that perl has lots of magic
22:23 Juerd Maybe I'm just spoiled but I don't see $_ as a magical thing :)
22:24 ash_ coming from another language, $_ feels like magic
22:24 Spreadsheet_ What is $_? Is it related to @_?
22:24 Juerd Oh, wow.
22:24 Juerd Spreadsheet_: $_ is the default variable for many Perl constructs.
22:25 Juerd Spreadsheet_: For example, if you write .foo that's short for writing $_.foo, and if you write for (@array) { ... } that's short for for (@array) <-> $_ { ... }
22:25 Juerd If you combine those, you can write "for (@array) <-> $_ { $_.something }" as "for (@array) { .something }" which is much nicer.
22:26 TimToady even better without the parens
22:26 phenny TimToady: 24 Apr 10:51Z <sorear> tell TimToady , What is the most reasonable interface for accessing Perl 5 globals?  Something like GLOBAL<perl5>::MainWindow.new, but you probably have a niftier syntax
22:26 Spreadsheet_ oo cool
22:26 Juerd TimToady: Right. Sorry :)
22:26 Juerd TimToady: I was wondering why it looked so funny. I guess I'm not used to seeing () with -> or <-> :)
22:27 Juerd Spreadsheet_: TimToady is right - it's even better when written as "for @array { .something }"
22:27 Juerd Of course Perl also has ".something for @array;" which I personally find even nicer.
22:27 jnthn And if you dont' care about the order the calls are done, @array>>.something
22:27 ash_ TimToady: i had a question about slurpy arguments, what would *$ slurp? i haven't figured that one out... or is the slurp on it just ignored
22:27 TimToady or even: map *.something, @array
22:27 Juerd That has little to do with $_ though :)
22:27 jnthn Juerd: Well, it saves a use of it. ;-)
22:28 TimToady *$ slurps the first arg that would have gone to *@
22:28 jnthn Rakudo, sadly, doesn't implement that one yet.
22:28 jnthn jnthn-- didn't get around to it.
22:29 * Juerd sends a truck full of wooden round tuits to jnthn
22:29 ash_ ah, so thats why that worked earlier... is it any different than sub foo($a, *@b) ?
22:29 jnthn Juerd: :-)
22:30 jnthn ash_: I guess yes, in that it will have enfoced list context on the whole load of arguments.
22:31 ash_ rakudo: sub foo(*$a, *@b) { say "a: ", $a, " b: ", @b; }; foo(1, 2, 3); foo(1); foo;
22:31 p6eval rakudo 9fbb25: OUTPUT«a: 1 b: 23␤a: 1 b: ␤Not enough positional parameters passed; got 0 but expected at least 1␤current instr.: 'foo' pc 200 (EVAL_1:79)␤»
22:31 ash_ that doesn't work in nqp, i realized, and so i tested it in rakudo, it seems to work fine in rakudo, i was just wondering what the function of *$ is, it seems to act like $
22:32 jnthn Oh.
22:32 jnthn Maybe it...accidentally works. ;-)
22:33 jnthn "works"
22:33 jnthn :-)
22:33 ash_ i was wondering if it should throw a parse error, since *$ doesn't make sense in my mind, but maybe i am misunderstanding it, the others *@, *%, *& make sense though
22:34 jnthn phenny: tell sorear I've reviewed your patch, refactored it just a little bit and fixed a bug. I'm not keen on the getprop/setprop bit, but I appreciate this is a work in progress and we can iterate on it a bit. But I'm putting it in for now, so people can start playing with the Perl 5 interop.
22:34 phenny jnthn: I'll pass that on when sorear is around.
22:35 TimToady ash_: the difference is if you call foo(@bar), whether @bar gets bound only to the first argument, or to all the slurpy arguments
22:37 ash_ jnthn i think i found a bug...
22:37 ash_ rakudo: sub foo(*@a, *$b) { say "a: ", @a, " b: ", $b; }; my @f = 1, 2, 3; foo(|@f);
22:37 p6eval rakudo 9fbb25: OUTPUT«Not enough positional parameters passed; got 3 but expected between 1 and 0␤current instr.: 'foo' pc 275 (EVAL_1:98)␤»
22:39 ash_ so, foo(*$a, *@b) { ... }   foo(@bar) should expand to $a = @bar[0], @b = @bar[1..*]?
22:39 jnthn ash_: Ah
22:39 jnthn We should probably whine about that.
22:40 jnthn std:  sub foo(*@a, *$b) { say "a: ", @a, " b: ", $b; };
22:40 p6eval std 30478: OUTPUT«ok 00:01 112m␤»
22:40 ash_ jnthn its *$
22:40 ash_ rakudo: sub foo(*$a) { }; my @a = 1, 2, 3; foo(|@a);
22:40 p6eval rakudo 9fbb25: OUTPUT«Too many positional parameters passed; got 3 but expected 1␤current instr.: 'foo' pc 275 (EVAL_1:98)␤»
22:41 ash_ it seems to be the fact i put the *$ after a *@
22:42 jnthn Yes, I suspect that should be disallowed.
22:44 rv2733 joined #perl6
22:45 wknight8111 joined #perl6
22:54 dalek rakudo: 6c52872 | jonathan++ | src/Perl6/Compiler/Package.pm:
22:54 dalek rakudo: Allow use of lexically declared classes as an r-value (that does the right thing).
22:54 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/6c52872f4a4b75721ed1f69f7d3436259d9ad790
22:54 dalek rakudo: 3a89591 | jonathan++ | src/Perl6/Module/Loader.pm:
22:54 dalek rakudo: Apply a slightly refactored and tweaked patch from sorear++ to add a first cut of loading and importing from foreign libraries. Works with Blizkost (tested here on Win32). Not complete/final, but should let people start playing with a few aspects of Perl 5 interop.
22:54 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/3a895915d086abd1fedecff2cbe1dcef2dfb903e
22:58 bbkr_ joined #perl6
23:00 gruotr joined #perl6
23:02 gurjeet joined #perl6
23:03 snarkyboojum joined #perl6
23:06 hercynium joined #perl6
23:20 pugssvn r30479 | jnthn++ | [t/spec] Add some very, very basic tests for lexical roles.
23:22 dalek rakudo: bd47b29 | jonathan++ | t/spectest.data:
23:22 dalek rakudo: Add S14-roles/lexical.t to spectest.data.
23:22 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/bd47b2931fd66a2aad9f91521b869bae865df019
23:30 am0c joined #perl6
23:32 sorear (backlogging)
23:32 phenny sorear: 22:34Z <jnthn> tell sorear I've reviewed your patch, refactored it just a little bit and fixed a bug. I'm not keen on the getprop/setprop bit, but I appreciate this is a work in progress and we can iterate on it a bit. But I'm putting it in for now, so people can start playing with the Perl 5 interop.
23:33 sorear Currently $!x is a bad semantic fit for private attributes for reasons like this; $._x is probably better
23:33 sorear moritz_:
23:38 TimToady the whole point of private attributes is to *not* supply a method; they're infrastructural
23:38 TimToady Moose gets away with it because it has Perl hashes underneath to do the infrastructure
23:42 TimToady $!x is providing the same functionality as hashes in P5, only opaquely even to the class using it for infrastructure
23:43 TimToady it's a different encapsulation layer than slots
23:51 pugssvn r30480 | colomon++ | [Spec] Add .minmax method along the lines of the .min and .max methods.
23:53 TimToady I think minmax should generally just work with Ranges, maybe
23:53 TimToady and assume any single $n is $n..4n
23:53 TimToady $n..4n
23:53 TimToady $n..$n  !!!!
23:54 TimToady .oO(stupid keyboard)
23:54 TimToady .oO(more like stupid corpus collosum)
23:55 diakopter "you might be ircing on a touchscreen phone if ..."
23:58 jnthn sorear: BTW, Blizkost and using it from Rakudo works well on Win32 + MSVC compiler. :-)
23:58 yinyin joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo