Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-06-09

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:20 eternaleye_ joined #perl6
00:23 ihrd joined #perl6
00:23 frew|work joined #perl6
00:23 ihrd left #perl6
00:27 snarkyboojum joined #perl6
00:29 bacek joined #perl6
00:33 _Nike_ joined #perl6
00:33 _Nike_ hello
00:35 unitxt left #perl6
00:35 xinming joined #perl6
00:52 xinming_ joined #perl6
00:54 sri_kraih_ joined #perl6
00:55 agentzh joined #perl6
00:57 xinming_ joined #perl6
01:02 xinming__ joined #perl6
01:38 Sark23 hi
01:39 TimToady howdy
01:39 Sark23 can i use rakudo do make a cms on web or index robot ?
01:39 Sark23 Or have this many bugs
01:40 TimToady yes, and yes :)
01:40 TimToady but there's already a wiki
01:40 TimToady see http://perl6-projects.org for other ideas
01:41 Sark23 thx
01:47 kcwu joined #perl6
01:58 meppl joined #perl6
02:03 mycelium joined #perl6
02:03 mycelium left #perl6
02:03 mycelium joined #perl6
02:06 snarkyboojum joined #perl6
02:10 frew_ joined #perl6
02:10 simcop2387 joined #perl6
02:34 om454545445 joined #perl6
02:42 om454545445 left #perl6
02:43 om454545445 joined #perl6
02:43 om454545445 hi guys
02:54 unitxt joined #perl6
02:56 cotto joined #perl6
02:56 JDlugosz joined #perl6
02:57 JDlugosz Hello
03:15 jdv79 where are modules written in p6?
03:17 s1n jdv79: scattered, mostly github for now
03:17 s1n jdv79: there's not much yet either
03:20 donaldh joined #perl6
03:21 jdv79 iirc there were a bunch dev'd in the pugs era - what about them?
03:21 s1n jdv79: i'm sure they don't compile anymore
03:21 jdv79 sad
03:21 s1n jdv79: not sad, it's advancement
03:22 jdv79 i guess.  that was a lot of effort though.
03:24 s1n nothing is static, even the mona lisa is falling apart
03:34 snarkyboojum joined #perl6
03:34 amoc joined #perl6
03:39 alester joined #perl6
03:42 Eevee joined #perl6
03:48 frew|work joined #perl6
03:51 s1n rakudo: class A { has $.foo = 'bar'; multi method foo(Str $test) { say $test }}; my $a = A.new; $a.foo("oh hai")
03:51 p6eval rakudo 063f3d:  ( no output )
03:51 s1n so the $.foo is not a multi method?
03:56 JDlugosz s1n:  good question.  I can see why you would want it to be.  Normally the auto-generated accessor is supressed if you write your own.  The multi should not affect that.  It's just confusing and pointless.
03:57 jdv79 does p6 have an explicit MOP?
03:58 meppuru joined #perl6
04:02 pyrimidine joined #perl6
04:03 c9s joined #perl6
04:05 pyrimidine s1n: that last line gives me a bus error for some reason
04:05 pyrimidine (locally)
04:05 pyrimidine rakudo: class A { has $.foo = 'bar'; multi method foo(Str $test) { say $test }}; my $a = A.new; $a.foo("oh hai")
04:05 p6eval rakudo 063f3d:  ( no output )
04:05 pyrimidine but this works:
04:05 pyrimidine rakudo: class A { has $!foo = 'bar'; multi method foo(Str $test) { say $test }}; my $a = A.new; $a.foo("oh hai")
04:05 p6eval rakudo 063f3d: OUTPUT«oh hai␤»
04:06 s1n pyrimidine: that's because $!foo doesn't generate any accessors
04:06 pyrimidine yep
04:06 * s1n files bug
04:09 pyrimidine jdv79: http://feather.perl6.nl/syn/S12.html#Introspection
04:12 jdv79 thanks
04:14 JDlugosz Shouldn't that be Ojai?
04:29 jdv79 frew_: around?
04:43 netfish joined #perl6
04:43 kate21de joined #perl6
04:53 jdv79 ah, looks like rakudo is fronting directly for the parrot metaobject or something
04:55 cotto joined #perl6
04:56 Sark23 joined #perl6
05:10 c9s joined #perl6
05:12 eternaleye joined #perl6
05:21 pugs_svn r27041 | lwall++ | [examples] first whack at modernization to STD standards
05:56 frew|work joined #perl6
06:02 synth joined #perl6
06:20 hanekomu joined #perl6
06:51 mberends joined #perl6
06:55 sri_kraih joined #perl6
06:55 DemoFreak joined #perl6
06:56 unitxt left #perl6
06:57 dakkar joined #perl6
06:58 viklund joined #perl6
07:00 eternaleye joined #perl6
07:06 eternaleye joined #perl6
07:22 donaldh joined #perl6
07:25 viklund_ jnthn: When will we be able to .wrap multis? ;)
07:30 mberends viklund_, although jnthn++ is physically near Bratislava, his brain is usually in a somewhat later timezone (he's a nocturnal animal) ;)
07:43 agentzh joined #perl6
07:43 moritz_ oh hai
07:44 mberends oh hai, howz vacation?
07:46 moritz_ fine
07:52 moritz_ we took great pictures, but it'll take me a week or so to upload them in a reasonable format
07:52 Matt-W Good morning #perl6
08:02 clintongormley joined #perl6
08:10 pugs_svn r27042 | lwall++ | [examples] more STD cleanup
08:15 cls_bsd joined #perl6
08:19 xinming joined #perl6
08:21 b_jonas joined #perl6
08:29 barney joined #perl6
08:35 payload joined #perl6
08:43 s1n joined #perl6
08:57 masak joined #perl6
08:59 alexn_org joined #perl6
09:04 masak I wrote two patches at home last night. I'm happy to see that pmichaud++ already wrote one of them independently and committed it. :)
09:05 mberends great minds think alike!
09:05 masak the other one, however... should 'prompt' warn of a use of an uninitialized value when the user presses ^D>
09:05 masak s/>/?/
09:06 mberends probably no, because EOF should also return an empty string
09:07 masak here's my patch: http://gist.github.com/126373
09:07 masak I'll run spectests now; I suspect it won't break anything.
09:08 hv2 joined #perl6
09:09 DanielC joined #perl6
09:09 DanielC moin
09:09 mberends is it ok that the two returns give two different types?
09:09 masak moin, DanielC.
09:09 DanielC mberends is here!
09:09 DanielC hi masak  o/
09:10 masak mberends: it probably wouldn't be if prompt was typed. I'll have a look what the spec says about it.
09:10 mberends DanielC is here too! o/
09:10 DanielC mberends: Let me know when you  have a chance to talk about modules.
09:11 masak S32/IO.pod says '--> Str'.
09:11 masak jnthn++ will know what to do. maybe I should wait until he arrives.
09:12 mberends DanielC: thanks for the research about indexes etc yesterday, it was really useful. The three file concept ticks all the boxes afaics.
09:14 DanielC mberends: I can also suggest a ridiculously easy implementation of a "hash table".  If the Fletcher-16 hash of "Foo::Bar" is a03b then its metadata is in a0/3b.yml
09:15 DanielC That file then contains the information about all modules that share that hash.
09:15 mberends DanielC: seeking into a single packages.yml would delievr the same, but faster
09:15 DanielC ok
09:16 hanekomu joined #perl6
09:16 mberends but yes, YAML format will make the metadata searchable
09:17 mberends the idea of using the built in Parrot hash is brilliant
09:17 jnthn o/
09:18 DanielC :-)
09:18 DanielC jnthn o/
09:18 DanielC mberends: I see that you backlogged. :)
09:18 * DanielC wonders if "backlogging" is the correct term
09:18 mberends DanielC, always backlog #perl6. correct
09:19 * mberends used to backlog slashdot, but got bored with it
09:19 jnthn (typed returns) undef ia always (aside from native types) fine, you can still write returns Str and return an undef.
09:20 jnthn rakudo: sub foo($x) returns Str { return $x ?? "lol" !! undef }; say foo(1); say foo(0);
09:20 p6eval rakudo 063f3d: OUTPUT«lol␤Type check failed on return value␤in sub foo (/tmp/tetKZLez5P:2)␤called from Main (/tmp/tetKZLez5P:2)␤»
09:20 jnthn But Rakudo has a bug there.
09:21 jnthn (There's a ticket IIRC, just didn't get to it yet.)
09:22 mberends s/to it/tuit/
09:23 DanielC mberends: jnthn tried to explain to me the implications of the Parrot hash idea. In the end it wasn't clear to me if there was a good way to implement the idea (I had to leave before I could ask more).
09:24 mberends DanielC, it looked very feasible. If the freeze/thaw is already partly built in, there's much less work to do.
09:26 DanielC You see, I don't fully get the freeze/thaw part...
09:26 jnthn I think there's freeze/thaw ops evne.
09:26 * jnthn gotta have phone call with $CLIENT and sort a few bits out, back in a bit.
09:26 mberends there may be some concurrency issues (changing the oil while the engine is running) but not worse than any other approach
09:26 DanielC ok
09:27 DanielC I think I understand better now.
09:28 mberends DanielC, I'll be afk intermittently (and backlogging), but shall we read the Parrot docs? I've made a start...
09:29 DanielC sure
09:29 DanielC I'll be afk too... my computer is acting up.
09:29 mberends ok
09:29 * DanielC has to kill X
09:30 sbp left #perl6
09:30 sbp joined #perl6
09:30 hv2 rakudo: our($a, $b) = "test" ~~ /(e)(s)/; say (~$a).perl, (~$b).perl;
09:31 p6eval rakudo 063f3d: OUTPUT«"e""s"␤»
09:31 hv2 our($a, $b) = map {~$_}, "test" ~~ /(e)(s)/; say (~$a).perl, (~$b).perl;
09:31 hv2 rakudo: our($a, $b) = map {~$_}, "test" ~~ /(e)(s)/; say (~$a).perl, (~$b).perl;
09:31 p6eval rakudo 063f3d: OUTPUT«Use of uninitialized value␤"es"""␤»
09:32 hv2 I was expecting the second to output the same as the first, is the problem me thinking that list context is the same as in p5?
09:32 DanielC joined #perl6
09:35 hv2 (I notice also that the map spectests only ever provide an array variable for the map BLOCK, LIST form, so I can't discern it from those.
09:42 dakkar rakudo: our($a, $b) = map {~$_}, ("test" ~~ /(e)(s)/); say $a.perl, $b.perl;
09:42 p6eval rakudo 063f3d: OUTPUT«"es"undef␤»
09:43 dakkar uh…
09:43 dakkar rakudo: ("test" ~~ /(e)(s)/).perl
09:43 DanielC joined #perl6
09:43 p6eval rakudo 063f3d:  ( no output )
09:44 dakkar rakudo: say ("test" ~~ /(e)(s)/).perl
09:44 p6eval rakudo 063f3d: OUTPUT«Match.new(␤ # WARNING: this is not working perl code␤ # and for debugging purposes only␤ ast  => "es",␤ Str => "es",␤ from => 1,␤ to   => 3,␤ positional => [␤  Match.new(␤    ast  => "e",␤    Str => "e",␤    from => 1,␤    to   => 2,␤   ),␤  Match.new(␤    ast  => "s",␤    Str
09:44 p6eval ..=> "…
09:45 dakkar the match returns a single Match object?
09:45 dakkar and then the assignment upacks the positionals?
09:46 hv2 Not when you assign to a list:
09:46 hv2 oh
09:46 dakkar IIRC it's not exactly a list…
09:47 hv2 so is there a least ugly way to get the two captured strings into the two variables?
09:48 b_jonas what's wrong with using $1 and $2 ?
09:48 dakkar rakudo: say map {" >${_}< "} ("test" ~~ /(e)(s)/)[]
09:48 p6eval rakudo 063f3d: OUTPUT«Can't use $ as non-variable in interpolated string at line 2, near "${_}< \"} ("␤in Main (src/gen_setting.pm:0)␤»
09:48 b_jonas I almost always use those and almost never use non-g match in list context in perl5
09:48 dakkar rakudo: say map {" >" ~ $_ ~ "< "} ("test" ~~ /(e)(s)/)[]
09:48 p6eval rakudo 063f3d: OUTPUT«Statement not terminated properly at line 2, near "(\"test\" ~~"␤in Main (src/gen_setting.pm:0)␤»
09:48 dakkar rakudo: say map {" >" ~ $_ ~ "< "}, ("test" ~~ /(e)(s)/)[]
09:49 p6eval rakudo 063f3d: OUTPUT« >e<  >s< ␤»
09:49 * dakkar keeps forgetting the syntax
09:49 hv2 I didn't want to split a perfectly simple p5 statement over two lines.
09:49 dakkar hv2: http://perlcabal.org/syn/S05.html#Match_objects
09:49 hv2 ah, []
09:49 dakkar or an array cast:
09:49 b_jonas oh yeah
09:49 dakkar rakudo: say map {" >" ~ $_ ~ "< "}, @("test" ~~ /(e)(s)/)
09:50 p6eval rakudo 063f3d: OUTPUT« >e<  >s< ␤»
09:50 b_jonas in ruby, that would be written as "test" =~ /(e)(s)/ and $~.captures
09:50 hv2 Coolness, thanks dakkar.
09:50 b_jonas because the plain .to_a method returns the whole match ($&) as first element as well
09:50 dakkar rakudo: "test" ~~ /(e)(s)/; say map {" >" ~ $_ ~ "< "}, @()
09:50 p6eval rakudo 063f3d: OUTPUT« >e<  >s< ␤»
09:51 dakkar where @() is a shorthand for @($/) (the match object, cast to array)
09:51 b_jonas hmm
09:51 b_jonas funny shorthand
09:53 dakkar my ($second,$first)=("test" ~~ /$first = (e) $second = (s)/); say ~$first; say ~$second
09:53 dakkar rakudo: my ($second,$first)=("test" ~~ /$first = (e) $second = (s)/); say ~$first; say ~$second
09:53 p6eval rakudo 063f3d: OUTPUT«s␤e␤»
09:53 dakkar hmm
09:53 b_jonas but in p6, doesn't the ~~ operator return the match object anyway?
09:54 dakkar b_jonas: yes
09:54 b_jonas so then can't you @("test" ~~ /re/)
09:54 dakkar yes
09:54 b_jonas oh you can
09:54 b_jonas you showed that above
09:54 hv2 With ref to the S05 spec, I suspect I actually need to read more elsewhere about context: I was expecting the phrase "when used as an array" to mean something very like p5's list context, and expected therefore to get it provided by the map.
09:54 b_jonas of course there's not much point, usually you need $/ anyway because you want to boolean match the match anyway
09:55 dakkar hv2: as far as I understand (which is isn't very far), "list" and "array" are more different in p6 than in p5
09:55 b_jonas that's why I'm using $1 etc normally, there's no easy way to test for a match and use the captures easily in one expression using only the lest
09:55 b_jonas I think they're less different, or different in a different way
09:56 hv2 b_jonas: in this case I'm unpacking elements of a literal array in the code, so I have no doubts about the boolean result of the match.
09:56 b_jonas p6 has a notion of a list somewhat similar to that in both maple and mathematica (though you rarely see them in mathematica explicitly)
09:56 b_jonas hv2: sure
09:56 dakkar b_jonas: something like «my ($a,$b);if (($a,$b) = ("test" =~ /(e)(s)/)) { print "-$a-$b-\n" }» ? (perl 5)
09:56 b_jonas hv2: I didn't even say "never", I sometimes use the list match too
09:57 b_jonas dakkar: yes, I guess that might work,
09:57 dakkar and yes, it looks conovulted
09:57 b_jonas dakkar: but then why assign to temps $a and $b if I can just use $1 and $2
09:57 b_jonas dakkar: you can put the my inside btw, like if (my($a, $b) = $test =~ /(e)(s)/) { ... }
09:57 dakkar sure
10:00 mj41 joined #perl6
10:08 phenny joined #perl6
10:09 Scorp1us joined #perl6
10:10 agentzh joined #perl6
10:12 payload joined #perl6
10:15 pmurias joined #perl6
10:21 StephenPollei joined #perl6
10:32 DemoFreak joined #perl6
10:32 masak jnthn: ok, committing. the spectest run didn't turn up anything frightful.
10:32 masak s/committ/push/
10:33 payload1 joined #perl6
10:33 mberends it will be nice if more of us get into PIR programming :)
10:34 hv2 it will be nice if more of us get into perl6 programming :)
10:35 mberends heh
10:37 dalek rakudo: fa4198c | masak++ | src/builtins/io.pir:
10:37 dalek rakudo: [src/builtins/io.pir] removed 'prompt' undef warning
10:37 dalek rakudo: When ^D is pressed in a 'prompt' call, a non-optional undef warning
10:37 dalek rakudo: was issued. Fixed this.
10:37 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/fa4198c91810000771313e6659d87e8f918d64e1
10:38 masak mberends, hv2: less talking, more coding! :P
10:38 mberends what can I say? nothing, apparently ;)
10:39 mberends masak is starting to behave like pmichaud
10:40 masak mberends: you're still talking? why aren't you coding? :)
10:40 mberends (gulp)
10:42 DanielC PIR does not seem to have an fseek()
10:43 mberends DanielC, seek()
10:43 DanielC Where is it? I didn't see it in the docs.
10:44 mberends http://docs.parrot.org/parrot/latest/html/docs/book/ch10_opcode_reference.pod.html
10:44 DanielC ok
10:44 Matt-W masak: calm down, it's only IRC :)
10:44 masak Matt-W: :)
10:46 DanielC mberends: I wonder if there is a way to set the file position to a given *line* number (rather than a given byte offset).
10:46 hv2 In the absence of adverbial modifiers, is there any way to get the effect of :g without an explicit loop?
10:46 DanielC mberends: That would be for reading the packages.yml file.
10:47 mberends DanielC, no, there ain't, but the index will store byte offsets
10:47 DanielC ok
10:48 hv2 my $s = 'xyzzy'; my $t; while $t = $s.subst(/z/, 'a') { last if $s eq $t; $s = $t }; say $t;
10:48 hv2 There must be an easier way than that to perform all substitutions, surely ...
10:49 DanielC Since we are using an index anyways, maybe it makes sense for it to store byte offsets for both the data file and the YAML metadata file.
10:50 DanielC hv2:   :global ?
10:50 hv2 Where? we don't have adverbial modifier support yet, I believe.
10:50 DanielC hv2: Why can't you say $s = $s.subst(/z/, 'a', :global) ?
10:50 DanielC yes, we do.
10:51 hv2 oh, as a separate argument
10:51 DanielC At least, rakudo does.
10:51 hv2 Gotcha, I didn't know they could go there, was looking for m:g/z/.
10:51 DanielC np
10:53 payload joined #perl6
10:53 mberends DanielC, it would probably be generally more efficient to has only the module name, and use the YAML for :ver :auth etc, because of possible wildcard searches. Therefore only the YAML file would carry the offsets to the versioned modules. We'll need to check this point though.
10:53 mberends *hash
10:54 * DanielC slaps his head
10:54 DanielC yeah
10:54 DanielC $P0["Foo::Bar"]
10:56 payload2 joined #perl6
10:59 mberends DanielC, I suggest we try a bottom up trial implementation completely outside of Rakudo, but presenting a Rakudo-friendly API. It will have to be heavily tested with realistic amounts of content before proposing it for inclusion in Rakudo. I'd like to set up a Gitorious repo for that, ok?
11:00 DanielC Sure... what is gitorious?
11:00 DanielC You are the expert here.
11:00 DanielC I'm happy to follow your lead.
11:00 masak mberends: you're implementing it in Perl 6, right?
11:00 mberends DanielC, another git sharing site
11:01 DanielC ok
11:01 mberends masak, no! PIR!
11:01 masak mberends: might still be a good idea to refer to it from proto, no?
11:01 masak maybe your new HTTP::Daemon too.
11:02 mberends masak: aha, the proto is always involved ;) Daemon is already referred.
11:03 masak oh, I see it is.
11:03 masak also, I'm thinking of rewriting the different sharting sites (github, googlecode, gitorious) as classes.
11:03 masak that way, we can use polymorphism when we install/update.
11:04 masak leading to cleaner code.
11:04 mberends good idea, we bikeshedded that earlier but didn't implement
11:04 masak I'll see if I can start doing that today in a local branch.
11:04 jnthn rakudo: Array.^parents>>.perl>>.say
11:04 p6eval rakudo fa4198: OUTPUT«Any␤Object␤»
11:04 jnthn rakudo: Str.^parents>>.perl>>.say
11:04 p6eval rakudo fa4198: OUTPUT«Any␤Object␤»
11:04 jnthn yay
11:05 masak jnthn++
11:05 jnthn rakudo: Str.^methods>>.name>>.say
11:05 p6eval rakudo fa4198: OUTPUT«Method 'name' not found for invocant of class 'Sub'␤»
11:05 jnthn uff
11:05 jnthn rakudo: List.^methods>>.name>>.say
11:05 p6eval rakudo fa4198: OUTPUT«invoke() not implemented in class 'ResizablePMCArray'␤in Main (src/gen_setting.pm:3225)␤»
11:05 jnthn ewww!
11:05 masak :(
11:05 jnthn masak: I spent a while improving .^parents last night.
11:06 masak it shows. :)
11:06 jnthn masak: Today methods gets the treatment, plus an expanded test file.
11:06 masak sounds good.
11:06 jnthn masak: Well, I got 40 tests for .^parents now. and didn't even write those for :tree yet, which is the missing bit.
11:06 jnthn coverage++
11:06 masak indeed.
11:06 jnthn Still need .^roles and .^attributes doing too.
11:06 * masak starts on today's TODO list
11:09 lichtkind joined #perl6
11:11 payload joined #perl6
11:18 masak rakudo: my @a = $b; my $b = 5
11:18 p6eval rakudo fa4198: OUTPUT«Null PMC access in isa()␤in Main (/tmp/bE1KkmjXJS:2)␤»
11:18 masak ewww.
11:19 masak can you put subs in a grammar? how do you call such a sub?
11:19 masak can you put methods in a grammar? can you put methods outside of classes?
11:19 jnthn Yes, we already have a gazillion tickets on the "oh noes I use a variable before declaring it and it hurts" issue :-)
11:19 jnthn subs in a grammar - yes, it's just like putting a sub in any other kind of package
11:19 jnthn methods in a grammar - sure.
11:19 masak jnthn: yes, I know. "don't do that, then.: :)
11:20 jnthn methods outside of classes - yes anonymous ones at least.
11:20 masak jnthn: how do I call a method-in-a-grammar?
11:20 masak rakudo: sub foo(--> Array of Str) { my Str @a = <foo bar baz>; @a }; foo
11:20 jnthn A grammar is just a class, so when you instantiate the grammar you call methods on the intance.
11:20 p6eval rakudo fa4198: OUTPUT«Use of type object as value␤Type check failed on return value␤in sub foo (/tmp/mLLU4z660S:2)␤called from Main (/tmp/mLLU4z660S:2)␤»
11:21 masak jnthn: ok.
11:21 masak rakudo: grammar A { method foo() { say "OH HAI" } }; A.new.foo
11:21 p6eval rakudo fa4198: OUTPUT«too few arguments passed (1) - 3 params expected␤in Main (/tmp/ovJk1WFc8L:2)␤»
11:21 masak jnthn: so that _should_ work, right?
11:22 jnthn I'm not sure
11:22 * masak submits rakudobug
11:22 jnthn It maybe is not Rakudo bug
11:22 jnthn rakudo: grammar A { }; A.new
11:22 masak but based on what you just said...
11:22 p6eval rakudo fa4198: OUTPUT«too few arguments passed (1) - 3 params expected␤in Main (/tmp/t2oLQ5Yelv:2)␤»
11:22 masak oh.
11:22 jnthn It's nothing to do with methods.
11:22 donaldh joined #perl6
11:22 masak seems you're right.
11:22 jnthn It's about what parameters the constructor wants.
11:22 masak and that's OK, because Grammar overrides new, I guess.
11:23 jnthn Yes, though whether it's overriding of new conforms to the spec, or whether it's spec'd, I couldn't tell you without digging into S05.
11:23 lichtkind is @() still in the spec?
11:23 masak lichtkind: yes.
11:23 masak lichtkind: just not the @ listop.
11:23 jnthn grammar A { method foo() { say "OH HAI" } }; A.new("foobarbaz").foo
11:24 jnthn rakudo: grammar A { method foo() { say "OH HAI" } }; A.new("foobarbaz").foo
11:24 p6eval rakudo fa4198: OUTPUT«OH HAI␤»
11:24 jnthn rakudo: grammar A { has $.a = "OH HAI"; method foo() { $.a } }; A.new("foobarbaz").foo
11:24 lichtkind masak: i mean the special variables that holds the positional regex match groups
11:24 p6eval rakudo fa4198:  ( no output )
11:24 jnthn rakudo: grammar A { has $.a = "OH HAI"; method foo() { say $.a } }; A.new("foobarbaz").foo
11:24 p6eval rakudo fa4198: OUTPUT«Use of uninitialized value␤␤»
11:24 jnthn Now _that_ is rakudobug.
11:24 masak lichtkind: I think so, yes.
11:25 * masak submits rakudobug
11:47 awwaiid Greetings. Someone mentioned to me relatively recently that Pugs is still the most feature-complete implementation of perl6. I have the feeling that they were wrong, but nothing to point at to decide how much more "complete" rakudo is. Any suggestions?
11:47 masak awwaiid: I suggest you download Pugs and Rakudo, and compare.
11:48 masak awwaiid: maybe decide beforehand what a good measure for 'complete' would be.
11:48 DanielC Do we have a measure of how many spec tests Pugs passes vs Rakudo?
11:48 masak yes.
11:48 skids_ some features have more tests than others, though.
11:48 awwaiid masak, good advice to be sure. I was hoping to shortcut that :)
11:49 DanielC masak: Where do we get that information for Pugs?
11:49 skids_ I think once laziness arrives then there will be no question about it.
11:49 masak awwaiid: well, the shortcut I usually takes in this matter is "does it really matter?" :)
11:49 DanielC awwaiid: I think we can shortcut that, if we can figure out how many tests Pugs passes.
11:49 jnthn awwaiid: I think that Rakudo and Pugs both have a lot of features. In many places they interesect. In other areas, there are things that one does that the other doesn't.
11:50 masak DanielC: I guess you could try and run the test suite on Pugs.
11:50 DanielC awwaiid: What masak said. :-)
11:50 masak it's likely to be... interesting.
11:50 jnthn awwaiid: For example, Rakudo's handling of roles and types is way beyond that of Pugs. On the other hand, Pugs probably is a bit ahead on laziness.
11:50 DanielC masak: I might do that, just for curiosity. Why interesting?
11:50 jnthn ('cus Rakudo doesn't do that at all yet)
11:50 skids_ Though it's slightly unfair in that it will fail a few stupid easily fixed things where the name of something just changed in the spec.
11:50 awwaiid masak, it matters for advocacy on the progress of various perl6 implementations
11:51 skids_ e.g. Str.flip
11:51 masak DanielC: because it's probably not been done in a while. bit rot, and all that.
11:51 DanielC jnthn: Being implemented in Haskell, Pugs should be ahead in laziness.
11:51 jnthn DanielC: Right.
11:51 DanielC masak: Ok.
11:51 jnthn DanielC: It comes easier there I guess. :-)
11:51 DanielC y
11:51 masak awwaiid: ah, that's why I can't really be bothered to care about it. I see. but you go on. :)
11:52 DanielC awwaiid: My understanding is that most of the activity is in Rakudo right now.
11:52 masak it is.
11:53 masak and sm0p, and STD.pm...
11:53 masak and Elf, I think...
11:53 masak basically all implementations except Pugs.
11:53 skids_ What was mcharity's decision as to the trajectory of elf?  Is it going to try to merge with smop?
11:53 synth joined #perl6
11:54 awwaiid masak, advocacy is important! I've been going around with a terminal and a big font and show people rakudo, and every now and then they bring up pugs (as I mentioned). I want to encourage people to participate but when someone is like doesn't-pugs-do-that-years-ago I want an accurate response. But I agree that such knowledge / response isn't required
11:54 skids_ (I got that right, right elf is mcharity's mostly?)
11:55 masak awwaiid: oh, sure, don't get me wrong. advocacy is important, no doubt.
11:55 awwaiid ya, cool. thanks for the info, I'll poke at pugs a bit sometime to see for myself as you advise :)
11:56 masak awwaiid: it's just that I don't feel my response to people's questions about Pugs has to involve exact numbers. I just say 'yes, that was the Golden Age. no-one is working on Pugs right now' and leave it at that.
11:56 skids_ "It isn't even keeping up with spec changes" might do it.
11:57 ruoso joined #perl6
11:57 masak yes, and my lack of interest in the Pugs 'progress' is predicated on such things.
11:57 masak it used to be Pugs was the cool Perl 6 implementation. now it's a historical curiosity. at least until someone picks it up again.
11:57 Sunbeam joined #Perl6
11:58 ruoso Hello!
11:58 ruoso pmurias, hi
11:59 mberends by recent trends, the Rakudo Christmas will probably come before the Pugs Christmas
12:04 Util joined #perl6
12:07 masak hopefully, the u4x Christmas will be reasonably finished by then...
12:08 masak speaking of which; literal: ping.
12:08 b_jonas I preferred Harry Potter birthdays – but of course not everyone has those, while everyone has Christmas at the same time
12:10 xinming_ joined #perl6
12:10 hv2 rakudo: my $s = 'x'; 'x' ~~ m/$s/;
12:10 p6eval rakudo fa4198: OUTPUT«Null PMC access in get_string()␤in regex PGE::Grammar::_block52 (/tmp/47O9zrxq1O:1)␤called from Main (/tmp/47O9zrxq1O:2)␤»
12:10 pyrimidine joined #perl6
12:11 pmurias_ joined #perl6
12:18 masak hv2: whoa! is that a known one?
12:19 masak oh wait.
12:19 masak it is.
12:19 masak it's the 'variables aren't interpolated in regexes' TODO bug.
12:21 masak mberends: I got an account on Gitorious, but I can't figure out how to clone/pull-request. so I'll just give you the patch directly: http://gist.github.com/126450
12:21 payload joined #perl6
12:27 lichtkind mberends: i largely expandet appendix B please clean up some corners in the meta op section if you like i leave now :)
12:28 yves joined #perl6
12:33 pugs_svn r27043 | wayland++ | [S12] A heirarch must be the heir of a lord or king or something.  Anyway,
12:33 pugs_svn r27043 | wayland++ |       I've killed him and replaced him with a hierarch :).
12:39 hv2 Cool, I have the first part of my program ported. Unfortunately, the main loop (scanning over a dictionary testing each word against a regex) is a bit slow, and a bit large - taking just the first 100k words (about 1MB) the program takes 123s and grows to 450MB. :(
12:41 DanielC Does Parrot support 64-bit arithmetic? e.g. can to xor two 64-bit values?
12:41 hv2 Taking the first 10k words, it runs for 13.7s and grows to 150MB, so it may just be the nature of the gc that's letting it grow so much.
12:44 masak wayland++ # but really, "fixed typo" is enough :P
12:44 Matt-W hv2: very little in the way of speed and size optimisation work has been done, so I'm not really surprised
12:49 masak although chromatic++ has been at it lately, judging from his blog posts.
12:49 * jnthn afk, slovak
12:50 rjh DanielC: seems rakudo coerces to double once you reach 2**50
12:50 DanielC rjh: Thanks.
12:52 masak jnthn: veľa šťastia!
13:06 * Matt-W twists his brain into Perl 5 mode
13:07 pmurias joined #perl6
13:07 pmurias ruoso: hi
13:07 ruoso pmurias, have you created the GSoC blog already?
13:11 pmurias ruoso: i have created it (pmurias.livejournal.com), put i still have to write the first blog post :(
13:12 ruoso that's cool... I'll just update the GSoC wiki page
13:13 pmurias where does the GSoC wiki live?
13:14 ruoso http://www.perlfoundation.org/perl5/index.cgi?gsoc
13:14 ruoso hmm... for some reason it doesn't accept the change...
13:17 PhatEddy joined #perl6
13:18 hv2 masak: which chromatic blog posts? all I can see are 6perl minutes, in which he mostly says very little himself.
13:18 masak hv2: hm, I'll see if I can dig up some. I've read a few lately, it seems. but I'm over a month behind on my blog reading.
13:19 hv2 Ah ok, I didn't look that far back.
13:19 pmurias ruoso: i updated the wiki page
13:19 PhatEddy rakudo: class Foo { $!a }
13:19 p6eval rakudo fa4198: OUTPUT«Lexical 'self' not found␤»
13:19 ruoso pmurias, alright...
13:19 PhatEddy rakudo: class Foo { has $!a, $!b }
13:19 p6eval rakudo fa4198: OUTPUT«Lexical 'self' not found␤»
13:19 ruoso mildew: say "Alive!"
13:19 p6eval mildew: OUTPUT«Bareword found where operator expected at perl6-snapshot/STD.pm line 4, near "$LANG is"␤  (Missing operator before is?)␤Bareword found where operator expected at perl6-snapshot/STD.pm line 5, near "$PKGDECL is"␤   (Missing operator before is?)␤Bareword found where operator expected
13:19 p6eval ..at…
13:19 masak hv2: http://use.perl.org/~chromatic/journal/38992 and http://use.perl.org/~chromatic/journal/38931
13:19 PhatEddy rakudo: class Foo { has ($!a, $!b) }
13:19 p6eval rakudo fa4198:  ( no output )
13:20 ruoso pmurias, do you think you could fix the evalbot?
13:20 hv2 masak: cool, thanks
13:20 amoc joined #perl6
13:20 ejs joined #perl6
13:20 PhatEddy I find the "Lexical 'self' not found" error impossibly obscure.  No ??
13:21 masak PhatEddy: no, why?
13:21 masak PhatEddy: come back! :)
13:21 pmurias ruoso: i can try
13:22 PhatEddy joined #perl6
13:23 synth joined #perl6
13:24 PhatEddy joined #perl6
13:30 Matt-W Amazing how quickly you get used to Perl 6
13:30 Matt-W I keep writing "self.getline()"
13:30 Matt-W which PErl 5 doesn't line
13:30 Matt-W like*
13:32 masak Matt-W: we need a Perl 6 emulation module on CPAN. :)
13:32 hv2 I tried to write 'while <$*IN>', which perl6 doesn't like, or rather likes for all the wrong reasons ...
13:34 pmurias masak: like v6.pm?
13:35 masak pmurias: aye... how does v6.pm work, again?
13:36 ruoso masak, it uses Module::Compile to generate p5 code from p6 code....
13:37 masak aha.
13:37 hanekomu joined #perl6
13:38 ruoso masak, but there was a weirdier plan to use B:: modules to generate p5 optree directly from the source...
13:39 ruoso which would allow natural debugging
13:39 masak sounds ambitious.
13:39 ruoso but it kinda lost moment when it became clear that p5 just can't provide all the semantics p6 needs
13:40 masak indeed. it's hard to both emulate forwards and break backwards compatibility.
13:41 Matt-W masak: I need to go to the future!
13:42 masak Matt-W: tag along, we're going there too!
13:43 Matt-W yay!
13:43 hv2 I want to go, but I don't have enough time :(
13:43 mizioumt joined #perl6
13:44 frew|work joined #perl6
13:47 b_jonas hv2++ lol
13:49 Whiteknight joined #perl6
13:56 decasm_parked joined #perl6
13:58 neisen joined #perl6
13:59 neisen left #perl6
14:01 FurnaceBoy hv2, sit tight, the future comes to you
14:02 pugs_svn r27044 | pmurias++ | [re-smop] restored the $reg = ... form in m0ld
14:03 masak The Future: Soon in a Theater Near You!
14:03 b_jonas http://xkcd.com/338/ or that other similar comic with boats?
14:09 p6eval joined #perl6
14:10 p6eval joined #perl6
14:12 p6eval joined #perl6
14:13 pmurias is it possible to see why the error messages the evalbot receives
14:20 pmurias pugs: say "hi"
14:20 p6eval pugs: OUTPUT«hi␤»
14:20 pmurias mildew: say "hi"
14:20 p6eval mildew:  ( no output )
14:23 masak pmurias: sorry, could you rephrase that question?
14:23 masak I reached the end of it and expected more. :/
14:24 masak (a predicate of some kind)
14:24 pmurias masak: sorry, i'm confused by fighting with the evalbot too much
14:25 pmurias what i meant is how can i see what errors the evalbot receives
14:26 masak pmurias: usually, it prints them too.
14:26 masak rakudo: }
14:26 p6eval rakudo fa4198: OUTPUT«Syntax error at line 2, near "}"␤in Main (src/gen_setting.pm:0)␤»
14:27 pmurias rakudo: while 1 {}
14:27 * jnthn back
14:27 p6eval rakudo fa4198:  ( no output )
14:28 p6eval joined #perl6
14:29 pmurias mildew: say "hi"
14:29 p6eval mildew: OUTPUT«hi␤»
14:30 pmurias moritz_: mildew exceeds some sort of timeout/limit
14:34 mberends pmurias: evalbot does not seem to collect stderr output: lines 144-146 in http://svn.pugscode.org/pugs/misc/evalbot/lib/EvalbotExecuter.pm
14:35 p6eval joined #perl6
14:35 pmurias mberends: it's a problem with runtime limits
14:36 pmurias mildew: say "hi"
14:37 p6eval mildew: OUTPUT«hi␤»
14:39 mberends masak: thanx for Net::SMTP patch. You'll be able to commit in future ;)
14:39 masak \o/
14:40 masak mberends: one day, I'll write an email client in Perl 6, and then dogfood that until I prefer it to the Gmail web interface. :)
14:40 snarkyboojum joined #perl6
14:40 mberends that will be one very fine day :)
14:41 b_jonas masak: do you want to write one for your exact needs only, or do you intend that lots of people use it?
14:42 b_jonas in the latter case, I can start complaining about all the features I am missing from gmail
14:42 masak b_jonas: I'll be happy to discuss, but I'm not intending to write a Gmail replacement, no.
14:42 jnthn mildew: class Foo { }
14:43 masak b_jonas: I just feel the need to cut the ties to Google before they engulf the world. :)
14:43 p6eval mildew: OUTPUT«Could not find variable ClassHOW in the lexical scope.␤»
14:43 mberends I'm trying to make the SMTP plumbing, but the Socket doesn't receive the initial banner from the host. It just hangs instead :(
14:43 jnthn mildew: knowhow Foo { }
14:43 p6eval mildew:  ( no output )
14:43 jnthn mildew: knowhow Foo { }; say "lived"
14:43 p6eval mildew: OUTPUT«lived␤»
14:43 b_jonas masak: sure, not a gmail replacement in terms that you won't provide terrabytes of free space and high reliability and fast internet connection to everyone for free
14:43 jnthn mildew: knowhow Foo { method x { say "lived" } }; Foo.x
14:43 p6eval mildew: OUTPUT«lived␤»
14:44 jnthn Nice
14:44 b_jonas masak: or a better ads business
14:44 masak b_jonas: :)
14:45 pmurias ruoso: wrote a first blog post at http://pmurias.livejournal.com/
14:45 Scorp1us left #perl6
14:46 frobnitz joined #perl6
14:53 snarkyboojum_ joined #perl6
14:54 estebann_ joined #perl6
14:59 justatheory joined #perl6
15:03 jferrero joined #perl6
15:07 mberends DanielC, let me know if you've created an account and want to be able to commit: http://gitorious.org/parrot-module-lib/main
15:12 masak jnthn: might it be that 'exit 1' stopped working when Perl 6 got its own HLL on Parrot?
15:12 TimToady hv2: I think you're seeing a known bug in rakudo
15:12 masak jnthn: I see other PIR code with 'exit 1', I tried it and it returns 1. Rakudo returns 0.
15:12 TimToady rakudo: say "abc" ~~ /(.).*(.)/
15:12 p6eval rakudo fa4198: OUTPUT«abc␤»
15:13 TimToady a Match in list context should behave as a Capture, and flatten
15:13 hv2 TimToady: this is my map over the captures?
15:13 TimToady map should supply a list context, so the match should flatten
15:14 hv2 TimToady: ah ok; the @(do the match) workaround was good enough for me for now.
15:14 TimToady rakudo: say ("abc" ~~ /(.).*(.)/).caps
15:14 p6eval rakudo fa4198: OUTPUT«0  a1      c␤»
15:14 TimToady rakudo: say ("abc" ~~ /(.).*(.)/).caps.WHAT
15:14 p6eval rakudo fa4198: OUTPUT«List()␤»
15:14 jnthn masak: Do we certainly reach that exit 1?
15:14 masak jnthn: yes.
15:14 pmichaud good morning, #perl6
15:14 masak jnthn: I checked.
15:14 jnthn masak: But yes, I looked at that last night and was like...huh...it *looks* correct. :-/
15:14 masak pmichaud: morning, pm.
15:14 jnthn pmichaud: morning
15:14 TimToady pmichaud: am pm
15:15 TimToady pmichaud: actually, am not pm
15:15 masak jnthn: I hope it's fixed before the next release. :/
15:15 hv2 TimToady: the speed and size are bigger problems for me, I just rewrote my plan to say "come back in a month, to see how things have improved"
15:16 TimToady yes they're concentrating on those right now, and hope to get better profiling soon
15:17 hv2 TimToady: hopefully by the time speed is slightly more sensible, there will also be enough of the missing features implemented to start making some of the gains I hoped to find. But I can't start diving into that myself right now, the pit is too bottomless at the moment.
15:18 hercynium joined #perl6
15:21 donaldh joined #perl6
15:22 viklund joined #perl6
15:23 viklund So, I'll repeat my question, when will I be able to .wrap multis? jnthn++?
15:24 viklund masak: 3G, in cars passengers seat
15:25 masak viklund: woot.
15:26 jnthn viklund: Once somebody figures out how wrapper candidate lists and multis interact and implements the code to Make It Work, I guess. ;-)
15:27 viklund my first test was trying to wrap a multi ;)
15:27 jnthn There's always someone...
15:27 viklund what's wrapper candidate lists?
15:27 jnthn the list of candidates to defer to (e.g. the inners)
15:28 viklund ok
15:28 jnthn I wonder if just making .wrap on a Multi call .wrap on all of the candidates would work.
15:28 viklund installing one wrapper for each?
15:28 jnthn Hmm...probably it could. And that'd be easy.
15:28 jnthn Yeah
15:28 DanielC mberends: HI. I just created an account at Gitorious. My account is DanielC.
15:28 masak jnthn: sounds like the way to go, by me.
15:29 jnthn masak: Yes and no
15:30 viklund is the MMD in parrot right now?
15:30 TimToady distribution of the wrapping doesn't sound right to me
15:30 mberends DanielC: cool, added as a committer :)
15:30 TimToady but I'm not sure why
15:30 DanielC :-)
15:31 viklund a wrap might modify the arguments so that a different multi should be called
15:31 jnthn viklund: That's why I'm not sure the wrap each candidate is correct.
15:31 viklund jnthn: no, I agree
15:32 moritz_ rakudo: multi a() { 1 }, multi a(@) { 2 }, &a.candidates>>.wrap { callsame }; say a()
15:32 p6eval rakudo fa4198: OUTPUT«Statement not terminated properly at line 2, near "{ callsame"␤in Main (src/gen_setting.pm:0)␤»
15:32 jnthn But it's a question of interaction.
15:32 jnthn If you wrap and give a different signature to any existing multi candidates, what does that mean?
15:32 moritz_ rakudo: multi a() { 1 }, multi a(@) { 2 }, &a.candidates>>.wrap(-> { callsame }); say a()
15:32 p6eval rakudo fa4198: OUTPUT«Null PMC access in find_method()␤in Main (/tmp/Kn9LGJxUW8:2)␤»
15:32 jnthn That we have a new candidate? That we temporarily hide the candidate that we wrapped?
15:32 moritz_ rakudo: multi a() { 1 }; multi a(@) { 2 }, &a.candidates>>.wrap(-> { callsame }); say a()
15:32 p6eval rakudo fa4198: OUTPUT«Null PMC access in find_method()␤in Main (/tmp/eRJBkD4dXn:2)␤»
15:33 jnthn I'm hugely tempted to punt and say, "y'know, go find the candidate you want to wrap and wrap that" for now.
15:33 viklund to my mind it should be a new candidate
15:33 jnthn And .wrap directly on a multi is illegal.
15:33 TimToady my &new := &old.assuming(42)
15:33 jnthn At least for 6.0.0.
15:33 TimToady what happens if &old is a multi
15:34 viklund but I guess just having something is better than nothing...
15:34 jnthn TimToady: assuming doesn't do any binding of parameters or any decision making.
15:34 TimToady I think of &foo as the external, singular abstraction of the call
15:34 jnthn TimToady: Or at least, Rakudo's one doesn't.
15:35 jnthn assuming just says "when I'm invoked, unshift this positional onto the start of the argument list"
15:35 jnthn Or stick it amongst the named's.
15:35 viklund so wrapping a multi directly is illegal? Hmm
15:35 jnthn viklund: I'm not sure.
15:35 jhorwitz joined #perl6
15:36 jnthn viklund: If we can come up with a sensible way to do it, I'd worry less.
15:36 TimToady it's probably the conservative thing to do, if we want to allow it someday
15:36 TimToady if you want the candidates, you know where to find them
15:36 viklund jnthn: The MMD, is that done in Rakudo currently or is it at the Parrot level?
15:37 jnthn It's one of those tricky feature interactions where I haven't yet seen something that's obviously right in the vast majority of situations.
15:37 TimToady course, what happens if one of the candidates is multi?
15:37 jnthn TimToady: How on earth would that come to pass?
15:37 TimToady depends on whether &foo is really an object that hides multiness
15:37 jnthn viklund: We subclass Parrot's MultiSub PMC as Perl6MultiSub to implement the Perl 6 dispatch algorithm.
15:38 viklund ok, I guess I should read up on this, it's interesting
15:38 jnthn TimToady: I agree it hides it to the point you can say foo(1,2,3) and not care if you're doing a multi dispatch or not.
15:38 jnthn TimToady: I guess the point we maybe agree less is just how much twiddling you can do before the differences being to show up.
15:39 jnthn *begin
15:39 nihiliad joined #perl6
15:39 TimToady might be possible to pessimize when you see &foo rather than foo()
15:39 M_o_C joined #perl6
15:39 TimToady and generate an only sub foo that redispatches
15:40 b_jonas um
15:40 TimToady then wrapping becomes a non-issue
15:41 b_jonas but only for multis, because if you have lexical subs then it's important that taking a my &foo parameter and passing it recursively passes the original sub instead of a wrapper sub that calls that sub
15:41 TimToady why?
15:41 b_jonas that's why ruby has Proc.new without arguments, which is a method that really shouldn't exist but is needed because proc { yield } has that problem
15:42 b_jonas TimToady: in a recursive function you could end up with passing an upvalue-chain of functions calling the next one
15:42 jnthn b_jonas: .wrap is an in-place modification, if that helps clarify things.
15:42 b_jonas and I do have examples where I pass a callback unmodified to a recursive invocation of myself
15:42 TimToady not sure that applies, since a wrapper calls with a different mechanism
15:42 b_jonas jnthn: I'm talking about plain &foo, not wrap
15:43 TimToady but certainly there's no reason to put a wrapper around something that already is an only sub
15:43 b_jonas TimToady: sure, only I'm saying if you want to do that with multis, you have to check that it's indeed a multi
15:44 TimToady the only point of the multi wrapper would be to make a list of candidates look like a single object really
15:44 b_jonas yes
15:44 TimToady sure
15:45 jnthn I guess the Multi role/whatever an implementation decides Multi should be would just have a .wrap that overrides the default one and makes the only wrapper.
15:45 jnthn It still feels awkward though.
15:45 jnthn I guess you'd have to know you were wrapping a multi, and that you'd better write a pretty permissive signature.
15:45 b_jonas (by the way, why does super in ruby only able to call a method of the same name as itself? I think that's a limitation which denies you from doing subclassing stuff you could otherwise do in smalltalk or perl5.)
15:46 TimToady wrappers are supposed to generally just bind the capture directly and pass it on, usually
15:48 TimToady it's probably motivated by the dual of duck typing, which would be type ducking
15:48 japhb joined #perl6
15:50 * b_jonas tries to imagine the dual of duck typing
15:51 TimToady if it ducks like a quack...
15:52 viklund ehm...
15:52 b_jonas I think it's when they burn someone and conclude that he's a duck or something… that doesn't really work
15:53 mberends DanielC, please add your thoughts: http://gitorious.org/parrot-module-lib/main/blobs/master/ROADMAP
15:53 DanielC ok
15:53 mberends you can git clone, commit and push there :)
15:54 DanielC Thanks.
15:54 * DanielC reads ROADMAP
15:54 DanielC 1. Hello World   :-)
15:54 DanielC Yeah, I'll need to start with that.
15:55 DanielC I don't know PIR, though it doesn't look as scary as I expected.
15:55 mberends same thoughts here
15:55 TimToady my serious point, though, is that, to the extent you make use of duck typing, method names become a funny kind of global namespace, so forces some conservatism about method names
15:56 jnthn Well, it's a line-based assembly-ish language, so there's not so much room for scariness ;-)
15:56 b_jonas yes, but you can still have private methods, and indeed perl6 has them
15:57 b_jonas and in theory you could even use lexical multis inside namespaces as methods, and then you have private methods you can ducktype
15:57 TimToady if a ruby class has a private method, can you also call a public method of the same name?
15:57 b_jonas TimToady: no, not in ruby
15:57 TimToady then they're not so very private
15:57 b_jonas I said perl6 has them, ont ruby or smalltalk
15:58 TimToady ah
15:58 DanielC mberends: After (2) we/I could make a Fletcher32 program. The "design notes" call for taking a Fletcher hash of the file data, and the Fletcher algorithm is just a notch harder than Hello World.
15:58 jnthn TimToady: Question on .^methods
15:58 * TimToady attempts to look like a toadstool
15:58 jnthn Given:
15:58 jnthn class A { method foo($param --> Any) { } multi method bar($thingy) { } multi method bar($thingy, $other_thingy) { }
15:58 b_jonas I'm thinking about something when you have a new Data::Dumper variant, and you want to allow classes to redefine how they're serialized: then you can have a multi sub in the namespace of that module, and let classes override that
15:58 alester joined #perl6
15:58 jnthn }
15:59 zostay_ joined #perl6
15:59 jnthn TimToady: How many methods does A.^methods(:local) hand back? 2 or 3?
15:59 jnthn (That is, are the multis grouped under a single entry, or returned individually?)
15:59 TimToady 2, because I think &bar is an object
16:00 jnthn OK, thanks.
16:00 mberends DanielC: ok. We'll need to lurk on irc.perl.org#parrot as well
16:00 TimToady on the other hand, it might be specced inconsistently with that
16:01 DanielC mberends: ok
16:01 jnthn TimToady: I didn't find S12 clear either way.
16:06 TimToady I'm sure I've been convinced both ways as to whether longnames transcend inheritance boundaries...
16:07 b_jonas flip a coin
16:08 TimToady if they do transcend, it implies &bar knows how to find bar candidates from parents as well as self
16:09 jnthn I've handled that as, if the dispatcher finds no applicable candidates in the most derived class, it looks up the inheritance hierarchy.
16:09 TimToady yes, but is that a fallback?
16:09 jnthn Fallback in what sense?
16:10 TimToady would a better candidate in a parent class be hidden by it?
16:10 jnthn Yes.
16:10 TimToady if there's a worse candidate in the derived class
16:10 jnthn Right.
16:10 TimToady then it's the non-transcendent model
16:10 TimToady the transcendent model is more like normal multi dispatch
16:10 beggars joined #perl6
16:10 b_jonas so the transcendent model is what c++ has, where a method in a subclass overrides a particular longname only?
16:11 jnthn I guess that one means knowing all the multi variants from the parents and making an augmented copy when constructing the subclass.
16:11 TimToady anyway, I can argue it both ways
16:11 b_jonas in fact, that's not even the transcendent model
16:11 b_jonas it's a third one
16:11 TimToady b_jonas: yes, basicaly
16:11 jnthn Having figured out how to make it work efficiently one way, I know which argument I prefer. ;-)
16:12 b_jonas because in c++ if you define a more specific method in a subclass only and you call that on a variable that's statically only known to be member of the superclass, the more general method in the superclass or its overridden variant is called only
16:12 b_jonas so I was wrong, that's an entirely different model
16:12 TimToady right, it's always virtual in p6
16:12 TimToady (well, unless you call a private method)
16:13 TimToady submethods are also sort of non-virtual in that sense
16:13 TimToady insofar as you have to know the acting type when you call it
16:13 TimToady not the actual type of the object
16:14 TimToady the effective type would be perhaps a better way to say it
16:14 b_jonas if you want the non-transcendent version, then for generality (treating multis and virtual methods the same) you'll want to have multi-multi subs which first dispatch to one of several multisubs on the arguments they're multi on, and then dispatches on the other variables, even if dispatching as a whole would find a more specific method
16:15 b_jonas whereas c++ can get away with this because there overloading functions and virtual methods are obviously different
16:15 b_jonas though this argument worked only if you indeed wanted to treat methods and multis the same, which you might not
16:16 TimToady yes, symmetry is overrated
16:18 * pmichaud reflects on that statement a bit.
16:20 b_jonas so, until someone disproves that conjecture that the plane cannot be tiled with congruent copies of a finite number of polygons with 5-fold rotational symmetry, we don't want to build systems from perfectly symmetrical building blocks?
16:23 b_jonas (is that still a conjecture by the way or has it been proved or disproved since?)
16:23 TimToady I think the universe is biased a bit toward spontaneous symmetry breaking :)
16:23 TimToady and anyway, I have another argument against transcendence
16:23 TimToady which is that if you inherit from a foreign object, it can't tell you about multis
16:23 hv2 symmetry is also underrated.
16:24 jnthn TimToady: That's a good point too.
16:24 jnthn TimToady: Also, not taking the transcendence route helps keep method dispatch semantics consistent when you have a multi.
16:24 jnthn TimToady: Things get awkward if class A has a multi, class B as an only and class C has a multi, where C < B < A.
16:25 jnthn Where those three routines all have the same name.
16:25 hanekomu joined #perl6
16:25 jnthn Because then you ahve to work out how to fit in the only.
16:25 TimToady well, sure, same is true in normal multi
16:25 TimToady but in normal multi, the only hides everything outside of itself
16:25 TimToady same would happen here
16:25 jnthn Right, but class B hiding the things in its subclass seems...wrong.
16:25 TimToady so one could argue that a foreign method is inherently only
16:26 TimToady yes, one could make a case for encapsulation forcing every super boundary to look like "only"
16:26 TimToady so I think I lean the way you want me to fall over :)
16:26 jnthn :-)
16:27 * TimToady pretends to be decisive
16:27 b_jonas maybe we should consider an example if you want to decide this, say how you'd implement a numeric tower so it can correctly dispatch adding two numbers of any types
16:28 TimToady as soon as you say "adding two numbers", you're talking about normal multis
16:29 TimToady we don't particularly provide infixes as single-dispatch methods except as a form of syntactic sugar for the infix
16:29 TimToady so there's not much point in trying to squeeze the semantics of $a + $b into SD
16:29 b_jonas am I? but how do you define them so that if you have a class that behaives as a vector made of any numbers and another class that implements bignums and neither knows about the other, a bignum multiplied by a vector of ints turns out to be a vector of bignums?
16:30 TimToady im(ns)ho
16:30 b_jonas even with multi-dispatch I've no idea how you can do that correctly
16:30 TimToady vector processing is explicit in Perl 6, generally, using hyper
16:31 b_jonas sure, but not a plain array vector but some trickier vector
16:31 b_jonas oh well
16:31 * TimToady handwaves in jnthn++'s direction :)
16:31 b_jonas in that case the vector just defines a multi sub with high enough priority so a vector multiplied by anything is dispatched to it
16:32 b_jonas plus, this is not an argument towards anything because I've no idea how this should be done properly
16:32 TimToady in the limit, you can write all the multis, though that can get explosive, of course
16:32 payload joined #perl6
16:33 b_jonas that's why I'm saying they don't know of each other
16:33 Psyche^ joined #perl6
16:33 b_jonas the vector class and the bignum class is developped independently and I'm just using them together without knowing how they work
16:33 b_jonas and I expect them to dwim
16:35 b_jonas I wrote an example like that once with two classes written by me pretending they don't know of each other, but that only worked because I wrote the multiplication as scalar * vector, not the other way
16:35 b_jonas I think it would have broken the other way
16:35 TimToady we at least have an fairly easy way to express commutivity
16:36 TimToady speaking of commuting, I'd better go take a shower
16:36 TimToady bbl &
16:36 TimToady (thanks, btw)
16:45 amoc joined #perl6
17:07 viklund joined #perl6
17:07 araujo joined #perl6
17:08 unitxt joined #perl6
17:09 Util joined #perl6
17:11 masak joined #perl6
17:12 justatheory joined #perl6
17:15 Util DanielC: ping
17:15 DanielC Util: pong
17:16 Util FYI I have converted and tested `binary-trees` and `fannkuch` from the Debian Shootout.
17:16 Util I have the former pushed into a branch of my repo fork, and will push the latter soon.
17:16 Util I will try to merge back into Main in the next few days. (Still learning Git)
17:16 Util I have not updated RESULTS, because I have no computer like your platform.
17:16 DanielC Ok. Thanks!
17:16 Util Glad to help!
17:16 DanielC Util: Is your work already in per6-examples?
17:16 DanielC pmichaud will be happy to give you commit access.
17:17 Util binary-trees is in my fork. pmichaud has already granted access, but I am trying to follow Frew's recommended workflow.
17:18 Util Hence, working in a branch of a fork, instead of the mainline.
17:18 DanielC I have no idea what Frew's recommended workflow is, but for per6-examples I don't think anybody cares.
17:18 Util http://wiki.github.com/rakudo/rakudo/frews-recommended-workflow
17:18 DanielC *click*
17:19 DanielC Keep in mind that perl6-examples is already its own branch, separate from Rakudo main.
17:19 DanielC So it's not as big a deal as if we were submitting code to Rakudo itself.
17:20 DanielC But it doesn't matter. I'm just glad that you contributed more benchmarks.
17:20 DanielC Util: Let me know when you upload your work to perl6-examples so I can update.
17:21 Util Update what? RESULTS file?
17:21 DanielC update = update my local repository so I can get your files.
17:21 DanielC "git pull"
17:22 Util DanielC: will do.
17:24 barney joined #perl6
17:25 hv2 left #perl6
17:37 ruoso mildew: say "ALIVE!"
17:37 p6eval mildew: OUTPUT«ALIVE!␤»
17:38 ruoso mildew: role Foo { method bar { say 'Cool!' } }; Foo.bar
17:38 p6eval mildew: OUTPUT«Cool!␤»
17:42 ruoso mildew: my $a = ::Multi.new; $a.variants.push(sub (int $a) { say $a }); $a.variants.push(sub ($b) {say 'Hah!'}); $a.(1); $a.('2');
17:42 p6eval mildew: OUTPUT«Could not find variable int in the lexical scope.␤»
17:43 ruoso hmm... it seems int is not in the CORE yet...
17:43 pugs_svn r27045 | lwall++ | [S12] limit multi method effects to inside a class to preserve encapsulation
17:43 pugs_svn r27045 | lwall++ | likewise .^methods describes a set of multi methods as a single method
17:43 ruoso mildew: my $a = ::Multi.new; $a.variants.push(sub ($a,$b) { say $a }); $a.variants.push(sub ($b) {say 'Hah!'}); $a.(1,2); $a.('2');
17:43 p6eval mildew: OUTPUT«1␤Hah!␤»
17:43 jnthn TimToady++
17:44 ruoso TimToady++ indeed... multi methods was still kinda blurry
17:44 TimToady though we'll have to decide whether it's .variants or .candidates :)
17:44 masak mberends: you have Rakudo commit access nowadays?
17:44 jnthn The spec is now in line with Rakudo. ;-)
17:45 b_jonas not .overloads ?
17:45 jnthn please not overloads!
17:45 jnthn :-)
17:45 ruoso rakudo: my $a = ::Multi.new; $a.variants.push(sub ($a,$b) { say $a }); $a.variants.push(sub ($b) {say 'Hah!'}); $a.(1,2); $a.('2');
17:45 masak I for one, welcome our .overloads overlords.
17:45 p6eval rakudo fa4198: OUTPUT«Method 'variants' not found for invocant of class 'Multi'␤»
17:45 ruoso rakudo: my $a = ::Multi.new; $a.candidates.push(sub ($a,$b) { say $a }); $a.candidates.push(sub ($b) {say 'Hah!'}); $a.(1,2); $a.('2');
17:45 p6eval rakudo fa4198:  ( no output )
17:45 ruoso that's surprising...
17:46 jnthn ruoso: .candidates is not the real candidate list.
17:46 jnthn Taht is, it doesn't reutrn something rw
17:46 masak jnthn: should you be able to push, then?
17:46 jnthn (so we should probably blow up on that...)
17:46 pmichaud "I, for one, welcome our new multi method overload masters."
17:46 TimToady let's you and him fight :)
17:46 jnthn At the moment you can do $a.push
17:46 pmichaud oops, masak++ beat me to it.
17:47 pmichaud masak: (re IO::prompt) -- I think that it should simply return   $*IN.get
17:47 b_jonas :-)
17:47 pmichaud no string conversions at all.
17:47 TimToady anyway, feel free to doctor S12 when you guys come to a consensus
17:47 masak pmichaud: I'll see if I can convert that thought to a patch.
17:48 pmichaud I think it can also go to setting :-)
17:48 ruoso one issue is when is a Multi mutable or immutable?
17:48 pmichaud multi sub prompt($msg) { print $msg; $*IN.get; }
17:48 masak pmichaud: I'll try that, than.
17:48 jnthn ruoso: The biggest issue with candidates just being an array accessor rather than adding a candidate being a method on Multi itself is cache invalidation.
17:48 jnthn ruoso: That is, it's easy if it's a method on Multi to say "oh hey, we have a new candidate, we need to re-sort"
17:49 jnthn (Since you only have to sort the candidates once...once you know the candidate list anyway. Or when the candidate list changes.)
17:49 TimToady .add_method++
17:49 ruoso jnthn, but you can still implement that while preserving the array-like acces
17:49 jnthn ruoso: It's a pain.
17:49 jnthn TimToady: .add_method for a multi-*sub* though?
17:49 jnthn TimToady: Maybe add_candidate?
17:49 * ruoso loves array and hash-like API for regular stuff
17:49 TimToady .add_variant :)
17:50 TimToady .push_pretty_please
17:50 ruoso but seriously... I do think having the API for lists following the list api as a cool thing
17:51 ruoso i.e. the *list* of candidates
17:51 ruoso it makes the API saner
17:52 ruoso so instead of having four methods in the Multi to manipulate the candidates... you simply have an accessor for the candidates, and the methods to manipulate that list in there...
17:52 jnthn ruoso: Yeah but then you need to have the List be some kinda proxy...which for something so low level...
17:53 ruoso but in the low-level you can access something more low-level
17:53 ruoso but in the high-level, it's cool to have that kind of semantics
17:53 b_jonas so? what's so magical in a tied array-like duck?
17:54 jferrero joined #perl6
17:54 TimToady it's not like adding variants is going to be on anybody's critical path...I sincerely hope...
17:55 TimToady s/critical/hot/ maybe
17:55 TimToady that's a TimToady-- for sloppy metaphors
17:55 masak pmichaud: moving 'prompt' into setting worked perfect. spectesting before pushing.
17:56 jnthn TimToady: I wasn't worrying about runtime efficiency.
17:56 Molaf joined #perl6
17:56 mberends masak, Rakudo commit access yes, but not many commits yet
17:57 b_jonas it's essential anyway that you be able add variants to multis in runtime I think
17:57 b_jonas that part is at least symmetric with methods
17:57 jnthn b_jonas: The debate isn't about whether you should be able to, just how the interface for doing that should look.
17:57 b_jonas but what does the interface matter?
17:58 masak mberends: anyway, great news. welcome aboard! :)
17:58 jnthn b_jonas: That you can do it the same way on different implementations.
17:58 b_jonas you're bound to implement a generic array-like duck on which you just have to define only a few methods anyway
17:58 masak mberends: viklund_++ and I are having a November hackathon tonight.
17:58 jnthn That sentence made little sense to me.
17:58 b_jonas or just make the variants return a snapshot and have an add_variant or something
17:59 pmichaud masak: excellent.  Less code++.  More Perl 6++ .
17:59 jnthn b_jonas: Yes, that's what Rakudo has at the moment.
17:59 masak pmichaud: "Less code. More Perl 6." stuff for a T-shirt, if you ask me.
17:59 pmichaud I will create that one.
17:59 jnthn Basically because the Multi needs to know when it gets a new candidate.
17:59 pmichaud I need to get my t-shirts ready anyway.
17:59 masak \o/
18:00 jnthn So it can invalidate its sorted candidate list and so forth.
18:00 b_jonas by the way, is perl6 required to have the kind of weak pairs that hold the car weakly and if the car can be collected then the cdr can be as well?
18:00 b_jonas and weak dictionaries with similar semantics?
18:01 b_jonas because a multi-method may need to hold its variants in a very tricky way so that if a variant requires a certain class of argument and that class is no longer referenced then that variant is freed too
18:02 jnthn The reference from the multi's signature is enough to keep it alive.
18:02 b_jonas isn't that optional?
18:02 jnthn No.
18:02 b_jonas meaning that it may keep it alive in some implementations but other implementatoins may collect it
18:02 TimToady y'know, guys, we're actually trying to keep multis statically analyzable here...
18:02 TimToady that's why by default multis are only lexical
18:03 b_jonas :-)
18:03 TimToady and lexical scopes close at the end
18:03 TimToady otherwise we can make no guarantees about the speed of $a+$b
18:04 TimToady so from a Perl 6 perspective, I don't really care how multi variants are inserted.  I almost want to hide that interface from mere mortals.
18:05 b_jonas so we can't override 6*9 to give the right result globally?
18:05 TimToady you could wrap an existing method
18:06 TimToady and if infix:<*> is defined in terms of low-level single-dispatch, you could even do monkey typing on the class
18:06 b_jonas so that's why you were saying multis and methods are different
18:06 TimToady but we don't encourage magical action at a distance
18:06 jnthn TimToady: In that case I *really* don't want to go to the extra effort of making it look prettier. :-)
18:07 TimToady subs define the language; method semantics are delegated to classes
18:07 TimToady and one of the fundamental design principles is that a given lexical scope should know exactly which language it's in
18:08 TimToady and not go all wobbly and generic without explicit declaration to that effect
18:08 b_jonas but then how would multimethods even work ?
18:08 TimToady they export into your lexical scope when you use
18:09 b_jonas but don't you have to dispatch the method part first and the multi part only after that?
18:10 TimToady you're confusing yourself with the term multimethod
18:10 mizioumt1 joined #perl6
18:10 TimToady Perl 6 has multi subs and multi methods, and they have little to do with each other
18:10 b_jonas maybe, but I don't get this "export to your lexical scope" thing. that sounds like a contradiction. it's not lexical if you export stuff to it.
18:11 b_jonas hmm, so "multi method" is like "long double"?
18:11 TimToady all importation in p6 is lexical by default
18:11 DanielC mberends: I can't figure out how to push. It says  "Permission denied (publickey)"
18:11 TimToady not package like P5
18:11 ruoso TimToady, anyway... that discussion was not only about Multi candidates... but as a general expectation on the Perl 6 API
18:11 mizioumt1 joined #perl6
18:12 DanielC mberends: I have already uploaded my SSH public key.
18:13 ruoso i.e.: should the API for things that contain List-like attributes be add_foo, remove_foo or .foo.push, .foo.shift
18:13 TimToady b_jonas: yes, very like long double, in an I
18:13 TimToady in an IQ-test sort of way
18:14 TimToady in either case the adjective defaults to a different meaning
18:14 TimToady if you leave out the noun
18:15 DanielC mberends: Ok, I got past the ssh key problem. Now I need to fight with git...   " ! [rejected]        master -> master (non-fast forward)"
18:15 DanielC mberens: I hate git. I can't figure out how to fix a conflict.
18:15 mberends DanielC, did you clone git:// or git@ ?
18:15 DanielC mbernds: We both edited the ROADMAP file, in slightly different ways.
18:16 DanielC git://
18:16 DanielC I think I'll just make a new clone of the repo.
18:16 TimToady git seems like a useful system for those who know in advance what they're going to do, which isn't me. :)
18:17 mberends you may need to edit url = git@gitorious.org:parrot-module-lib/main.git into .git/config
18:18 Tene Hardly.  I like git precisely because it gives me enough rope to get done whatever I want to do, regardless of whether I planned for it originally.
18:18 masak aye. git is very granular. I like that.
18:18 jnthn yeah but half the time I end up with the rope around my neck.
18:18 viklund should it be possible to wrap say *?
18:18 viklund &*.wrap(sub ($a, $b) { ... }??
18:18 DanielC mberends: Yay \o/  My first "git push".
18:18 masak viklund: you mean infix:<*> ?
18:19 viklund masak: yes
18:19 mberends DanielC: \o/
18:19 masak viklund: you can refer to it as &[*]
18:19 masak but not yet in Rakudo, I think...
18:19 jnthn &infix:<*> should work though
18:19 * viklund tries
18:19 DanielC mberends: I implemented Fletcher-16 and Fletcher-32.
18:20 mberends excellent!
18:20 DanielC mberends: You give the function a file name, a byte offset and the number of bytes to read.
18:20 viklund ahh, right, it's a MultiSub
18:20 masak dang. :)
18:20 viklund not Perl6MultiSub??
18:21 DanielC mberends: Fletcher-32 has a bug in that it always reads an even number of bytes, even if you asked for an odd number. I'll fix that later. Other than that, I think they are probably ok.
18:21 jnthn viklund: Not yet, no...been working on moving us in that direction though.
18:22 dalek rakudo: b677d60 | masak++ | src/ (2 files):
18:22 dalek rakudo: moved 'prompt' into the setting
18:22 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/b677d60762125344f4afb464fbdc83b994a7baa2
18:23 mberends DanielC: pulled it. your code looks very nice indeed
18:23 viklund jnthn: ok
18:23 jnthn viklund: Though doubt it'll be until July we have it.
18:23 DanielC :-D
18:24 jnthn Unless somebody does it while I'm on vacation. :-)
18:24 masak you never know. :)
18:25 viklund TimToady: I like git just because I do stuff all day long and then decide how and what to commit and resolve conflicts
18:25 jnthn mmmm...vacation :-)
18:25 viklund it maps very well to my disorganized mind
18:26 masak full ack on that.
18:26 masak git is for people who like organisation after the fact. :)
18:26 TimToady well, I did say "seems"...  # feeble
18:27 masak unfortunately, no-one can be _told_ what git is... you have to see for yourself.
18:27 viklund masak: sigh
18:31 TimToady masak: which is, basically, a religious argument :)
18:31 mberends DanielC: from Internet RFC 1146: "It is necessary ... to pad a datagram containing an odd number of octets with a zero octet."
18:31 TimToady and operative whether the religion is true or false :)
18:31 [particle]1 joined #perl6
18:32 viklund ;)
18:32 masak TimToady: I wish that description of git was less true. :)
18:34 Sunbeam joined #Perl6
18:35 mberends DanielC: doing the FIXME
18:38 viklund Hooray for BUILD, jnthn++
18:38 masak jnthn++ # BUILD \o/
18:39 masak jnthn: do you have any idea how much nicer the Druid code became? :)
18:40 DanielC mberends: thanks
18:42 mberends DanielC, pushed
18:43 mberends oops, 1 instead of 0, re-pushing
18:44 mberends fixed
18:44 DanielC "git pull"
18:46 DanielC mberends: Looks good. I'm removing the "FIXME" line.
18:47 mberends hmm, it works but 0 isn't really a string. how about "\x0" instead ?
18:47 DanielC Just use $I1 = 0 instead of $S0 = 0
18:48 * DanielC fixes it
18:48 mberends and move ODD_LENGTH to under the ord
18:48 DanielC y
18:48 mberends teamwork++
18:48 DanielC "git push"
18:49 DanielC :)
18:50 DanielC Ok, now I'll go watch a movie.
18:50 DanielC afk
18:56 mizioumt joined #perl6
18:58 masak mberends: I'm a semantic-markup junkie, so I thought I'd change your .red CSS declaration to something like .warning -- is that OK with you?
18:58 TimToady he meant "communist"
18:59 masak :)
18:59 mberends masak, agreed totally
18:59 masak mberends: oh, I see DanielC probably wrote that.
18:59 masak anyway, changing.
19:01 viklund bug?:
19:01 viklund rakudo: my @s=^5; say @s.perl; say @s[0..*].perl
19:01 p6eval rakudo b677d6: OUTPUT«[0, 1, 2, 3, 4]␤[0, 1, 2, 3, 4, undef]␤»
19:02 viklund shouldn't they be the same?
19:02 TimToady yes
19:02 * viklund submits rakudobug
19:02 TimToady though I think that one may be known
19:03 masak viklund: that one's already in there...
19:03 TimToady but volleyball principle
19:03 TimToady better too many going for the ball than too few
19:03 viklund masak: ty
19:03 viklund ;)
19:03 masak glad to help. :)
19:06 mberends masak, the #parrot people are dissecting our Socket code
19:07 masak mberends: yes, I see. interesting.
19:07 pastorn left #perl6
19:07 masak "I just did what mberends told me to do!" :P
19:08 mberends :)
19:08 lichtkind mberends: where you currently on?
19:09 masak viklund: http://rt.perl.org/rt3/Ticket/Display.html?id=64566
19:10 viklund thanks
19:12 masak rakudo: my @a = 0, 1, 2, 3; say @a[*].perl
19:12 p6eval rakudo b677d6: OUTPUT«[0, 1, 2, 3]␤»
19:12 masak rakudo++
19:12 mberends lichtkind: a basis for possible implementation of side by side module versioning http://gitorious.org/parrot-module-lib/main
19:13 lichtkind mberends: great did you seen latest appendix B effort its now nearly twice as long
19:14 * mberends reads Perl Tablets Appendix B...
19:15 Tene mberends: another significant issue is how we deal with actually loading two different versions of a module in the same interpreter.
19:16 mberends Tene: indeed, and that's above my head. Being librarian will keep me happily occupied.
19:16 Tene :)
19:19 amoc__ joined #perl6
19:20 pasteling joined #perl6
19:21 donaldh joined #perl6
19:24 ejs joined #perl6
19:26 bigpresh_ joined #perl6
19:28 masak is there a way to use a 2-arg sub in an infix position?
19:28 mizioumt1 joined #perl6
19:30 TimToady sure, define an infix operator :)
19:31 viklund_ hrmpf
19:31 masak apparently, we're not Haskell yet...
19:32 masak :)
19:32 masak by the way, I'm still suffering from random attacks of the C<"load_bytecode" couldn't find file 'perl6.pbc'> error.
19:32 masak and I am _not_ amused.
19:33 TimToady maybe GC does random chdirs :D
19:33 masak I wouldn't put it past the GC to do such a thing.
19:34 masak I wish I could reliably reproduce this error.
19:34 TimToady cd /dev, open "mem"
19:34 jnthn viklund_,masak: Happy you liked BUILD. masak - no, I didn't see how much nicer Druid became, but it sounds like it got much nicer. :)
19:35 masak jnthn: http://github.com/masak/druid/commit/4dc85c610ac3f910378d8edde798ebda7ecdaf91 http://github.com/masak/druid/commit/4bb79f9082163ccc5238e827a35c78cca01d90b6
19:35 masak jnthn: oh, and when do we get attribute auto-initialization? :P
19:36 mberends lichtkind, leave Appendix B for me to edit a little bit...
19:37 jnthn masak: Waiting on another refactor to happen first, but I think it's high on pmichaud++'s list.
19:37 jnthn We discussed how to make it work already. :-)
19:37 masak eeexcellent.
19:38 * masak touches fingertips on one hand with fingertips on other hand
19:38 viklund_ he really did, I checked
19:39 TimToady sometimes we say "he tented is hands/fingers"
19:39 TimToady *his
19:39 masak ah, nice metaphor.
19:40 TimToady or sometimes "steepled"
19:40 TimToady if the angle is acute
19:40 masak it is.
19:41 jnthn That's acute metaphor.
19:41 masak though apparently not in Mr. Burns' case: http://en.wikipedia.org/wiki/Mr._Burns
19:41 diakopter what's the term for fingertips on-end
19:41 lambdabot diakopter: You have 2 new messages. '/msg lambdabot @messages' to read them.
19:42 TimToady dunno, maybe caged his fingers
19:42 TimToady but it conveys an entirely different emotion
19:43 TimToady sly and conniving
19:43 TimToady rather than thoughtful
19:43 diakopter "he sphered his fingers"
19:43 TimToady as if it says, "I'm thinking about this, but I don't want you to know I'm thinking about it"
19:46 pmichaud back from phone
19:47 TimToady I feel like the gesture is highly stylized, as if from theatrical practice, maybe from Shakespearean times
19:50 pmichaud ...what's high on my list?
19:50 lichtkind mberends: it is left :)
19:51 masak pmichaud: making sure attributes are assigned values from the parameters at the end of a BUILD submethod.
19:51 mberends :) hacking...
19:51 masak pmichaud: or so I heard. :)
19:51 pmichaud oh.  didn't know that was on my list.  It can be.
19:51 masak \o/
19:51 StephenPollei rakudo: my Complex $namcu =1.3
19:51 p6eval rakudo b677d6: OUTPUT«Type mismatch in assignment; expected something matching type Complex but got something of type Num()␤in Main (/tmp/GkRHLNL8k0:2)␤»
19:51 gfote joined #perl6
19:53 mberends lichtkind, translating some more German to English in App B
19:53 lichtkind mberends: you meant the metaop section?
19:53 mberends yes
19:54 mberends a few changes saved already
19:55 lichtkind mberends: i thing by the end of the week all appendixes shoul be ready :)
19:55 mberends good
19:56 jnthn pmichaud: It wasn't so much that this bit was on your list, it was the rw refactor that came before it. :-)
19:57 Tene masak: what's this proto stuff?  I hear you might know something about it?
19:57 ejs joined #perl6
19:58 masak Tene: I hear it's a pretty decent installer for Perl 6 projects.
19:58 pmichaud ah, rw refactor.  That shouldn't be far off.
19:58 masak Tene: it's not the future, though. it's just an admittedly shoddy present. :)
19:58 masak (from me to the Perl 6 community.)
19:58 jnthn pmichaud: Though feel free to task steal the BUILD be. Especially because I ain't going to be here.
19:58 jnthn *bit
19:59 pmichaud jnthn: I'll see where it comes up on the pain threshhold.  There are quite a few items demanding my attention over the next few weeks.  :-|
19:59 masak Tene: maybe I should have started with "why, what have you heard?"
20:00 mberends proto is arguably the best Perl 6 installer ever written
20:01 Tene masak: I've seen it mentioned a few times... I was just looking at someone's net-smtp repo, and Configure.pl bailed out with a complaint saying I should talk to the proto people.
20:01 masak :)
20:01 * pmichaud snickers... "proto people"
20:01 mberends dependencies--
20:01 masak we're all proto people. :)
20:02 masak Tene: how can it say something like that? the string 'proto' doesn't occur in the net-smtp project...
20:02 StephenPollei I think proto people are homo habilus or homo erectus, clearly ;-)
20:04 masak Tene: anyway, talking to mberends++ would qualify as "talking to the proto people", but I bet he'll be more help in his function as Net::SMTP author...
20:04 Tene masak: Ah... net-snmp's Configure.pl puts ./lib on the end of @*INC
20:04 Tene and I have web in my PERL6LIB
20:05 masak ouch.
20:05 masak mberends: it should put it in the beginning of @*INC.
20:05 masak maybe I fixed that already, but Net::SMTP should fix it too.
20:06 mberends oh yes, you changed push to unshift in proto, but not in every other project in the world
20:06 Tene mberends: net-snmp configure will only work from parrot's build-dir?
20:06 Tene why does it care where parrot was built from?
20:06 masak ah, and Web.pm's Configure.pm does have a 'please contact the proto people' message.
20:07 masak what a non-orthogonal thing to advise!
20:07 masak Configure.pm is independent of proto. :)
20:07 mberends Tene, it should work anywhere with perl6 in $PATH
20:07 masak mberends: can I change it in net-smtp?
20:07 mberends please do!
20:08 * masak does
20:08 masak mberends: also, I have an idea for a WTOP... :P
20:08 mberends Tene: quick fix, unset PERL6LIB temporarily
20:09 Tene mberends: I did.
20:09 Tene mberends: I have perl6 in my path.  doesn't work.
20:09 Tene I have parrot in ~/src/parrot and rakudo in ~/src/rakudo
20:10 Tene but configure.pm is looking for either rakudo contains parrot or parrot contains rakudo?
20:10 Tene I have rakudo properly installed in lib/1.2.0-devel/languages/perl6 in my parrot install prefix...
20:11 Tene ... net-smtp's Makefile tries to locally precompile rakudo's Test.pm? o.O
20:11 mberends should handle either. 'make test' looks in rakudo_dir for Test.pm
20:12 masak Tene: I think Configure.pm is just trying to figure out reasonable values for RAKUDO_DIR and/or PARROT_DIR.
20:12 Tene yes, but Configure.pm locates rakudo-dir by trying to find it relative to parrot-dir
20:12 mberends Tene, that's because Rakudo doesn't know its own dir
20:13 mberends it tries to grok it from %*VM<config>
20:13 Tene Hmm... I guess I shouldn't be complaining without providing patches.
20:13 masak Tene: I wasn't aware it was even possible to have Rakudo either in languages/rakudo or .. relative to Parrot.
20:13 * jnthn builds all the time wiht Rakudo in languages/rakudo
20:14 masak sorry, s/to have/not to have/
20:14 jnthn Well that just changes everything.
20:14 mberends proto, the famous proto, would fail on those directory layouts too
20:14 Tene masak: I have parrot installed to ~/parrot and rakudo installed in there too, so that load_language can work properly
20:15 pugs_svn r27046 | lwall++ | [STD] tighten up messages about old regex modifiers
20:15 pugs_svn r27046 | lwall++ | [viv] don't loose track of positions on list-ending nullterm
20:16 pugs_svn r27047 | lwall++ | [examples] more cleanup
20:16 mberends after --gen-parrot appeared "the proto developers" assumed there could only be two relative directory nestings: rakudo/parrot or parrot/languages/rakudo, and that's how Configure.pm does its guessing.
20:17 Tene pmichaud: how would you feel about me adding a 'make install' target to rakudo's makefile that installed things relative to the prefix reported by parrot_config prefix?  or do you have plans for 'make install' for rakudo later that that would interfere with?
20:23 StephenPollei ../fudge rakudo declare.t ; ~/src/rakudo/perl6 declare.rakudo gave Can't find ./Test in @INC in Main (src/gen_setting.pm:438) .. stupid question but how do invoke the test framework properly?
20:24 Tene StephenPollei: export PERL6LIB=$HOME/src/rakudo
20:24 pmichaud Tene: I'm working on 'make install' today, actually.
20:25 Tene pmichaud: :)
20:25 StephenPollei ki'e Tene thanks
20:25 pmichaud Tene:  the challenge to that is that Rakudo still wants the build tree to be present before it can run (that's the part I'm fixing today).
20:26 pmichaud I also haven't decided where we want the Perl 6 libs to go by default.
20:27 Tene pmichaud: the one relevant thing I was just confirming is that Parrot adds languages/perl6/dynext/ to the relevant search path, so you can put perl6_ops.so and perl6_group.so in there.
20:28 pmichaud Tene: it adds that to the search path.... when?
20:28 Tene when you load_language 'perl6'
20:28 pmichaud Tene: what about when running the perl6 fakecutable?
20:29 pmichaud (the fakecutable doesn't do load_language.)
20:29 Tene I don't know enough abot how the fakecutable works, but I don't thin kit uses... yeah, that.
20:29 pmichaud so, just copying the *.so files into languages/perl6/dynext doesn't seem sufficient
20:30 Tene I'd say that's a problem with fakecutables, though.
20:30 pmichaud I'm open to alternatives.
20:31 pmichaud Seems like having a module with  ".HLL 'perl6'"  ought to be sufficient to add languages/perl6/dynext into the search path, though.
20:31 pmichaud I don't know if that's the case.
20:31 Tene It isn't.
20:32 pmichaud Hmm.
20:32 pmichaud That seems like a better tie than tying things to the load_language opcode.
20:32 Tene Yes, it does.
20:32 pmichaud i.e., that loading a HLL adds its dynext into the library path.
20:34 pmichaud anyway, I really don't want too many "half-measures" in Rakudo's make install target; it either works, or we don't provide one.
20:34 pmichaud where "works" as in "works the way people expect"
20:34 Tene Right.
20:34 Tene oh, that's not what I read the first time...
20:34 pmichaud and I really am working on 'make install' today -- I want Rakudo's June release to run from an installed version of Parrot's June release, if it all possible.
20:35 pmichaud or, if it doesn't, then I want to specifically identify the deficiencies needed to get it to that point.
20:35 Tene Yes, after looking at this more, I wouldn't be comfortable relying on that either.
20:36 Tene (I lied about perl6/dynext.  It actually adds a 'perl6dynext' directory to the search path.)
20:37 pmichaud weird.
20:37 Tene I don't know if that's a bug or intentional.  This isn't documented anywhere.
20:37 pmichaud Yes, that's also part of what bugs me at the moment -- very little about "installed parrot" is documented.
20:38 mberends lichtkind, Appendix B all translated
20:38 pmichaud afk for a while, need lunch
20:39 decasm left #perl6
20:45 masak rakudo: my @a = 1, 2, 3; my $x = 4; @a.push: $x xx 3; $x = 5; say @a.perl
20:45 p6eval rakudo b677d6: OUTPUT«[1, 2, 3, 5, 5, 5]␤»
20:45 masak o_O
20:46 jnthn I've tried to fix push before...
20:47 lichtkind mberends: great
20:49 lichtkind mberends: appendix E is now so far ready
20:49 lichtkind mberends: Appendix should contain german?
20:49 StephenPollei pmichaud, make install even on selinux enabled systems? http://danwalsh.livejournal.com/13716.html allow_execmem, allow_execstack, allow_execheap, allow_execmod -- textrel_shlib_t unconfined_execmem_exec_t java_exec_t mono_exec_t
20:51 masak mberends: another great name for a Perl 6 project: 'acceleraptor'.
20:52 mberends :) but make sure it deserves it ;)
20:52 mberends lichtkind: Appendix E should be English only, translated yesterday
20:52 StephenPollei rakudo: my Bit $namcu =1;
20:52 p6eval rakudo b677d6: OUTPUT«Malformed declaration at line 2, near "Bit $namcu"␤in Main (src/gen_setting.pm:0)␤»
20:53 masak viklund_++
20:53 lichtkind mberends: yes but i fixed resorted links and added internal links to contents inside the wiki
20:54 lichtkind mberends: many links had the format of the other wiki and where not usable
20:54 mberends oh, I never tested the links :(
20:54 StephenPollei is Bit not working yet? or am I decalring it incorrectly?
20:54 masak how do I write 'all of @a' with a range and the whatever star? is it @a[0..*] or @a[0..*-1]?
20:55 jnthn masak: why don't you just write @a[*] ?
20:55 jnthn But 0..* I think is right.
20:55 lichtkind mberends: dont worry its now good
20:55 masak jnthn: so 0..*-1 means 'all but the last element?' in this context?
20:56 masak jnthn: I don't write @a[*] because I'm interested in the semantics of @a[0..*] :)
20:56 pugs_svn r27048 | jnthn++ | [t/spec] Add a bunch of new tests for .^methods, and move those in meta-class.t to this file.
20:56 jnthn masak: I forget the order of precednece
20:57 jnthn That may or may not end up doing what you want.
20:57 mberends 'all but last' looks better as @a[0..^*]
20:57 jnthn If it's 0..(*-1) it's like 0..{ $_ - 1 }
20:58 jnthn Which I'm not quite sure what happens with, but maybe it then becomes { 0 .. { $_ - 1 } }
20:58 masak jnthn: I think the semantics might be confusing, but at present, I'm too confused to explain how...
20:58 jnthn lol
20:58 skids_ ISTR it's 0..*-1 for the whole array.
20:59 jnthn Aye, but 0..* is the whole array (also?).
20:59 skids_ But since its the dwim operator maybe that could be up for negotiation.
20:59 viklund_ mberends: shouldn't that be @a[^*]?
20:59 masak skids_: if so, then the RT ticket whose URL I pasted to viklund_ earlier is invalid.
20:59 * skids_ tries to find speccage
20:59 jnthn masak: I'm not 100% sure, tbh
21:00 mberends viklund: yes, more elegant
21:00 lichtkind mberends: i like you explanation of second reduction op
21:00 lichtkind mberends: how is that called?
21:01 pmurias joined #perl6
21:01 skids_ S02 says @foo[*-1] is last element but still looking for exact example.
21:01 lichtkind mberends: i fixed some optical glitches in appendix B
21:01 mberends lichtkind, it took a long time to write ;)
21:01 lichtkind haha
21:01 skids_ http://perlcabal.org/syn/S09.html#Negative_and_differential_subscripts
21:02 lichtkind mberends: i also mad the explanation of hyper more correct, i will add some missing special vars and appendix B should then nearly complete or?
21:02 masak skids_: note that the section never mentions @a[0..*].
21:02 skids_ true.
21:03 mberends lichtkind, the . . . do not align vertically in my browser. typical font mismatch. Go for it, I'm editing Appendix C.
21:03 masak so http://rt.perl.org/rt3/Ticket/Display.html?id=64566 might well be invalid.
21:03 viklund_ which would mean that @a[^*] _might_ work ;)
21:03 viklund_ linenoise++
21:04 skids_ Hrm, well, S09 has a few '@nums[1..*:by(2)]' in there...
21:04 masak viklund_: of course it works! :)
21:04 masak skids_: oh noes!
21:04 masak someone is wrong in the spec! :P
21:04 viklund_ specbug!
21:04 masak specfight!
21:05 skids_ Well, I guess it depends on what is right :-)
21:05 pmurias ruoso: should we standardize with rakudo and change variants to candidates?
21:05 lichtkind mberends: did you recocgnis yesterday larry altert somethin in op precedence i changed it nearly realtime in B
21:05 ruoso pmurias, yes...
21:06 mberends lichtkind: oh, wow!
21:06 lichtkind mberends: yeah svn changelogs of syn appear on p6l which i read sometimes :)
21:08 * ruoso later &
21:08 lichtkind mberends: R reverses order of operands ot operator but i fixed that too :)
21:08 masak Google Fight has spoken: http://tinyurl.com/mkth28
21:09 pugs_svn r27049 | pmurias++ | [re-smop] renamed variants to candidates to me more compatible with
21:09 pugs_svn r27049 | pmurias++ | rakudo
21:12 skids_ Right above the negative subscripts section: 'say @calendar[5..*];          # Same as:  say @calendar[5..11]'
21:12 skids_ It's actually pretty clear, but not if you jump right to the section.
21:13 masak ok.
21:13 skids_ Treating * as a number: *-1.  Just * alone, also means last specified index.
21:13 masak that's the confusing thing.
21:13 masak but perhaps it's not so bad.
21:14 masak * is already highly magical anyway.
21:14 skids_ I'll add a verbiage tweak to the top of that section.
21:14 masak skids_++
21:15 dalek rakudo: 1ff28a3 | jnthn++ | src/ (7 files):
21:15 dalek rakudo: Lots of fixes to get method introspection mostly working. Not 100% there yet, but a whole load better than it was. Also prevents us getting quite so explodely when we're putting MultiSubs into arrays (Parrot's MultiSub inheriting from RPA is srsly stupid), and makes .name work on Multis too.
21:15 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/1ff28a33d5c77ad00b81414fdd65860f0e7e63a0
21:15 dalek rakudo: c7d4dad | jnthn++ | t/spectest.data:
21:15 dalek rakudo: Add S12-introspection/methods.t to spectest.data.
21:15 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/c7d4daded625330cab3c6bc69830ad232733cfb5
21:15 dalek rakudo: 5af9cf3 | jnthn++ | :
21:15 dalek rakudo: Merge branch 'master' of git@github.com:rakudo/rakudo
21:15 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/5af9cf3204b51be177d4a2461a1254e0cf8aea52
21:18 masak where in the spec does it say that if blocks and for loops have expression values?
21:21 pugs_svn r27050 | skids++ | Make 0..* versus 0..*-1 less confusing to spec greppers
21:22 masak I reserve the right to be just as confused by this in the future too. :)
21:24 justatheory joined #perl6
21:25 skids_ S04: 'The value of a loop statement is the list of values from each iteration'
21:25 masak skids_: thank you.
21:26 masak and good night. :)
21:26 skids_ Though, looking at the exact language, and noticing fonts, it doesn't explicitly include while/until/for
21:26 skids_ just 'loop'
21:28 skids_ Oh wait, I'm hallicinating a C<code>.  Fonts too close here :-)
21:29 pugs_svn r27051 | stephenpollei++ | Add tests to see if you can declare the various built-in types
21:45 Sunbeam joined #Perl6
21:46 viklund_ what's the right semantics here:
21:46 viklund_ rakudo: class P { has $.bl = { "Hi" } }; say P.new().bl()
21:46 p6eval rakudo b677d6: OUTPUT«_block59␤»
21:46 viklund_ should that say "Hi"?
21:46 viklund_ rakudo: class P { has $.bl = { "Hi" } }; my $s = P.new().bl(); say $s()
21:46 lichtkind mberends: still not complete but i had to sync with german version
21:46 p6eval rakudo 5af9cf: OUTPUT«Hi␤»
21:47 viklund_ does the right thing though...
21:47 jnthn viklund_: afaik Rakudo is correct
21:47 jnthn viklund_: Because those parens on the end there are on the call to the accessor method hl
21:48 jnthn viklund_: Rather than meaning "and call the thing .hl returns"
21:48 viklund_ jnthn: yes, I can see that now, (after asking)
21:48 jnthn rakudo: class P { has $.bl = { "Hi" } }; say P.new().bl().()
21:48 p6eval rakudo 5af9cf: OUTPUT«Hi␤»
21:48 viklund_ jnthn: ahh, ty, that was my next question ;)
21:48 viklund_ jnthn++ # Seeing into the future
21:49 mberends lichtkind, Appendix C is done but I did not understand some of the code examples, better check them all
21:49 lichtkind yo
21:50 gfote anyone using leopard?
21:52 viklund_ gfote: is that 10.5?
21:52 gfote right
21:53 viklund_ ok, then masak is using that, why?
21:53 viklund_ he just went afk though
21:55 lichtkind viklund_ dont worry if we ready with the tablet appendixes i turn to november again
21:56 viklund_ lichtkind: what do you mean?
21:57 lichtkind viklund_ i dont abandoned november just finishing a portion of the tablets
21:57 viklund_ lichtkind: ahh, ok, that's fine
21:57 viklund_ we've fixed a few more bugs since you checked it last time ;)
21:57 lichtkind viklund_ i have lots of projects
21:57 lichtkind great
21:57 viklund_ but we still haven't got any TOC or monspace things
21:58 Whiteknight joined #perl6
21:58 viklund_ the monospace was on masaks list for today, but he couldn't compile for some reason
21:58 pmichaud 21:46 <viklund_> rakudo: class P { has $.bl = { "Hi" } }; my $s = P.new().bl(); say $s()
21:58 pmichaud Rakudo is correct there.
21:59 viklund_ pmichaud: yes, jnthn++ told me so
21:59 DanielC joined #perl6
21:59 pmichaud That's what I fixed over the weekend.  :-)
21:59 viklund_ November previously relied on the old behavior, started breaking all of a sudden
22:00 jan___ joined #perl6
22:01 viklund_ pmichaud: it is more logical this way
22:01 viklund_ so I'm happy
22:02 lichtkind viklund_ monospace is  nice to have because otherwise sourcecode looks crappy
22:02 viklund_ lichtkind: yes, it does
22:03 lichtkind viklund_ you are really good at fixing 3 more such weeks and im for replacing socialtext with november
22:03 lichtkind viklund_ (if it where fast enough)
22:03 viklund_ lichtkind: you're too kind
22:03 TimToady skids: * doesn't have any consistent meaning such as "last index"
22:04 TimToady its meaning is always "you figure something out", where you is the exact operator you're feeding it to
22:04 TimToady 0..* is always all the non-negative integers, because that's how .. treats it
22:05 TimToady it doesn't give a rip whether it's in a subscript or not
22:05 pmichaud so,   @a[0..*].elems would be... Inf?
22:05 TimToady just all the ones that make sense
22:06 TimToady so same as @a[*].elems
22:06 pmichaud okay, so the subscript cares about having a range.
22:06 DanielC @seen mberends
22:06 lambdabot I saw mberends leaving #perl6 6m 42s ago, and .
22:06 DanielC mberends: ping?
22:07 TimToady *-1 also doesn't care about whether it's in a subscript or not
22:07 pmichaud sure, that one I got.
22:07 TimToady was talking to skids
22:07 pmichaud okay.
22:07 pmichaud would    @a[0..Inf].elems    be Inf?
22:08 TimToady but *-1, unlike 0..*, returns a unary function
22:08 TimToady I don't think elems is ever going to return more elements than there actually are
22:08 pmichaud @a[1 xx 100].elems
22:08 lambdabot Maybe you meant: arr ask
22:08 pmichaud surely there are 100 there, regardless of the size of @a
22:09 TimToady sure, but you have dups
22:09 TimToady a range isn't going to have dups
22:10 pmichaud so, subscripting automatically "crops" the Range to fit its ideas of begin/end?
22:10 jan joined #perl6
22:10 b_jonas that sounds bad
22:10 b_jonas shouldn't @a[0..8] give eight elements even if there are fewer in the list?
22:10 pmichaud (nine)
22:10 b_jonas array I mean
22:10 b_jonas I dunno actually
22:11 TimToady I think only infinite ranges are cropped
22:11 b_jonas why'd you use an infinite range like @a[3..Inf] instead of @a[3..*] or @a.drop(3) ?
22:12 TimToady well, I wouldn't, but 3..* means the same thing
22:12 b_jonas er why?
22:12 b_jonas * doesn't mean Inf
22:12 TimToady it does to ..
22:12 pmichaud in the range context it does.
22:12 b_jonas doesn't it create a range (not list) with upper limit * ?
22:13 b_jonas I mean
22:13 TimToady so does ..Inf
22:13 pmichaud both   3..*   and 3..Inf  create a lazy Range
22:13 b_jonas the range doesn't get realized as a list anyway, so why couldn't * as upper limit mean different thing from * as upper limit?
22:13 TimToady why should it mean something different?
22:14 b_jonas well * could mean the index of last element so you can write @a[*-2]
22:14 pmichaud b_jonas: it already does that.  But *-2 isn't a Range.
22:14 TimToady yes, but then you're using -, not ..
22:14 b_jonas so @a[3..*] or @a[0..*-2] should work too
22:14 b_jonas how would the latter work?
22:14 viklund_ like a charm?
22:14 pmichaud note that   0..*-2  is not at all the same as 0..*
22:14 b_jonas dunno
22:15 b_jonas maybe I shouldn't care about this and just stick to takedrop when I mean something like this
22:15 b_jonas is there even a @a[*/2] for binary search? :-)
22:15 pmichaud yes.
22:15 TimToady 0..*-2 means 0..{$_ - 2}
22:16 pmichaud rakudo:  my @a = <a b c d e f g>;   say @a[*/2];
22:16 p6eval rakudo 5af9cf: OUTPUT«d␤»
22:16 b_jonas okay, that's ETOOMUCHMAGIC for me
22:16 pmichaud rakudo:  my @a = <a b c d e f g>;   say @a[*/2+1];
22:16 p6eval rakudo 5af9cf: OUTPUT«e␤»
22:17 TimToady not magic at all, but specifically delegating the meaning of * to the operator, always
22:17 pmichaud rakudo:  my @a = <a b c d e f g>;   say @a[0..*/2];
22:17 p6eval rakudo 5af9cf: OUTPUT«abcd␤»
22:18 pmichaud It really was ETOOMUCHMAGIC, I guess.
22:18 viklund_ ;)
22:19 pmichaud TimToady: perhaps we need to be a bit careful about "0..*-2 means 0..{$_ -2 }" ?
22:20 pmichaud because, at least as Rakudo currently has things, the *-2 isn't _exactly_ the same as {$_-2} (more)
22:20 TimToady yes, I was oversimplifying
22:20 pmichaud okay.
22:20 pmichaud I'm making sure that's the case; so that I'm not overcomplexifying.
22:21 pmichaud ("overcomplifying"?)
22:21 pugs_svn r27052 | jnthn++ | [t/spec] Tests for :tree modifier on .^methods, plus one for .perl on what .^methods returns.
22:23 TimToady no, it's oversimplying and overcomplexexifying
22:23 pmichaud :-D
22:24 dalek rakudo: f80f12c | jnthn++ | src/parrot/misc.pir:
22:24 dalek rakudo: Make .perl on a Parrot MultiSub not explode when we take .perl of a list containing it (yes, this patch sucks some...plan to improve .perl a bit on routines soon, though, and this is better than exploding).
22:24 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/f80f12c07d9584ffcbe7dda6253decf112a7c7ee
22:24 dalek rakudo: 86aeafb | jnthn++ | src/parrot/ClassHOW.pir:
22:24 dalek rakudo: Fix :tree support for .^methods.
22:24 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/86aeafbbbe17c2ff4c4b4bedcbc18667b81ad5f5
22:24 TimToady perhaps we should make sure splice works for b_jonas as awtdi :)
22:25 PZt joined #perl6
22:26 TimToady I do think that people reading Whatever code without knowing what it does are going to come up with a lot of inadequate folk theories about what the * means
22:26 ruoso joined #perl6
22:26 TimToady ah well, when they overgeneralize and cargo cult it wrong, that's when they're ready to learn it, I hope
22:28 TimToady maybe 0..* makes a RangeCode with an optional max  :) * .5
22:29 TimToady defaulting to Inf
22:33 TimToady course, then you get the one-too-many meaning of .[0..*+0], and that's harder to detect than an infinite range if you want to autotrim it
22:35 TimToady commuting&
22:39 pmichaud 22:09 <TimToady> a range isn't going to have dups
22:39 pmichaud how about.... @a[ 0..*:by(0.5) ]
22:39 pmichaud :=P
22:43 phenny joined #perl6
22:53 TimToady well, we could just say that if we notice we're running off the end
22:53 TimToady then we ask the range if it's infinite
22:54 TimToady since lists are supposed to be able to know that anyway for mostly eager semantics
22:55 frew|work joined #perl6
23:10 pmichaud (running off the end)  yes, that's kinda what came to my mind as well
23:14 lichtkind appendix C is done wow were completely done
23:14 lichtkind will be a vec command in perl 6?
23:16 skids_ joined #perl6
23:20 jnthn pmichaud: I need to go and rest soonish, but if you have something testable for install tomorrow probably I can help.
23:20 pmichaud yes, it won't happen until later tonightish.
23:21 pmichaud Too many other things distracting me today :-(
23:21 jnthn OK.
23:21 justatheory_ joined #perl6
23:22 meldrake joined #perl6
23:23 TimToady lichtkind: nope
23:23 TimToady Array of bit
23:24 lichtkind as data type
23:25 TimToady hopefully represented compactly, and convertable to a Buf if you need it
23:25 DanielC joined #perl6
23:25 lichtkind thanks
23:25 lichtkind good night
23:25 DanielC @seen mberends
23:25 TimToady in any case, if there were a vec, it would be defined only on bugs, not strs
23:25 lambdabot I saw mberends leaving #perl6 1h 25m 47s ago, and .
23:25 TimToady *bufs
23:26 jnthn If converted to a Buf, each byte in the Buf would have 8 of the bits from the Array of bit?
23:26 TimToady depends on what kind of Buf :)
23:26 TimToady Buf8, sure :)
23:26 jnthn ah
23:26 jnthn I hadn't realized be had that distinction.
23:27 TimToady yeah, it's buried way back in the later synopses, say, about S02  :P
23:27 jnthn You think I read the synopses? ;-)
23:28 jnthn Guess we need to think about the compact array stuff at some point in Rakudo though.
23:29 TimToady my int4 @nybbles;
23:30 cognominal joined #perl6
23:30 jnthn Aye, I knew about the int\d+ ones. I just didn't know buf had the same.
23:30 sjohnson so what do you guys think... universal $DUMMY variable in perl 6?
23:30 TimToady why?
23:30 Tene $DUMMY?  what would it be?
23:31 TimToady I don't think you've wanted it enough times yet...
23:31 TimToady I never buy something unless I've wanted it at least three times
23:31 TimToady well, almost never...
23:32 Tene sjohnson: what would $DUMMY be?
23:33 sjohnson Tene: a compiler variable to stick in values that yuo don't care about iinstead of havnig to declare them
23:33 sjohnson () = 5+5; works
23:33 sjohnson but sending () as an argument to something will fail as it's "readonly"
23:34 TimToady rakudo: (*) = 5+5
23:34 p6eval rakudo 86aeaf:  ( no output )
23:34 sjohnson my brother wrote something like that in a javascript framework i use at work to do that, and i found it a novel idea
23:34 TimToady rakudo: $*JUNK = 5+5
23:34 p6eval rakudo 86aeaf:  ( no output )
23:34 sjohnson timtoady:  what about:  sysread(STDIN, (*), 1);
23:34 sjohnson or something
23:34 TimToady rakudo: (*) = say 5+5
23:34 p6eval rakudo 86aeaf: OUTPUT«10␤»
23:35 sjohnson it is the sysread-like application that I am concerned about, as () / (*) seem to work already
23:35 TimToady my point exactly, that's the one time you've really wanted it :)
23:35 sjohnson basically if i am doing my own "Press any key to continue" i would use the sysread thing in that manner
23:35 TimToady in which case $*JUNK works fine
23:36 TimToady and is just as short as $DUMMY
23:36 sjohnson $*JUNK is actually what i am asking for?
23:36 TimToady rakudo: (my$) = say 5+5
23:36 sjohnson or is it the same as doing $*THIS_IS_GARBAGE?
23:36 p6eval rakudo 86aeaf: OUTPUT«Malformed declaration at line 2, near "$) = say 5"␤in Main (src/gen_setting.pm:0)␤»
23:36 StephenPollei I was just looking at S02 and while Buf buf8 ,buf16 and buf32 exist.. it doesn't mention Buf8 etc
23:36 TimToady rakudo: (my $) = say 5+5
23:36 p6eval rakudo 86aeaf: OUTPUT«Malformed declaration at line 2, near "$) = say 5"␤in Main (src/gen_setting.pm:0)␤»
23:36 TimToady std: (my $) = say 5+5
23:36 p6eval std 27052:  ( no output )
23:37 StephenPollei As a generic type Buf may be instantiated as (or bound to) any of buf8, buf16, or buf32 (or to any type that provides the appropriate Buf interface), but when used to create a buffer Buf defaults to buf8.
23:37 TimToady yeah, there really is no Buf8, only buf8
23:38 sjohnson TimToady: is $*JUNK just an arbitrary name?
23:38 TimToady since it's a native type
23:38 TimToady yes
23:38 sjohnson ie, is $*HAPPINESS is the same thing?
23:38 TimToady yes
23:38 sjohnson what does the * do?
23:38 TimToady assuming nobody defines a contextual variable of that name, it would mean the global one
23:38 sjohnson ie, how is it different than my $JUNK
23:39 TimToady in this case, short for $GLOBAL::JUNK
23:39 StephenPollei Not sure how to bind it to different types however, and it would be easy to create a Buf16 and Buf32 that do the right thing
23:39 TimToady (my $) should work too
23:39 sjohnson that is perfect! and less typing
23:39 TimToady just as (state $) gives you an anonymous state var
23:39 sjohnson less likelihood of getting arthirits
23:40 sjohnson thanks Tim's toady
23:40 sjohnson i am having a hard time trying to find something that isn't in Perl 6
23:40 TimToady some would say that's precisely the problem :)
23:41 sjohnson here's a question to throw out there.  is getting the ALT-<arrow keys> to do common readline stuff like go back to the last inputted value, a real pain in the neck?
23:41 TimToady btw, I'd say that the parameters to sysread could be made to default sensibly
23:42 TimToady so that $*IN.sysread just reads one char to nowhere
23:42 sjohnson that would be pretty ideal
23:42 * sjohnson approves
23:43 sjohnson sorry to ask a n00b question, but what does the * do?
23:43 TimToady generally, having to supply a dummy variable indicates a design smell elsewhere
23:43 sjohnson make it global?
23:43 sjohnson maybe it makes it anonymous... *scratches head*
23:43 sjohnson i am not sure
23:44 TimToady it means to search for the name up the dynamic scopes, and if you don't see it, assume it's in GLOBAL:: or PROCESS:: packages
23:44 sjohnson what about... my $.sysread
23:44 sjohnson for a dummy
23:45 TimToady that is shorthand for self.sysread
23:45 sjohnson hmm
23:45 TimToady so the . twigil means "search in the current object"
23:46 TimToady actually, ! means that, while . means search all the current object's classes
23:47 TimToady a ? twigil means a compile-time constant
23:47 TimToady so you never have to search at all, the compiler already knows it
23:48 TimToady twigils generally indicate strange scoping
23:48 sjohnson if you were in my shoes, would your "way to do it", simply be $*IN.sysread?
23:52 * jnthn -> sleep, night all
23:52 sjohnson provided, of course, that it was implemented to do so
23:53 sri_kraih joined #perl6
23:57 TimToady well, maybe, but it gets all complicated as soon as you want to get the arrow keys, since they could be multi-character sequences, or X events, or whatever
23:58 TimToady as soon as you get into GUI-land, you're at the mercy of its notions
23:58 TimToady and no two GUIs do it the same, alas
23:59 sjohnson the guis become gooey

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

Perl 6 | Reference Documentation | Rakudo