Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2011-07-24

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:07 sorear TimToady: in J, that's a feature of implicit hypers, not indexing
00:08 sorear TimToady: imagine it more like @array >>index>> 0,1,3
00:15 TimToady we've now reached 350 RC entries \o/
00:30 [particle]1 is now known as [particle]
00:33 envi joined #perl6
00:37 Limbic_Region joined #perl6
00:43 eternaleye_ joined #perl6
00:47 LoRe_ joined #perl6
00:47 xinming joined #perl6
00:51 colomon_ joined #perl6
00:51 colomon left #perl6
00:51 dual left #perl6
00:51 sivoais left #perl6
00:51 xinming_ left #perl6
00:51 LoRe left #perl6
00:51 eternaleye left #perl6
00:51 colomon_ is now known as colomon
00:52 sivoais joined #perl6
00:59 TimToady does anyone know if rakudo (master) can open a file in binary mode?  I only seem to get Str() out of it
01:00 TimToady s/anyone/anyone awake/  :)
01:00 dual joined #perl6
01:00 noganex_ joined #perl6
01:01 sorear IIRC the mode is selected on an operation-by-operation basis
01:01 sorear rakudo: say $*IN.read(16).perl
01:01 p6eval rakudo 922500: OUTPUT«Buf.new(76, 97, 110, 100, 32, 100, 101, 114, 32, 66, 101, 114, 103, 101, 44, 32)␤»
01:02 TimToady oh, good, thanks
01:04 noganex left #perl6
01:18 tokuhirom joined #perl6
01:19 Chillance left #perl6
01:22 bluescreen10 joined #perl6
01:50 drbean joined #perl6
01:52 bluescreen10 left #perl6
02:15 molaf_ left #perl6
02:55 tokuhirom left #perl6
02:58 Limbic_Region left #perl6
03:26 Su-Shee left #perl6
03:28 Su-Shee joined #perl6
04:26 daniel-s joined #perl6
04:26 daniel-s_ joined #perl6
04:26 daniel-s left #perl6
04:28 perlhack joined #perl6
04:31 daniel-s__ joined #perl6
04:31 daniel-s_ left #perl6
04:32 perlhack left #perl6
04:35 daniel-s joined #perl6
04:35 simcop2387 left #perl6
04:35 daniel-s__ left #perl6
04:36 daniel-s left #perl6
04:37 simcop2387 joined #perl6
05:01 mattp_ left #perl6
05:03 mattp_ joined #perl6
05:29 daniel-s joined #perl6
05:33 daniel-s left #perl6
05:33 daniel-s__ joined #perl6
05:34 kaare_ joined #perl6
05:38 _daniel-s__ joined #perl6
05:38 daniel-s__ left #perl6
05:42 daniel-s joined #perl6
05:42 _daniel-s__ left #perl6
05:46 daniel-s__ joined #perl6
05:46 daniel-s left #perl6
05:50 am0c joined #perl6
05:51 _daniel-s__ joined #perl6
05:51 daniel-s__ left #perl6
05:55 daniel-s joined #perl6
05:55 _daniel-s__ left #perl6
05:59 daniel-s__ joined #perl6
06:00 daniel-s left #perl6
06:25 masak joined #perl6
06:25 masak good morning, #perl6
06:27 kcwu left #perl6
06:32 sorear hi masak
06:37 Mowah joined #perl6
06:39 kcwu joined #perl6
06:57 am0c left #perl6
07:10 am0c joined #perl6
07:19 masak std: my @nums[3;3;3]; say @nums[ ||(0..2) ]
07:19 p6eval std 516268a: OUTPUT«ok 00:01 122m␤»
07:22 * masak realizes that Each, if ever implemented anywhere, would sit on the same level as Any and Junction
07:30 am0c left #perl6
07:33 masak enumerable types in S09 -- what are they and through what mechanism can I make my own class enumerable?
07:35 masak I realize that enums are enumerable. from the examples, it also seems that ranges of Int as well as finite lists of Str are enumerable.
07:38 molaf joined #perl6
07:39 Jackneill joined #perl6
07:39 masak perl6: my %h; say %h<foo>.WHAT
07:40 p6eval pugs: OUTPUT«Scalar␤»
07:40 p6eval ..rakudo 922500, niecza v7-44-g54b5188: OUTPUT«Any()␤»
07:40 masak S09:1282 claims that the result here should be Failure. I guess that's a fossil.
07:41 masak S09:1268 also claims that Failure is returned when lookup fails.
07:57 * masak just learned that lightning talk sessions were introduced by MJD++
08:15 Instil joined #perl6
08:35 masak left #perl6
08:53 moritz good morning
09:01 * moritz tries his hands on regex adverbs, again
09:02 viklund joined #perl6
09:09 masak joined #perl6
09:09 masak morning, moritz.
09:09 masak I found a bug. :)
09:09 masak rakudo: subset Foo of Str where any(<foo bar>); for <foo OH NOES> { when Foo { say "$_ is a Foo" } } # this is fine
09:09 p6eval rakudo 922500: OUTPUT«foo is a Foo␤»
09:09 masak rakudo: my @strings; subset Foo of Str where any(@strings); for <foo OH NOES> { when Foo { say "$_ is a Foo" } } # OH NOES
09:10 p6eval rakudo 922500: OUTPUT«foo is a Foo␤OH is a Foo␤NOES is a Foo␤»
09:10 * masak submits rakudobug
09:10 daniel-s__ is now known as daniel-s
09:10 masak rakudo: my @strings; subset Foo of Str where { any(@strings) }; for <foo OH NOES> { when Foo { say "$_ is a Foo" } } # OH NOES
09:10 p6eval rakudo 922500:  ( no output )
09:10 masak hm.
09:10 masak rakudo: my @strings; subset Foo of Str where { $_ ~~ any(@strings) }; for <foo OH NOES> { when Foo { say "$_ is a Foo" } }
09:10 p6eval rakudo 922500: OUTPUT«foo is a Foo␤OH is a Foo␤NOES is a Foo␤»
09:11 masak oops, sorry.
09:11 masak forgot to populate @strings.
09:11 masak rakudo: my @strings = <foo bar>; subset Foo of Str where any(@strings); for <foo OH NOES> { when Foo { say "$_ is a Foo" } }
09:11 p6eval rakudo 922500: OUTPUT«foo is a Foo␤OH is a Foo␤NOES is a Foo␤»
09:12 masak even with an empty @strings, it's still wrong, of course.
09:14 masak rakudo: my @strings = <foo bar>; subset Foo of Str where { $_ ~~ any(@strings) }; for <foo OH NOES> { when Foo { say "$_ is a Foo" } }
09:14 p6eval rakudo 922500: OUTPUT«foo is a Foo␤OH is a Foo␤NOES is a Foo␤»
09:14 Mowah left #perl6
09:14 masak rakudo: my @strings = <foo bar>; subset Foo of Str where { say @strings.perl; $_ ~~ any(@strings) }; for <foo OH NOES> { when Foo { say "$_ is a Foo" } }
09:14 p6eval rakudo 922500: OUTPUT«Null PMC access in find_method('perl')␤  in <anon> at line 22:/tmp/anRU_Bl9Wt␤  in 'Block::ACCEPTS' at line 6377:src/gen/core.pm␤  in 'infix:<~~>' at line 483:src/gen/core.pm␤  in <anon> at line 1:/tmp/anRU_Bl9Wt␤  in 'Block::ACCEPTS' at line 6377:src/gen/core.pm␤ …
09:15 masak ah; it's the ol' "scope has wrong outer" bug again.
09:16 masak I'll submit it anyway because the use case might be worth having a test for. someone who finds the old ticket, if any, is free to merge.
09:21 viklund left #perl6
09:24 moritz without populated @strings it's still a bug
09:24 moritz why should 'foo' ~~ any(@empty_list)  be true?
09:25 masak <masak> even with an empty @strings, it's still wrong, of course.
09:25 masak I made the bug report skip over my confusion, though.
09:25 ab5tract joined #perl6
09:26 kytibe left #perl6
09:27 lateau joined #perl6
09:27 masak rakudo: $_ = "foo"; say so /foo/
09:27 p6eval rakudo 922500: OUTPUT«Method 'match' not found for invocant of class ''␤  in 'Regex::Bool' at line 6434:src/gen/core.pm␤  in 'prefix:<?>' at line 497:src/gen/core.pm␤  in 'prefix:<so>' at line 599:src/gen/core.pm␤  in main program body at line 22:/tmp/tMsv4FVbES␤»
09:28 masak should this work?
09:28 masak rakudo: $_ = "foo"; say $_ ~~ /foo/
09:28 p6eval rakudo 922500: OUTPUT«foo␤»
09:37 pmurias joined #perl6
09:37 masak rakudo: $_ = "open"; my @verbs = "open", "close"; say $_ ~~ /^ @verbs/
09:37 p6eval rakudo 922500: OUTPUT«␤»
09:37 masak rakudo: $_ = "open"; my @verbs = "open"; say $_ ~~ /^ @verbs/
09:37 p6eval rakudo 922500: OUTPUT«open␤»
09:38 masak ah, seems array interpolation isn't correctly implemented after all. (the array stringifies instead of acting like any(@verbs)). that's too bad.
09:38 moritz rakudo: $_ = "open"; my @verbs = <open close>; say $_ ~~ /^ @verbs
09:38 p6eval rakudo 922500: OUTPUT«===SORRY!===␤Confused at line 22, near "say $_ ~~ "␤»
09:39 moritz rakudo: $_ = "open"; my @verbs = <open close>; say $_ ~~ /^ @verbs/
09:39 p6eval rakudo 922500: OUTPUT«␤»
09:41 masak maybe an appropriate change to src/Perl6/Actions.pm:3109 would fix things.
09:41 masak then again, maybe not. :) in any case, it would be too big a yak shave just to get the June 30 blog post out.
09:42 masak the game will have to keep evolving for a while afterwards anyway.
09:44 masak huh. that's odd.
09:45 masak looking at the commit for that area of code, the !MAKE_REGEX routine in src/glue/regex.pir seems to be *specifically* made for handling arrays interpolated into regexes.
09:45 masak but I don't see it applying any infix:<|> semantics.
09:46 masak pmichaud: ^
09:48 am0c joined #perl6
09:54 masak S05:1139: "An interpolated array [...] is matched as if it were an alternation of its elements."
09:54 * masak submits rakudobug
10:03 ktbe joined #perl6
10:07 masak I didn't intentionally put crypt.pl on the envelope of Rakudo's abilities -- but it does turn out that a number of features we *almost* have would make the game code nicer. :)
10:07 ktbe left #perl6
10:14 MayDaniel joined #perl6
10:16 BULGARIAN-BOY joined #perl6
10:16 BULGARIAN-BOY left #perl6
10:23 dalek rakudo/nom: a50225a | moritz++ | / (3 files):
10:23 dalek rakudo/nom: bring back rx// and :s adverb
10:23 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a50225a1a9
10:23 dalek rakudo/nom: 44c8eeb | moritz++ | t/spectest.data:
10:23 dalek rakudo/nom: more passing test files
10:23 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/44c8eeb638
10:23 dayangkun joined #perl6
10:32 donri joined #perl6
10:32 * tadzik stops by
10:34 tadzik Announcement: my laptop's broken, and I have limited computer resources. Not sure if I'll have any replacement until it's fixed. Will try to report on #phasers
10:35 moritz ouch
10:35 moritz what's broken?
10:35 tadzik power input. No way to charge or to run on AC
10:36 tadzik We disassembled it on the uni, but no manpower to fix it, the voltage in the insides still looks ok, must be something on the motherboard
10:37 tadzik So I'll just hope my warranty is still valid, and it'll take less than a couple of gsoc weeks :/
10:37 wamba joined #perl6
10:37 fsntation joined #perl6
10:38 tadzik anyway, do I see regexes in nom?
10:39 moritz /.../ style regexes have been in for some time now
10:40 moritz I've added rx// just now
10:40 masak tadzik: oh noes!
10:40 masak tadzik: was it the sweets? :/
10:41 dayangkun left #perl6
10:42 tadzik masak: no, I highly doubt it. It's broken deeply inside somewhere
10:42 masak oh, ok.
10:43 tadzik Funny, I charged it in my flat and on the conference I was already unable to. As if it broke on the bus somewhere :/
10:44 drbean left #perl6
10:49 mj41 joined #perl6
10:49 kaare_ left #perl6
10:50 * tadzik leaves
10:50 woosley joined #perl6
10:52 MayDaniel left #perl6
10:58 tokuhirom joined #perl6
11:09 [Coke] left #perl6
11:09 fsntation left #perl6
11:13 [Coke] joined #perl6
11:25 [Coke] left #perl6
11:27 [Coke] joined #perl6
11:28 MayDaniel joined #perl6
11:30 * masak read and liked http://www.xray.mpe.mpg.de/mailing-lis​ts/perl5-porters/2011-07/msg01066.html -- tchrist++'s Unicode Shootout slides from OSCON
11:38 * mathw wonders if it's time to see if Form works in nom yet
11:40 whiteknight joined #perl6
11:42 masak mathw: ooh!
11:53 nimiezko joined #perl6
11:57 masak rakudo: sub foo(--> Int) { return 42 }; say foo
11:57 p6eval rakudo 922500: OUTPUT«42␤»
11:57 masak rakudo: sub foo(--> Int) { return "OH HAI" }; say foo
11:57 p6eval rakudo 922500: OUTPUT«OH HAI␤»
11:57 masak meh :/
11:58 masak rakudo: sub foo() returns Int { return "OH HAI" }; say foo
11:58 p6eval rakudo 922500: OUTPUT«OH HAI␤»
11:58 mj41 left #perl6
12:01 dalek rakudo/nom: c15a26e | moritz++ | src/Perl6/Actions.pm:
12:01 dalek rakudo/nom: enable m//, though without adverb checking and runtime adverbs
12:01 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/c15a26e410
12:04 kaare_ joined #perl6
12:05 perlhack joined #perl6
12:07 stm` left #perl6
12:11 masak heh, I keep finding more uses for this &inverse_index in the game. :)
12:12 perlhack :-)
12:12 masak perlhack! \o/
12:12 perlhack masak, hey hey
12:12 masak hi ho :)
12:12 perlhack :-)what are you doing
12:13 masak hacking on my p6 game :)
12:13 masak (preparing to make the last June blog post)
12:13 perlhack :-)my my my my god
12:13 masak yes... exciting!
12:13 perlhack :-)nice idea.
12:14 masak rakudo: sub inverse_index(@array, $value) { (first { .value eq $value }, @array.pairs).key }; say inverse_index [<left middle right>], "middle"
12:14 p6eval rakudo 922500: OUTPUT«1␤»
12:14 masak rakudo: sub inverse_index(@array, $value) { (first { .value eq $value }, @array.pairs).key }; say inverse_index <left middle right>, "middle"
12:14 p6eval rakudo 922500: OUTPUT«1␤»
12:15 masak right. no [] needed.
12:16 spetrea hello everyone :)
12:16 moritz rakudo: sub inverse_index(@array, $value) { @array.keys.first: { @array[$_] eq $value } );say inverse_index <left middle right>, "middle"
12:16 p6eval rakudo 922500: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
12:16 masak spetrea: hi! :)
12:16 perlhack hi spetrea
12:16 moritz rakudo: sub inverse_index(@array, $value) { @array.keys.first: { @array[$_] eq $value }) ;say inverse_index <left middle right>, "middle"
12:16 p6eval rakudo 922500: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
12:17 perlhack spetrea, send you a smile.
12:17 masak moritz: you have one ')' too many and one '}' too few.
12:17 moritz phenny: tell pmichaud that m:s// now works in nom, but not :sigspace -- is that something you want to fix on the qregex level, or should I do it in nom (as best as I can)?
12:17 phenny moritz: I'll pass that on when pmichaud is around.
12:18 moritz rakudo: sub inverse_index(@array, $value) { @array.keys.first: { @array[$_] eq $value }} ;say inverse_index <left middle right>, "middle"
12:18 p6eval rakudo 922500: OUTPUT«1␤»
12:18 moritz masak: thanks. I hate those unspecific error messages.
12:18 spetrea perlhack: thanks :)
12:23 masak moritz: I like your version better. changing :)
12:41 drbean joined #perl6
12:42 moritz $ ./perl6 -e '$_="foo"; say m:c(1)/./'
12:42 moritz o
12:42 moritz \o/
12:42 masak moritz++
12:44 moritz the hard part really was done in master already, and now the changes just reflect a different internal API (wihch is much saner)
12:45 moritz master used a global stack of adverb hashes, and the top of the stack would apply to the current regex
12:45 dalek rakudo/nom: 5ee5857 | moritz++ | / (2 files):
12:45 dalek rakudo/nom: enable runtime adverbs or m//, enable checks for valid adverbs
12:45 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5ee5857d50
12:45 moritz now we have a dynamic var %*RX for adverbs
12:45 masak nice.
12:46 moritz afk&
12:47 am0c left #perl6
12:52 * mathw grabs and compiles nom, then watches cat watching the compiler output
12:53 kjeldahl_ joined #perl6
12:56 Jackneill left #perl6
12:59 am0c joined #perl6
13:06 masak mathw: is cat doing this? http://icanhascheezburger.files.wordpress.c​om/2009/08/funny-pictures-cat-is-amazed.jpg
13:07 perlhack left #perl6
13:09 kboga joined #perl6
13:11 mathw well there was some of that
13:11 mathw but there is now mostly this kind of thing
13:11 mathw http://farm6.static.flickr.com/​5290/5233479532_283423ea0f.jpg
13:13 masak watching compiler output can be exhausting.
13:13 mathw I suspect the exhaustion comes from all that strenuous eating he's been doing this morning
13:13 mathw not to mention the lying around in the sun
13:14 kboga left #perl6
13:15 masak I get tired just thinking about it.
13:15 kaare_ left #perl6
13:16 mj41 joined #perl6
13:16 mathw :)
13:21 kboga joined #perl6
13:24 mj41 left #perl6
13:24 kjeldahl_ left #perl6
13:26 kjeldahl joined #perl6
13:30 kboga left #perl6
13:32 masak I just ran spectests on nom. three test files with non-zero exit status: t/spec/S02-builtin_data_types/assigning-refs.rakudo t/spec/S02-literals/numeric.rakudo and t/spec/S32-num/pi.t
13:32 masak in the first, 18 tests ran. in the other two, 0.
13:33 masak no tests failed in any of the files.
13:33 kboga joined #perl6
13:36 mj41 joined #perl6
13:45 wamba left #perl6
13:54 kaare_ joined #perl6
13:55 kjeldahl_ joined #perl6
13:55 drbean left #perl6
13:56 Instil left #perl6
14:01 Jackneill joined #perl6
14:03 MayDaniel left #perl6
14:04 * flussence finally gets around to doing that separate-dirs-per-branch suggestion...
14:06 masak rakudo: role R { method foo { self.bar(42) }; method bar($x) { say "OH HAI" } }; class C does R { method foo { self.R::foo } }; C.new.foo
14:06 p6eval rakudo 922500: OUTPUT«OH HAI␤»
14:06 masak rakudo: role R { method bar($x) {}; method foo { self.bar(42) } }; class C does R { method foo { self.R::foo } }; C.new.foo
14:06 p6eval rakudo 922500: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤  in 'bar' at line 22:/tmp/N060_2D3In␤  in 'C::foo' at line 22:/tmp/N060_2D3In␤  in main program body at line 22:/tmp/N060_2D3In␤»
14:06 * masak submits rakudobug
14:07 masak only the order of the method declarations in the role differs.
14:08 masak rakudo: role R { method bar($x) { say "OH HAI" }; method foo { self.bar(42) } }; R.new.foo
14:08 p6eval rakudo 922500: OUTPUT«OH HAI␤»
14:08 masak and it seems that, somehow, the role method delegation is necessary to trigger it.
14:09 mj41 left #perl6
14:09 kjeldahl left #perl6
14:11 kjeldahl joined #perl6
14:19 dalek roast: 97a2584 | (Kyle Hasselbacher)++ | TODO:
14:19 dalek roast: [TODO] There is no t/spec/, only roast
14:19 dalek roast: review: https://github.com/perl6/roast/commit/97a25847b5
14:21 mj41 joined #perl6
14:22 wamba joined #perl6
14:22 jaldhar left #perl6
14:22 jaldhar joined #perl6
14:28 Chillance joined #perl6
14:30 wolfman2_ left #perl6
14:31 wamba left #perl6
14:32 wamba joined #perl6
14:39 wamba left #perl6
14:48 fsntation joined #perl6
14:54 Jackneill left #perl6
14:57 masak by the way, if anyone else feels like beta testing the crypt text adventure game, now is the time: https://github.com/masak/crypt
14:57 masak I've been doing a fair amount of changes lately, and it's possible I've broken something down the line.
14:58 masak plus, there are probably thousands of sensible commands than no-one has thought to try yet. the more coverage, the better.
15:02 masak jlaire: by the way, I just plugged the Hanoi loophole you found in the manner we discussed. jlaire++
15:13 Su-Shee would be nice to have a perl 6 analysis in comparison... http://98.245.80.27/tcpc/OSCON2011/gbu/index.html (tom christiansen's overview over unicode in several languages..)
15:16 whiteknight left #perl6
15:17 whiteknight joined #perl6
15:21 woosley left #perl6
15:21 am0c left #perl6
15:21 perlhack joined #perl6
15:22 masak TimToady: has anyone ever proposed interdependent roles? like, 'role P { ... }; role R requires P { ... }'
15:22 perlhack left #perl6
15:22 wamba joined #perl6
15:23 masak hm, maybe it can already be done, by twiddling role R's metaobject somehow.
15:25 MayDaniel joined #perl6
15:33 pmurias left #perl6
15:34 am0c joined #perl6
15:40 kjeldahl_ left #perl6
15:41 kfo joined #perl6
15:43 wamba left #perl6
15:45 kfo_ left #perl6
15:47 Trashlord joined #perl6
15:49 moritz masak: why not simply   role R does P { ... } ?
15:50 masak hm.
15:50 masak I can think of several reasons why not.
15:50 masak late binding being the foremost.
15:54 lateau left #perl6
15:55 masak moritz: heh, I realized that at least for the crypt game, your advice applies. so I'm adding a lot of 'does P's to role declarations now :)
15:55 masak thanks. :)
15:57 mj41 left #perl6
16:01 moritz you're welcome
16:01 wolfman2000 joined #perl6
16:01 moritz masak: I don't understand the late binding argument - care to elaborate?
16:05 masak I was thinking something like the role R only requiring P[Cool $a], but the class that composes R decides to be narrower and composes P[Str $a].
16:06 * moritz wonders if that falls under the "a role may never conflict with itself" rule or not
16:07 masak note that under my (imagined) scheme, R doesn't compose or drag in P[Cool $a] in any way. so there's no conflict.
16:08 kboga nom: my %hash9; %hash9{1} = 2; %hash9{2} = 3; $_ = ~%hash9; say ?m{^(1\t2\s+2\t3|2\t3\s+1\t2)\s*$}
16:08 p6eval nom: OUTPUT«Bool::True␤»
16:08 masak I just pushed a big refactor of the whole disposition of the crypt script. it's now composed of eight sections, with no (or very few) forward references.
16:08 kboga my %hash9; %hash9{1} = 2; %hash9{2} = 3; $_ = ~%hash9; say ?m{^(11\t2\s+2\t3|2\t3\s+1\t2)\s*$}'
16:09 kboga nom: my %hash9; %hash9{1} = 2; %hash9{2} = 3; $_ = ~%hash9; say ?m{^(11\t2\s+2\t3|2\t3\s+1\t2)\s*$}'
16:09 p6eval nom: OUTPUT«Confused at line 1, near "say ?m{^(1"␤current instr.: 'nqp;HLL;Grammar;panic' pc 23557 (src/stage2/gen/NQPHLL.pir:6323) (src/stage2/gen/NQPHLL.pm:329)␤»
16:09 kboga nom: my %hash9; %hash9{1} = 2; %hash9{2} = 3; $_ = ~%hash9; say ?m{^(11\t2\s+2\t3|2\t3\s+1\t2)\s*$}
16:09 p6eval nom: OUTPUT«Method 'nqpattr' not found for invocant of class 'Undef'␤current instr.: 'nqp;NQPCursorRole;_block1352' pc 24914 (src/stage2/QRegex.pir:7668) (src/stage2/QRegex.nqp:467)␤»
16:10 wamba joined #perl6
16:11 s1n where's the operator precedence defined? is it in std.pm?
16:12 moritz s1n: S03 too
16:13 masak the sections are: predeclarations (4%), global variables (7%), utility subroutines (6%), roles for things and rooms (16%), things (14%), directions (4%), rooms (22%), and the game itself (27%).
16:14 * masak --> store
16:14 kjeldahl left #perl6
16:16 s1n masak: that looks good, thanks
16:17 s1n what does the "A" column mean in that table?
16:17 moritz Associativity
16:17 masak i.e. whether A op B op C means (A op B) op C or A or (B op C)
16:18 masak or neither :)
16:18 moritz or (A op B) && (B op C)
16:20 moritz there's a table of the associativities below the table of precedence levels
16:22 lichtkind joined #perl6
16:22 s1n i don't see where the associativities are defined
16:23 s1n (i.e. what is "C"?)
16:23 masak chaining.
16:23 MayDaniel left #perl6
16:23 masak ISTR S03 has some wording about it.
16:24 masak yes, see S03:65.
16:26 * masak --> store, really
16:27 ymasory_ joined #perl6
16:27 s1n seems to say what chaining is, but i still don't see a table that tells me what all of the associativity tables are?
16:28 s1n (that wasn't a question, oops)
16:28 moritz s1n: S03:65
16:29 s1n i guess i need to pull down the actual files so i can check that line
16:29 envi left #perl6
16:29 moritz s1n: in the IRC logs, S03:65 is a link to the right line
16:30 moritz http://irclog.perlgeek.de/​perl6/2011-07-24#i_4161348 points to http://perlcabal.org/syn/S03.html#line_65
16:31 moritz nom: say 'A' ~~ /<.upper>/
16:31 p6eval nom: OUTPUT«A␤»
16:31 moritz nom: say 'A' ~~ /<:upper>/
16:31 p6eval nom: OUTPUT«Unrecognized regex metacharacter (must be quoted to match literally) at line 1, near ":upper>/"␤current instr.: 'nqp;HLL;Grammar;panic' pc 23557 (src/stage2/gen/NQPHLL.pir:6323) (src/stage2/gen/NQPHLL.pm:329)␤»
16:32 s1n oh, i can add the line as an anchor tag
16:41 perlhack joined #perl6
16:48 thou joined #perl6
16:51 thou left #perl6
16:52 ymasory_ left #perl6
16:53 perlhack left #perl6
16:56 thou joined #perl6
17:09 moritz nom: my @a = 1, 2; say 'a', 'b', 'c', 'd' Z @a, *
17:09 p6eval nom: OUTPUT«a 1 b 2 c Whatever<57124920>␤»
17:09 moritz nom: my @a = 1, 2; say 'a', 'b', 'c', 'd' Z @a, @a[*-1] xx *
17:09 p6eval nom: OUTPUT«a 1 b 2 c 2 d 2␤»
17:16 moritz nom: say 'a' ~~ /<.upper>/;
17:16 p6eval nom: OUTPUT«␤»
17:18 moritz nom: say 'OH NOEZ' if 'a' ~~ /<.upper>/
17:18 p6eval nom: OUTPUT«OH NOEZ␤»
17:18 moritz nom: say ('a' ~~ /<.upper>/).WHAT
17:18 p6eval nom: OUTPUT«Match()␤»
17:18 moritz nom: say ('a' ~~ /<.upper>/).Bool
17:18 p6eval nom: OUTPUT«Bool::True␤»
17:18 benabik Oh noez, indeed
17:18 moritz nom: say ('a' ~~ /<.upper>/).perl
17:18 p6eval nom: OUTPUT«␤»
17:18 moritz nom: say ('a' ~~ /<.upper>/).from
17:18 p6eval nom: OUTPUT«0␤»
17:18 moritz nom: say ('a' ~~ /<.upper>/).to
17:18 p6eval nom: OUTPUT«0␤»
17:19 moritz nom: say ('a' ~~ /<?upper>/).to
17:19 p6eval nom: OUTPUT«0␤»
17:19 moritz nom: say ('a' ~~ /<?upper>/).Bool
17:19 p6eval nom: OUTPUT«Bool::True␤»
17:19 moritz nom: say ('A' ~~ /<?upper>/).to
17:19 p6eval nom: OUTPUT«0␤»
17:19 moritz nom: say ('A' ~~ /<.upper>/).to
17:19 p6eval nom: OUTPUT«1␤»
17:20 moritz nom: say ('a' ~~ /<.upper>/).to
17:20 p6eval nom: OUTPUT«0␤»
17:20 moritz so if ti doesn't match, it simply creates a zero-width match?
17:20 TimToady masak: There is a walls here.  x walls --> Method 'lines' not found for invocant of class ''
17:21 moritz pmichaud: see above
17:27 am0c left #perl6
17:28 moritz nom: say ('a' ~~ /^<.upper>$/).to
17:28 p6eval nom: OUTPUT«-3␤»
17:29 moritz nom: say ('a' ~~ /^<.upper>$/).Bool
17:29 p6eval nom: OUTPUT«Bool::False␤»
17:31 masak TimToady: thank you. will investigate.
17:32 Trashlord left #perl6
17:34 Trashlord joined #perl6
17:45 nimiezko left #perl6
17:49 shinobicl joined #perl6
17:51 shinobicl hi... how do i handle a list of arrays as parameters? example : sub myfunc(@arr1, @arr2) and sub myfunc(@arr1, @arr2, @arr3)
17:52 moritz for now either you need to define separate multis  for each arity, or pass the arrays as yourfanc([@arr1], [@arr2], ...)
17:53 moritz though in nom you can already  declare myfunc(**@LoL) { ... }
17:53 moritz and that gets the nested list of all arrays passed to the sub, unflattened
17:54 moritz nom: sub f(**@l) { say @l.perl }; my @a = 1, 2, 3; my @b = <a b c>; f @a; @b
17:54 p6eval nom: OUTPUT«LoL.new([1, 2, 3])␤»
17:54 moritz nom: sub f(**@l) { say @l.perl }; my @a = 1, 2, 3; my @b = <a b c>; f(@a; @b)
17:54 p6eval nom: OUTPUT«LoL.new((Array.new(1, 2, 3),), (Array.new("a", "b", "c"),))␤»
17:54 moritz nom: sub f(**@l) { say @l.perl }; my @a = 1, 2, 3; my @b = <a b c>; f(@a, @b)
17:54 p6eval nom: OUTPUT«LoL.new([1, 2, 3], ["a", "b", "c"])␤»
17:54 moritz ah, works with , too
17:56 shinobicl rakudo: sub myfunc(*@arrlist) { for (@arrlist) { say $_.WHAT }}; my @arr1=<1 2 3>; my @arr2 = <a b c d>; myfunc(@arr1); say '---'; myfunc(\@arr1, \@arr2);
17:56 p6eval rakudo 922500: OUTPUT«Str()␤Str()␤Str()␤---␤Capture()␤Capture()␤»
17:56 shinobicl rakudo: sub myfunc(@arrlist) { for (@arrlist) { say $_.WHAT }}; my @arr1=<1 2 3>; my @arr2 = <a b c d>; myfunc(@arr1); say '---'; myfunc(\@arr1, \@arr2);
17:56 p6eval rakudo 922500: OUTPUT«Str()␤Str()␤Str()␤---␤Nominal type check failed for parameter '@arrlist'; expected Positional but got Capture instead␤  in 'myfunc' at line 22:/tmp/CrNp5W2TMA␤  in main program body at line 22:/tmp/CrNp5W2TMA␤»
17:57 moritz forget about backslashes in Perl 6 for now.
17:57 Mowah joined #perl6
17:57 moritz they don't do what they did in Perl 5
17:57 shinobicl nom: sub myfunc(**@arrlist) { for (@arrlist) { say $_.WHAT }}; my @arr1=<1 2 3>; my @arr2 = <a b c d>; myfunc(@arr1); say '---'; myfunc(@arr1, @arr2);
17:58 p6eval nom: OUTPUT«Array()␤---␤Array()␤Array()␤»
17:58 masak moritz: yes, it works with infix:<,> because arrays do not flatten in captures.
17:58 shinobicl what is the meaning of ** ?
17:58 shinobicl i know that * is 'flatten'
17:58 moritz shinobicl: * means "use up as many as you can"
17:58 moritz shinobicl: and ** means "use up as many as you can, without flattening"
17:58 birdwindupbird joined #perl6
17:59 shinobicl ahhhhh, nice :)
17:59 sorear good * #perl6
17:59 shinobicl but maybe it should be the opposite way
17:59 shinobicl * should be "use up as many as you can, without flattening"
17:59 moritz shinobicl: * is far more often used than **
18:02 masak good *, sorear
18:03 moritz \o sorear
18:03 moritz nom: say "foo bar" ~~ m:s/\w+ \w+/
18:03 p6eval nom: OUTPUT«No applicable candidates found to dispatch to for 'ACCEPTS'. Available candidates are:␤:(Mu, Mu $topic, Mu %_)␤␤current instr.: 'ACCEPTS' pc 478282 (src/gen/CORE.setting.pir:124539) (src/gen/CORE.setting:280)␤»
18:03 moritz nom: $_ = "foo bar"; say  m:s/\w+ \w+/
18:04 p6eval nom: OUTPUT«foo bar␤»
18:04 masak nom: $_ = "foo bar"; say  m:s/:!s \w+ \w+/
18:04 p6eval nom: OUTPUT«foo␤»
18:05 masak :)
18:05 masak nom: $_ = "foo bar"; say  m:s/:!s \w+: \w+:/
18:05 moritz nom: $_ = "foo bar"; say  m:s:r/:!s \w+ \w+/
18:05 p6eval nom: OUTPUT«␤»
18:05 p6eval nom: OUTPUT«␤»
18:05 masak great minds regex alike :P
18:05 moritz s/great/similarly conditioned/ :-)
18:06 mathw :)
18:08 masak s/conditioned/brain-washed/ :P
18:08 masak TimToady: thanks, fixed.
18:09 masak TimToady: also, now some hieroglyphs on the walls of the Hall say "Larry Wall was here" :)
18:12 rgrau joined #perl6
18:17 kjeldahl joined #perl6
18:22 MayDaniel joined #perl6
18:25 shinobicl was there an operator for flattening an array?
18:25 flussence |@a
18:25 moritz .flat
18:26 flussence oh wait, .flat
18:26 flussence different things
18:26 moritz both not wrong :-)
18:26 shinobicl i'm still thinking about * and **
18:26 flussence (is there a use for |@ outside function args?)
18:27 shinobicl * is "use as many as you can" and ** "use as many as you can without flatenning"
18:28 shinobicl *@arr, **@arr, |@arr, i don't see a 'pattern' in here :S
18:29 masak I think *@arr is at the callee end, while |@arr is at the caller end.
18:29 moritz note that the first two happen at the callee side, and the last on the caller side
18:29 mj41 joined #perl6
18:29 masak at one point, the view was that they were the same on both ends.
18:29 masak for some reason, they're not.
18:30 moritz that's because they don't do the same thing
18:30 masak well, that's true for a lot of things on either side of a call with the *same* syntax.
18:30 masak so it can't be just that.
18:30 moritz for example?
18:31 masak :$arg creates a pair.
18:31 masak :$param denotes a named parameter.
18:31 moritz ":$arg creates a pair." is too simplistic
18:31 masak agreed.
18:31 masak but they don't do the same thing.
18:32 moritz it does marks it as named
18:32 moritz so they don't do the same thing, but coressponding things
18:32 masak well, flattening and slurping are the same kind of corresponding things.
18:33 moritz so des | correspond to * or to ** ?
18:33 moritz s/des/does/
18:33 masak I'd guess | corresponds to *, and || to **
18:33 masak but I haven't researched this deeply :)
18:34 sorear note that jnthn++ has talked about making *all* argument modification callee-side
18:37 moritz that doesn't really make sense to me in the context of multi dispatch
18:38 moritz because the multi dispatcher has to act as if it works on a capture in which |@things are already interpolated
18:38 mathw apparently I'm no longer capable of building a usable Rakudo
18:40 Instil joined #perl6
18:43 birdwindupbird left #perl6
18:46 mathw the one make install put into rakudo/install/bin won't work from outside the Rakudo tree :(
18:47 moritz mathw: nom or master?
18:47 moritz nom is know not to install correctly :(
18:49 mathw oh
18:49 mathw this is nom
18:49 mathw well that explains that then :)
18:49 mathw I don't feel stupid anymore
18:53 kboga left #perl6
18:55 Trashlord left #perl6
18:58 Trashlord joined #perl6
19:05 Mowah left #perl6
19:05 MayDaniel left #perl6
19:10 ymasory_ joined #perl6
19:13 * moritz is mostly to blame
19:14 moritz when I did the hack for the modules to look in blib/ I didn't really consider installed nom
19:14 kboga joined #perl6
19:15 mathw I would politely suggest that it might be wise t ofix it before releases start off nom :)
19:16 moritz before nom becomes master, really
19:16 mathw that seems sensible
19:17 shinobicl i'm trying to implement this example i saw here in this irc channel:
19:17 shinobicl role Counter[**@ranges] { has @.ranges; method new(*@values) { for (@ranges) -> @onerange { die "Wrong number of args" unless onerange == @values; die "Out of range" @values Z<= @onerange; } self.bless(*, :@values); } };
19:17 shinobicl nom: role Counter[**@ranges] { has @.ranges; method new(*@values) { for (@ranges) -> @onerange { die "Wrong number of args" unless onerange == @values; die "Out of range" @values Z<= @onerange; } self.bless(*, :@values); } };
19:17 p6eval nom: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 1␤current instr.: 'nqp;Regex;Cursor;FAILGOAL' pc 3863 (src/Regex/Cursor.pir:244)␤»
19:17 shinobicl i don't undesrtand the syntax error :S
19:18 shinobicl the original example was on rakudo, but only nom supports "**" for the moment
19:20 moritz die "Out of range" @values Z<= @onerange;  # that's two terms in a row
19:20 moritz though the error message sucks, yes
19:21 shinobicl nom: role Counter[**@ranges] { has @.ranges; method new(*@values) { for (@ranges) -> @onerange { die "Wrong number of args" unless onerange == @values; die "Out of range" unless @values Z<= @onerange; } self.bless(*, :@values); } };
19:21 p6eval nom: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 1␤current instr.: 'nqp;Regex;Cursor;FAILGOAL' pc 3863 (src/Regex/Cursor.pir:244)␤»
19:22 shinobicl oh well... i try something else then :)
19:22 shinobicl thank you for your patience:)
19:22 shinobicl bye!
19:22 shinobicl left #perl6
19:22 moritz std: role Counter[**@ranges] { has @.ranges; method new(*@values) { for (@ranges) -> @onerange { die "Wrong number of args" unless onerange == @values; die "Out of range" unless @values Z<= @onerange; } self.bless(*,  :@values); } };
19:22 p6eval std 516268a: OUTPUT«[31m===[0mSORRY![31m===[0m␤Preceding context expects a term, but found infix == instead at /tmp/JA6xg6XpM0 line 1:␤------> [32m "Wrong number of args" unless onerange [33m⏏[31m== @values; die "Out of range" unless @v[0m␤Parse failed␤FAILED 00:01 125m␤»…
19:23 moritz gone
19:26 ymasory_ left #perl6
19:31 donri left #perl6
19:32 donri joined #perl6
19:36 masak there's also a 'onerange' there in the middle which should probably have a '@' stuck on it.
19:36 masak that might even be the cause of the error, if STD.pm6 assumes it's a listop and switches to term expectry.
19:37 masak (no, 'expectry' isn't a word. maybe it should be.) :P
19:42 Chillance left #perl6
19:43 Chillance joined #perl6
19:46 dalek rakudo/nom: e5d914c | moritz++ | / (3 files):
19:46 dalek rakudo/nom: implement &samecase
19:46 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e5d914c4ab
19:46 dalek rakudo/nom: 0376f99 | moritz++ | src/core/Str.pm:
19:46 dalek rakudo/nom: implement :x in Str.match
19:46 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/0376f991a1
19:56 kaare_ left #perl6
20:14 Tene Has anyone here looked at http://freeformlang.sourceforge.net/ yet?
20:15 wamba left #perl6
20:16 masak not I. but it puts me in mind of http://eidola.org/ -- a project that caught my attention many years ago.
20:19 moritz how do comments work in a representation-independent language?
20:19 masak what a Zen question. :)
20:20 moritz it's actually the first question that came to my mind, and very practical at that
20:21 masak I'm not sure it's that much of a problem. how do free-form annotations work in sheet music?
20:21 mathw umm
20:22 mathw you guess
20:22 mathw it's not a precise notation system
20:22 masak but it *is* solvable.
20:22 mathw yes
20:22 mathw unless the composer/engraver is a total arse
20:23 mathw I suppose actually rather than imprecise it's more... incomplete
20:25 mathw but really when you get down to it, somebody can write whatever they like on music in order to instruct the player to do something
20:25 mathw the problem I have is that people tend to write it in Italian
20:26 masak "sempre in avanti. semaforo."
20:26 masak :)
20:27 mathw my favourite was always the direction at the start which translates to "lively, but not too fast"
20:27 mathw it just looks ridiculous
20:27 wamba joined #perl6
20:40 rgrau left #perl6
21:02 benabik left #perl6
21:08 moritz "con spirito ma non tropo" or something
21:08 masak "with liveliness, but not too much"?
21:09 moritz right
21:09 kjeldahl left #perl6
21:09 moritz troppo actually
21:16 MayDaniel joined #perl6
21:16 masak heh. I'm finding more bugs by blogging about the game. :)
21:22 MayDaniel left #perl6
21:28 moritz nom: my $x = 'a'; say 'a' ~~ /$x/
21:28 p6eval nom: OUTPUT«Method 'rxtype' not found for invocant of class 'PAST;Regex'␤current instr.: 'nqp;QRegex;P6Regex;Actions;_block2296' pc 67311 (src/stage2/QRegex.pir:20930) (src/stage2/QRegex.nqp:983)␤»
21:29 dalek rakudo/nom: b6150b2 | moritz++ | src/core/Str.pm:
21:29 dalek rakudo/nom: implement limit for Str.comb
21:29 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/b6150b224a
21:29 dalek rakudo/nom: 3867e02 | moritz++ | src/core/Str.pm:
21:29 dalek rakudo/nom: since the loop in Str.match is not lazy anymore, use push instead of gather/take; might be faster
21:29 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3867e0275a
21:29 dalek rakudo/nom: 0cbd875 | moritz++ | src/core/ (2 files):
21:29 dalek rakudo/nom: implement limit for Str.split
21:29 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/0cbd875143
21:39 mj41 left #perl6
21:43 Psyche^ joined #perl6
21:47 Patterner left #perl6
21:47 Psyche^ is now known as Patterner
21:55 ggoebel left #perl6
21:57 drbean joined #perl6
21:57 dalek nqp: 9fe040c | pmichaud++ | src/HLL/Compiler.pm:
21:57 dalek nqp: Eliminate $!commandline_{banner|prompt}, replace with interactive_* methods.
21:57 dalek nqp: review: https://github.com/perl6/nqp/commit/9fe040c4c6
21:57 dalek nqp: 9573361 | pmichaud++ | src/HLL/Compiler.pm:
21:57 dalek nqp: Refactor HLL::Compiler.command_line so that compilers can more easily intercept argument processing.
21:57 dalek nqp: review: https://github.com/perl6/nqp/commit/95733616c2
21:59 masak pmichaud! \o/
21:59 dalek rakudo/nom: fedd5b3 | pmichaud++ | / (4 files):
21:59 dalek rakudo/nom: Add initial version of @*ARGS.
21:59 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/fedd5b3f76
22:00 ggoebel joined #perl6
22:01 masak B.L.O.G. POST! http://strangelyconsistent.org/bl​og/june-30-2011-text-adventure-ii
22:01 masak phew! :)
22:05 bluescreen10 joined #perl6
22:20 ascent_ left #perl6
22:28 Trashlord left #perl6
22:35 wolfman2000 left #perl6
22:47 benabik joined #perl6
22:47 benabik left #perl6
22:49 tokuhirom left #perl6
22:53 wamba left #perl6
23:00 isBEKaml joined #perl6
23:02 isBEKaml .u ð
23:02 phenny U+00F0 LATIN SMALL LETTER ETH (ð)
23:03 isBEKaml .u æ
23:03 phenny U+00E6 LATIN SMALL LETTER AE (æ)
23:03 phenny U+0020 SPACE ( )
23:08 masak 'nighty, #perl6.
23:08 masak left #perl6
23:10 kfo left #perl6
23:20 isBEKaml left #perl6
23:29 orafu left #perl6
23:29 orafu joined #perl6
23:45 shinobicl joined #perl6
23:57 molaf left #perl6
23:59 shinobicl hi all :)

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

Perl 6 | Reference Documentation | Rakudo