Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-08-31

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:04 kanru joined #perl6
00:06 ting joined #perl6
00:22 hercynium joined #perl6
00:24 dduncan left #perl6
00:34 Caelum joined #perl6
00:42 Limbic_Region joined #perl6
01:20 eternaleye joined #perl6
01:34 Auzon joined #perl6
01:38 [particle] joined #perl6
03:05 literal joined #perl6
03:16 aindilis2 joined #perl6
03:42 sail0r joined #perl6
03:51 bacek_ joined #perl6
04:47 BinGOs joined #perl6
04:54 BinGOs_ joined #perl6
05:16 xuser joined #perl6
05:26 Psyche^ joined #perl6
05:38 alanhaggai_ joined #Perl6
07:03 Myoma joined #PERL6
07:36 abra joined #perl6
07:45 iblechbot joined #perl6
07:50 BinGOs joined #perl6
07:55 zamolxes joined #perl6
08:01 barney joined #perl6
08:37 kowey joined #perl6
08:41 pmurias joined #perl6
09:04 masak joined #perl6
09:29 rff joined #perl6
09:31 iblechbot_ joined #perl6
09:40 elmex joined #perl6
09:50 cmdl1n3 joined #perl6
10:07 rff joined #perl6
10:17 jferrero joined #perl6
10:34 masak perl6: sub f($l) { $l <= 0 ?? '' !! map { $l ~ f($l-1) }, 1..3 }; f(2)
10:34 p6eval pugs: RESULT[("21 1 1", "21 1 1", "21 1 1")]
10:34 p6eval ..rakudo 30669: OUTPUT[maximum recursion depth exceeded␤current instr.: 'f' pc 179 (EVAL_17:69)␤]
10:34 p6eval ..elf 22078: OUTPUT[Unknown rule: infix:conditional␤It needs to be added to ast_handlers.␤ at ./elf_f line 1918␤]
10:42 masak perl6: sub f($l) { $l ?? 0 !! join ''. map { $l ~ f($l-1) }, 1..3 }; f(2)
10:42 p6eval rakudo 30669: OUTPUT[Statement not terminated properly at line 1, near ". map { $l"␤␤current instr.: 'parrot;PGE::Util;die' pc 119 (runtime/parrot/library/PGE/Util.pir:82)␤]
10:42 p6eval ..pugs: OUTPUT[*** ␤    Unexpected " map"␤    expecting ".", "\187", ">>", "=", "^", operator name, qualified identifier, variable name, "...", "--", "++", "i", array subscript, hash subscript or code subscript␤    at /tmp/hKwRQDZvZR line 1, column 32␤]
10:42 p6eval ..elf 22078: OUTPUT[Parse error in: /tmp/T7jpRrFX0B␤panic at line 1 column 12 (pos 12): Missing right brace␤WHERE: sub f($l) { $l ?? 0 !! join ''. map { $l ~␤WHERE:            /\<-- HERE␤  STD_red/prelude.rb:99:in `panic'␤  STD_red/std.rb:255:in `_block_rest'␤  STD_red/std.rb:242:in `block in
10:42 p6eval ..block'...
10:42 masak perl6: sub f($l) { $l ?? 0 !! join '', map { $l ~ f($l-1) }, 1..3 }; f(2)
10:42 p6eval elf 22078: OUTPUT[Unknown rule: infix:conditional␤It needs to be added to ast_handlers.␤ at ./elf_f line 1918␤]
10:42 p6eval ..pugs, rakudo 30669: RESULT[0]
10:56 sri_work joined #perl6
10:57 sri_work joined #perl6
11:04 xinming joined #perl6
11:12 xinming__ joined #perl6
11:16 tessier__ joined #perl6
12:26 ruoso joined #perl6
12:26 alc joined #perl6
12:31 abra joined #perl6
12:37 Lichtkind joined #perl6
12:47 drbean joined #perl6
13:07 ruoso Hello!
13:16 xinming joined #perl6
13:16 kcwu joined #perl6
13:22 masak ruoso: greetings.
13:22 hareldvd joined #perl6
13:36 alanhaggai joined #Perl6
13:37 rindolf joined #perl6
13:45 pmurias joined #perl6
13:45 pmurias ruoso: Hi!
13:46 ruoso hi masak, pmurias...
13:46 masak slow Perl 6 day today.
13:46 masak on #parrot too :/
13:47 * ruoso getting some documentation up-to-date in a $work related projet
13:48 * masak hacking away on the new HTML::Template, but mostly blocking on a Parrot bug
13:49 ruoso pmurias, so.. what do you think about the capture expand thing?
13:50 pmurias getting round to reading it&
13:52 pmurias ruoso: i'm not sure if's better to do a proxy object instead of just merging captures
13:52 * ruoso too ;)
13:52 ruoso that's why I'm asking for other opinions... ;)
13:53 pmurias most of the time captures will be IMHO small
13:53 pmurias so it might be faster to just merge them
13:55 ruoso pmurias, would you like to write the p6 code that would do the merging?
13:59 pmurias plus native captures are expected in a lot of places
13:59 pmurias ruoso: what is simpler for you to implement?
13:59 pmurias ruoso: have to some other $stuff first, i was away on a windsurfing camp this week
14:00 * pmurias tends to have less free time on weekends
14:00 ruoso pmurias, I think keeping native captures is nice, although we have to deal with that some time...
14:00 ruoso I was thinking on taking the "for" implementation
14:00 pmurias i think kp6 implemented for in terms of map
14:02 ruoso pmurias, "for" is actually simple... I just need to ask for .arity of the signature of the code and use the iterator api
14:03 hercynium joined #perl6
14:03 pmurias ruoso: you mean "map"?
14:03 ruoso I understand prefix:<=> takes the next element... but I don't see how prefix:<=> will signalize the end of the iteration..
14:03 ruoso pmurias, no... I did mean 'for'...
14:06 ruoso s/prefix:<=> takes/prefix:<=> returns/
14:10 pmurias hm, for =$iterator {...} is possible, as prefix:<=> returns a lazy list in list context
14:11 pmurias we can turn for @array {...} into @array.map(-> {...})
14:13 ruoso hmmm
14:13 ruoso but for @array is also lazy...
14:13 ruoso I mean...
14:13 ruoso if @array is lazy, obviously...
14:14 masak does the evaluation of a for result in a value?
14:15 ruoso but I was thinking on 'for' in terms of while ($value.has_next) { $code.($value.next) }
14:15 ruoso masak, I don't think so...
14:15 masak so you have to hide that as well. probably not too difficult, though.
14:16 pmurias pugs: my @array = for (1,2,3) {$_};
14:16 p6eval pugs: OUTPUT[*** ␤    Unexpected "@array"␤    expecting "=", context, ":" or "("␤    postfix op␤    at /tmp/kT0buKHxVU line 1, column 4␤]
14:16 pmurias masak: for is not an expression
14:16 masak right. but map is.
14:17 pmurias yes
14:17 masak so there's a bit of an impedence mismatch.
14:17 pmurias no
14:17 masak ...in the sense that a for build on top of a map has to hide the value returned from the map
14:18 pmurias no
14:18 masak ok :)
14:18 pmurias we have void context
14:18 masak ah. ok.
14:20 pmurias ruoso: iterators are just a less powerfull version of lists, so if you have a (lazy) list there is no point in treating it as one
14:20 ruoso as a list you mean... you can treat it only as an iterator...
14:21 ruoso and that's my plan...
14:21 ruoso I mean...
14:21 ruoso in the end I have two options...
14:22 ruoso "for" might start with .[0] and end in the last element...
14:22 ruoso and the other is having an iterator-like api
14:22 ruoso which is .has_next and .next
14:23 ruoso the reason I'm trying to push towards an iterator-like API
14:23 ruoso is to allow navigating in iterators that are not representing index-oriented lists... or unordered lists...
14:23 ruoso or streams...
14:24 ruoso for instance...
14:24 ruoso BerkeleyDB loses a lot of its efficiency if you have to support index-based access
14:24 ruoso it's much more efficient when you have a cursor-based access...
14:24 ruoso that's what I mean...
14:27 pmurias if we implemnt for as .map we still get the efficiency, and it's the simplest way
14:28 pmurias as we have to implement .map anyway
14:29 ruoso right...
14:29 ruoso but anyway... that doesn't answer my question...
14:29 ruoso .map needs to iterate the list anyway...
14:29 ruoso ah...
14:29 ruoso wait...
14:29 ruoso map is implemented by the list itself...
14:30 ruoso now I got it...
14:30 ruoso it's easier...
14:33 ruoso pmurias++... I've just updated the roadmap... now we need unshift, grep and map in the list
14:34 ruoso and for is just a call to .map
14:34 ruoso pmurias, but...
14:34 ruoso map is supposed to be lazy, isn't it?
14:37 ruoso for is supposed to evaluate each item eagerly, isn't it?
14:37 ruoso I mean...
14:37 ruoso it won't expand the list before...
14:38 ruoso but it will execute immediately the code block for every item..
14:39 ruoso while map will only evaluate the block as the returned array is traversed...
14:39 ruoso so that 'map { } grep { } map { } @foo' work as expected
14:42 ruoso I even think that Perl 6 should warn about "useless use of map in void context..."
14:42 ruoso to be clear that map is lazy
14:43 pmurias pugs: my @foo=(1,2,3,4);@foo.map(-> { say $_});
14:43 p6eval pugs: OUTPUT[␤␤␤␤]
14:43 pmurias pugs: my @foo=(1,2,3,4);@foo.map(->($arg) { say $arg});
14:43 p6eval pugs: OUTPUT[1␤2␤3␤4␤]
14:44 pmurias pugs: my @foo=(1,2,3,4);my @bar = @foo.map(->($arg) { say $arg});
14:44 p6eval pugs: OUTPUT[1␤2␤3␤4␤]
14:45 ruoso pugs: my @foo = (1,2,3,4); @foo.map(->($arg) { say $arg }); 'the last statement is returned...'
14:45 p6eval pugs: OUTPUT[1␤2␤3␤4␤]
14:46 pmurias pugs: my @foo=(1,2,3,4);my @bar = @foo.map(->($arg) { say $arg});'last'
14:46 p6eval pugs: OUTPUT[1␤2␤3␤4␤]
14:46 pmurias pugs might be wrong here
14:47 ruoso I think it is...
14:48 pmurias TimToady: does map in void context run the block at all?
14:48 pmurias we can always use "eager @array.map {...}"
14:49 ruoso eager simply iterates the list...
14:50 ruoso causing the lazy list to be evaluated...
14:50 ruoso which brings us to the same problem...
14:51 pmurias all the code blocks will be executed
14:51 ruoso OTOH... I could argue that "for" could be part of the Array API
14:51 ruoso Array.for($code)
14:51 masak pmurias++, ruoso++ # doing cool nitty-gritty stuff
14:51 ruoso pmurias, the problem is how to iterate some list...
14:53 pmurias using iterators you mean?
14:53 ruoso yes...
14:54 ruoso but... I think including .for in the Array API is a very much interesting option...
14:54 jan_ joined #perl6
14:57 pmurias ruoso: i don't now how to get the iterator for a list, iterators are barely specced and probably not encouraged in Perl 6
14:58 ruoso pmurias, yeah... but I'm now convinced "for" should be a method of the Array API
14:58 ruoso ;)
14:58 ruoso and bare "for" is a global sub...
14:59 pmurias a bare for can be just translated to a method call
15:00 ruoso yeah... it's probably better, since it has a special syntax
15:02 * pmurias hates multi tasking, as he ends up doing one thing with half the brain power
15:03 * ruoso out to by drinks for lunch...
15:04 rindolf joined #perl6
15:30 aindilis joined #perl6
15:43 meppl joined #perl6
15:53 idemal joined #perl6
15:59 abra joined #perl6
16:16 iblechbot joined #perl6
16:22 fronty__ joined #perl6
16:38 rindolf joined #perl6
17:12 Myoma joined #PERL6
17:34 Khisanth pugs: my $foo = [ 1 .. 10 ]; say $foo[ 3 .. 8 ]
17:34 p6eval pugs: OUTPUT[456789␤]
17:35 Khisanth pugs: my $foo = [ 1 .. 10 ]; say $foo[ 3 .. 8 ].join( " " )
17:35 p6eval pugs: OUTPUT[4 5 6 7 8 9␤]
17:35 Khisanth pugs: my $foo = [ 1 .. 10 ]; say $foo[ 3 .. $foo.end ].join( " " )
17:35 p6eval pugs: OUTPUT[4 5 6 7 8 9 10␤]
17:38 broquaint joined #perl6
17:52 preflex joined #perl6
17:58 Front_slash left #perl6
18:04 lambdabot joined #perl6
18:08 moritz_ re
18:09 eternaleye joined #perl6
18:10 ilbot2 joined #perl6
18:10 Topic for #perl6is now http://pugscode.org/ | nopaste: http://sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, elf: etc.) (or perl6: for all) | irclog: http://irc.pugscode.org/
18:29 rakudo_svn r30671 | moritz++ | [rakudo] Str.subst can take a closure as second argument
18:30 pugs_svn r22079 | moritz++ | [t/spec] unfudge subst.t for rakudo
18:32 cmdl1n3 left #perl6
18:36 lambdabot joined #perl6
18:54 khisanth_ joined #perl6
18:59 [1]Maghnus joined #perl6
19:18 moritz_ @tell dr_df0 very nice work on the test suite. In future try to separate words in file names with '-', not with '_'; but that's just a minor nit
19:18 lambdabot Consider it noted.
19:24 alester joined #perl6
19:27 rindolf joined #perl6
19:58 rindolf joined #perl6
20:17 shlomif joined #perl6
20:22 moritz_ anyway, dr_df0++ # test suite work
20:23 rakudo_svn r30672 | moritz++ | [rakudo] add 8 more files to spectest_regression, dr_df0++ and others++
20:24 lambdabot joined #perl6
20:58 moritz_ on the train today I a few more posts for my perl-5-to-6 blog
20:58 moritz_ and I now I have to restrain myself from publishing them all at once
20:58 moritz_ (but I know that I won't have the time to write enough this week)
20:59 moritz_ ;-)
21:10 wknight8111 joined #perl6
21:11 ibo2go joined #perl6
21:17 Chillance joined #perl6
22:43 lambdabot joined #perl6
23:03 explorer__ joined #perl6
23:06 BinGOs joined #perl6
23:26 _Chillance_ joined #perl6
23:28 _Chillance_ joined #perl6
23:41 lambdabot joined #perl6
23:54 meppl good night

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

Perl 6 | Reference Documentation | Rakudo