Camelia, the Perl 6 bug

IRC log for #perl6, 2010-06-04

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs

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

All times shown according to UTC.

Time Nick Message
00:28 eternaleye TimToady: (backlogging) re the Z bug, I would thing kit was the doubled parens around the pair not collapsing correctly
00:29 eternaleye Oh wait, nvm. I missed the 'for'
00:33 sorear Passed 781/815,  95.83%
00:34 sorear 34 failed
00:34 sorear TimToady: ^^
00:37 sorear TimToady: Why is there a parse/parsefile split?
00:43 yinyin joined #perl6
00:45 lue joined #perl6
00:45 lue [message check]
00:45 lue ohai dere. I had a case of camel apathy :/
00:51 jnthn lue: You got the hump?
00:51 sorear TimToady: I wish there were a way to localize all of the compiler's contextuals in one swoop.  Something like a my %*LANG, but not for $~ ...
00:52 sorear thoughts are swirling in my head involving connecting this to COMPILING, but I'm not quite there yet
00:54 sorear TimToady: What is Cursor.pmc 2392-2393 doing?
00:56 * lue considers continuing his tutorial for Perl 6 ( you know, the MMORPG :) )
00:57 snarkyboojum joined #perl6
00:57 snarkyboojum_ joined #perl6
01:14 pausenclown joined #perl6
01:14 sorear TimToady: Do $*CORE and $*GLOBAL need to be contextualized?
01:18 sorear TimToady: How does $ALL<UNIT> interact with being able to recurse into other compilation units?
01:20 * sorear gives up for want of understanding the stash system
01:21 masonkramer_ joined #perl6
01:28 gfx joined #perl6
01:31 jaldhar joined #perl6
01:33 lue afk
01:33 gabiruh joined #perl6
01:36 madalu joined #perl6
01:51 plobsing joined #perl6
01:52 PenThrive joined #perl6
01:55 BrowserUk joined #perl6
01:58 yinyin joined #perl6
02:01 jaldhar joined #perl6
02:10 BrowserUk left #perl6
02:10 gbacon joined #perl6
02:13 patspam joined #perl6
02:22 [mark] joined #perl6
02:22 colomon rakudo: my { a => 1, b => 2 }.WHAT
02:23 p6eval rakudo a0b6d7: OUTPUT«===SORRY!===␤Malformed my at line 11, near "{ a => 1, "␤»
02:23 colomon rakudo: { a => 1, b => 2 }.WHAT
02:23 p6eval rakudo a0b6d7:  ( no output )
02:23 colomon rakudo: { a => 1, b => 2 }.WHAT.say
02:23 p6eval rakudo a0b6d7: OUTPUT«Hash()␤»
02:31 agentzh joined #perl6
02:44 f00li5h joined #perl6
02:44 f00li5h joined #perl6
02:51 sorear I want to kill LazyMap.
02:51 sorear It's too deeply tied to the Perl 5 concepts of list context and unpacking.
02:58 shade__ joined #perl6
03:11 rv2733 joined #perl6
03:11 xinming joined #perl6
03:24 snarkyboojum joined #perl6
03:26 dalek rakudo: e92a5f4 | (Solomon Foster)++ | src/core/metaops.pm:
03:26 dalek rakudo: Allow embedded hashes in array hypers.
03:26 dalek rakudo: Needs work (particularly better handling of errors) but works as a first
03:26 dalek rakudo: approximation.
03:26 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/e​92a5f4a8ff0b0fdc78574fc7b7a0ea9b91b6875
03:27 pugssvn r31094 | colomon++ | [t/spec] Tests for hypers on arrays containing hashes.
03:33 shade_ joined #perl6
03:54 snarkyboojum_ joined #perl6
03:58 ajs1 joined #perl6
03:58 ashleydev joined #perl6
03:59 ajs2 joined #perl6
04:02 molaf joined #perl6
04:15 satyavvd joined #perl6
04:20 snarkyboojum joined #perl6
04:38 __2synth joined #perl6
04:40 __2synth85 joined #perl6
04:41 snarkyboojum joined #perl6
04:46 pugssvn r31095 | lwall++ | [STD] don't attempt two-terms detection on infix_circumfix
04:46 JimmyZ joined #perl6
04:47 JimmyZ rakudo: use MONKEY_TYPING; my $d = ''; augment class Str { method some_meth_1 {$d = $d ~ self;}};for '0' .. '5' -> $a {  sub;};
04:47 p6eval rakudo e92a5f: OUTPUT«===SORRY!===␤Symbol '$ss_SS_S_S__S_S_s' not predeclared in <anonymous>␤»
04:47 JimmyZ what?
04:48 jrtayloriv joined #perl6
04:49 JimmyZ use MONKEY_TYPING; my $d = ''; augment class Str { method some_meth_1 {$d = $d ~ self;}}; for '0' .. '5' { .WHAT.say; .some_meth_1; };
04:49 JimmyZ rakudo: use MONKEY_TYPING; my $d = ''; augment class Str { method some_meth_1 {$d = $d ~ self;}}; for '0' .. '5' { .WHAT.say; .some_meth_1; };
04:49 p6eval rakudo e92a5f: OUTPUT«Str()␤Str()␤Method 'some_meth_1' not found for invocant of class 'String'␤  in main program body at line 11:/tmp/MCqD6zcoAJ␤»
04:51 JimmyZ rakudo: use MONKEY_TYPING; my $d = ''; augment class Str { method some_meth_1 {$d = $d ~ self;}}; for '0' .. '5' { .WHAT.say; sub; };
04:51 p6eval rakudo e92a5f: OUTPUT«===SORRY!===␤Symbol '$ss_SS_S_S__S_S_s' not predeclared in <anonymous>␤»
04:51 sorear well, first off, you always need ; after } in one-liners
04:52 sorear secondly, iirc that string is part of p6eval's security tripwire
04:52 sorear so you need to get a real rakudo
04:53 JimmyZ really?
04:53 JimmyZ rakudo: use MONKEY_TYPING; my $d = ”; augment class Str { method some_meth_1 {$d = $d ~ self;}}; for '0' .. '5' { .WHAT.say;};
04:53 p6eval rakudo e92a5f: OUTPUT«===SORRY!===␤Confused at line 11, near "my $d = \u201d;"␤»
04:53 sorear it's definitely part of p6eval
04:53 JimmyZ rakudo: use MONKEY_TYPING; my $d = ''; augment class Str { method some_meth_1 {$d = $d ~ self;}}; for '0' .. '5' { .WHAT.say;};
04:53 p6eval rakudo e92a5f: OUTPUT«Str()␤Str()␤Str()␤Str()␤Str()␤Str()␤»
04:53 JimmyZ No, I don't always need ; after } in one-liners
04:54 sorear rakudobug
04:54 JimmyZ these three are bugs.
04:57 pugssvn r31096 | lwall++ | [STD] parse >>R~<< correctly, or at least dwimmily
05:00 TimToady sorear: Cursor:2392 establish a cut scope for :::, backtrack out of current rule
05:01 sorear TimToady: How does $::XACT work?
05:02 sorear And why doesn't it just use cursor_xact?
05:02 TimToady cursor_xact doesn't have the right scope to localize it
05:03 TimToady p5 can't localize something in its caller
05:06 TimToady $::XACT can use the local mechanism because it's only used for setting the initial xact at an alternation point
05:06 finanalyst joined #perl6
05:06 TimToady the other cursors are just copies, so have the same .{_xact} pointer
05:07 TimToady once we're off into lazy cursor land, we only ever rely on the ->{_xact}
05:07 colomon TimToady: what was wrong with >>R~<<?
05:07 TimToady parsed as >>[R~<]<
05:08 TimToady because it only did the dwim if it was in HYPER, and R isn't HYPER
05:08 TimToady so it now does it in any kind of meta
05:08 colomon oh, ick.
05:08 TimToady yeah
05:08 TimToady it was giving the appearance of running forever on t/spec/S03-metaops/hyper.t
05:09 TimToady because of the prior bug, that looked for a term when it was expecting the << to see if it was two-terms
05:09 colomon btw, is the nested hash thing okay?  It's not clear to me if it's spec or not, but it seems to make sense and was easy enough to add.
05:09 TimToady and in that particular spot, looking for a term starting with < was invoking a maze of twisty nibblers, all alike
05:10 TimToady if it makes sense, fine
05:11 TimToady perhaps the .suppose method should have a time limit on it--it was running for at least 5 minutes on my machine
05:12 TimToady there are a *lot* of nested <'s and >'s after the >>R~<< in that file...
05:12 sorear TimToady: I'm afraid I still don't follow you.  Why is cursor_xact able to work in arbitrary subclasses of Cursor but not in categories?
05:12 TimToady and it was desperately trying to get the counts to match
05:12 colomon sorry...
05:13 colomon .oO(sounds like getting STD to work with the test case was harder than implementing the feature being tested...)
05:13 TimToady not in categories?
05:13 TimToady I don't understand your question
05:13 sorear TimToady: add_categorical doesn't use cursor_xact
05:13 sorear you said it was because of scope issues
05:14 TimToady add_categorical does use cursor_xact
05:15 TimToady line 2396
05:17 sorear I somehow hallucinated the # as one row higher
05:18 sorear but I still don't follow why it doesn't use my $C = $C->cursor_xact('...'); my $xact = $C->{_xact}; like viv-generated code
05:22 JimmyZ std: use MONKEY_TYPING; my $d = ''; augment class Str { method some_meth_1 {$d = $d ~ self;}}; for '0' .. '5' { .WHAT.say;};
05:22 p6eval std 31096: OUTPUT«ok 00:01 106m␤»
05:22 JimmyZ sorear: I don't think it's a bug
05:23 TiMBuS joined #perl6
05:23 JimmyZ std: use MONKEY_TYPING; my $d = ''; augment class Str { method some_meth_1 {$d = $d ~ self;}} for '0' .. '5' { .WHAT.say;};
05:23 p6eval std 31096: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unexpected block in infix position (two terms in a row, or previous statement missing semicolon?) at /tmp/0znKv4QYPb line 1:␤------> [32meth_1 {$d = $d ~ self;}} for '0' .. '5' [33m⏏[31m{ .WHAT.say;};[0m␤    expecting any of:␤  bracketed infix␤
05:23 p6eval ..inf…
05:24 TimToady sorear: I don't remember offhand why there's an extra RULE wrapper there, unless it's accounting for the outer proto somehow maybe
05:25 pugssvn r31097 | sorear++ | [Cursor et al] Rename Cursor to CursorBase; add a Cursor subclass
05:25 sorear that could make sense; I'll have to look at it in more detail later
05:25 TimToady in case we ever had a way to cut against the proto
05:25 TimToady (which we don't)
05:26 TimToady but then I don't know why the circumfix code below doesn't also do that...
05:26 TimToady that's about all my migrainey braney can deduce from the codey currentley
05:27 TimToady fortunately, my migraines are idiosyncratic and not generally painful
05:33 sorear TimToady: What did we use before LazyMap?
05:35 TimToady pugs
05:36 TimToady actually there was an intermediate form that just generated all the lists eagerly
05:36 TimToady .*? was even more expensive back then...
05:37 sorear I want to get rid of lazymap; it's too deeply tied to Perl 5 list context semantics
05:38 sorear and I don't think I can reasonably rewrite it in Perl6
05:38 diakopter (?:.*.?)*
05:38 sorear so what I'm planning to do is change viv output to work on raw iterator functions
05:38 sorear things that can backtrack produce iterators, things that can't produce values
05:39 sorear what does FIXINS mean?
05:40 TimToady I dunno, I didn't write that part of the Makefile
05:40 diakopter heh
05:40 diakopter I think only pmurias worked on it other than you..?
05:40 diakopter (besides sorear)
05:42 TimToady but how will a bare iterator do all the cursor transformations that a lazymap does?  those subs are there for a reason...
05:43 TimToady and I don't understand at all what you mean by "too deeply tied"
05:44 sorear I don't understand how to write a viv-Perl6 port of LazyMap
05:44 TimToady with the current setup, you can be guaranteed that the first element of the list is of type Cursor
05:44 sorear especially as it would interact with the javascript output
05:44 TimToady if you pass everything as scalars, they'd have to be polymorphic
05:44 sorear LazyRange?
05:44 TimToady and you'd have to test them everywhere for whether they were an iterator or a cursor
05:45 sorear it's always possible to know statically whether an expression is iterator-y or cursor-y
05:45 sorear whether a regex backtracks is a static property
05:46 sorear and it only occurs ~30 times in STD.pmc
05:50 shade_ joined #perl6
05:51 _jaldhar joined #perl6
05:52 TimToady I am not convinced it can be known statically.
05:53 TimToady when you call <foo> some of the subrules could be ratchety and some of them not
05:54 TimToady you'd be forced to always expect an iterator even for the ratchety ones
05:54 TimToady by always returning at least one cursor followed by an optional iterator, we relieve the caller of that
06:00 sorear cursor + iterator? would work too
06:00 sorear it's mostly the cursor [cursor | iterator]* that bothers me
06:01 sorear Transmitting file data ....svn: Commit failed (details follow):
06:01 sorear svn: Can't open file '/usr/local/src/pugs/src/perl6/boot/.s​vn/tmp/text-base/Cursor.pmc.svn-base': No such file or directory
06:06 uniejo joined #perl6
06:06 TimToady well, P6 also allows lazy lists to batch up known values
06:07 TimToady putting my poor head to bed &
06:08 sorear sleep wel
06:08 sorear perl 6 Cursor will land in a few minutes
06:08 eternaleye sorear++ # Sustained awesomeness
06:08 shade_ joined #perl6
06:22 pugssvn r31098 | sorear++ | [Cursor] Rewrite in Perl 6, bring under bootstrap control
06:39 Su-Shee joined #perl6
06:44 moritz_ good morning
06:46 eternaleye o/
06:47 JimmyZ good morning moritz_
06:53 shade_ joined #perl6
06:54 moritz_ rakudo: my @a = <a b c>; say @a[-1]
06:54 p6eval rakudo e92a5f: OUTPUT«Cannot use negative index on arrays␤  in 'Array::postcircumfix:<[ ]>' at line 2575:CORE.setting␤  in main program body at line 11:/tmp/iRY8V6NofP␤»
06:54 moritz_ rakudo: say 'abc'.comb[-1]
06:54 p6eval rakudo e92a5f: OUTPUT«c␤»
07:04 shade_ joined #perl6
07:18 pugssvn r31099 | moritz++ | [t/spec] simple tests for combining ** quantifier and :sigspace
07:19 synth joined #perl6
07:20 dalek rakudo: 8b116ff | moritz++ | build/PARROT_REVISION:
07:20 dalek rakudo: bump PARROT_REVISION to get latest nqp-rx fixes for ** quantifier and :sigspace
07:20 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/8​b116ffe60fe44d709042c1db725fcc3c258aa9a
07:26 c9s joined #perl6
07:43 dalek rakudo: a1695f0 | (Timothy Totten)++ | src/core/ (2 files):
07:43 dalek rakudo: Implemented Date.new(::DateTime) and DateTime.Date()
07:43 dalek rakudo: methods.
07:43 dalek rakudo: Signed-off-by: Moritz Lenz <moritz@faui2k3.org>
07:43 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/a​1695f01a6584a63423880565ac18abbcbe8a19d
07:44 moritz_ phenny: tell masak that his bug report for :sigpace + ** quantifier never made it to RT, but it's fixed in 8b116ff in
07:44 phenny moritz_: I'll pass that on when masak is around.
07:45 moritz_ s/in/anyway/ # where did I leave my mind?
07:51 ejs joined #perl6
07:57 ejs joined #perl6
08:01 tann_ joined #perl6
08:02 tann_ rakudo:  my $x = repeat { prompt "number? " } until $x == 5;
08:02 p6eval rakudo e92a5f: OUTPUT«Use of uninitialized value in numeric context␤Could not find sub &repeat␤  in main program body at line 11:/tmp/Oa4510PDLK␤»
08:03 agentzh joined #perl6
08:12 bjarneh joined #perl6
08:13 skangas joined #perl6
08:16 snarkyboojum joined #perl6
08:20 pugssvn r31100 | sorear++ | [STD,Cursor] Push error reporting functions down into the new Perl6 Cursor.  You can now define non-STD grammars with viv.
08:27 dakkar joined #perl6
08:34 k-bits joined #perl6
08:40 wallberg joined #perl6
08:44 masak joined #perl6
08:44 masak oh hai from a bus!
08:44 phenny masak: 07:44Z <moritz_> tell masak that his bug report for :sigpace + ** quantifier never made it to RT, but it's fixed in 8b116ff in
08:45 mberends oh hai to a bus, masak!
08:46 masak moritz_: actually reporting it must have slipped my mind. it's reported now though, and resolved. http://rt.perl.org/rt3/Tic​ket/Display.html?id=75558
08:47 masak mberends: I've made some decisions regarding proto.
08:47 mberends masak: I'm all ears
08:48 masak mberends: I think 'pls' is a fitting name for whatever proto is becoming. but I also think that a rename should be accompanied by some core improvements.
08:48 masak so it'll be more of a Great Refactor than just a rename.
08:48 mberends agreed
08:49 masak` joined #perl6
08:49 masak`` joined #perl6
08:50 temporaryusernam joined #perl6
08:50 mberends masak's bus must be driving on a bumpy road
08:50 masak`` I think the satellite was temporarily behind a cloud.
08:51 mberends or a jumbo jet
08:51 snarkyboojum joined #perl6
08:52 yinyin joined #perl6
08:52 masak`` there's a troll on Twitter who seems to take pleasure in saying nasty things about Perl. http://twitter.com/anktastic/status/15396749783 - I've tried talking to him, which gave me a deeper understanding of the expression "feeding the troll".
08:53 masak I'm not at the point where I'm blocking him yet, but I kinda feel sorry for him, and want to help somehow. guess one can't help everyone, though.
08:55 xabbu42 joined #perl6
08:57 pugssvn r31101 | sorear++ | [STD-ecosystem] Overhaul README
08:57 * sorear sleep
09:02 masak rakudo: use MONKEY_TYPING; my $x = "OH HAI "; augment class Str { method foo { say $x, self } }; for "1".."5" { .foo }
09:02 p6eval rakudo a1695f: OUTPUT«OH HAI 1␤Method 'foo' not found for invocant of class 'String'␤  in main program body at line 11:/tmp/GlDeqeEeZO␤»
09:02 * masak submits rakudobug
09:02 moritz_ masak: it's enough to re-open
09:03 JimmyZ masak: the bug is in RT
09:03 masak url?
09:04 JimmyZ http://rt.perl.org/rt3/Tic​ket/Display.html?id=75114
09:05 masak yep, it's already in there. good.
09:05 moritz_ is there anybody for whom t/spec/S14-roles/anonymous.rakudo has no unexpectedly passing TODOs?
09:08 xabbu42 joined #perl6
09:08 JimmyZ moritz_: yes, but occasionally
09:10 JimmyZ moritz_: http://paste.lisp.org/display/111137
09:12 moritz_ thanks
09:14 clintongormley joined #perl6
09:18 dalek nqp-rx: 42209fb | pmichaud++ | src/ (3 files):
09:18 dalek nqp-rx: ":my" in regexes is now properly declarative for LTM purposes.
09:18 dalek nqp-rx: Fix a bug with prefix computation on uncaptured subrules.
09:18 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/4​2209fba432a01f1918a14e35d5a2a52cb2878ed
09:20 colomon joined #perl6
09:24 temporaryusernam left #perl6
09:24 masak joined #perl6
09:26 colomon o/
09:26 shrub joined #perl6
09:27 masak \o
09:28 gfx joined #perl6
09:31 bjarneh joined #perl6
09:34 masak` joined #perl6
09:38 pmurias joined #perl6
09:39 pmurias hi
09:40 colomon \o
09:40 snarkyboojum joined #perl6
09:41 mberends masak: imho a proto -> pls refactor is a big task to undertake on the Rakudo * timescale, unless it can be broken down into smaller intermediate steps.
09:43 masak` mberends: indeed. I'm just throwing the idea out there. I want to finish the Web.pm grant before digging into proto.
09:43 mberends ok, you've got my neurons oscillating
09:43 masak` for me, 'testable core' is the important feature in such a refactor. after that, it's mostly about gradually adding tests.
09:44 mberends yes, testing still rocks :)
09:47 mathw yes
09:47 mathw testing is good
09:47 mathw especially if you've got code written to allow it
09:48 masak`` joined #perl6
09:49 masak`` the pls core would essentially be a brain-in-a-vat, getting sensory input through some channels and sending motor instructions through others.
09:49 masak`` I should be able to whip up a proof-of-concept in a day or so.
09:49 masak`` after Web.pm is wrapped up.
09:49 masak``` joined #perl6
09:50 mathw well that's what you want for testing
09:50 mathw logic core self-contained, no I/O done inside it
09:50 mathw then you can just wrap tests around it
09:50 masak```` joined #perl6
09:50 mathw which carress it lovingly until it explodes
09:50 mathw having problems, I see
09:50 masak```` yes. think of logging off for a while.
09:51 dalek rakudo: 738fad4 | (Solomon Foster)++ | src/core/metaops.pm:
09:51 dalek rakudo: Extend prefix and postfix array hypers to handle nested hashes.
09:51 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/7​38fad4ca24951c879cd0542a39fb370b9885547
09:51 mathw \o/
09:51 mathw nice commit
09:51 masak```` colomon++
09:53 pugssvn r31102 | colomon++ | [t/spec] Tests for prefix and postfix array hypers with nested hashes.
09:57 colomon slowly but surely extending hypers.
10:00 snarkyboojum I'd enjoy helping out with a proto refactor if extra hands are needed
10:01 snarkyboojum if not, I'll just cheer from the sidelines :P
10:06 xabbu42 joined #perl6
10:07 mberends snarkyboojum: we do need a helping hand there. It's a combination of P5 and P6 code that "grew" as the needs appeared.
10:07 mathw I suggest... some kind of design
10:09 mberends mathw: agreed. the previous process evolved without a Grand Plan, hence the need to refactor
10:10 mberends in the meantime, the Perl 6 module ecosystem has been given a better shape in ~/.perl6
10:11 snarkyboojum mberends: yeah, I'm kinda familiar with it - I've used it and read through the source code a couple of times
10:12 mberends :)
10:12 Chillance joined #perl6
10:13 mathw mberends: recent experience at $day-job has shown me the value of a good plan, especially on a multi-person project
10:15 mberends mathw: it's so obvious that we sometimes forget it. And everything we do in #perl6 should be multi-person :)
10:16 mathw :)
10:16 mathw or at least potentially multi-person
10:17 mberends one design area that bothers me, is that proto cannot determine whether to install modules into ~/.perl6/lib or <parrot_install>/lib/2.4.0​-devel/languages/perl6/lib
10:18 mberends the former is personal, the latter is system
10:20 arnsholt Default to personal, add switch to install to system?
10:20 arnsholt And perhaps other way 'round if you're root
10:20 colomon +1
10:22 __2synth joined #perl6
10:24 snarkyboojum and/or do what cpanm is doing - install to a system perl6 unless you're using local::lib (or equiv eventually) :)
10:24 snarkyboojum maybe
10:26 pugssvn r31103 | colomon++ | [t/spec] Add fudged test for >>. on hash.
10:31 pmurias joined #perl6
10:42 proller joined #perl6
10:44 wolverian joined #perl6
10:50 colomon jnthn: ping?
11:03 jnthn colomon: morning!
11:04 colomon o/
11:04 colomon I was just looking at the code for >>.method
11:05 colomon Seems like it would be a win if we could refactor it to use the standard >>op code.
11:06 cognominal o/
11:06 jnthn Feel free if you can get it to work.
11:06 jnthn I guess we'd need to somehow promote the method call to a closure or soemthing.
11:06 jnthn *something
11:06 colomon jnthn: well, the thing is, I don't have a clue how to approach that in nqp.
11:06 colomon right.
11:08 colomon I guess if we could get the name of the method, we could do right
11:08 jnthn colomon: What's the main win we'd get from it?
11:09 proller joined #perl6
11:09 colomon sub apply-method($method-name, $object) { $object."$method-name" } and then use assuming...
11:09 colomon main win is it would automatically handle all the cases that aren't just a straight array.
11:09 colomon nested arrays, hashes, etc.
11:10 colomon right now >>. is drastically stupider than >>op
11:13 jnthn OK
11:13 ejs joined #perl6
11:16 * colomon just realized that the hyper subs should be a direct part of the spec -- lots of potential reuse value for non-operators...
11:19 jnthn colomon: Hmm. I don't think it'll be too hard, but perhaps not too easy either. :-)
11:20 colomon :)
11:20 jnthn Can probably have a proper go at the weekend or so.
11:20 cognominal jnthn, help :   http://paste.lisp.org/display/111140
11:21 cognominal why ~$<name>  returns "1"?
11:23 jnthn cognominal: because it's quantified
11:23 jnthn Go for ~$<name>[0]
11:24 cognominal I hate the current behavior  '?' quantifier
11:24 cognominal here again I got hurt.
11:25 jnthn It's consistent with all the quantifiers, at least.
11:27 cognominal I agree, but consistency for sake of consistency has never been condoned here :)
11:29 colomon jnthn: \o/
11:50 plainhao joined #perl6
11:53 envi^home joined #perl6
11:57 meppl joined #perl6
12:09 proller joined #perl6
12:13 shrub1 joined #perl6
12:16 bluescreen joined #perl6
12:19 takadonet morning all
12:20 colomon o/
12:45 Guest86191 joined #perl6
12:47 kaare joined #perl6
12:58 finanalyst left #perl6
13:00 mathw It's so quiet today
13:00 colomon joined #perl6
13:00 mathw In the office, online...
13:00 mathw even in here!
13:06 jnthn OH HAI MATHW
13:06 jnthn It's Friday afternoon. Nobody trusts themselves to do anything right. ;-)
13:06 mathw lolitsjnthn
13:06 mathw half my office are on holiday
13:06 * mathw scowls
13:06 jnthn Wait, it is Friday right...
13:06 mathw yes it's Friday
13:07 jnthn ah
13:07 M_o_C joined #perl6
13:07 jnthn Thursday mighta been preferable. Still quite a bit to prepare for $dayjob-project-showing-off.
13:08 jnthn otoh, at least it's going well. :-)
13:09 jnthn mathw: Wasn't it bank holiday in the UK on Monday?
13:10 mathw yes
13:10 mathw it's also half term
13:10 snarkyboojum joined #perl6
13:11 jnthn Ah
13:11 ejs joined #perl6
13:11 jnthn Can imgine they combine to give a lot of people having time off.
13:11 mathw yes
13:12 mathw there are definitely some parents who've had the four days off
13:12 mathw and lots of people off today, tacking an extra day on the weekend
13:13 jnthn Well, if the weather is as nice there as it is here, I can't blame 'em. :-)
13:13 mathw it's lovely today
13:13 mathw really sunny and clear
13:13 mathw and I'm stuck in an office with overactive air conditioning :(
13:13 mathw it's actually cold in here
13:13 mathw ridiculous
13:15 jnthn Quite the energy waste.
13:16 mathw yes
13:16 mathw and on a day when it's so hot outside, I shouldn't need to be considering bringing a jumper to keep me warm in the office!
13:16 mathw although when the air con fails, this building gets very uncomfortable very quickly so I am kind of glad it's on...
13:16 mathw it's not designed sensibly
13:18 jnthn Let me guess, in winter the heating is so good you can work in a t-shirt? :-)
13:20 mathw mostly
13:20 mathw but it's got a lot of help from all the computers :)
13:20 mathw if they were really clever they could pipe heat from the server room into the offices in the winter
13:20 mathw but they're not that cunning
13:21 masonkramer_ joined #perl6
13:24 bjarneh joined #perl6
13:27 ejs joined #perl6
13:29 skids joined #perl6
13:46 pmurias joined #perl6
14:01 JimmyZ joined #perl6
14:03 JimmyZ p6c
14:04 spinclad joined #perl6
14:10 pmurias JimmyZ: ?
14:10 JimmyZ hello?
14:11 pmurias hi
14:12 JimmyZ hello
14:12 arthur-_ joined #perl6
14:12 ash__ joined #perl6
14:21 jnthn Wow...so nice outside. :-)
14:21 * jnthn wishes laptops weren't so uncomfy for him, otherwise he could go and hack in a the park for a bit
14:25 * ash__ and screen's were decent in sunlight
14:25 macdaddy joined #perl6
14:25 * jnthn points out the low-tech solution of a shady tree :-)
14:27 ash__ true, those work most of the time
14:27 ash__ the new macbook pro's from apple get 9 hours of battery life, my friend just got one, they are really nifty...
14:28 jnthn Nice
14:28 jnthn I thought my ThinkPad comfortably managing around six hours was good going. :-)
14:29 mathw it is
14:30 mathw ThinkPads have trackpoints
14:30 mathw therefore they are far superior to any shiny thing from apple
14:31 ash__ lol, this reminds me of a patent apple got recently, its for using external light (eg. sunlight) to light a screen instead of led's http://gizmodo.com/5502431/apple-p​atent-application-describes-displa​ys-backlit-from-captured-sunlight
14:32 jnthn mathw: Yes, but they're not shinier. Isn't that what matters most? ;-)
14:32 mathw jnthn: no
14:33 mathw I much prefer my ThinkPad to my Powerbook G4
14:33 mathw even though ti was very nice and far superior to the Dell I had afterwards
14:33 mathw but I always wanted a ThinkPad
14:33 mathw and now I've got one
14:33 jnthn #
14:33 jnthn oops
14:34 jnthn Yeah, I had one for several years, until the point it was just too slow.
14:34 jnthn I work on this thing that's quite resource intensive now and then...
14:34 jnthn :-)
14:36 dalek book: e5b650b | moritz++ | src/operators.pod:
14:36 dalek book: [ops] typo, whiteknight++
14:36 dalek book: review: http://github.com/perl6/book/commit/e5​b650b72aea9352d749de159b17e8325befe657
14:37 ash__ i am making progress on my GSoC NCI work, i hope it gets done before Rakudo* comes out, then you can dynamically make any signature for FFI calls you want
14:37 mathw \o/
14:38 ash__ i think that would lower the bar for use a lot, since you don't have to make C extensions to use most libraries
14:38 ash__ s/bar/bar of entry/
14:38 ash__ err
14:38 ash__ i fail english
14:39 * moritz_ might buy an Acer UL30a for $work
14:40 moritz_ it has a nominal battery life of 12H
14:40 jnthn ash__: Nice!
14:40 jnthn ash__++
14:41 moritz_ dual core, 4G ram... 13.3" display
14:41 jnthn ash__: Is it suing some existing FFI library? Or home-grown?
14:41 ash__ libffi
14:41 jnthn ok
14:41 jnthn Know how well it builds/works on Win32?
14:41 ash__ which is supported on a large number of systems
14:41 ash__ yes, it works on windows
14:42 jnthn \o/
14:42 jnthn ash__: Anything in Parrot trunk yet?
14:43 ash__ there are some platform specific things, like for instance if I wanted to load libc on OS X, or linux i'll ask for a library called libc, but on windows its msvcrt
14:43 ash__ not yet, but when i do, it should be merged eventually
14:43 proller joined #perl6
14:44 jnthn OK, it'd be cool to have that before R*.
14:46 ash__ http://github.com/atgreen/libffi it lists Windows as supported platforms (x86 and x86-64) but if you use the windows compiler you have to configure it with an additional parameter
14:46 estrabd joined #perl6
14:47 gbacon joined #perl6
14:56 ashleydev joined #perl6
14:56 jnthn ash__: Eww.
14:56 jnthn ash__: To build it with MS VC++ you still need MinGW!
14:56 ash__ really?
14:56 ejs joined #perl6
14:56 jnthn Yeah, but tbh for Windows users I suggest just make a binary and link to it somewhere, or better link to an existing one.
14:57 jnthn (if there is such a thing)
14:57 mberends would that akshually make zavolaj redundant?
14:57 jnthn mberends: No, it makes Zavolaj useful :-)
14:57 jnthn Well, usefuller.
14:57 mberends :-) :-)
14:58 mberends yeah, flexibler
14:58 jnthn mberends: We already rely on Parrot's NCI today. This means we can support any signature rather than just those Parrot gives us.
14:58 mberends ash__++
15:03 ash__ i'll see if i can find a libffi pre-built for windows, i know before 3.0.10 (which hasn't actually been released yet) there were a set of patches that were needed for it to build on windows, but they have them merged into the core now. I know python uses libffi for its ctypes (the same thing as nci) and they bundle libffi in the core source code with the patches applied
15:03 jnthn ash__: Heh, I could always download Python binary build...just for the libffi. ;-)
15:04 ash__ i don't know if its a separate part or if they just put it all into python's main dll
15:04 jnthn .oO( Python guys: Even the Perl 6 team find a use for Python! )
15:27 pnu joined #perl6
15:31 pmichaud good morning, #perl6
15:31 PerlJam good morning pm.  How's life?
15:32 pmichaud About the same 1/2 :-)
15:32 Guest43663 joined #perl6
15:33 patspam joined #perl6
15:33 jnthn morning, pmichaud
15:35 PerlJam pmichaud: your name came up at the TCOON meeting yesterday
15:36 PerlJam pmichaud: Doug asked if we could hire you to document all of the software for datums processing and write a little manual for it.
15:38 jaldhar joined #perl6
15:39 pmichaud PerlJam: easier (and cheaper) would be if we just got you or other members of TCOON to ask me questions and I write responses and you guys make a manual out of that :)
15:39 pmichaud (and faster, likely)
15:41 PerlJam Since jrizzo is supposedly going to learn how it all works so that he can do the processing, he might be the right person to ask questions.
15:41 PerlJam But somehow I think he's as adverse to writing manuals as the rest of us.
15:42 pmichaud Right.  But I suspect that in my current situation I'm more adverse.  :)
15:42 PerlJam indeed
15:42 proller joined #perl6
15:43 pmichaud also, I figure I kinda owe CBI some work, so I'm not sure I'd want to be paid for it.
15:44 PerlJam If you want to work for free, I'd rather you work on something more fun (for all of us) than a manual  :)
15:44 pmichaud well, for the next eight weeks I'm unlikely to work on anything other than Rakudo.  :-)
15:45 jnthn :-)
15:45 PerlJam oh, and Dale Crocket asked about you too.
15:46 k23z__ joined #perl6
15:46 k23z__ just saw on reddit a question about a GUI toolkit
15:47 k23z__ I'm writing my own toolkit in C++ from scratch on top of SDL
15:47 k23z__ SDL offers just basic graphics primitives
15:47 k23z__ and is also portable, as a result the toolkit will be portable
15:47 k23z__ anyone interested in writing bindings ? :) hehe
15:47 pmichaud PerlJam: I noticed that TCOON stations how have their own facebook pages?!?
15:48 PerlJam pmichaud: and the data are broadcast via twitter too
15:48 PerlJam several of the sponsors (and potential sponsors) were very excited about that.
15:48 pmichaud sometimes I worry about you guys.
15:48 pmichaud :-)
15:49 jnthn omgzweb2.0!
15:49 jnthn :-)
15:49 [particle] what, they don't use twitter?
15:49 * jnthn says, while hacking on shiny AJAX thingy
15:49 PerlJam pmichaud: if the tcoon stations get their own myspace pages ... *then* you should start to worry ;)
15:50 pmichaud or if they start showing up on match.com
15:51 ruoso joined #perl6
15:57 Su-Shee jnthn: we're at web 3.5 already. please update. :) ("HTML 5, CSS 3")
15:57 jnthn Oh noes...my skills are out of date!
15:59 Su-Shee jnthn: but it's VERY shiny!
16:00 Su-Shee ok, actually it's really cool and will make serious web development extremely nicer and powerful.
16:00 uvtc joined #perl6
16:02 arnsholt Is there an established Perl 6 idiom for a for loop where you need a counter variable?
16:02 colomon arnsholt: counter by itself, or counter along with a value?
16:03 uvtc Hi. I've got Parrot + Rakudo installed into /usr/local/parrot and would like to try installing a few modules for it. I've created a /usr/local/perl6lib directory to house those modules. Is there any sort of standard yet for how to go about installing the modules listed at http://proto.perl6.org/ ?
16:03 arnsholt Along with a value
16:03 pmichaud arnsholt:    for @list.kv -> $index, $value { ... }
16:03 arnsholt Oooh, nice. Thanks muchly
16:04 estrabd joined #perl6
16:05 uvtc I mean, if you want to install by-hand, rather than using Proto.
16:05 uvtc Analogous to Perl 5's: perl Build.PL   ./Build   ./Build test   ./Build install
16:07 dual joined #perl6
16:11 ashleydev_ joined #perl6
16:15 xabbu42 joined #perl6
16:16 arnsholt Does the @ sigil imply List or Array?
16:17 pmichaud currently "Positional"
16:17 mberends k23z__: yes, I'm interested in writing bindings (using zavolaj) for native libraries
16:18 uvtc FWICT, there's no standard ATM. Will just copy files manually into place if not using Proto.
16:18 arnsholt Ah. In S32/Containers I see stuff like method foo(@values:) for both List and Array. That would then be a bit wrong for both, right?
16:19 pmichaud arnsholt: possibly, but possibly not.
16:19 arnsholt Hmm?
16:20 mberends uvtc: before choosing your own custom directories, consider using the standard ones listed in: perl6 -e'.say for @*INC'
16:21 k23z__ mberends, what's zavolaj ?
16:22 uvtc mberends: Thanks. I see. Per-user ones can go in ~/.perl6/lib and system ones can go into .../parrot/lib/2.4.0-devel/languages/perl6/lib .
16:22 mberends k23z__: the Rakudo link to Parrot NCI: http://github.com/jnthn/zavolaj
16:22 mberends uvtc: correct!
16:23 rokoteko joined #perl6
16:23 uvtc mberends: That said, I think a 3rd option would be useful: system modules that you don't want to install under the parrot directory. That is, if I wipe out and reinstall Parrot + Rakudo, I'd like to still have my system Perl 6 modules around somewhere.
16:24 justatheory joined #perl6
16:24 * sorear return
16:24 mberends uvtc: good point. I think the planned proto -> pls refactor should take your scenario into account
16:24 proller joined #perl6
16:25 uvtc mberends: "proto -> pls"?
16:25 mberends we're expecting to refactor proto "soon", and pls my be its new name
16:25 mberends *may be
16:26 eternaleye arnsholt: Positional is a role. Array does it, Seq does it, etc.
16:27 arnsholt True. But Something that does Positional is not necessarily an Array or a Seq, no?
16:27 moritz_ no
16:27 arnsholt But I suppose that might not be a problem
16:27 shrub1 left #perl6
16:27 uvtc mberends: Thanks. Do you happen to know if "pls" is an acronym for something?
16:28 uvtc mberends: just curious.
16:28 moritz_ ./pls install foo
16:28 uvtc Hahaha. :)
16:28 arnsholt I'm just glad it's not plz =)
16:28 arnsholt Although if it were called plzen we could abbreviate it to plz ^^
16:29 jnthn "Perl Library System"
16:29 mberends ./pls gimme foo
16:29 jnthn arnsholt: If it were called plzen I'd drink it!
16:29 arnsholt Me too =D
16:30 Su-Shee jnthn: wrong. "polite library system" :)
16:30 jnthn Su-Shee: Nice :-)
16:30 Su-Shee I'm totally for pls. :)
16:31 Su-Shee it makes so much more sense.. pls delete foo, pls install bar, pls update xyz .. great :)
16:31 pmichaud 16:27 <arnsholt> True. But Something that does Positional is not necessarily an Array or a Seq, no?
16:31 pmichaud correct, which is partially why I said @ _currently_ means Positional.  It may change.
16:34 jnthn mberends: pls call it that ;-)
16:34 pmichaud ./pls install cheezburger kthxbye
16:35 pmichaud pls +1
16:35 jnthn Nice, now I know what to call my next 2 Perl 6 modules.
16:35 mberends :-)
16:36 Su-Shee jnthn: HugMe and KissMe? ;)
16:37 jnthn EALREADYHUGME
16:37 pmichaud why would that be an E, exactly?  ;-)
16:37 Su-Shee pls is definetely cool. :)
16:38 bjarneh joined #perl6
16:38 jnthn pmichaud: Well here the prefix stands for "Excellent!"
16:38 jnthn :-)
16:39 [particle] i can't believe pls hasn't already been taken by some linux pkg, but i can't find it with apt-get
16:40 [particle] pls make me a sandwich
16:40 pmichaud IT'S OURS NOW!!!!! YOU CAN'T HAVE IT!
16:40 uvtc sudo pls make me a sandwich
16:41 Su-Shee pls test foobar. nice.
16:41 uvtc For running tests that come with Perl 6 modules, is it simply `cd project-dir; perl6 t/*`?
16:43 ash__ uvtc: make test
16:43 rokoteko hm. the 'Perl 5 to perl 6' tutorial (at http://perlgeek.de/en/article/5-to-6) says 'Since everything is an object, you can call methods on arrays' in the chapter talking about arrays it states 'http://perlgeek.de/en/article/5-to-6' ... is sub foo { 3, 1, 2 4 }; foo.sort(); expected to DWIM then?
16:43 phenny rokoteko: 22 May 18:53Z <TimToady> tell rokoteko you want something like: my $x = { map { $^x * 2}, @_ };  say $x(1..5);
16:43 phenny rokoteko: 22 May 18:56Z <TimToady> tell rokoteko Yes, ... is a dwimmy "series" operator, while .. is just interval ranges; === is exact type and value equivalence, while == is forced numeric as in p5
16:44 pmichaud rokoteko: if you're expecting it to sort the return values, then yes -- I think it dwym
16:44 ash__ rakudo: sub foo { 4, 2, 3, 1}; say foo.sort;
16:44 p6eval rakudo 738fad: OUTPUT«1234␤»
16:44 jnthn rokoteko: Note that you're calling the sub and sorting the returns, not calling .sort on the sub
16:44 rokoteko ah. brilliant. I should learn to use the bots here or compile perl6.
16:45 jnthn rokoteko: To call an actual method on a sub you stick an & before it, fyi.
16:45 ash__ you can /msg p6eval rakudo: + code and it will give the result
16:45 uvtc ash__: From looking at some of the modules listed at http://proto.perl6.org/ (I assume this is currently the main Perl 6 module listing), some don't come with a makefile (though some come with a Makefile.in and a Configure script ...)
16:45 ash__ or do it here if you want others to see it
16:45 jnthn rakudo: sub foo($a, $b?) { }; say &foo.signature.perl
16:45 p6eval rakudo 738fad: OUTPUT«:(Any $a, Any $b?)␤»
16:46 * TimToady is going into the shower to think about whether Positional should delegate unrecognized methods to its 0th element if .elems == 1
16:46 TimToady would take the agony out of ? quantifiers, methinks
16:46 rokoteko TimToady: man that's amazing what just happened.
16:46 Su-Shee jnthn: could you please repeat "call a method on a sub"? ;) how do I call a method on a method then? ;)
16:47 rokoteko TimToady: I guess Im repeating myself instead of reading the docs. ;)
16:47 TimToady you can say that again
16:47 Su-Shee rokoteko: read the specs directly and code "like it feels right". you usally hit the right stuff.
16:47 cdarroch joined #perl6
16:47 cdarroch joined #perl6
16:48 jnthn Su-Shee: Get hold of the method somehow and call on it. :-)
16:48 ash__ uvtc: sorry, i thought you meant the core perl6 tests
16:48 rokoteko hm. the 'Perl 5 to perl 6' tutorial (at http://perlgeek.de/en/article/5-to-6) says 'Since everything is an object, you can call methods on arrays' in the chapter talking about arrays it states 'Since everything is an object, you can call methods on arrays' is sub foo { 3, 1, 2 4 }; foo.sort(); expected to DWIM then?
16:48 rokoteko # just trying it out.
16:48 jnthn Su-Shee: .^methods for example
16:49 jnthn rakudo: class A { method m($x) { } }; say A.^methods[0].signature.perl
16:49 p6eval rakudo 738fad: OUTPUT«:(Mu : Any $x;; *%_)␤»
16:49 rokoteko Im clueless. but Im sure there are a lot of powers beside my understanding. Just never thought it would happen on irc. ;)
16:50 ash__ rakudo: say (1, 2).^methods
16:50 Su-Shee jnthn: why do I even ask.. ;)
16:50 p6eval rakudo 738fad: OUTPUT«postcircumfix:<[
16:50 p6eval ..]>listACCEPTShashfmtsortSeqiteratorBoolitem​definedrotateperlCaptureofelemsIntlistNumeage​relemsSeqStrceilingunpolarsamecasefloorsubstr​asechordroundflipsplitmatchacosecacoshwordsco​sechcotanatan2ucfirstcombtanatancosacosfmteva​lchoptanhsubstNumericchompindexchracotanht…
16:51 jnthn rakudo: say (1, 2).WHAT # Parcel, I guess
16:51 p6eval rakudo 738fad: OUTPUT«Parcel()␤»
16:51 rokoteko jnthn: so are you saying that foo.sort.map{} is ok, but it's not lazy?
16:51 jnthn rokoteko: Well, I think a sort kinda can't be lazy in some senses. But it's possible (but not for sure) that the sort could be delayed until the .map first needs a value.
16:52 ash__ @a = foo ==> *.sort ==> map: { } ;   # is that right? for feeds
16:53 jnthn ash__: hmm...maybe you'd want instead
16:53 jnthn foo ==> *.sort ==> map: { } ==> @a
16:54 rokoteko jnthn: in other words; my $count = 0; foo.map{$count++ < 10}.sort.map{}; sub foo { 1..Inf } .. is it dwimmy?
16:54 ash__ oh, i have it backwards, <== is feed
16:54 jnthn ash__: Well, both are, you can do either direction :-)
16:54 ash__ oh, got ya
16:54 rokoteko oh wait. it misses a last.
16:54 ash__ rakudo: my $count = 0; foo.map{$count++ < 10}.sort.map{}; sub foo { 1..Inf };
16:54 p6eval rakudo 738fad: OUTPUT«No candidates found to invoke␤  in main program body at line 11:/tmp/37z1JkorBt␤»
16:54 rokoteko jnthn: in other words; my $count = 0; foo.map{$count++ < 10 and last}.sort.map{}; sub foo { 1..Inf } .. is it dwimmy?
16:55 jnthn map wants the thing you pass to it to be in a closure there, fwiw
16:55 rokoteko ok, this is bit kludgish, but hope you get my point of passing the Inf list through a map and a sort before checking when to end.
16:55 jnthn oh, and "or last"
16:55 jnthn But I think it would do what you want yes
16:55 jnthn At the moment though map doesn't handle "last" etc
16:55 rokoteko ah brilliant.
16:55 jnthn But it should.
16:55 ash__ rakudo: my $count = 0; (1..Inf).map: { $count++ if $^a < 10 or last }
16:56 p6eval rakudo 738fad: OUTPUT«===SORRY!===␤Confused at line 11, near "(1..\x{1c}Inf)."␤»
16:56 sorear also, map { $count++ < 10 or last } is spelled batch(10)
16:56 bjarneh left #perl6
16:56 sorear what does .map{}; mean?
16:56 jnthn sorear: It means a : is missing :-)
16:57 rokoteko rakudo: batch(10).map{$_++}.sort.map{$_ % 4}.(1..Inf)
16:57 p6eval rakudo 738fad: OUTPUT«Could not find sub &batch␤  in main program body at line 11:/tmp/iFuS0oquq5␤»
16:57 rokoteko sorear: where is batch() defined?
16:57 sorear Not sure
16:57 sorear it is defined, and it works beautifully
16:58 sorear ah
16:58 sorear S07:196
16:58 * jnthn takes a little break
16:59 ash__ rakudo: my $count = 0; eager(1..Inf).map: { print $^a; $count++ if $^a < 10 or last }; print $count; # how do you make it not lazy again?
16:59 p6eval rakudo 738fad:  ( no output )
16:59 ash__ that was a bit more lazy than i meant it to be
16:59 rokoteko sorear: can you show an example of it working with the eval bot? Im bit confused. Hope you pardon my questions. :/
17:00 colomon ash__: pretty sure saying eager(1..Inf) is a Bad Idea.
17:00 PerlJam indeed
17:00 ash__ good point..
17:00 ash__ rakudo: my $count = 0; eager(1..100).map: { print $^a; $count++ if $^a < 10 or last }; print $count;
17:00 p6eval rakudo 738fad: OUTPUT«0»
17:04 rokoteko TimToady: btw. thanks for explanation of the difference with "==" and "===" ..
17:07 PacoLinux joined #perl6
17:08 cognominal is there a class that all hash, array and scalar nature at once without all the bagage of a Signature?
17:09 supernovus joined #perl6
17:10 PerlJam "nature at once"?
17:11 ashleydev joined #perl6
17:11 PacoLinux_ joined #perl6
17:11 cognominal A signature can act as a scalar, or an array, or an hash.  That's what I want.
17:12 colomon rakudo: my $count = 0; (1..100).map: { print $^a; $count++ if $^a < 10 or last }.eager; print $count;
17:12 p6eval rakudo 738fad: OUTPUT«Method 'eager' not found for invocant of class 'Block'␤  in main program body at line 11:/tmp/Q0GrWJO32J␤»
17:12 colomon rakudo: my $count = 0; ((1..100).map: { print $^a; $count++ if $^a < 10 or last }).eager; print $count;
17:12 p6eval rakudo 738fad: OUTPUT«12345678910␤  in <anon> at line 1␤  in main program body at line 5466:CORE.setting␤»
17:14 colomon last doesn't work properly in map yet, I think.
17:15 cognominal hum, may be I just can't use a Signature. Probably, I will not be hurt by its extra behaviors.
17:16 azert0x joined #perl6
17:16 cognominal or I could derive from the Capture PMC without adding anything
17:18 supernovus Creating patches for rakudo is easy enough, but how would I go about sending a patch for a spectest? svn is not as nice in this case. Would an svn diff work?
17:19 proller joined #perl6
17:19 [Coke] sure. or you could just get a commit bit.
17:21 supernovus Hi [Coke], how would I go about getting a commit bit?
17:22 [Coke] most folks here can hand one out for pugs.
17:22 justatheory joined #perl6
17:22 [Coke] they'd just need your email addy
17:24 rokoteko Su-Shee: oh man, you were lying. it's not dwimmy at all. :/
17:24 [particle] i can hand out a commit bit...
17:25 Su-Shee rokoteko: it is! just do what _I_ mean! ;)
17:25 [Coke] er, email addy and a desired userid.
17:25 Su-Shee rokoteko: and don't start with high end golf.
17:26 [Coke] (and this is why I dislike "dwim" =-)
17:26 rokoteko Im trying to avoid assigning to operators in between calls to functions. is that wrong?
17:26 rokoteko s/operators/variables/
17:26 proller_ joined #perl6
17:26 [particle] supernovus: what's your email address and preferred username?
17:26 supernovus Well, my e-mail addy is easy enough, avoiding spam-bots from harvesting the IRC logs, it's the current year AT huri dot net and 'novus' for userid or 'supernovus' if the prior is unavailable.
17:26 [particle] sweet
17:26 TimToady I think I convinced myself in the shower that treating <atom>? the same as <atom>**0..1 is a mistake, and ? should go back to being special cased to return a scalar or undefined
17:26 Su-Shee rokoteko: remember this quote about premature optimaziation? ;)
17:27 [particle] send an invite to 2010@... /novus
17:27 Su-Shee optimization.
17:27 TimToady and I think we can change it back without too much pain, since .[0] is a no-op on a scalar
17:27 [particle] might take a few minutes to get it.  speak up if something goes wrong
17:28 rokoteko Su-Shee: If I wouldnt be prematurely optimizing I would be trying to do this in perl5.
17:28 TimToady pmichaud: ^^^
17:28 pmichaud TimToady: !!!!
17:28 pmichaud .[0] is a no-op on a scalar?
17:28 pmichaud really?
17:28 TimToady and I think with the current setup we induce an unnecessary FAQ
17:28 TimToady pugs: say 42.[0].[0].[0]
17:28 p6eval pugs: OUTPUT«42␤»
17:28 pmichaud okay, I can make that work.
17:29 TimToady rakudo: say 42.[0].[0].[0]
17:29 p6eval rakudo 738fad: OUTPUT«get_pmc_keyed() not implemented in class 'Integer'␤  in main program body at line 1␤»
17:29 pmichaud Changing the meaning of ? now is going to cause a lot of nqp pain.  :-(
17:29 Su-Shee rokoteko: well then you have to up you understanding of dwim :)
17:29 TimToady at worst, it creates a list via Any and indexes that
17:29 supernovus thanks [particle] the mail has arrived :-)
17:30 pmichaud TimToady:    <atom>?   <other>  <atom>?   would still result in an array, yes?
17:31 TimToady yes, presumably
17:31 TimToady multiple mentions always have that effect
17:31 pmichaud okay, here's the issue I see.
17:31 supernovus hmm, the link to set my password appears to be broken though.
17:31 pmichaud in the case of match objects, .[0] is never a no-op
17:32 TimToady $<atom>[0] always gets the first <atom>, which may or may not be defined
17:33 pmichaud I would think that $<atom>  would give me the 0-capture from within the atom subrule.
17:33 pmichaud sorry,  $<atom>[0]
17:33 pmichaud token atom {  (xyz) };    token expr { <atom>? }
17:33 TimToady that's already not true for <atom>*
17:34 pmichaud $<atom>[0] means something entirely different if  $<atom> is a match object instead of an array.
17:35 pmichaud I feel like I must be missing something obvious.
17:35 supernovus never mind, google chrome and port 6666 don't seem to like each other... firefox works fine
17:36 pmichaud I just don't see how "we can change it back ..."  can be true.
17:38 rokoteko my $x = { @_.map({ ++$_}).map({ ++$_ }).map({ ++$_ }).batch(5)}; print $x(1..5)  # can I pass another array as an input to $x ?
17:39 rokoteko ie. $x((1..3), (1..4)) ?
17:39 colomon rokoteko: yes, but that's not really the way to do it.
17:39 pugssvn r31104 | novus++ | Tests for DateTime.Date() and Date.new(::DateTime) added.
17:40 colomon or wait, maybe it will work?
17:40 colomon it's not very idiomatic p6, at any rate, IMO.
17:40 pmichaud anyway, I'm ultimately fine if we change $<atom>?  to be undef/match instead of always an array, but I don't think it's an easily reversible decision.
17:41 [particle] novus++
17:41 rokoteko rakudo: my $x = { @_.map({ ++$_}).map({ ++$_ }).map({ ++$_ }).batch(5)}; print $x(1..10)
17:41 p6eval rakudo 738fad: OUTPUT«45678»
17:41 rokoteko colomon: how am I supposed to do it then?
17:41 pmichaud (as evidenced by the fact that is itself a reversal that isn't easily made for existing code)
17:41 pmichaud *that this
17:43 hercynium joined #perl6
17:44 rokoteko rakudo: my $x = { @_.map({ ++$_}).map({ ++$_ }).map({ ++$_ }).batch(5)}; print $x($_) for ((1..10), (11..20))
17:44 p6eval rakudo 738fad: OUTPUT«4567891011121314151617181920212223»
17:44 rokoteko ahh it works. how is this not perl6'ish?
17:44 supernovus Well, in both cases trivial stuff, but yesterday was my first patch to rakudo, and today my first commit to the test suite. :-)
17:44 rokoteko $x = {} .. then you can only do $x($scalar)  not a $x(@list) ?
17:45 stephenlb joined #perl6
17:46 TimToady pmichaud: okay, I will think about how best to get there from here.
17:46 TimToady commuting &
17:46 pmichaud TimToady: I'm only asking that if we do change it, we don't later decide to change it back yet again.  :)
17:46 pmichaud as it is, this is a change that will affect a lot of existing p6-code.
17:47 rokoteko and my point being, which I think TimToady has been trying to explain me many times, the above with $x(1..*) is not supposed to work, correct?
17:48 pmichaud rokoteko: why would $x(1..*) not work?
17:49 colomon pmichaud: well, it wouldn't work under the last list revamp proposal I saw...
17:49 pmichaud (and note that 1..* can be a scalar... anything can be a scalar)
17:50 colomon rakudo: my $x = { @_.map({ ++$_}).map({ ++$_ }).map({ ++$_ }).batch(5)}; print $x(1..*)
17:50 p6eval rakudo 738fad:  ( no output )
17:50 pmichaud rakudo may fail there simply becuase lists are not yet sufficiently lazy.
17:50 pmichaud *because
17:50 pmichaud that's not a restriction of the language.
17:50 rokoteko pmichaud: ah. with the scalar issue I was referring to $x(@list_of_lists) .. the 1..* is a different issue. and I think it doesn't work, because I tried it out.
17:51 pmichaud rokoteko: "list of lists" makes me think you're really looking for Slicels
17:51 rokoteko Might be. I have no idea what they are. can you give an example? :)
17:51 pmichaud rokoteko: note that Rakudo has many things "not quite right" with respect to lists, so you can't say "rakudo fails this case, therefore it's not valid Perl 6".
17:51 rokoteko pmichaud: and thanks for the correction with the 1..* -issue. so it's problem with implementation, not with the language. :)
17:52 pmichaud in fact, the entire list specification needs a rework, which is what did last weekend (and what I'm continuing today)
17:52 pmichaud (and that's why I said @-sigils "currently" mean Positional, because there's a small chance that will need to change)
17:53 rokoteko pmichaud: nods. Im no only here to figure out reasons for learning perl6 compared to keep on trying to learn perl5. :)
17:54 colomon pmichaud: I'm still inclined to think @-sigils meaning Positional is a bad idea.
17:54 rokoteko pmichaud: do you really mean Slicels or did you just mistype slices, that happen to work in a weird way in perl6?
17:54 colomon rokoteko: he means Slicels.
17:55 colomon they're not yet implemented, so far as I know.
17:57 rokoteko rakudo: my $x = { @_.map({ ++$_}).map({ ++$_ }).map({ ++$_ }).batch(5)}; print $x([(1..10), (11..20)])
17:58 p6eval rakudo 738fad: OUTPUT«1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 23»
17:58 colomon pmichaud: The thing is that Positional is much much weaker than Perl programmers expect @vars to be.
17:58 pmurias joined #perl6
17:58 pmurias ruoso: ping
17:58 diakopter pmurias: hi
17:58 pmurias diakopter: hi
17:58 pmurias diakopter: how's stuff?
17:59 rokoteko my $x = { @_.map({ ++$_}).map({ ++$_ }).map({ ++$_ }).batch(5)}; print $x(([1..10], [20..30]))
18:00 rokoteko man. it always seems to flatten the lists. where I can read about what Slicels are?
18:01 diakopter pmurias: slow. I'm an invalid, convalescing from a back injury
18:03 pmurias :(
18:03 jnthn diakopter: Aww. Hope you recover quickly.
18:05 pmichaud colomon: (Positional)   I agree.
18:06 clintongormley joined #perl6
18:06 colomon pmichaud: of course, if we're planning on making iterators upgrade to List/Seq/Array, then Positional can too...
18:07 pmichaud I'm not planning on that currently -- I think that's a mistake at the moment.
18:07 pmichaud I think that iterators should remain scalar unless explicitly told to upgrade.
18:07 colomon pmichaud: oooo, a change in plans.
18:08 pmichaud well, the last plan I saw (on the mailing list) I don't think is workable.
18:08 pmurias diakopter: is you injury serious?
18:10 diakopter pmurias: I doubt it
18:10 diakopter actually it might give me more hacking time
18:10 diakopter we'll see
18:11 TimToady rakudo: say ~(1..*).batch(10); say ~(1..*)[^10]
18:11 p6eval rakudo 738fad: OUTPUT«Method 'batch' not found for invocant of class 'Range'␤  in main program body at line 11:/tmp/EOQlJ9I4Zl␤»
18:12 TimToady rakudo: say ~(1...*).batch(10); say ~(1...*)[^10]
18:12 p6eval rakudo 738fad: OUTPUT«1 2 3 4 5 6 7 8 9 10␤»
18:12 * TimToady thinks [^10] is not lazy
18:12 pmichaud not yet. :-)
18:12 pmichaud actually, it should be lazy, as it just produces a Range.
18:13 pmichaud but the subscripting might not be lazy
18:13 TimToady yet... :)
18:13 rokoteko TimToady: ok. now Im not understanding the "..." operator again. what did you say about types related to this again?
18:15 rokoteko '=== is exact type and value equivalence' I thought you meant something like Int $foo vs String $foo ... ?
18:15 TimToady rakudo: say "42" == 42
18:16 p6eval rakudo 738fad: OUTPUT«1␤»
18:16 TimToady rakudo: say "42" === 42
18:16 p6eval rakudo 738fad: OUTPUT«0␤»
18:16 TimToady different types, so aren't the same
18:16 TimToady == coerces to numeric, and then they're equal
18:17 rokoteko but what about your example above with .batch(10) ? ~ is not a "not" operator as in perl5?
18:17 TimToady ~ is string concat in p6
18:17 colomon rokoteko: ~ is stringification in p6
18:17 TimToady because we used . for method calls
18:18 rokoteko so ~(1...*) forces the $_ to be a string ?
18:18 TimToady yes, prefix ~ is stringify, which is the same as concat with ''
18:18 TimToady yes
18:18 TimToady well, there's no $_ there
18:18 TimToady but it's not applied to the (1...*), but to the (1...*).batch(10)
18:18 rokoteko nods. sorry. Im a beginner in your language, but I think I get your point.
18:19 TimToady methods are tighter than prefixes
18:19 colomon which is good, because otherwise it would be an infinite string.
18:19 TimToady are you familiar with p5?
18:19 colomon (and infinite strings are not yet implemented.  ;)
18:19 rokoteko TimToady: I would say somewhat yes.
18:19 TimToady okay, many things are the same, and most p6 things can be explained in terms of p5
18:19 rokoteko TimToady: several years of perl5 'knowledge' behind, to be more exact.
18:20 TimToady that's okay, though if you'd played with Moose, you'd have a headstart on p6 OO
18:22 rokoteko I know bit of Moose, so Im aware of stuff like that Int $str exists. but never used Moose in practise. also I know a bit about how Moose is implement, about the meta-system etc. no need to hook to methods, because you can just modify what they actually do.
18:22 TimToady we do wrapping slightly differently in p6
18:23 justatheory joined #perl6
18:23 TimToady we consider "before" and "after" to be redundant with "around" semantics
18:24 justatheory joined #perl6
18:24 TimToady or whatever that's called in Moose
18:25 patrickas joined #perl6
18:25 patrickas saba7o perlsixers
18:27 rokoteko ... sorry Im not that familiary with Moose. considering: sub foo { .. }, do you mean: { do_stuff_before(); sub foo {..}; do_stuff_after() }; .. or { sub foo { do_stuff_before(); .. do_stuff_after(); } }?
18:27 pugssvn r31105 | patrickas++ | Added tests for advent calendar day 18
18:28 patrickas ping jnthn
18:28 jnthn pong patrickas
18:31 gbacon joined #perl6
18:33 TimToady more like when you call foo(), you actually: get do_stuff_before(); inner_foo(); do_stuff_after()
18:33 TimToady s/: get/ get:/
18:35 pmichaud afk, lunch
18:35 rokoteko to me that sounds like the latter example of mine. but ok, go on with the "..." and "there's no $_ there" explanation, if you arent in a hurry.
18:40 TimToady in a meeting, so distracted...
18:40 colomon rokoteko: (1...*).batch(10) produces a list of 10 numbers, starting from 1 and counting up.
18:40 rokoteko ah no probs, I can chat about this again, or someone else willing can explain it to me. :)
18:40 rokoteko s/again/another time/
18:40 colomon applying prefix ~ to that converts that list to a string.
18:41 colomon rakudo: say ~(1...10)
18:41 p6eval rakudo 738fad: OUTPUT«1 2 3 4 5 6 7 8 9 10␤»
18:41 colomon rakudo: say ~(1...*).batch(10)
18:41 p6eval rakudo 738fad: OUTPUT«1 2 3 4 5 6 7 8 9 10␤»
18:41 rokoteko colomon: yes I understood that. but as a side question. how would you force it to be a string? "~~" or maybe "!~"  ?
18:41 colomon rokoteko: you're seeing it right there.
18:41 colomon rakudo: say ~(1...10)
18:41 p6eval rakudo 738fad: OUTPUT«1 2 3 4 5 6 7 8 9 10␤»
18:41 colomon rakudo: say 1...10
18:41 p6eval rakudo 738fad: OUTPUT«12345678910␤»
18:41 pugssvn r31106 | patrickas++ | Added a currently skipped failing test for roles
18:41 colomon If you don't force it to be a string, you don't get the spaces between the numbers.
18:42 rokoteko rakudo: say ~("a".."d")
18:42 p6eval rakudo 738fad: OUTPUT«a b c d␤»
18:43 pugssvn r31107 | lwall++ | [viv] make sure concise has \n on the end
18:43 colomon If you say $a ~ $b, that forces both $a and $b to strings and concats them.
18:43 colomon if you say ~$a, it just forces $a to be a string.
18:44 colomon or, as TimToady says, it's like saying "" ~ $a.
18:44 colomon There is an equivalent operator for numbers, +
18:44 colomon ack, sorry, sloppy language there.
18:45 pugssvn r31108 | lwall++ | [viv] move "\n" guarantee down into spew
18:45 colomon it doesn't change $a or $b, it just returns their values as strings.
18:45 colomon rakudo: my $a = 10; say (~$a).WHAT; say $a.WHAT
18:45 p6eval rakudo 738fad: OUTPUT«Str()␤Int()␤»
18:47 rokoteko this might be a bit sily question, but Im definitely missing something essential here. how do you do a say @$_ for (["a".."b"], [1..3])   in perl6 as compared to perl5?
18:51 colomon rakudo: for [[1, 2, 3], [4, 5, 6]] -> $a { say $a; say $a.perl; say $a.WHAT }
18:51 p6eval rakudo 738fad: OUTPUT«1 2 3 4 5 6␤[[1, 2, 3], [4, 5, 6]]␤Array()␤»
18:52 cognominal say @( $_ ) for ["a".."b"], [1..3]  # would do it, I guess
18:52 colomon rakudo: for ([1, 2, 3], [4, 5, 6]) -> $a { say $a; say $a.perl; say $a.WHAT }
18:52 p6eval rakudo 738fad: OUTPUT«1 2 3␤[1, 2, 3]␤Array()␤4 5 6␤[4, 5, 6]␤Array()␤»
18:52 TimToady @$_ should work too
18:52 colomon rakudo: for ([1, 2, 3], [4, 5, 6]) -> $a { say $a; say $a.perl; say $a.WHAT; say +@$a }
18:52 p6eval rakudo 738fad: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 11␤»
18:53 colomon I don't think @$_ works in rakudo.
18:53 colomon rakudo: for ([1, 2, 3], [4, 5, 6]) -> $a { say $a; say $a.perl; say $a.WHAT; say +@($a) }
18:53 p6eval rakudo 738fad: OUTPUT«1 2 3␤[1, 2, 3]␤Array()␤3␤4 5 6␤[4, 5, 6]␤Array()␤3␤»
18:53 TimToady it *should* work  :)
18:53 colomon @($_) works.
18:53 PerlJam TimToady: is @$_ the same as @($_) ?
18:53 TimToady yes
18:54 TimToady std: @$_
18:54 p6eval std 31105: OUTPUT«ok 00:01 107m␤»
18:54 TimToady std: @$$$$$$$_
18:54 p6eval std 31105: OUTPUT«ok 00:01 104m␤»
18:54 pugssvn r31109 | patrickas++ | Added missing tests
18:54 TimToady of course $() is generally a no-op
18:55 cognominal TimToady, also  @$_.a  means @($_).a, not  @( $_.a ) ?
18:56 PerlJam except that it affords item context where their otherwise may not be.  $() that is.
18:56 TimToady STD uses @$x in 19 spots
18:56 rgrau joined #perl6
18:56 PerlJam s/their/there/
18:56 TimToady cognominal: yes, it means @($_).a
18:56 PerlJam that was a weird brain-o
18:56 takadonet left #perl6
18:57 TimToady @$ is a special form--the @ is not an operator
18:57 rgrau hi #perl6
18:58 PerlJam TimToady: so ... @ is the sigil and $ the twigil in that case  :)
18:59 rokoteko cognominal: thanks. :)
19:00 TimToady PerlJam: kinda sorta
19:01 TimToady though...
19:01 TimToady std: @$^a
19:01 p6eval std 31109: OUTPUT«ok 00:01 107m␤»
19:02 PerlJam sigil, twigil, ... thrigil?  spigil?  quidril?
19:02 PerlJam \
19:03 jnthn std: @$$
19:03 p6eval std 31109: OUTPUT«[31m===[0mSORRY![31m===[0m␤Non-declarative sigil is missing its name at /tmp/GfUIjCbKL6 line 1:␤------> [32m@$[33m⏏[31m$[0m␤Confused at /tmp/GfUIjCbKL6 line 1:␤------> [32m@$$[33m⏏[31m<EOL>[0m␤    expecting twigil␤Parse failed␤FAILED 00:01 105m␤»
19:03 jnthn Shiny.
19:03 jnthn rakudo: @$$
19:03 p6eval rakudo 738fad: OUTPUT«===SORRY!===␤Confused at line 11, near "@$$"␤»
19:03 * cognominal tries to see where TimToady handle the @$ special form in STD
19:03 jnthn LTA
19:03 rokoteko would be easier to use the stringifications of greek alphabets. alphail, betail, deltail, gammail, epsilonil ;)
19:04 TimToady cognominal: look for desigilname
19:05 patrickas rakudo: for^20{my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%{$c}s%{$d-$c}s\n",$a,$b}
19:05 rokoteko they would easily map to unicode also to avoid englishmism.
19:05 p6eval rakudo 738fad: OUTPUT«===SORRY!===␤Sorry, multi-dimensional indexes are not yet supported at line 11, near ""␤»
19:05 PerlJam that looks like it might be easish to add to rakudo
19:06 patrickas alpha: for^20{my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%{$c}s%{$d-$c}s\n",$a,$b}
19:06 p6eval alpha 30e0ed: OUTPUT«     C  G␤      CG␤     T A␤   G    C␤ T     A␤ G     C␤ G   C␤  CG␤ TA␤ G   C␤ T     A␤  A     T␤   A    T␤     T A␤      GC␤    C   G␤  A     T␤ A     T␤ T    A␤ C  G␤»
19:08 TimToady that's not Perl 6
19:09 TimToady std: or^20{my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%{$c}s%{$d-$c}s\n",$a,$b}
19:09 p6eval std 31109: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unsupported use of %{$c}; in Perl 6 please use %($c) at /tmp/LRqcjNhJUq line 1:␤------> [32mp {6+4*sin($_/2)},$_,$_+4; printf "%{$c}[33m⏏[31ms%{$d-$c}s\n",$a,$b}[0m␤Undeclared routine:␤   'or' used at line 1␤Parse failed␤FAILED 00:01 108m␤»
19:09 TimToady std: for^20{my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%{$c}s%{$d-$c}s\n",$a,$b}
19:09 p6eval std 31109: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unsupported use of %{$c}; in Perl 6 please use %($c) at /tmp/GjhJRGFuzO line 1:␤------> [32mp {6+4*sin($_/2)},$_,$_+4; printf "%{$c}[33m⏏[31ms%{$d-$c}s\n",$a,$b}[0m␤Undeclared routine:␤   'for' used at line 1␤Parse failed␤FAILED 00:01 108m␤»
19:09 patrickas unfrtunately that's what we're teaching the kids these days :-(
19:09 TimToady it's wrong several ways, from a p6 point of view
19:09 patrickas straight from : http://perl6advent.wordpress.com/2009/12/​16/day-16-we-call-it-the-old-switcheroo/
19:11 patrickas I really like the result... I'd hate to remove the example .... maybe we just need to clean it up a bit :-)
19:11 TimToady that particular message is perhaps suppressible, since {} has a different meaning as interpolation
19:11 TimToady however
19:11 TimToady if we fix that...
19:12 TimToady std: for^20{my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%\{$c}s%\{$d-$c}s\n",$a,$b}
19:12 p6eval std 31109: OUTPUT«[31m===[0mSORRY![31m===[0m␤Undeclared routine:␤      'for' used at line 1␤Check failed␤FAILED 00:01 108m␤»
19:12 TimToady let's add spaces around the ^20
19:12 TimToady std: for ^20 {my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%\{$c}s%\{$d-$c}s\n",$a,$b}
19:12 p6eval std 31109: OUTPUT«ok 00:01 108m␤»
19:12 TimToady that's Perl 6 :)
19:12 patrickas btw spaces everywhere always trip me off in perl6
19:13 patrickas ok thanks
19:13 TimToady statement controls require spaces
19:13 patrickas *i* know, i just can't always convince my fingers
19:13 TimToady and {} without space before it is always a subscript
19:13 jjore joined #perl6
19:14 patrickas rakudo: for ^20 {my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%\{$c}s%\{$d-$c}s\n",$a,$b}
19:14 p6eval rakudo 738fad: OUTPUT«Too many positional parameters passed; got 3 but expected 2␤  in 'map' at line 1523:CORE.setting␤  in main program body at line 11:/tmp/PcAO7uENGt␤»
19:14 patrickas unfortunately rakudo can't handle it yet :(
19:14 patrickas alpha: for ^20 {my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%\{$c}s%\{$d-$c}s\n",$a,$b}
19:15 p6eval alpha 30e0ed: OUTPUT«Insufficient arguments supplied to sprintf␤Insufficient arguments supplied to sprintf␤Insufficient arguments supplied to sprintf␤Insufficient arguments supplied to sprintf␤Insufficient arguments supplied to sprintf␤Insufficient arguments supplied to sprintf␤Insufficient
19:15 p6eval ..arguments s…
19:15 patrickas neither could alpha :(
19:15 TimToady yes, well, those backslashes were to fool std, not make the interpolation work right :)
19:15 TimToady I'll fix that one
19:17 TimToady rakudo: for ^20 {my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%{$c}s%{$d-$c}s\n",$a,$b}
19:17 p6eval rakudo 738fad: OUTPUT«Too many positional parameters passed; got 3 but expected 2␤  in 'map' at line 1523:CORE.setting␤  in main program body at line 11:/tmp/ZyNEgzkxsr␤»
19:18 patrickas rakudo is having problems with the map .... regardless of the slashes
19:18 patrickas alpha can do it though
19:18 TimToady rakudo: for ^20 {my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map({6+4*sin($_/2)},$_,$_+4); printf "%{$c}s%{$d-$c}s\n",$a,$b}
19:18 p6eval rakudo 738fad: OUTPUT«Too many positional parameters passed; got 3 but expected 2␤  in 'map' at line 1523:CORE.setting␤  in main program body at line 11:/tmp/iguIpmAiND␤»
19:18 TimToady rakudo: for ^20 {my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map({6+4*sin($_/2)},($_,$_+4)); printf "%{$c}s%{$d-$c}s\n",$a,$b}
19:18 p6eval rakudo 738fad: OUTPUT«     C  G␤      AT␤     A T␤   T    A␤ C     G␤ C     G␤ A   T␤  GC␤ CG␤ G   C␤ T     A␤  G     C␤   G    C␤     G C␤      TA␤    T   A␤  G     C␤ C     G␤ A    T␤ T  A␤»
19:19 patrickas thanks :-)
19:19 patrickas I suppose it should not be that hard to fix map ... I'll take a look
19:20 TimToady looks like @list should be *@list in some signature
19:20 colomon oh, right, sub map doesn't take a slurpy right now.
19:20 colomon That's either very easy to fix, or a big problem.
19:20 colomon used to be a big problem, but something may have changed along the way.
19:20 PerlJam Wasn't map just waiting on real laziness?
19:20 colomon it's line 272 in Any-list.pm
19:21 colomon PerlJam: map is already really lazy.
19:22 TimToady I think this relates to the list rethink that pmichaud is doing
19:22 patrickas arrg PIR, /me backs away slowly :-)
19:22 TimToady and there's a fundamental problem with using the @ sigil to represent a list
19:22 colomon TimToady: certainly might affect it, but I don't think that's really it.
19:23 colomon that is to say, grep is already taking a slurpy.
19:23 colomon my memory is just that things break when you try it.
19:23 patrickas I'll modify the example in the post in the mean while until map is fixed
19:23 colomon but I'm working on it again in the meantime.
19:23 colomon (I mean, trying it, just to see what happens.)
19:24 ShaneC joined #perl6
19:26 jjore joined #perl6
19:26 ShaneC left #perl6
19:27 colomon rakudo: say ~map({$_ * 2}, :values(3, 4, 4, 5))
19:27 p6eval rakudo 738fad: OUTPUT«6 8 8 10␤»
19:27 TimToady we might need to steal the *$foo notation for binding the iterator to $foo; the only alternative is to force *@foo to use shift to iterate its iterator destructively
19:27 colomon yeah, that's it.
19:27 TimToady as far as I can see
19:27 colomon If I change @values to be slurpy, then the above becomes
19:27 colomon > say ~map({$_ * 2}, :values(3, 4, 4, 5))
19:27 colomon Unexpected named parameter 'values' passed
19:28 colomon but
19:28 colomon > say ~map({$_ * 2}, 3, 4, 4, 5)
19:28 colomon 6 8 8 10
19:28 colomon I think at the moment you can get one or the other but not both.
19:28 PerlJam Is that the rakudo uncertainty princimple?
19:28 PerlJam s/imp/inp/
19:28 PerlJam grr
19:28 TimToady I think the variadic form is much more important than being able to name your list
19:28 PerlJam s/imp/ip/
19:28 * colomon personally prefers the method forms of map and grep....
19:29 colomon TimToady: well then, let me see what tests I break...
19:29 colomon *broke
19:30 * colomon is relieved to have a programming problem simple enough he can handle it after being up most of the night with a feverish toddler.
19:42 TimToady if *$head,*@tail can be replaced by *[$head,*$tail], we could steal *$ for *$iterator and **$sliceiterator
19:43 PerlJam I think I like it.
19:43 PerlJam (FWIW)
19:44 TimToady then it's clear that 'for |$iterator {...}' is destructive, unlike @iterator
19:46 TimToady what's clear is that @ means inconsistent things in the current design
19:49 TimToady the other way out is to have a way that says to interpolate an array destructively
19:49 TimToady for @array {...} just reads, but...
19:50 TimToady for @array.mumble {...} iterates @array destructively
19:50 TimToady this could work because laziness is orthogonal to arrays
19:51 TimToady that is, both arrays and iterators have a reified part and an imaginary part, it's just api policy that differs
19:53 TimToady "mumble" could be something like "shiftall", or it might be common enough to deserve its own operator
19:53 pugssvn r31110 | patrickas++ | Added test for DNA one liner at the end of the post
19:54 TimToady for @array.munch   :)
19:54 xinming joined #perl6
19:57 pmurias joined #perl6
20:01 colomon should map { .WHAT } , {"a"=> 1 , "b"=>2}).join(' ')  be 'Pair() Pair()'  ?
20:02 TimToady I don't think so
20:02 TimToady [] and {} don't flatten
20:02 colomon that's failing now... apparently it used to convert {"a"=> 1 , "b"=>2} to a list, now that it's slurpy it takes it as a single argument.
20:02 TimToady [] and {} are like $ scalars in a list
20:02 colomon I see the test is marked "#hash in list context", which certainly seems a bad sign...
20:03 Psyche^ joined #perl6
20:03 TimToady %hash would flatten, but $hash wouldn't
20:03 TimToady it's not the type
20:03 TimToady %$hash would flatten
20:03 TimToady %({}) would flatten
20:03 TimToady |{} would flatten
20:05 pugssvn r31111 | colomon++ | [t/spec] Fudge tests to work with slurpy map.
20:07 colomon TimToady: okays, map is now slurpy.
20:07 justatheory joined #perl6
20:08 justatheory joined #perl6
20:08 dalek rakudo: 7c83e65 | (Solomon Foster)++ | src/core/Any-list.pm:
20:08 dalek rakudo: Switch sub version of map to take slurpy values.
20:08 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/7​c83e65fb2cda0ddd85e6abe98b18ee7da4a465f
20:10 * TimToady wonders if @array[@keys]:delete can lazily delete/return values
20:11 TimToady that's .munch, more or less
20:12 kfo_ joined #perl6
20:12 patrickas colomon that's what happens when you give noobs svn access
20:12 colomon patrickas: what is?
20:13 patrickas Broken tests
20:13 patrickas ps: I am the noob to blame in that case
20:13 colomon patrickas: believe me, there have been (and probably are) plenty of broken tests written by non-noobs.
20:14 pmichaud back from lunch and shopping
20:14 colomon and it was pretty subtle, and it did work before, after all.
20:15 patrickas colomon it didn't work before :-( I thought it should work like that (after asking around) and made it work like that and added a test for it to work like that ... but apparently I was wrong
20:15 colomon TimToady: I think I like the .munch idea better.
20:16 cognominal rakudo: %()
20:16 p6eval rakudo 738fad:  ( no output )
20:17 TimToady well, if we had a delete macro, it'd be 'delete @array' vs 'delete @array[@keys]'
20:17 TimToady where 'delete @array' presumably means 'delete @array[*]'
20:17 TimToady or 'munch @array', which gives the idea that it returns the munched values
20:18 TimToady so we'd have 'for munch @array {...}'
20:18 colomon TimToady: wait, I think there's a big problem with .munch as an idea.
20:18 colomon Or at least...
20:18 ashleydev joined #perl6
20:18 TimToady well, same problem as .delete, if there are keys that have to be unreferenced
20:18 TimToady that's why it has to be a macro or a modifier on the subscript
20:19 patrickas So would the correct test be
20:19 patrickas rakudo: use Test; my $h= {"a"=> 1 , "b"=>2}; is( (map { .WHAT } , $h).join(' ') , 'Pair() Pair()' );
20:19 p6eval rakudo 738fad: OUTPUT«ok 1 - ␤»
20:19 TimToady no
20:19 colomon patrickas: no
20:19 TimToady $h doesn't flatten either
20:19 pmichaud what are we trying to test?
20:20 patrickas pmichaud: the way I am seing it .... my ignorance and your patience  :-)
20:20 colomon whether a hash becomes an array of pairs in certain circumstances.
20:20 pmichaud a flattening hash does, yes.
20:21 pmichaud a non-flattening hash wouldn't.
20:21 pmichaud my %h = { a=>1, b=>2 };   # %h flattens
20:22 pmichaud my $h = { a=>1, b=>2 };   # $h doesn't flatten
20:22 TimToady but has nothing to do with the type of the hash itself
20:22 pmichaud correct.
20:22 patrickas pmichaud:  apparently that was just said in the channel 10 minutes ago but I was too thick to grasp it :-)
20:22 TimToady my %h := $h;  %h now flattens
20:22 pmichaud both %h and $h above are of type "Hash"
20:23 TimToady actually, both of those are wrong
20:23 TimToady they want :=
20:23 pmichaud oh, correct.
20:23 TimToady well, the first one is wrong
20:23 pmichaud well, the second doesn't.
20:23 pmichaud :)
20:23 TimToady beatcha :P
20:23 pmichaud my mind is a little tapioca'd at the moment.
20:24 TimToady I know the pudding, er, feeling
20:24 colomon .oO(oooo, tapioca)
20:24 TimToady pmichaud: been thinking about the *@iter quandry above
20:25 pmichaud TimToady: I saw that.
20:25 pmichaud lately I've been wondering if we really want a Feed type.
20:25 colomon My mind is like tapioca where someone has gone through and sucked out all the little fish eyes.
20:25 pugssvn r31112 | pmurias++ | [smop] fix some warnings
20:25 patrickas ok so since the hash should not flatten, what should the result be ?
20:25 patrickas of a no nflattening hash passed to map ?
20:26 TimToady well, speaking of tapioca, I need to be pudding some lunch into my bloodstream, and it's already after 13:26 here...
20:26 colomon patrickas: you pass the entire hash to one iteration of the map.
20:26 TimToady decommute &
20:26 pmichaud TimToady: in particular, I'm wondering about the objects being passed between
20:26 pmichaud map { $_**2 } <== sort <== grep { $_ % 2 } <== @nums;
20:27 patrickas ok... I'll try to fix the tests then
20:27 colomon pmichaud: Feed would essentially wrap an Iterator
20:27 colomon ?
20:27 pmichaud colomon: right, but would be different List in that respect
20:27 pmichaud i.e., a Feed doesn't need memory
20:27 pmichaud unless it's bound/mapped/attached to something that wants memory
20:28 colomon pmichaud: right.
20:28 pmichaud *different from List
20:29 colomon and you have to explicitly request a Feed, yes?
20:29 pmichaud well, I'd think no.
20:29 colomon (whether by declaring a variable to be  a Feed or using <==)
20:29 pmichaud It may depend (more)
20:29 pmichaud for example,  .map() on a Feed might behave slightly differently than .map on an Array.
20:30 pmichaud or one might delegate to the other.
20:30 pmichaud but in general, it seems that .map wants to return a Feed and not a List/Seq/Array
20:30 colomon gather also returns a Feed?
20:30 pmichaud colomon: yes
20:30 pugssvn r31113 | patrickas++ | trimmed the lines so the test passes regardless of line ending character
20:31 pmichaud i.e., Feed is the explicit type for "I can produce a sequence of elements in a list context, but I don't bother keeping any of the values of the sequence around."
20:31 pmichaud it's still a fuzzy notion at the moment, but it seems to me that we have at least  List, Iterator, Feed, and Array
20:32 colomon that feels very right to me.
20:32 colomon but I get all tangled up in the details.
20:32 pmichaud well, same here :)
20:32 pmichaud I had to abandon work a bit earlier in the week, so I'm back on it now.
20:33 pmichaud Also, it's hard to work on this when answering questions on irc :)
20:33 colomon seems like the tricky bit is we want Feed to automatically convert to an Array when needed, and vice versa?  (tricky as in, I don't know how to make dispatch do that without extra magic)
20:33 pmichaud but the existence of <== and ==> and the like somehow tells me that we need a "feed type"
20:34 pmichaud I'm not sure about "automatically convert to an Array" -- seems like it might be "be wrapped by an Array"
20:34 colomon yes.
20:34 pmichaud e.g., when it's bound.
20:35 colomon I mean, if I have sub fred(@a), I want to be able to pass a Feed to it.
20:35 colomon binding, yes.
20:35 pmichaud sure
20:35 colomon and if I have sub fred(Feed $a), I want to be able to pass an array to it.
20:35 pmichaud and binding a @-sigil to a feed actually creates an intermediate Array
20:35 colomon pmichaud: yes on the @-sigil.
20:35 pmichaud hmmm
20:35 pmichaud I'm not sure if Array ~~ Feed, though.
20:36 colomon I'm pretty sure Array !~~ Feed.
20:36 colomon that's why it seems like the binding needs magic.
20:36 pmichaud in which case I don't think we need to pass an array to   fred(Feed $a)...
20:36 PerlJam Feed ~~ Positional ?
20:36 pmichaud PerlJam: haven't decided that one yet.
20:37 pmichaud colomon: I don't see the place where we need for  sub fred(Feed $a) { ... }   to be able to accept an Array.
20:37 colomon pmichaud: just trying to be properly dwimmy
20:38 pmichaud it should not be the case that just anything passes everywhere.
20:38 pmichaud if you want to accept arrays, you should probably be using @a  anyway
20:38 pmichaud and not trying to accept a feed-as-scalar.
20:38 colomon I guess you could always have an additional sub fred(@a) { fred(@a.Feed) }
20:38 colomon disagree strongly with that last.
20:38 colomon for some subs, Feed will be a natural.
20:38 pmichaud I don't think you even need an additional sub.
20:39 pmichaud colomon: example?
20:40 patrickas just so I don't mess things up again, I'll replace the currently broken hash test with http://gist.github.com/425910 did I finally get things right ?
20:41 pmichaud patrickas: my %flattens= {"a"=> 1 , "b"=>2};  # wrong
20:41 pmichaud patrickas: maybe you want parens there.
20:42 colomon pmichaud: sorry, brain too gone to quickly think of an explicit example, but think of any time you want to refactor a long string of maps and greps out to a single function.  You'd normally want it to take a Feed, but that doesn't mean you'd never want to pass an @array to it.
20:43 pmichaud colomon: in that case, you have it take an @array, and you shift elements from the @array
20:43 patrickas rakudo: my %h1= {"a"=> 1 , "b"=>2};my %h2= ("a"=> 1 , "b"=>2); %h1.perl.say; %h2.perl.say;
20:43 justatheory joined #perl6
20:43 p6eval rakudo 738fad: OUTPUT«{"a" => 1, "b" => 2}␤{"a" => 1, "b" => 2}␤»
20:43 pmichaud and the feed automatically promots to an array
20:43 pmichaud *promotes
20:43 cognominal %()  crashes is the golfed version of a program that crashes rakudo, whatever the way it is run (p6 shell, with -e, as a program). According to the trace it triggers a infinit recursion in the GC
20:43 pmichaud but trying to get an array to automatically promote to a feed is asking for trouble
20:43 cognominal should i file a bug?
20:44 pmichaud or, instead of trying to get   sub foo(Feed $a) to work, what you really want is   sub foo($a as Feed)
20:44 pmichaud i.e., so that it coerces $a into a Feed, instead of trying to make binding automatically promote it
20:44 colomon pmichaud: $a as Feed, yes.
20:44 pmichaud whenever we try to make our type constraints perform coercions we're likely to run into problems.
20:45 Guest86191 joined #perl6
20:45 colomon pmichaud: I don't really have any major problem with the idea of forcing you to do a one-line multi sub to get the same behavior as $a as Feed
20:46 pmichaud since $a as Feed is the natural way of expressing "convert the argument to a Feed", I think we should use it.
20:46 colomon Is it also a valid p6 way?  I've seen it tossed about, but not known if it is real or just a notion.
20:47 patrickas in rakudo how can I detect that "my %h1= {"a"=> 1 , "b"=>2};" is different than  "my %h2= ("a"=> 1 , "b"=>2);" ?
20:48 pmichaud the first will end up being a (runtime) error.
20:48 pmichaud because you're tying to create a hash from a list of one scalar.
20:48 colomon pmichaud: (I'm 1000% behind $a as Feed if we can make that work, for what that's worth.)
20:50 patrickas oh ok thanks... so current rakudo is as much to blame as I am :-)
20:50 pmichaud well, even if "as Feed" doesn't work, we can always do
20:50 pmichaud sub foo($a) { $a = $a.Feed; ... }
20:51 pmichaud which explicitly builds a Feed for $a, regardless of $a's type.  If $a is already a Feed, then it's a no-op.
20:53 pugssvn r31114 | patrickas++ | Corrected broken test
20:53 colomon rakudo: sub foo($a) { say $a.WHAT }; my @a = 1..10; say foo(@a)
20:53 p6eval rakudo 7c83e6: OUTPUT«Array()␤1␤»
20:53 colomon pmichaud: word.
20:54 TimToady I don't understand how Feed is different from a List
20:54 colomon pmichaud: $a as Feed is more elegant, but $a = $a.Feed seems like a perfectly sensible way of doing it.
20:54 pmichaud TimToady: they may in fact be the same.
20:55 pmichaud TimToady: I'm still teasing out the commonalities.
20:55 pmichaud But if Feed is List, that's assuming that List means "I don't remember values"
20:55 pmichaud (which is fine)
20:55 colomon but calling it Feed takes a step back from all the confusing current half-notions.
20:55 pmichaud right
20:55 pmichaud at the moment I'm calling it a Feed just to avoid confusion with past terms
20:55 pmichaud also, S06 talks a lot about "feeds", so it seems reasonable to have a Feed type
20:56 TimToady maybe
20:56 pmichaud (which we may end up calling 'List', but 'Feed' is more obvious for discussion)
20:56 colomon I think Feed is a good term, too, because it isn't loaded with all sorts of other connotations.  (at least to my ear)
20:56 PerlJam and then we'll get a Feed-lot and some cattle and ...
20:56 pmichaud I'm not entirely comfortable with the name Feed either.
20:56 pmichaud I also considered Pipe, Pipeline, etc.
20:56 TimToady up till now, "feed" has mode more promises about threadability than "list" has, I suspect
20:57 pmichaud but at the moment (for me at least) it's just useful to separate away from the overloaded term "list"
20:57 PerlJam Ceci n'est pas une pipe
20:58 pmichaud TimToady: I did have a question about the current synopsis... what's the fundamental difference between  the "flat" and "list"  listops?
20:58 pmichaud s/listops/contextualizers
20:59 pmichaud (i.e., what difference is the synopsis aiming at?)
20:59 TimToady .list only undoes the non-interpolation of $, [], and {}, I suspect
20:59 pmichaud okay
20:59 TimToady so prefix:<|> is basically .list, I think
20:59 TimToady except not quite
21:00 TimToady since | also removes a Parcel wrapping on the arguments
21:00 pmichaud it's not hugely important what the exact difference is... just wanted to get a sense of what the underlying intent was
21:00 TimToady whereas .list, if it's a normal method, would have a Parcel around its values
21:00 pmichaud so essentially, 'list'  removes scalar-ness but doesn't deal with interior parcles
21:00 pmichaud *Parcels
21:00 TimToady yes
21:01 pmichaud whereas 'flat' also flattens the interior Parcels
21:01 TimToady whereas .flat switches to an flattening iterator
21:01 pmichaud okay
21:01 TimToady that squashes interior parcels
21:01 pmichaud I'm not sure I see where that distinction is needed yet, but I'll know it when I see it.
21:01 Guest43663 joined #perl6
21:02 patrickas does this mean the method 'list'  in 'Hash' gets called only when the Hash needs to flatten ?
21:02 TimToady in a list context, .list merely undoes the non-interpolation (I almost said non-flattening)
21:02 TimToady there may not be a .list method, but there will be a .flat method, I think
21:03 patrickas there is a .list method because I added it and I am checking to know if I should remove it :-)
21:03 pmichaud patrickas' question is part of the reason why I'm departing from List for a bit
21:03 pmichaud it's much easier to say "what do I use to get a feed of elements from a Hash"?
21:04 skids joined #perl6
21:04 pmichaud if we later say that Feed is in fact List, then it works out
21:04 TimToady but if the hash returns $feed, that probably stays a single item if %hash.feed is in list context
21:05 pmichaud well, for a single item I really want an Iterator
21:05 pmichaud as opposed to a Feed
21:05 pmichaud and that would be %hash.iterator
21:05 pmichaud in some sense, .iterator is the scalar form of a feed.  or a feed is something that knows how to flatten an iterator
21:06 pmichaud (but do so w/o memory of past elements)
21:06 PerlJam flatten == iterate?
21:06 pmichaud I suppose we could just have flattening and non-flattening iterators.
21:06 TimToady not sure that's right
21:06 pmichaud .iterator gives back a non-flattening iterator, while .list or .feed or .flat or whatever gives back a flattening iterator
21:07 pmichaud I agree that doesn't seem right either, which is why I'm choosing to multiply types for now until I figure out what the use cases are, then look for combining them where it makes sense
21:07 pmichaud PerlJam: I'm pretty sure that Feed ~~ Positional,  as people will expect   .map(...).[5]   to work
21:08 TimToady I don't think so
21:08 pmichaud PerlJam: but I keep going back-and-forth on that.
21:09 TimToady I think Any.[] will create a positional for Positional.[]
21:09 TimToady this is how Any.[0] is Any for non-iterables
21:09 pmichaud sure, but I'm pretty sure the result of .map() is generally iterable.
21:10 TimToady iterable !=== positional
21:10 xabbu42 joined #perl6
21:10 pmichaud can we do   .grep().elems   ?
21:10 TimToady hmm, we've been using iterable for something that can *produce* an iterotor, not something that is an iterator
21:10 xabbu42 joined #perl6
21:10 pmichaud some iterators are also iterable.
21:11 TimToady but if so, they probably clone the iterator
21:11 pmichaud sure
21:11 pmichaud but they're iterable :)
21:11 TimToady I don't see why .elems wouldn't do similarly, though Any.elems can short-circuit when we know there's only one thing
21:12 pmichaud but I think that whatever .map() returns can't be simply defaulting to Any.elems
21:12 colomon Should these be Any or Cool?
21:12 pmichaud colomon: Any.
21:12 pmichaud the list methods seem to operate outside of the Cool framework.
21:12 TimToady only scalars are Cool :)
21:13 colomon Ah, that explains Any-list.pm.
21:13 colomon :)
21:14 TimToady only scalar *values* are Cool; and iterators are values
21:14 TimToady *aren't
21:14 TimToady gotta get that n't key fixed...
21:15 colomon that's "iterators aren't values", I hope?  :)
21:16 pmichaud TimToady: so, is Any ~~ Positional?  (I think no.)
21:16 pmichaud is it that it simply understands postcircumfix:<[ ]>  without actually being Positional?
21:16 pmichaud *that Any
21:17 TimToady we can probably work it that way
21:17 pmichaud okay.  Otherwise,  @x can potentially bind to any scalar :-)
21:17 TimToady just because a role requires a method doesn't mean it can't be duck-typed outside the role
21:17 pmichaud well, to any Any.  :)
21:18 pmichaud agreed (duck-typed); just wanted to make sure I wasn't making an incorrect assumption
21:19 pmichaud well, I'm now at a mental point where I think a walk around the block and some note-jotting will be most helpful
21:19 pmichaud so, afk
21:19 TimToady nap &
21:21 sjohnson nap at work &
21:21 sjohnson just kidding.. i dont want to get fired
21:23 * PerlJam feels like taking a nap
21:29 sorear TimToady: How do I write an "around" in perl 6?
21:30 sorear sjohnson: move to spain, I hear they're much more enlightened there
21:31 * [Coke] is thankful again for his flexible job. =)
21:32 PerlJam sorear: See S06:2569  (the section on Wrapping)
21:32 jnthn sorear: I think they have a like ~ 20% unemployment rate at the moment. You've a 1/5 chance of being able to spend all day napping there...
21:32 sorear PerlJam: that has absolutely nothing to do with "around"
21:33 jnthn sorear: What exactly are you wanting to do?
21:33 * jnthn doesn't know what "around" is
21:33 arthur-_ joined #perl6
21:33 jnthn It sounds like something you'd achieve with callsame etc though
21:34 sorear jnthn: 'around' et al in Moose are how you use superclass functions
21:34 jnthn sorear: ah, then callsame and friends
21:34 jnthn Or callwith
21:34 sorear class Foo { method bar { ... }; };  class Quux is Foo { around bar { ... } }
21:34 jnthn in Perl 6
21:34 jnthn s/around/method/
21:34 jnthn And then "callsame" where you want to call up to bar
21:35 jnthn er, up to Foo's bar
21:35 jnthn Or callwith to change the args
21:35 sorear Does that work in roles?
21:35 jnthn Yes
21:35 jnthn It iterates over the candidate list
21:35 jnthn Well, that said, by the time you get to dispatch time the role methods don't really play into the equation though.
21:35 jnthn Since composition is flattening.
21:36 sorear excellent
21:36 sorear looks like one of my first perl 6 projects will be a macro library implementing before and after and augment and inner, though
21:36 jnthn :-/
21:36 * jnthn is a bit scared that macros are so longed after
21:37 sorear hey, it'll be a great testbed for the metamodel
21:37 jnthn True :-)
21:37 arthur-_ joined #perl6
21:37 jnthn I didn't mean that specific example, just that I fear macros will be overused when we first get 'em.
21:37 PerlJam sorear: Perl 6's .wrap looks like it's exactly how you would do Moose's around to me.
21:37 * sorear comes from Moose-land, where for hopefully obvious reasons the metamodel is a great deal more mature than even the one specced in S12
21:38 jnthn It's a hunch.
21:38 sorear PerlJam: perl 6 .wrap modifies a method in place
21:38 sorear PerlJam: moose around creates a new, wrapped version of a superclass method and installs it in a subclass method table
21:40 sorear around foo => sub { my ($orig, @args) = @_; ...; $orig->(@args); ... }; == sub foo { my ($self, @args) = @_; ...; $self->SUPER::foo(@args); ... }  but role-aware
21:41 sorear there's also before and after, which only insert code in one space and return the same thing as the original code
21:41 sorear "return the same thing" being fairly fiddly in Perl 5, whatwith downwards context propagation and all
21:41 sorear so it's quite useful to have it in the libraries
21:42 pmichaud .oO( sometimes walks are so helpful to design :-)
21:42 pmichaud *to the design process
21:42 sorear agreed
21:42 sorear except I never got the "block" part down
21:43 sorear people look at me funny when I spent an hour walking in circles mumbling to myself, but it really does help
21:55 hercynium joined #perl6
22:01 ispeak_ joined #perl6
22:01 colomon walks are terrific.  hoping to soon again have a dog that needs to be walked.
22:01 pmichaud colomon: you're welcome to come walk mine.  She's always begging for walks.
22:01 pmichaud We can't even say the word "walk" anymore, we always have to spell it out as w-a-l-k
22:02 pmichaud she also knows "go", because it often precedes the word "walk" :-)
22:03 Guest48560 left #perl6
22:03 colomon pmichaud: if you lived in reasonable driving distance, I'd take you up on that.
22:03 pmichaud gee, I never have trouble with the driving distance to my house.  :-)
22:41 ash___ joined #perl6
22:52 pugssvn r31115 | lwall++ | [STD] don't complain on "%{$count}s" in printf format as if it's a P5ism
23:00 lue ohai
23:02 orafu joined #perl6
23:14 plainhao joined #perl6
23:16 Woody2143 joined #perl6
23:17 lue *chirp*
23:33 pugssvn r31116 | wayland++ | Made some changes based on S05 -- they may even be right :).
23:36 Woody2143 joined #perl6
23:36 sorear TimToady: Is Cursor and $¢ a specified thing in Perl 6.n, or is it strictly an implementation detail?
23:38 TimToady spec, grep for $¢ in S05
23:39 sorear The first mention of Cursor in S05 is before the definition of Cursor
23:40 sorear ah, found it
23:41 sorear hmm
23:43 sorear S05 says that every regex returns a Cursor and <&foo> is "sugar for something like" { $¢ = foo($¢); }
23:43 sorear was this written before the current conception of regexes as returning lists?
23:44 TimToady no, it's just sloppy writing and thinking in ratchet terms
23:44 TimToady every regex returns a list of Cursors, potentially
23:45 TimToady and I don't know how we'd write that inside a block offhand
23:48 TimToady except { return () } fails the current rule
23:49 TimToady and { return $¢.foo() } would return the list that foo returns
23:50 TimToady perhaps we need a block in list context that lazymaps or .[0]'s as appropriate
23:58 sorear why would a block in a regex catch control exceptions?

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

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs