»ö« | perl6.org/ | nopaste: paste.lisp.org/new/perl6 | evalbot usage: 'perl6: say 3;' or rakudo:, alpha:, pugs:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend!
Set by lichtkind on 5 March 2010.
00:07 ruoso joined 00:17 Spreadsheet_ left, colomon joined 00:22 yinyin joined 00:30 rgrau` left 00:31 sundar left, REPLeffect left 00:33 REPLeffect joined 00:34 kensanata left 00:36 k23z__ joined
pugssvn r30477 | colomon++ | [t/spec] Add more tests using the base argument. 00:39
00:42 sundar joined 00:43 sundar is now known as sundar_afk 00:57 wknight8111 left
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:04
*its parent 01:05
01:05 ruoso left
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:05
sorear .HOW is theoretically supposed to be special syntax, not a method 01:06
a predefined macro or grammar rule
CokeBot9000 sorear: I'm talking about rakudo, not "the spec"
01:07 takadonet left
CokeBot9000 (I'm pretty sure that rakudo is treating all the macros as methods atm for convenience.) 01:07
01:10 lest_away is now known as lestrrat
CokeBot9000 guesses src/class/Role.pir ? 01:10
no, that's Perl6Role, no P6Role. 01:11
phenny: hepl? 01:16
phenny: help?
phenny CokeBot9000: Hi, I'm a bot. Say ".commands" to me in private for a list of my commands, or see inamidst.com/phenny/ for more general details. My owner is sbp.
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:28
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: 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.
phenny CokeBot9000: I'll pass that on when jnthn is around.
CokeBot9000 (ugh)
Sorry about the repeat-o-spam. =-)
01:31 hicx174 left 01:35 hicx174 joined 01:46 alester joined
colomon rakudo: say Int ~~ Cool 01:52
p6eval rakudo e393c7: OUTPUT«1␤»
diakopter rakudo: say Nil ~~ Cool 01:56
p6eval rakudo e393c7: OUTPUT«1␤»
01:58 Psyche^ joined 02:02 Patterner left, Psyche^ is now known as Patterner 02:07 JimmyZ joined 02:09 ruoso joined 02:10 TiMBuS left 02:14 bradb left 02:15 ruoso left 02:17 JimmyZ left 02:30 ruoso joined 02:47 meppl joined 02:48 gfldex left 02:52 cosimo joined 02:56 JimmyZ joined 03:00 bradb joined 03:21 SmokeMachine joined 03:23 SmokeMachine left 03:26 yinyin left 03:40 meppel joined 03:44 meppl left 03:55 nihiliad left 03:57 k23z__ left 04:03 fridim joined 04:04 bradb left 04:08 yves left 04:14 orafu left, orafu joined 04:26 s1n joined 04:44 orafu left 04:54 lestrrat is now known as lest_away 04:55 lest_away is now known as lestrrat 04:57 Dunearhp left, lestrrat is now known as lest_away 05:02 ReiniUrban joined 05:03 rurban left, ReiniUrban is now known as rurban 05:09 meppel is now known as meppl 05:15 Dunearhp joined
diakopter hi 05:16
05:16 molaf joined 05:18 yinyin joined 05:23 alester left 05:31 hudnix left
sorear hello 05:34
diakopter: CLR uses a single unified namespace, right? So DateTime in Perl6-land is identical with DateTime in C# and Java? 05:36
05:41 molaf left 05:52 uniejo joined 06:02 eiro left 06:09 JimmyZ left 06:20 am0c joined 06:21 Chillance left 06:23 ab5tract left
moritz_ good morning 06:40
sorear indeed
06:41 yves__ joined
moritz_ I've just checked my log files, and nearly fell over - typically 300 to 800 visitors per day, yesterday 8800 06:42
mostly due to www.reddit.com/r/programming/commen..._compiler/ it seems
sorear Personally I thought compilers being easy was self-evident 06:44
moritz++ being better at psychology
06:45 lest_away is now known as lestrrat 06:46 yves__ left 06:47 viklund joined
sorear nqp: 0 ?? say("Oops!") !! say("Good") 06:47
p6eval nqp: OUTPUT«Good␤»
sorear hello viklund
viklund hello 06:48
moritz_ hi 06:49
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)␤»
sorear nqp: my %x; %x<a> := 1; for %x { say($_); }
p6eval nqp: OUTPUT«a␤»
sorear rakudo: my %x; %x<a> = 1; for %x { say($_); }
p6eval rakudo e393c7: OUTPUT«a 1␤␤»
sorear :/
use of hashes in interlanguage APIs considered ridiculous 06:59
06:59 JimmyZ joined
sorear Hello JimmyZ 06:59
JimmyZ hello
moritz_ so nqp just iterates over the keys? 07:00
sorear well, it's a function of the PMC
07:00 yves__ joined
sorear parrot;Hash just iterates over the keys 07:00
perl6;Hash iterates over both
you have to know what language %foo came from if you want to iterate over it
moritz_ maybe it's saner to copy foreign hashes onto Perl 6 hashes before using 07:02
sorear That doesn't help - the only way to copy hashes is to iterate over them 07:03
moritz_ oh.
sorear The current HLLCompiler interface is specced to return a hash of exports
rakudo: my %x; %x<a> = 1; for %x { say(~$_); } 07:04
p6eval rakudo e393c7: OUTPUT«a 1␤␤»
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)␤»
sorear rakudo: my %x; %x<a> = 1; for %x { say(pir::isa__IP($_,'Pair') ?? $_.key !! $_); }
p6eval rakudo e393c7: OUTPUT«a 1␤␤»
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
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)␤»
spinclad rakudo: my %x; %x<a> = 1; for %x.keys { say($_, "\t", %x{$_}); }
p6eval rakudo e393c7: OUTPUT«a 1␤»
sorear ok, easy fix: I'm going to respec HLLCompiler to always return a hash implementation that iterates keys 07:11
for export methods.
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)␤»
sorear nqp: pir::undef__p() // 1
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)␤»
sorear nqp: pir::null__p() // 1
p6eval nqp: ( no output )
sorear nqp: say(pir::null__p() // 1)
p6eval nqp: OUTPUT«1␤»
spinclad nqp could at least get a .keys method added to its hashes in util/, i suppose; then iterating .keys would be common... 07:14
sorear no 07:15
spinclad though i don't know what sort of thing parrot;Hash is, and how that constrains you
sorear nqp doesn't have its own hashes 07:16
say() is basically the extent of the NQP RTS
say(), ok(), and plan()
07:17 Xaero joined
spinclad are you constrained from adding to those in util/ ? 07:17
07:18 XaeroOne left
sorear there is no util/ 07:19
there is only src/cheats/nqp-builtins.pir
spinclad i misremembered then, sry
check with parrot's Plumage project, i thought it was being more flexible about a RTLib for NQP code 07:20
japhb *rez* 07:21
Huhwhat?
spinclad hi japhb
japhb o/
spinclad Plumage is your project, yes
japhb Ah, asking about runtime libraries for NQP?
spinclad ?
japhb spinclad, yes 07:22
spinclad yes
japhb There are a couple different offerings.
Plumage includes Plumage::NQPUtil 07:23
There's also Kakapo.
NQP can build hashes with a tiny bit of help by tricking the calling conventions into doing all the work.
Extracting keys and values takes only slightly bigger chunks of code. 07:24
07:24 XaeroOne joined, iblechbot joined
japhb gitorious.org/parrot-plumage/parrot...QPUtil.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 Xaero left
japhb spinclad, yup. 07:26
Just do:
module Hash { 07:27
method foo () { ... }
method bar () { ... }
}
And now Parrot Hashes have two new methods. :-)
spinclad sorear, ^^ would this help? 07:29
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)␤»
spinclad that looks about the right error for this stage of mockup, anyway 07:32
japhb nqp: module Hash { method keys () { say('hi'); }; }; my %h; %h<a> := 1; %h.keys(); 07:33
p6eval nqp: OUTPUT«hi␤»
japhb Your %h.keys wasn't returning anything iterable. :-)
spinclad nqp: module Hash { method keys () { say('hi'); return [1, 2]; }; }; my %h; %h<a> := 1; for %h.keys { say('what?'); }
p6eval nqp: OUTPUT«hi␤what?␤what?␤»
spinclad ha! there she be!
japhb The real version of that is really simple: 07:34
japhb hacks your example ...
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)␤»
sorear spinclad: Absolutely not.
japhb nqp: module Hash { method keys () { my @keys; for self { @keys.push($_.key); }; @keys; }; }; my %h; %h<a> := 1; for %h.keys { say('what?'); }
p6eval nqp: OUTPUT«what?␤»
sorear spinclad: My problem is not NQP.
japhb nqp: module Hash { method keys () { my @keys; for self { @keys.push($_.key); }; @keys; }; }; my %h; %h<a> := 1; for %h.keys { say($_); }
p6eval nqp: OUTPUT«a␤»
sorear spinclad: My problem is that iterating over hashes is undefined behavior in Parrot.
japhb No its not. 07:36
spinclad (as long as you get every key exactly once...)?
japhb (Well, I suppose, order is undefined, but that's what hashes do)
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.
Iterating over a Rakudo hash, sure
Try that with a native Parrot hash and you'll just get the keys, not pair objects.
Try that with any other language and there's no telling what you'll get. 07:38
There's no telling you'll get anything at all, because the PDDs don't actually specify how you remove values from iterators
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.
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)␤»
spinclad nqp: my %h; %h<a> := 1; for %h { say(%_.key); say(%_.value); }
p6eval nqp: OUTPUT«Symbol '%_' not predeclared in <anonymous>␤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 137 (compilers/pct/src/PCT/HLLCompiler.pir:101)␤»
japhb $_
spinclad nqp: my %h; %h<a> := 1; for %h { say($_.key); say($_.value); }
p6eval nqp: OUTPUT«a␤1␤»
sorear japhb: I did. He's the one who told me that the iterator interface was unspecified.
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!
spinclad sorear: that's why it looked like you were only getting the keys
japhb Yes, the pairs stringify as a key, for backwards compatibility. 07:41
nqp: my %h; %h<a> := 1; for %h { say($_.key); say($_.value); say(~$_);}
p6eval nqp: OUTPUT«a␤1␤a␤»
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 08:17 kaare joined, kaare is now known as Guest3069 08:29 dakkar joined 08:35 mdxi left, mdxi joined, clintongormley joined, Patterner left
sorear ok, coding done, now I need to find a good way to test this 08:37
sorear make src/gen/perl6.pbc #is there a better way? 08:39
arnsholt If you've edited parts of the source, just say make 08:40
That will compile all the modified files and the files that depend on them
sorear Yes
But that takes a long time
arnsholt If you've added stuff, you'll have to tweak buils/Makefile.in
sorear about 15 minutes
because it has to recompile the entire setting
08:40 Psyche^ joined, Psyche^ is now known as Patterner
arnsholt Yeah, that's an unfortunate side-effect =) 08:41
sorear but I'm hacking on the compiler proper, and I want rapid turnaround
arnsholt Compiler proper?
sorear src/Perl6/**
I have a first implementation of use :from<perl5> in Perl6::Module::Loader. I'm certain it won't work. 08:42
08:42 jonasbn joined
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.
I don't think I actually need the setting to play with use
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
arnsholt (Compilers are a bit nasty like that)
sorear arnsholt: I do that AFTER I have the stage1 working
arnsholt Ah, right
sorear and good, since it doesn't work 08:49
What does stringifying a match do? 08:50
mathw gives you the matched text, I believe 08:51
sorear huh, our current grammar requires no space in use CGI:from<perl5>; 09:01
09:02 vorner joined
moritz_ I think the :from<perl5> is part of the name 09:10
Tene at's right. Part of the name, no space allowed. 09:15
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.
jnthn half suspected that
JimmyZ jnthn: there is patch nopaste.snit.ch/20371
jnthn JimmyZ: Does that fix everything in Rakudo? 09:28
moritz_ this looks only half right
jnthn Or just that particular build issue?
sorear jnthn: I've managed to convince Rakudo to stub symbols for perl5 09:30
jnthn sorear: \o/
09:30 am0c left
JimmyZ jnthn: Nope, I don't know how to fix setprop null access error 09:30
09:31 bbkr joined
sorear there has got to be a simpler way to do this, though 09:31
I want to patch a foreign namespace into Rakudo-space
but... there's no set_hll_namespace opcode
JimmyZ sorear: send request to parrot-dev maillist 09:32
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
avar: *laughs* I jumped on this bandwagon specifically because jnthn was asking for perl5 guts experts 09:35
as of a month ago, I had no knowledge of Parrot or Perl6
but it sounded fun
avar ah, so maybe not then:)
moritz_ hopes it's still fun, at least most of it :-) 09:36
sorear it's not always fun, but it is extremely rewarding 09:37
there, fixed the stupid bug that was keeping coloned modules from working 09:41
bacek sorear, (Parrot hashes) japhb was right. Iterating over Hash in parrot yields HashIteratorKey with C<key> and C<value> methods. 09:43
sorear yes 09:44
I see that now
and learn new things!
09:48 yinyin left
avar sorear: where are you working on this? 09:50
i.e. repo 09:51
sorear avar: local. I don't have a PCA so I'll be submitting patches
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
was 261 peak immediately after chromatic++'s leakhunt
avar: right now, I'm just patching rakudo
I've already had the necessary Parrot patch applied 09:53
(both figures MiB)
09:56 IllvilJa left
sorear > use Text::LevenshteinXS:from<perl5>; say distance("apple", "ogle") 09:58
3
in rakudo master + my working patch 09:59
jnthn oh wow!
sorear++
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:00
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
sorear hey masak 10:02
avar sorear: do you have a branch of github? I'd like to monitor it and maybe send patches:)
masak oh hai
phenny masak: 25 Apr 16:40Z <colomon> tell masak Good catch!
masak colomon: once bitten... :P
avar s/of/on/
jnthn yayitsmasakonmonday! 10:04
10:06 pjcj left, XaeroOne left 10:07 pjcj joined
sorear so, who wants to look over pastie.org/935206 10:07
masak got a comment from chip on an old blog post of mine: use.perl.org/comments.pl?sid=44169&cid=71922
sorear masak: you just missed it, I have use Module:from<perl5> working in rakudo master now \o/ 10:09
masak sorear++ \o/
sorear: that's awesome!
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
masak hugme: hug JimmyZ 10:11
hugme hugs JimmyZ
masak JimmyZ: pastie.org contains petty-borgeois propaganda! it must be resisted! 10:12
:P
JimmyZ use Java:from<java> 10:15
masak JimmyZ: that'll have to wait until we can import grammar mods :) 10:16
jnthn use YourGrandfathersParentheses:from<lisp>;
masak 'from a more noble age...'
10:21 meppl left
IllvilJa \action \o 10:21
IllvilJa rereads docs on how to use 'action' in my IRC client... 10:22
sorear masak: Well, that doesn't work yet :/
also, "SCALAR" is false.
WTF?
masak IllvilJa: forward slash? 10:23
IllvilJa masak: I know. Has happened before that I write '\action' instead of '/action'. Good way to establish a 'leet IRC image'... not! 10:24
Otherwise, I liked chromatic's article on the value of being civil in chats. 10:25
10:25 ruoso left
jnthn IllvilJa: Yeah you fail it! 10:25
oh, wait...
:-)
masak IllvilJa: whatever, n00b!
oh, right...
:)
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)␤»
jnthn I suspect the parser should whine at you for that.
std: sub foo { my class X; return X.new; };
p6eval std 30477: OUTPUT«ok 00:01 109m␤»
jnthn :/
std: sub foo { class X; return X.new; }; 10:27
p6eval std 30477: OUTPUT«ok 00:01 107m␤»
jnthn Heh. I thought a class decl with a ; had to be the first statement in the file?
bbkr: Anyways, use my class X { } form.
bbkr rakudo: sub foo { my class X {}; return X.new; }; sub bar { my class X {}; return X.new; }; print foo() === bar();
p6eval rakudo e393c7: OUTPUT«0»
jnthn Two different Xs. :-) 10:28
bbkr looks correct, class names are the same, but they were defined in different scopes.
jnthn *nod*
Yes, that's what I'd expect.
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.
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
araujo tests how long takes to build rakudo with his new laptoppy
IllvilJa makes a bet it takes less than ten years... 10:30
jnthn viklund: Yes, and then they patched it.
bbkr it will take few minutes. i was building Rakudo with full spectest on netbook this weekend :)
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
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"
famtastoc
dalek kudo: f6ec0aa | (Solomon Foster)++ | src/core/ (4 files):
Rework log methods for Numeric.
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...
arnsholt Well, it's right. It's ground extremely precisely, according to the wrong specification =D
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.
sorear that's a *lot* of new functionality for us to play with
moritz_ sorear++
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 :-) )
JimmyZ rakudo: loop { sorear++; }
p6eval rakudo e393c7: OUTPUT«Could not find sub &sorear␤current instr.: '_block46' pc 323 (EVAL_1:142)␤»
sorear the rovers are more a case of THIS WILL NOT DIE.
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)␤»
JimmyZ rakudo: say say2++;
p6eval rakudo e393c7: OUTPUT«Could not find sub &say2␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
sorear rakudo: " rakudo++" x 50
p6eval rakudo e393c7: ( no output ) 10:36
sorear rakudo: say " rakudo++" x 50
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++
..rakudo++ ra…
sorear rakudo: say " rakudo--" x 50
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--
..rakudo-- ra…
10:39 meppl joined, JimmyZ left 10:41 sundar_afk left
araujo 4m30.225s 10:42
not bad i guess.....
masak not sure what rakudo did to deserve so much neg karma... :/ 10:47
sorear it was a momentary quantum fluctuation in karma levels
sorear wonders how hard it would be to implement psuedo packages
10:48 lestrrat is now known as lest_away
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)␤»
masak should this be allowed? is masak evil? discuss.
viklund are the two statements exclusive?
masak not at all.
cognominal :)
viklund good 10:59
jnthn You get exactly what you deserved for trying.
masak how does C3 get into it?
jnthn Hell knows
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. :-)
masak now look here.
what I did above may be silly, but I found myself doing something quite similar in real code...
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.
that worked, by the way. jnthn++
jnthn I'm...surprised. :-)
Oh
cognominal rakudo: say Mu == Mu 11:02
jnthn That said:
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)␤»
jnthn rakudo: use MONKEY_TYPING; class A {}; class B { }; augment class B is A { };
masak jnthn: it happens in this snippet: gist.github.com/378420
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)␤»
jnthn Heh
masak (of which I'm otherwise quite proud, by the way :) )
masak submits rakuodbug
jnthn It's nothing to do with the (peverse) nesting.
masak jnthn: good catch :)
jnthn Changing the inheritance hieraarchy in augment is just...nasty. 11:03
masak why?
jnthn Well, consider the above example. You're now multiply inheriting. 11:04
If it worked, from Any and then form A. 11:05
With Any taking precedence.
masak aye.
jnthn Also though, don't expect this to get fixed any time soon.
I'll put in a nice error saying it's not allowed to do this yet.
masak it's not a priority :)
jnthn++
jnthn But the deeper issue is that Parrot classes don't allow you to modify the inheritance hierarchy post-instantiation.
masak ah. 11:06
11:08 lest_away is now known as lestrrat
jnthn We should be moving away from those after R *. 11:11
11:11 XaeroOne joined 11:14 constant left
cognominal Rakudo closure? :) 11:18
masak Rakudo continuation... 11:27
11:33 sjohnson joined
araujo $!a , inside a class, is like a self.a equivalent? 11:33
masak $.a always goes through a method. 11:35
$!a always goes directly to the 'storage location'.
so $.a could be seen as 'third person' and $!a as 'internal'.
use of the former is encouraged in methods, and the latter in submethods, IIUC. 11:36
moritz_ I'd put it another way 11:37
whenever you want to use the external API from within a calls, you use $.a
whenever you want raw storage access (for example for writing) you use $!a
btw completely off-topic, but very hilarious: www.csua.berkeley.edu/~ranga/humor/..._email.txt 11:38
actually when I read it, I suspected something similar to the actual problem described later on 11:39
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
Is it just me or does someone else run into this at times?
(I mean, the workaround does work, but it is inelegant) 11:43
moritz_ running 'make realclean' in the parrot dir should also help
IllvilJa moritz_: txh for tip
moritz_ I have a different setup, where I have a git clone of parrot in the parrot/ dir
IllvilJa Aha.
moritz_ I usually use 'git clean -xdf' to remove all files that are not checked in 11:44
that guarantues a clean building environment (but if you have patches lying around, it also deletes those)
so it's not a recommened setup, unless you know exactly what you're doing 11:45
11:45 pencilk left 11:49 am0c joined, orafu joined 11:51 XaeroOne left 11:55 sundar_afk joined
araujo thanks masak :) 11:56
& moritz_
11:56 iblechbot left
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
11:57 renormalist left
masak (not saying I agree with this practice, let alone follow it, but it's in there in S12) 11:57
11:57 renormalist joined
moritz_ well 11:58
so only submethods should change attributes?
masak that doesn't follow.
if the $.a is rw, you can change it with a method, too.
moritz_ yes, but you don't always want that
masak I know. 11:59
but I'd need a concrete use case, I think.
araujo there exist a link or document where I can check the current libraries/modules available for rakudo?
masak araujo: proto's projects.list
12:01 gfldex joined
araujo by the way, how do i test if a file name is a directory? 12:01
masak ~~ :d
moritz_ by newest spec $filename.IO ~~ :d 12:02
masak araujo: github.com/masak/proto/blob/master/projects.list
moritz_ but rakudo doesn't implement that yet
12:02 takadonet joined
takadonet morning all 12:02
masak araujo: but note that most of those were written for alpha, and haven't taken the jump yet.
takadonet: \o
12:03 XaeroOne joined
araujo moritz_, oooh 12:03
masak, ooh, i see
12:07 am0c left
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
sort of a condensed version of jnthn++'s "Solved in Perl 6".
snarkyboojum masak o/ 12:14
masak snarky!
snarkyboojum sounds good
moritz_ masak: did you read my blog series idea in the backlog?
masak moritz_: the one about weekly updates?
moritz_ masak: weekly contributions
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) :-)
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:16
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
snarkyboojum masak: I have free time this week
masak \o/
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
masak: sounds fun :0
12:18 dual left 12:20 constant joined, constant left, constant joined
masak two commits pushed to the 'blocks' branch. one tiny one and one huge one. 12:20
github.com/masak/yapsi/commits/blocks 12:21
12:21 bluescreen joined
masak that branch now handles 'my $a = 42; { say my $a }' correctly. 12:21
12:21 bluescreen is now known as Guest40234
CokeBot9000 sorear++ # blizkost hacking! 12:22
snarkyboojum masak++ o/
12:22 XaeroOne left
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
moritz_ CokeBot9000: helpful, but didn't bring us all the way 12:24
Null PMC access in setprop()
current instr.: 'perl6;Callable[::T];' pc 13098 (src/builtins/Num.pir:167)
avar why work of the pre-refactor version?
*off
CokeBot9000 is it applied?
moritz_ while compiling the setting
snarkyboojum masak: looks great.. be back in a bit
CokeBot9000 er, pushed?
moritz_ CokeBot9000: I haven't pushed it on the branch, but I can do it 12:25
jnthn Please don't apply that patch.
moritz_ ok
jnthn It doesn't solve the underlying issue.
CokeBot9000 k. I didn't even look at it.
jnthn Probably we need a change in P6Object.
12:29 iblechbot joined
CokeBot9000 jnthn: ahh. "add_method" in p6object is just shoving it into a namespace, not calling "add_method()" 12:29
testing... 12:30
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
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
colomon moritz_++
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
smash_ hello everyone 12:34
masak smash_: \o
takadonet smash_: how are you ? 12:37
moritz_ \o/ in 2.5 hours the accepted gsoc proposals will be announced 12:38
takadonet !!
smash_ takadonet: i'm fine, thank you
moritz_: great, where ?
moritz_ smash_: not sure, but probably a link will show up on socghop.appspot.com/ 12:39
smash_ moritz_: ok, thks 12:40
CokeBot9000 ok. looking at p6o will take more cycles than I have to spare atm. 12:42
it is suspiciously looking at at the namespace when dealing with methods in add_parent, though.
12:45 jonasbn left 12:48 JimmyZ joined 12:52 ingy left
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:52
mst++ told him to show the whole code, runnable code. 12:53
frettled heh
masak one thing that we do well here on #perl6 is that we often focus code discussions around lines of p6eval code.
frettled How many swearwords were there?
masak none.
frettled wow
jnthn Holy shit!
moritz_ is mst ill?
IllvilJa is mst here? 12:54
jnthn ;-)
frettled Has someone taken over his computer?
masak mst only swears when there's any need.
CokeBot9000 masak: how much of that is due to the average size of runnable p6?
masak CokeBot9000: well, cue the second part of the discussion.
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.
at the same moment, the guy with the nopaste said he'd do the same thing.
IllvilJa I actually stay away from #perl...
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
masak www.shadowcat.co.uk/blog/matt-s-tro...hole-code/
12:56 ruoso joined
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!
what'd e say. 12:57
IllvilJa masak and moritz_: I know about that article :-).
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.
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.
frettled masak: The stupid example (which may not be entirely stupid, but I thought there ought to be better ways around the problem) is…
Web services in a multi-threaded environment
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.
masak urk.
moritz_ well, you need a database :-) 13:01
masak badly :)
frettled moritz_: yep, that's what I think may be one of the better ways around it
13:02 ReiniUrban joined, viklund left, ingy joined 13:03 rurban left
jnthn Or you could still use a lexical hash and write an accessor if you're really desperate. 13:03
13:03 ReiniUrban is now known as rurban
jnthn (for that case) 13:03
moritz_ the most sensible use i've seen for global variables is a $DEBUG flag
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
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
colomon o/ 13:05
moritz_ good morning
jnthn morning, pmichaud 13:06
pmichaud moritz_: done.
masak mornin', pm
moritz_ pmichaud: thanks
\o/ yesterday's blog post got about 12k visits so far 13:07
colomon moritz_++ 13:08
masak moritz_: good blog post, by the way. moritz_++ 13:09
moritz_ thanks masak
colomon well-deserved visitors, it was a great post.
masak perl6advent.wordpress.com still pulls in about ~80 viewers a day. 13:11
there was a peak on the 20th, for some reason.
colomon madelbrot maybe? 13:12
13:12 constant left
masak quite possibly. 13:12
13:12 constant joined, constant left, constant joined
colomon I linked to that page again, anyway. 13:13
around then.
afk
13:15 Xaero joined 13:16 SmokeMachine joined 13:17 XaeroOne left 13:19 [particle] left 13:20 REPLeffect left
frettled Hot-diggety-bleep, I haven't gotten around to reading moritz_' new blog entry. 13:20
moritz_ frettled: when you do I'll get another visit :-) 13:21
masak 12k1 :)
CONGRATULATION YOU ARE THE TWELVE THOUSAND AND FIRST VISITOR 13:22
frettled heh
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?
moritz_ you have won that pretty hat, which you know have to wear
masak pmichaud: did already.
pmichaud okay
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
moritz_ frettled: I put the full posts into the RSS 13:22
masak moritz_++
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 constant left
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.
moritz_ yes, in Iceland
frettled woot 13:24
So we actually managed to bully Iceland into hosting that!
I can see my vacation savings fund diminishing rapidly.
moritz_ which currently has some travelling restrictions, it seems :-)
jnthn Yeah, seems NPW is postponed. 13:25
13:25 constant joined, constant left, constant joined
masak :( 13:25
frettled You just need to follow these instructions carefully: linselyst.files.wordpress.com/2010/...igjen1.jpg
jnthn :-(
frettled: lol! 13:26
"And we screw off the volcano"? :-)
frettled switch off, but yes
masak frettled: lol!
masak feels better now 13:27
13:27 rgrau_ joined 13:29 envi^home joined, M_o_C joined
CokeBot9000 pmichaud: morning. 13:33
13:39 REPLeffect joined 13:40 Xaero left 13:41 XaeroOne joined 13:48 REPLeffect left 13:52 xinming left 13:54 xinming joined 13:55 IllvilJa left 13:59 XaeroOne left 14:01 slavik joined 14:02 REPLeffect joined 14:03 guotr left 14:05 gurjeet left 14:07 rv2733 joined 14:08 uniejo left 14:13 sundar_afk left 14:18 alester joined, fridim left 14:21 Guest3069 left 14:23 nihiliad joined
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:29
takadonet colomon: you are probably right 14:30
14:47 iblechbot left, JimmyZ left 14:54 _jaldhar left 14:57 PacoLinux joined 14:58 XaeroOne joined 14:59 isBEKaml joined 15:01 molaf joined
moritz_ don't underestimate the number of readers of planetsix :-) 15:01
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:02
so it's easily 200 readers for any blog post on there, probably much more 15:03
15:03 XaeroOne left
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:03
end enough to cause a spike in p6advent stats 15:04
15:05 IllvilJa joined, XaeroOne joined, ruoso left
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:06
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 parrot.org
moritz_ isBEKaml: first of all the implementations explore different areas of the spec first
[particle] rakudo is an implementation of perl 6 running on parrot, more at rakudo.org 15:08
15:08 pmurias joined
[particle] rakudo is largely written in perl 6 15:08
moritz_ isBEKaml: for example smop/mildew focus on the meta object protocol
a second answer is that people just start a new compiler because they have an idea they like better than the existing compilers
jnthn Rakudo these days borrows increasingly from smop too. :-)
[particle] c has many compilers, for example msvc, gcc, icc, cc, etc 15:09
jnthn (In terms of ideas rather than implementation.)
moritz_ and we can't tell people to abandon their efforts and join another project - volunteer work doesn't work that way
[particle] s/compilers/implementations/
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.
[particle] more on that in S01
isBEKaml I see, so when we see ends to be integrated, won't that lead to lot of confusion? 15:10
[particle]: SO1?
masak isBEKaml: well, we tend to send people towards Rakudo, since that's what most newcomers want.
[particle] perlcabal.org/syn/S01.html
masak it being the currently most advanced and most worked-on implementation.
moritz_ isBEKaml: well, we have a test suite to ensure that all compilers implement the same language :-)
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.. ;)
masak isBEKaml: have you found perl6advent yet? 15:12
15:12 pmurias left
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
15:12 cotto_work left
isBEKaml masak: not yet.. 15:12
masak it's nice.
find it :)
moritz_ isBEKaml: if you have suggestions on how to make perl6.org clearer (without making it too verbose), we're open for suggestions
[particle] camelia appreciates your help and enthusiasm 15:13
15:13 pmurias joined
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
In fact, I like the design of perl6.org much better than learn.perl.org
:)
masak \o/
moritz_ YaY, somebody likes it :-) 15:15
isBEKaml we need more docs, I just downloaded the perl6book from github. :)
moritz_ well, we're working on it
CokeBot9000 moritz_: one down, several 100K to go. =-)
masak and on Rakudo, so it'll be ready for the book.
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) :)
will that impede me from learning perl6 and be upto speed?
masak not really.
it helps to know Perl 5 already, but it's not a requirement. 15:17
do read the book, but I think going through perl6advent might teach you more right now.
moritz_ isBEKaml: the book is targeted at people who already know most programming concepts. But no prior Perl knowledge required
isBEKaml masak: I can understand perl5 concepts, if not, I've got perldoc in my linux box to help. ;)
masak isBEKaml: also, downloading Rakudo and playing around with it is often very instructive. 15:18
it's also possible to play around here on-channel (in moderation, of course).
isBEKaml masak: I'll try that sometime.
masak rakudo: say "OH HAI, isBEKaml!"
p6eval rakudo f6ec0a: OUTPUT«OH HAI, isBEKaml!␤»
masak rakudo: say Date.today 15:19
p6eval rakudo f6ec0a: OUTPUT«2010-04-26␤»
isBEKaml masak: nice. what are those terminators in the output?
-04-26NL
masak moritz_: Date.today reads very well :)
moritz_ sub karma-up($whom) { print "$whom++" }; karma-up("isBEKaml")
isBEKaml NL something symbol?
masak isBEKaml: those are the characters for line endings.
moritz_ right
pmurias diakopter: sprixel fails to build on my box
moritz_ you need proper UTF-8 support in you IRC client
isBEKaml NL! newline, I see.. 15:20
moritz_ otherwise it will be displayed as mojibake
diakopter pmurias: error?
pmurias pasting...
CokeBot9000 moritz++ # my new japanese word of the day.
isBEKaml moritz_: I can understand perl code. I went up to perl objects and gave up! :(
masak isBEKaml: then we have good news for you :) 15:21
isBEKaml they seem very raw..
masak rakudo: class A { method foo { say "lol I am an object" } }; A.new.foo
p6eval rakudo f6ec0a: OUTPUT«lol I am an object␤»
lisppaste3 the build error pasted "untitled" at paste.lisp.org/display/98381
diakopter pmurias: svn up # I just commited :) 15:22
pmurias diakopter: just noticed it
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
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
diakopter pmurias: tho hang on; it's still broke
masak the more I look at Perl 6 OO, the more I realize that public methods are often the solution. 15:23
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?
won't private methods work?
masak isBEKaml: sounds like a submethod.
jnthn method !i-am-private() { ... }
diakopter pmurias: ha! this is almost the identical error I created when parameterizing patterns in jsmeta!
masak isBEKaml: there's more on the topic in S12.
diakopter lol 15:25
jnthn ! before the name indicates a "private".
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
jnthn You can't call them with normal method syntax
isBEKaml moritz_: S for specs?
diakopter pmurias: fixed now. you may be interested in the diff 15:26
moritz_ isBEKaml: spec or "synopsis"
isBEKaml jnthn: I see. thanks. 15:27
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.
abort?
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!
masak and welcome back!
moritz_ takes the bike home
lisppaste3 pmurias pasted "result of running a test" at paste.lisp.org/display/98383
15:29 jiing joined
diakopter pmurias: o_O 15:30
pmurias to the tests pass for you?
diakopter looks like another bug for #mono
15:31 mikehh left
diakopter pmurias: what version of mono? 15:31
pmurias 2.6.3?
s/?//
15:32 christine joined, XaeroOne left
diakopter pmurias: they work on the .NET CLR; I haven't tried them on mono lately 15:33
I reported it to #mono on gimpnet 15:34
15:37 kaare_ joined
colomon have the gsoc announcements come in yet? 15:38
15:39 kaare_ left
diakopter the apps are all still pending 15:40
15:41 constant left, [particle] left, ingy left, s1n left, cognominal left, lisppaste3 left, elmex left, sorear left, Trey left, yahooooo left, opx^away left, Woody2143 left 15:42 constant joined, [particle] joined, ingy joined, s1n joined, cognominal joined, lisppaste3 joined, elmex joined, sorear joined, Trey joined, yahooooo joined, opx^away joined, Woody2143 joined 15:44 CokeBot9000 is now known as TPF|Coke
TPF|Coke 195 minutes remaining on GSOC announcements. 15:44
masak exciting!
colomon :)
diakopter pmurias: could you perhaps svn bisect it? 15:49
pmurias what would be the right way to solve such problems would be to have something like taptinder 15:50
diakopter: see failing test for a bug in the comments parsing i found 15:51
diakopter ok
pmurias: I don't get any SIGABRT when running run_tests.sh on mono 2.6.3 on linux.. 15:52
any SIGABRT that prove doesn't hide, I mean 15:53
15:53 brrant left
pmurias diakopter: does prove give you a red 2 tests passed message? 15:54
diakopter fixed
all ok for me 15:55
green All tests successful
do you have 32-bit linux or 64-bit 15:56
pmurias 32bit
diakopter ah. mine is 64bit
are you still getting a SIGABRT?
pmurias yes
but the comments test runs now 15:57
diakopter what do you run to get the SIGABRT?
(what's the command line) 15:58
15:58 ash__ joined
pmurias mono bin/Release/Sprixel.exe t/if.t 15:58
diakopter weird.
mine works.
15:59 justatheory joined
pmurias it seems like a strange 32bit vs 64bit memory error 16:00
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
diakopter but it's 64-bit :P 16:03
so it wouldn't catch this error 16:04
oh, smolder, the test result server
16:05 _jaldhar left, _jaldhar joined 16:06 isBEKaml_ joined 16:07 bradb joined 16:11 cognominal left 16:13 gurjeet joined
diakopter afk& 16:13
16:15 Guest40234 left 16:16 Guest40234 joined 16:21 cognominal joined 16:27 szabgab left
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:28
ash__ no, ICU is only required if you want full unicode support 16:29
isBEKaml_ masak: I now understand what you meant by p6advent. :)
masak isBEKaml_: \o/
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
16:30 szabgab joined
isBEKaml_ ash__: that means I can still compile Rakudo ? 16:30
masak isBEKaml_: good luck!
swimming &
16:30 masak left
ash__ yeah, you can still compile rakudo without icu 16:30
moritz_ isBEKaml_: you can. But having ICU is nicer
isBEKaml_: what OS do you use?
slavik icu?
isBEKaml_ moritz_: slackware. 16:31
ash__ ICU lets you use: «» for instance
or ¢ even
moritz_ slavik: site.icu-project.org/
slavik how would I enter it on an american keyboard?
moritz_ isBEKaml_: I'm sure icu is packaged for slackware, though since I'm not a slackware user I don't know the details
isBEKaml_ slavik: I would guess, altGR+X or Z, however it suits you.
16:31 cotto_work joined
slavik oh god 16:31
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
moritz_ slavik: or compose<<
slavik colomon: nice, what text editor?
colomon TextMate
though you can also just use << or >> instead.
(I mean, in Perl 6.)
moritz_ in vim it's Ctrl+k < <
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?
ash__ colomon: you can use Option+| (bar) to get « and Shift+Option+| to get » 16:33
16:33 pmurias left
colomon «» You're right! 16:33
ash__++
ash__ in OS X just hold Option and most keys become unicode 16:34
moritz_ sotirov-bg.net/slackpack/pack.cgi?id=627
isBEKaml_: you'd need the C version
colomon ash__: usually I just get accidental greek characters that way. ;)
moritz_ (if there's a distinction - could be one package for both)
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. ;)
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:36
any opinions? 16:37
isBEKaml_ moritz_: I'll go few days without sugar (ICU, :) ) and tehn try the sugar coating. :)
moritz_ isBEKaml_: I'm spoiled by Debian - sudo aptitude install libicu-dev # and you're done :-)
sure, whatever you prefer
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....
moritz_ colomon: since the last release
colomon and just to the source, or to the source plus spec plus test suite?
moritz_ colomon: good question... no idea 16:39
maybe just rakudo now
16:39 japhb left
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?
colomon I'm just trying to think it through. :)
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.
isBEKaml_ ash__: why differentiate between contributors? They are contributors, after all..
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
although one big list isn't hard either, but still
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. ;)
moritz_ there are some intersections, yes :-)
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.
jnthn is even known to write tests once in a while. :-)
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.
isBEKaml_ colomon: that's what I thought too..
moritz_ 13 commit authors in the last 31 days 16:45
isBEKaml_ is building Rakudo without ICU for his early learning
moritz_ that doesn't include those mentioned in the commit messages, which I'd like to parse too
ash__ isBEKaml_: are you going to go through the advent calendar?
moritz_ like people being ++'ed or appear afer a "courtesy by" 16:46
takadonet moritz_: I would be on that list !
isBEKaml_ ash__: yes, the 24 day walk up the hill. :)
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.
moritz_ \o/ 16:47
ash__ sweet
16:48 Trashlord left
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:48
ash__ i wonder how it will handle matrix stuff 16:49
colomon I'm also toying with a new (at least to me) idiom:
(1 ..^ +@.points).grep({ @.points[$_ - 1] < $u < @.points[$_]; })
oh wait, I see a bug in that particular instance. :) 16:51
moritz_ rakudo: say <a b c>.pairs.perl
p6eval rakudo f6ec0a: OUTPUT«(0 => "a", 1 => "b", 2 => "c")␤»
isBEKaml_ moritz_: pairs wil only do numbers to strings? Can I do a rot13 pair matching? :)
moritz_ isBEKaml_: pairs give array index + array item 16:52
rakudo: say <foo bar baz>.pairs.perl
p6eval rakudo f6ec0a: OUTPUT«(0 => "foo", 1 => "bar", 2 => "baz")␤»
colomon isBEKaml_: when used on an array, moritz_ means.
moritz_ isBEKaml_: it's usually more useful on hashes
colomon but you can say something like
jnthn rakudo: say (a..z Z=> (n..z,a..o)).perl
p6eval rakudo f6ec0a: OUTPUT«Could not find sub &a␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
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)␤»
jnthn rakudo: say ('a'..'z' Z=> ('n..z','a..o')).perl
p6eval rakudo f6ec0a: OUTPUT«("a" => "n..z", "b" => "a..o")␤»
colomon rakudo: say ('a' .. 'z' Z=> 'b'..'z', 'a').perl
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",
.."x" =…
jnthn grr
moritz_ :-)
isBEKaml_ :)
jnthn colomon++
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",
.."x" =…
colomon is that rot13
?
isBEKaml_ $colomon++
jnthn Yes.
16:54 iblechbot joined
isBEKaml_ :) 16:54
colomon TimToady++ for thinking up Zop. :)
jnthn Indeed. 16:55
moritz_ rakudo: my %r = ('a' .. 'z' Z=> 'n'..'z', 'a'..'m'); say 'hello'.comb.map( { %r{$_} }).join
p6eval rakudo f6ec0a: OUTPUT«uryyb␤»
colomon does .trans work yet?
isBEKaml_ Zop's a map?
moritz_ colomon: nope
jnthn isBEKaml_: Z is a meta-operator.
isBEKaml_: => is the pair constructor in Perl 6
so 'a' => 'n' makes a pair. 16:56
If you put a Z before it it means "apply it to each thing in the list either side"
So we make a list of pairs out of two other lists.
:-)
But you can put any operator there.
isBEKaml_ what if I were to say: 'a' .. 'z' => 'n' .. 'z' ? 16:57
colomon rakudo: say ('a' .. 'z' «=>» 'n'..'z', 'a'..'m').perl
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",
.."x" …
16:57 cdarroch joined, cdarroch left, cdarroch joined
jnthn isBEKaml_: It'll terminate when the shortest list hits its end. 16:57
colomon oh, the hyper op also can do that. :)
isBEKaml_ jnthn: Oh, the zipper. sweet..
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.)
jnthn Right.
Hypers give you more checking / control over that.
isBEKaml_ colomon: so the other elements on the longer list be undefs? Does Perl6 have undef? 16:59
16:59 _jaldhar left
colomon looking back at my results, the hyper version actually missed the second range. 16:59
moritz_ it has many undefs :-)
jnthn colomon: That may be a precedence issue.
colomon isBEKaml_: hyper either extends with the last element in the list or fails outright.
jnthn colomon: In that hypers have transparent precedence.
Alternatively, it could be a bug.
isBEKaml_ moritz_: yeah. :D
colomon jnthn: nah, probably precedence. 17:00
17:01 dakkar left 17:02 _jaldhar joined
isBEKaml_ colomon: looking at your code, does p6 have something like <=> operator to apply both ways? say: 'a' .. 'z' <=> 'n' .. 'za' .. 'm' ? 17:05
I understand that's what Zop does.
ash__ <=> is in perl6
colomon <=> does numeric comparison 17:06
jnthn It's a comparsion operator, though.
colomon you want to build a list of pairs going one way and a list of pairs going the other way?
isBEKaml_ ash__: I merely thought it would look appropriate for the Zop.
colomon: something like it. :)
I'm trying to learn as my poor old machine's building Rakudo in the background. :-) 17:07
17:07 xalbo left
isBEKaml_ colomon: numeric comparison? in what way? 17:08
ash__ isBEKaml_: you can always use p6eval here, just say rakudo: in a msg
isBEKaml_ rakudo: 77 <=> 9
p6eval rakudo f6ec0a: ( no output )
ash__ > is numeric and gt is strings, most operators are for a single type of value 17:09
rakudo: say 77 <=> 9
p6eval rakudo f6ec0a: OUTPUT«1␤»
colomon rakudo: my %encode = 'a'..'z' Z=> 'n'..'z', 'a'..'m'; my %decode = %encode.invert; say %decode.perl
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",
.."x" =…
ash__ rakudo: say 9 <=> 77
p6eval rakudo f6ec0a: OUTPUT«-1␤»
ash__ rakudo: say 'a' leg 'b'
p6eval rakudo f6ec0a: OUTPUT«-1␤»
colomon isBEKaml_: as ash__ is demonstrating, <=> works like strcmp does in C.
ash__ rakudo: say 'b' leg 'a' 17:10
p6eval rakudo f6ec0a: OUTPUT«1␤»
colomon returns -1 for less than, 0 for equal, 1 for greater than
ash__ leg is <=> for strings
rakudo: say 'a' cmp 'b'
p6eval rakudo f6ec0a: OUTPUT«-1␤»
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
yes, i thought of strcmp.
ash__ cmp is also simillar
really, <=> is the same as +$a cmp +$b
isBEKaml_ +$?
ash__ and leg is the same as ~$a cmp ~$b
+$a turns $a into a Num
colomon +$a means "treat $a like a number" 17:12
ash__ and ~$a turns $a into a string
colomon ash__: a Numeric, actually, could also be an Int.
isBEKaml_ ah, I see..
colomon rakudo: say (+"4/5").WHAT
p6eval rakudo f6ec0a: OUTPUT«Num()␤»
colomon Not sure if that is supposed to work or not.
ash__ ah, oops, yeah, it could be any Numeric type object, so Int, Rat, Num, etc.
colomon rakudo: say (+"4/5")
p6eval rakudo f6ec0a: OUTPUT«4␤»
ash__ rakduo: say +"1.25".WHAT 17:13
colomon But if $a is already a Rat, say, +$a should leave it a Rat.
isBEKaml_ colomon: looking at your code for encode and decode. is it possible to view the full output?
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
isBEKaml_ Rat? as in rational? is that a native type on p6?
colomon isBEKaml_: as in Rational, and yes.
> my %encode = 'a'..'z' Z=> 'n'..'z', 'a'..'m'; my %decode = %encode.invert; say %decode.perl
{"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"}
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:15
rakudo: say (4/5 + 2/7).perl 17:16
p6eval rakudo f6ec0a: OUTPUT«38/35␤»
17:16 araujo left
colomon rakudo: say 4/5 + 2/7 # by default Rats print as decimals 17:16
p6eval rakudo f6ec0a: OUTPUT«1.08571428571429␤»
ash__ aren't we changing how to write Rat literals? 17:17
17:17 araujo joined
colomon ash__: those aren't Rat literals, if that's what you mean. 17:17
it
ash__ ah
colomon it's just 4 divided by 5 and 2 divided by 7
ash__ <4/3> is the literal form right? 17:18
colomon rakudo: say (0.8 + 2/7).perl
p6eval rakudo f6ec0a: OUTPUT«38/35␤»
ash__ rakudo: say <4/2>.WHAT
p6eval rakudo f6ec0a: OUTPUT«Str()␤»
isBEKaml_ rakudo: say (4/2).WHAT
p6eval rakudo f6ec0a: OUTPUT«Rat()␤»
colomon I don't think <4/3> works in Rakudo yet.
jaffa4 How to write -e in Perl 6?
colomon and I think it's supposed to be both a Str and a Rat?
ash__ jaffa4: its still -e 17:19
colomon jaffa4: on the command line or as a file op?
jaffa4 file op
ash__ oh, lol good question, i was thinking the command line
so, no i am wrong, sorry
colomon ~~ :e
like "file" ~~ :e
jaffa4 ok
colomon but I don't know if that one is implemented yet.
ash__ rakudo: say "/etc/hosts" ~~ :e
colomon rakudo: say "/etc/passwd" ~~ :e 17:20
p6eval rakudo f6ec0a: OUTPUT«0␤»
rakudo f6ec0a: OUTPUT«1␤»
17:20 kensanata joined
jaffa4 what is not -e? 17:21
colomon guess it is implemented, then.
ash__ !~~ :e
can you use them as junctions yet?
colomon ash__: try it and see? I'm guessing no...
isBEKaml_ file op? the -f switch in shell builtins? 17:22
ash__ rakudo: say '/etc/passwd' ~~ :e, :w, :f
p6eval rakudo f6ec0a: OUTPUT«2 unexpected named parameters passed (f, w)␤current instr.: 'say' pc 369645 (src/gen/core.pir:28584)␤»
ash__ oops
17:22 envi^home left
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)␤»
ash__ nope, not yet
17:23 mikehh joined
colomon rakudo: say '/etc/passwd' ~~ :e & :e 17:23
p6eval rakudo f6ec0a: OUTPUT«1␤»
ash__ isBEKaml_: perlcabal.org/syn/S32/IO.html#Other_things is what we are talking about
colomon I think :w isn't implemented yet, maybe?
rakudo: say '/etc/passwd' ~~ :e & :f
p6eval rakudo f6ec0a: OUTPUT«1␤»
ash__ guess not
yeah, seems to be :w
colomon rakudo: say '/etc' ~~ :e & :f
p6eval rakudo f6ec0a: OUTPUT«0␤»
colomon rakudo++
isBEKaml_ as in: if [ -f "/etc/passwd" ]; then echo "true"; else echo "false"; fi
ash__ yeah thats what :f does 17:24
there are a bunch, in the spec you can see the full list
colomon but only a very limited subset of them are implemented so far.
ash__ rakudo: say '/etc' ~~ :d 17:25
p6eval rakudo f6ec0a: OUTPUT«1␤»
isBEKaml_ ash__: I'm reading the spec slowly. Just gotten to S02. :) 17:27
ash__ thats fine, just showing you where the section is for what we were talking bout 17:28
s/bout/about/
17:30 XaeroOne joined 17:32 XaeroOne left, XaeroOne joined 17:38 dual left 17:39 kensanata left
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
Rat()?
cognominal use WHAT.perl to avoid the parenthese. 17:43
isBEKaml_ rakudo: say (15/14).WHAT.perl
p6eval rakudo f6ec0a: OUTPUT«Rat␤»
isBEKaml_ cognominal: what's the difference? .perl pretty prints? :) 17:45
cognominal you can feed the output of .perl to the interpretor 17:46
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.
I can't remember the exact rationale 17:48
oops, no pun intended
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:49
cognominal I share your perplexity on that one. 17:51
17:51 uniejo joined
TPF|Coke tries to figure out how to google for ".WHAT" in the syn. 17:52
ash__ perlcabal.org/syn/S12.html#Introspection 17:54
is where they talk about .WHAT some
isBEKaml_ perlcabal.org/syn/S29.html, something about ref()
17:54 japhb joined
cognominal irclog.perlgeek.de/perl6/2010-04-23#i_2257610 # I asked the same question answered by TimTaody 17:55
ash__ what does *$a mean in a paremeter? like: sub foo(*$a) { } ? 17:58
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
std: sub foo(*$a) { }
p6eval std 30477: OUTPUT«ok 00:01 110m␤»
ash__ also, what would *&a mean? 18:00
hmm
cognominal hum, I think you can slurp block, like in a multicriteria sort 18:02
S32-setting-library/Containers.pod:301: our Array multi method sort( @values: *&by ) 18:04
S32-setting-library/Containers.pod:335: our multi method min( @values: *&by )
S32-setting-library/Containers.pod:359: our multi method max( @values: *&by )
ash__ rakudo: sub foo(*$a, *@b) { say($a, @b); }; foo(1, 2, 3);
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?
p6eval rakudo f6ec0a: OUTPUT«123␤»
ash__ rakudo: sub foo(*$a, *@b) { say "a: ", $a, " b: ", @b); }; foo(1, 2, 3);
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 smash_ left
p6eval rakudo f6ec0a: OUTPUT«a: 1 b: 23␤» 18:05
jnthn .WHAT gives you the type object.
ash__ interesting...
jnthn This happens to stringify to the name of the type.
(Just like any other object can choose how it stringifies.)
isBEKaml_ jnthn: whatever I throw at it, it just pops back I_entered_This() 18:07
jnthn: is that an object type?
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)␤»
jnthn isBEKaml_: Well, you have to give it a type name that is declared.
isBEKaml_ rakudo: say MyVar.WHAT
p6eval rakudo f6ec0a: OUTPUT«Could not find sub &MyVar␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
jnthn Otherwise it assumes what you have is a subroutine and tries to call it.
MyVar.WHAT is like (MyVar()).WHAT 18:09
OTOH
rakudo: class Beer { }; say Beer.WHAT
p6eval rakudo f6ec0a: OUTPUT«Beer()␤»
TPF|Coke rakudo : say Role.WHAT
ash__ rakudo: say Role.WHAT
p6eval rakudo f6ec0a: OUTPUT«Role()␤»
ash__ rakudo: say WHAT Role
p6eval rakudo f6ec0a: OUTPUT«Role()␤»
TPF|Coke (didn't like the space.)
jnthn But you can aactally use it to make a new one too. 18:10
rakudo: class Beer { }; my $pint = Beer.new; my $type = $pint.WHAT; say $type.new.WHAT;
p6eval rakudo f6ec0a: OUTPUT«Beer()␤»
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! :)
jnthn Yeah, types are just objects. :-)
First class and all that lot.
isBEKaml_ objects are first class citizens, great! 18:16
isBEKaml_ perl6 built now, finally!
ash__ everything is first class, except when its not...
regex's are first class
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:17
18:18 stephenlb joined 18:22 hercynium left 18:23 ShaneC joined, ShaneC left
ash__ rakudo: my $reg = /(\d+) { $0 < 128 or fail }/; say '123' ~~ $reg, '129' ~~ $reg; 18:23
p6eval rakudo f6ec0a: OUTPUT«123»
avar is there an API for match objects yet? 18:24
I.e. for writing your own regex matchers as *normal* subs 18:25
ash__ like tokens?
or do you mean extending the regex grammar?
moritz_ avar: not quite... there's something going on with subclassing Cursor, but I don't know the details
ash__ can't you extend the regex grammar though? 18:26
avar I'm mainly interested in writing a perl5 re::engine::*, but I was always blocking on match objects being "who knows" :) 18:27
moritz_ avar: so are you looking for an API for matcher rules, or for objects of type Match? 18:28
colomon rakudo: say ~(2..4) 18:29
p6eval rakudo f6ec0a: OUTPUT«2 3 4␤»
lisppaste3 avar pasted "I wanted to be able to write perl5-matcher subs like this" at paste.lisp.org/display/98390 18:32
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
moritz_ avar: that's what the unfinished match objects are called like 18:34
18:34 rv2733 left
moritz_ if you look into STD.pm6, that's what's stored in $¢ 18:34
but I don't know how much of it is API
lisppaste3 avar pasted "more specifically, to rewrite the subs to perl5 like this" at paste.lisp.org/display/98391 18:35
avar moritz_: ah..
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)␤»
ash__ rakudo: use MONKEY_TYPING; augment grammar Regex::P6Regex::Grammar { };
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)␤»
ash__ thats no good
moritz_ rakudo: Grammar
p6eval rakudo f6ec0a: ( no output )
avar is there a perl6 example of extending a grammar with plain perl subs? 18:38
i.e. 'sub' instead of 'regex/token/rule'
since they're just regular subs with the same calling conventions, or so I thought
moritz_ avar: I don't know such an example... maybe pmichaud does
(and they are methods in Perl 6, not subs) 18:39
avar right, terminology:)
moritz_ but that won't make much of a difference in Perl 5 anyway :-)
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
ash__ i am not sure what your trying to do avar, what exactly do you mean to accomplish? 18:40
avar write a plugin to bring grammars to perl5 18:41
moritz_ you do know of Regexp::Grammar though, I guess?
18:41 ruoso left
ash__ oh, for perl5? 18:41
moritz_ erm, Regexp::Grammars
yes
ash__ makes sense now, my bad 18:42
ash__ wonders how gimme5 does it...
moritz_ with Cursor.pmc
avar moritz_: Yeah I've seen Regexp::Grammar. I don't think it cuts it by a long shot 18:45
I'm interested in something that seemlessly uses perl5 method calling conventions
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
moritz_ *pm6
TPF|Coke wonders how long until sorear's work is checked in so others can play. 18:49
18:49 finanalyst joined
jnthn TPF|Coke: I'll give the patch a look in an hour or two. 18:49
18:49 hercynium joined, hercynium left, hercynium joined
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)␤»
colomon rakudo: say (1, 3, 6, 3, 4, 2, 1231, -32).min(-> $a, $b { $a <=> $b };).perl
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)␤»
moritz_ colomon: no ; after }
colomon rakudo: say (1, 3, 6, 3, 4, 2, 1231, -32).min(-> $a, $b { $a <=> $b }).perl
moritz_++
p6eval rakudo f6ec0a: OUTPUT«-32␤»
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)␤»
colomon think I'll have to fix that....
jnthn :-)
jnthn afk for a little bit 18:52
18:52 finanalyst left
colomon errr... wait, minmax is an operator? 18:52
moritz_ yes
colomon is there a reason there isn't a minmax method as well? 18:53
(just like we have the min operator and the min method?)
moritz_ no idea
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?
ash__ PERL6LIB is checked isn't it? (i think it defaults to ~/.perl6/lib 18:56
)
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
isBEKaml_ no PERL6LIB
18:57 ruoso joined
colomon moritz_: better forgiveness than permission, right? :) 18:58
moritz_ colomon: aye... what are you planning? :-)
colomon just adding a minmax method which is exactly analogous to the existing min and max methods, and the output of the minmax operator. 18:59
first implementation is compiling now, and I'm getting ready to add spectests. 19:00
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
(-32, 1231)
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:10 ruoso left, ash__ left 19:11 _jaldhar left 19:13 XaeroOne left, ruoso joined, _jaldhar joined 19:14 ash_ joined
moritz_ congratulates masak++ and pmurias++ to their accepted gsoc proposals 19:19
colomon \o/
that's fantastic news!
moritz_ masak's project: adding binary data to Rakudo 19:20
ash_ cool
moritz_ pmurias' project: releasing SMOP to the CPAN
spinclad \o/ \o/
ash_ adding binary data to rakudo?
spinclad Bug
colomon ash_: Buf
spinclad *Buf
ash_ ooh, got ya
cool
moritz_ Buf, .encode, .decode, IO
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.
PerlJam + pack/unpack
moritz_ see socghop.appspot.com/gsoc/program/li...e/gsoc2010 for the full list - don't know if it's publicly visible
ash_ i wonder if any of that will fall back into parrot...
colomon moritz_: you're mentoring him, yes?
moritz_ colomon: nope, jnthn++ does 19:22
colomon ah, cool.
[particle] spinclad: i kinda like Bug. my Bug $x; # easy to find trouble later... 19:23
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:24
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
colomon oh wow, those are great parrot proposals, too! this is really exciting. 19:26
moritz_ ash_: I'm a (possible) mentor, I can see them anyway... the general public might not 19:27
oh, just tried in another browser -- can the the abstract and title there
colomon I couldn't find masak on the list in my browser. :( 19:28
moritz_ colomon: search for Rakudo in the project title
colomon: I can't find him by name either - weird
colomon I don't get rakudo either, actually.
I wonder if I'm just not seeing the entire list.
ash_ its a big list 19:29
colomon parrot stuff comes up...
ash_ it took a while for it to load for me
(its loading via javascript)
diakopter you have to scroll to the bottom several times
it loads another 250 each time you scroll to the very bottom
TPF|Coke if you click on teh search icon, you can do that before the whole list loads.
diakopter there are 1025 total
TPF|Coke I do that and search for rakudo, I see one from masak. 19:30
diakopter yes
colomon ah, if I enter masak under student I get his.
moritz_ dukeleto++
[particle]++
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++
TPF|Coke sighs.
TPF|Coke wonders if he can get "coke" on this server. :P 19:32
diakopter pastebin.com/gJetFy3t 19:33
ordered by project/organization
33 for Python
moritz_ not surprising; google is a python shop 19:34
diakopter 15 for wordpress
moritz_ still I think 10 for perl is not bad at all
[particle] it's better than the 5 we had last year
slot allocation is partially based on previous year's success 19:35
diakopter 50 for kde
lol; 4 for freedroid
[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
moritz_ with rurban++ as mentor, iirc 19:37
diakopter I suspect a good strategy to accumulate more slots is to submit more applications
PerlJam ash_: can you explain to me why you think that would be cool?
ash_ because you could have less XS stuff
moritz_ because writing XS sucks?
PerlJam ash_: I read it but couldn't get excited about it. It seems like just another interface.
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
PerlJam ash_: you mean like search.cpan.org/~gaal/FFI-1.04/FFI.pm ? 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
yeah, thats the one I have seen in the past 19:40
19:41 clintongormley left
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:41
19:42 gurjeet left
ash_ nothing, ctypes is libffi 19:43
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:44
plobsing looking over the FFI.pm doc, it uses libffcall, not libffi. Also it's support for pointer types looks a bit weak. 19:47
ash_ plobsing: my llvm stack frame project was accepted into the GSoC, so you know, it listed you as my mentor 19:50
19:51 uniejo left
plobsing yes, I saw 19:52
I'm look forward to seeing how that turns out
s/look/looking/
colomon ash_++ 19:56
19:58 nihiliad left, nihiliad joined, molaf left
dalek kudo: 8098bf9 | (Solomon Foster)++ | src/core/Any-list.pm:
Add Any.minmax.
20:01
pugssvn r30478 | colomon++ | [t/spec] Add tests for method form of minmax.
jnthn back 20:02
colomon jnthn: yay for gsoc! 20:05
jnthn Yes! :-D
cognominal martinfowler.com/snips/201004261601.html # may interest some people here 20:06
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␤»
diakopter whee.
20:11 REPLeffect left
diakopter now to add the reverter line to the exit point of all blocks... 20:12
20:13 SmokeMachine left
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
[particle] that's very pointy, don't drop it!
colomon moritz_: sure enough. though that's a lot of tricky typing. :)
20:15 gruotr joined
moritz_ rakudo: <a b 1 2 -5 8>.sort(&[<=>]).perl.say 20:16
p6eval rakudo f6ec0a: OUTPUT«("-5", "a", "b", "1", "2", "8")␤»
moritz_ rakudo++
20:16 gurjeet joined
jnthn That short form is cute. :-) 20:17
ash_ rakudo: say <1/2> * 2; say "1/2" * 2; say 1/2 * 2; 20:18
p6eval rakudo 8098bf: OUTPUT«2␤2␤1␤»
moritz_ rakudo doesn't understand literals in <...> yet
ash_ but the "1/2" still wasn't right either...
or is that also not expected to pass?
moritz_ it numifies to 1 20:19
at least I think so
ash_ rakudo: say +"1/2", +"0.5";
p6eval rakudo 8098bf: OUTPUT«10.5␤»
ash_ thats 1 and 0.5 not 10.5 20:20
should of added a space i guess
so, right now its doing more like /\d+ [ \. \d+ ]?/ when it should maybe be more like /\d+ [ \.|\/ \d+]?/ maybe? 20:22
moritz_ depends on what you mean by "should" 20:24
ash_ just trying to figure out how you could match against fractions and decimals 20:25
i am also assuming 1/2/2/3 isn't a fraction, and you can't do 1/1.5
which i probably shouldn't assume 20:26
20:27 REPLeffect joined
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
rakudo: my $a = 1/2/2/3; say $a.WHAT; say $a.perl
p6eval rakudo 8098bf: OUTPUT«Rat()␤3/4␤»
colomon rakudo: my $a = 1/1.5; say $a.WHAT; say $a.perl
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)␤»
colomon rakudo: my $a = 1 / 1.5; say $a.WHAT; say $a.perl
p6eval rakudo 8098bf: OUTPUT«Rat()␤2/3␤» 20:34
colomon think that first is a Rakudobug, actually.
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()
p6eval rakudo 8098bf: OUTPUT«hello␤world␤sign␤hello␤»
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()
p6eval perlesque: OUTPUT«hello␤world␤sign␤hello␤»
diakopter yay.
(finally) 20:35
ash_ colomon: i am talking about string to num conversions 20:36
rakudo: say +"1/2";
p6eval rakudo 8098bf: OUTPUT«1␤»
ash_ rakudo: say +"1/2" == 1/2;
p6eval rakudo 8098bf: OUTPUT«0␤»
20:37 SmokeMachine joined
diakopter rakudo: say +"1/2" - 1/2; 20:39
p6eval rakudo 8098bf: OUTPUT«0.5␤»
20:39 pmurias joined
diakopter pmurias: yo. 20:39
ash_ "1/2" gets converted to 1, (i think its just the first digit it sees) when it should be 1/2 20:40
pmurias diakopter: hello 20:41
my proposal got accepted ! :)
moritz_ pmurias: congratulations! Time for community bonding :-)
20:43 REPLeffect left, REPLeffect joined
pmurias moritz_: do to get the perlesque mildew backend to work to bond with diakopter 20:47
;)
diakopter whee
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␤»
diakopter perlesquel: . 20:49
p6eval perlesquel: OUTPUT«hello␤world␤sign␤hello␤real 0.13␤user 0.02␤sys 0.02␤»
diakopter perlesquel: .
p6eval perlesquel: OUTPUT«hello␤world␤sign␤hello␤real 0.04␤user 0.03␤sys 0.01␤»
colomon pmurias++
diakopter perlesque: my $a = BigInteger.Create("335722"); $a += 357389; say($a) 20:51
p6eval perlesque: OUTPUT«693111␤»
diakopter o_O I didn't realize "+" would work with BigInteger and int
of course it won't work the other way 20:52
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:56
g'nite folks.. 20:57
jnthn night o/
20:57 isBEKaml_ left 20:58 isBEKaml left 21:01 ReiniUrban joined, cdarroch left 21:03 rurban left, ReiniUrban is now known as rurban 21:08 SmokeMachine left
pmurias diakopter: could you check why pastie.org/936229 fails 21:11
?
21:15 cdarroch joined, cdarroch left, cdarroch joined, M_o_C left
rurban Ctypes just uses the more liberal libffi, and adds a heafder parsr 21:17
Ctypes just uses the more liberal libffi, and adds a header parser. Otherwise it's the same old FFI as the other 5.
(just saw this discussion) 21:18
21:20 hercynium left
dalek kudo: 9fbb25c | jonathan++ | src/Perl6/Compiler/Role.pm:
Implement lexical roles. Also, allow roles of all scopes to be used as r-values.
21:22
kudo: ef4e74f | jonathan++ | src/Perl6/ (2 files):
Add anon scope declarator so it's possible to declare anonymous named things.
21:38 gruotr left 21:40 gurjeet left, Guest40234 left
Juerd Anonymous named things? Oh my god this language is powerful! 21:42
21:42 snarkyboojum left
Juerd I hope it's not like PHP's create_function, though 21:42
Which is cleverly documented as "Creates an anonymous function from the parameters passed, and returns a unique name for it." 21:43
Of course, PHP's create_function creates named anonymous things, not anonymous named things. 21:44
Or something. I'm confused :(
jnthn no, it's not that nasty. :-)
Juerd Of course it's not. I firmly believe that Perl 6 developers are incapable of writing anything that's that nasty. 21:45
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)␤»
Juerd They keep things free of nastiness or go WELL beyond PHP's standards for it.
jnthn Ah, not updated yet.
anyway
> my $x = anon class Foo { }; say $x
Foo()
The idea is that there's no Foo installed anywhere, but the thing still knows its name.
21:47 alester left
Juerd Reminds me of search.cpan.org/~xmath/Sub-Name-0.0...ub/Name.pm 21:47
Ewwwwwww. The tap water smells funny and looks yellowish.
I think I'll boil it and have tea instead. 21:48
jnthn Eww!
21:49 iblechbot left
PerlJam sulphuric tea 21:49
jnthn Tastes like ash! 21:50
diakopter pmurias: I think the sub needs a name 21:52
either that or method calls don't yet accept more than 1 argument :) 21:53
hm, they do. 21:54
so, I think the sub needs a name
frettled U984?
21:56 Spreadsheet_ joined, Spreadsheet_ left, Spreadsheet_ joined, Spreadsheet_ left, Spreadsheet_ joined
Spreadsheet_ Does Perl 6 have a variable for the last evaluated value? 21:56
Like ML's "it"
diakopter not that I know of
Spreadsheet_ So I call subroutine "foo", which evaluates to 42. I can access it by getting "it"
I think it would be useful 21:57
frettled Why, when you can store the result in a variable?
Spreadsheet_ I think it has to do something with currying.. let me read this blog post
21:59 christine left
frettled Like this, you mean? blogs.gurulabs.com/stephen/2008/12/...erl-6.html 21:59
arnsholt frettled: The most compelling use of it I saw was anaphoric macros in Lisp
frettled arnsholt: Yes, that's about it. 22:00
arnsholt So you do if foo($bar, $blech) && $it + 42 > 100 { ... }
diakopter perlesque: say("foo'" == 'foo\'') 22:02
p6eval perlesque: OUTPUT«False␤»
diakopter forgot to unescape things 22:03
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.
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.
Spreadsheet_ Ok I think this is what they are trying to say
pmurias diakopter: it would be helpfull if when adding features you added tests so i could see what's supported
Spreadsheet_ I'll paste it
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
Spreadsheet_: on paste.lisp.org/new/perl6?
Spreadsheet_ Yes
arnsholt Yeah, I think the way is to make it some kind of magic added by a module
22:06 christine joined
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:06
22:07 REPLeffect left 22:08 REPLeffect joined
frettled It sort of reminds me of certain kinds of assembly programming. 22:09
22:09 lichtkind joined, Spreadsheet_ left
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:10
22:11 pmurias left, Spreadsheet_ joined
Spreadsheet_ Back 22:11
22:11 ruoso left
frettled Perhaps it could be solved with a sequential junction? 22:14
Spreadsheet_ wow, I can't think of why an "it" variable would be useful 22:15
frettled :) 22:16
Spreadsheet_ I got it from www.svendtofte.com/code/curried_javascript/
Juerd I've sometimes wanted a "that" variable, that would refer to the value of the last boolean :) 22:19
s/boolean/condition/
Spreadsheet_ Apparently "it" is only useful in an interactive environment
jnthn remembers it from his ML days
It was nice in a REPL. 22:20
Juerd if (something) { print that }
22:20 stepnem joined
jnthn Juerd: if something -> $that { print $that } 22:20
22:20 Infinoid joined
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:20
jnthn True. :-) 22:21
Juerd Note that I'm not at all convinced that it would be a good idea.
jnthn Yeah
Feels a bit *too* magical for me.
ash_ what about $_
$_ is rather magical sometimes
Juerd ash_: How useful would $_ still be if it were changed with every conditional? :) 22:22
for (@foo) { if (/.../) { argh! } }
ash_ no, i am not saying update $_, i was just commenting that perl has lots of magic
Juerd Maybe I'm just spoiled but I don't see $_ as a magical thing :) 22:23
ash_ coming from another language, $_ feels like magic 22:24
Spreadsheet_ What is $_? Is it related to @_?
Juerd Oh, wow.
Spreadsheet_: $_ is the default variable for many Perl constructs.
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
If you combine those, you can write "for (@array) <-> $_ { $_.something }" as "for (@array) { .something }" which is much nicer.
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
Spreadsheet_ oo cool
Juerd TimToady: Right. Sorry :)
TimToady: I was wondering why it looked so funny. I guess I'm not used to seeing () with -> or <-> :)
Spreadsheet_: TimToady is right - it's even better when written as "for @array { .something }" 22:27
Of course Perl also has ".something for @array;" which I personally find even nicer.
jnthn And if you dont' care about the order the calls are done, @array>>.something
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
TimToady or even: map *.something, @array
Juerd That has little to do with $_ though :)
jnthn Juerd: Well, it saves a use of it. ;-)
TimToady *$ slurps the first arg that would have gone to *@ 22:28
jnthn Rakudo, sadly, doesn't implement that one yet.
jnthn-- didn't get around to it.
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) ?
jnthn Juerd: :-)
ash_: I guess yes, in that it will have enfoced list context on the whole load of arguments. 22:30
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)␤»
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 $
jnthn Oh. 22:32
Maybe it...accidentally works. ;-)
"works" 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 lichtkind left
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.
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:35
ash_ jnthn i think i found a bug... 22:37
rakudo: sub foo(*@a, *$b) { say "a: ", @a, " b: ", $b; }; my @f = 1, 2, 3; foo(|@f);
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)␤»
ash_ so, foo(*$a, *@b) { ... } foo(@bar) should expand to $a = @bar[0], @b = @bar[1..*]? 22:39
jnthn ash_: Ah
We should probably whine about that.
std: sub foo(*@a, *$b) { say "a: ", @a, " b: ", $b; }; 22:40
p6eval std 30478: OUTPUT«ok 00:01 112m␤»
ash_ jnthn its *$
rakudo: sub foo(*$a) { }; my @a = 1, 2, 3; foo(|@a);
p6eval rakudo 9fbb25: OUTPUT«Too many positional parameters passed; got 3 but expected 1␤current instr.: 'foo' pc 275 (EVAL_1:98)␤»
ash_ it seems to be the fact i put the *$ after a *@ 22:41
jnthn Yes, I suspect that should be disallowed. 22:42
22:44 rv2733 joined 22:45 wknight8111 joined
dalek kudo: 6c52872 | jonathan++ | src/Perl6/Compiler/Package.pm:
Allow use of lexically declared classes as an r-value (that does the right thing).
22:54
kudo: 3a89591 | jonathan++ | src/Perl6/Module/Loader.pm:
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:55 ash_ left 22:56 nihiliad left 22:58 bbkr_ joined 23:00 gruotr joined 23:02 gurjeet joined, rgrau_ left 23:03 snarkyboojum joined 23:06 hercynium joined 23:12 gurjeet left 23:14 gruotr left 23:15 lue left
pugssvn r30479 | jnthn++ | [t/spec] Add some very, very basic tests for lexical roles. 23:20
dalek kudo: bd47b29 | jonathan++ | t/spectest.data:
Add S14-roles/lexical.t to spectest.data.
23:22
23:30 am0c joined
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.
sorear Currently $!x is a bad semantic fit for private attributes for reasons like this; $._x is probably better 23:33
moritz_:
TimToady the whole point of private attributes is to *not* supply a method; they're infrastructural 23:38
Moose gets away with it because it has Perl hashes underneath to do the infrastructure
$!x is providing the same functionality as hashes in P5, only opaquely even to the class using it for infrastructure 23:42
it's a different encapsulation layer than slots 23:43
23:48 bbkr_ left
pugssvn r30480 | colomon++ | [Spec] Add .minmax method along the lines of the .min and .max methods. 23:51
23:52 lestrrat is now known as lest_away
TimToady I think minmax should generally just work with Ranges, maybe 23:53
and assume any single $n is $n..4n
$n..4n
$n..$n !!!!
.oO(stupid keyboard)
23:54
23:54 cdarroch left
TimToady
.oO(more like stupid corpus collosum)
23:54
diakopter "you might be ircing on a touchscreen phone if ..." 23:55
jnthn sorear: BTW, Blizkost and using it from Rakudo works well on Win32 + MSVC compiler. :-) 23:58
23:58 yinyin joined