Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-06-06

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:16 meppuru joined #perl6
00:19 frew|work joined #perl6
00:23 xinming_ joined #perl6
00:41 sjohnson Khisanth: that too :)
00:45 Aisling joined #perl6
01:00 sjohnson anyone else noticed that the core module Switch; in p5 is as unrealiable as an alcoholic employee?
01:03 sjohnson i cant wait will p6 has it's given/when technology in place
01:03 sjohnson its*
01:04 Khisanth you never heard for perl 5.10?
01:05 Khisanth and of course Switch sucks, it's a source  filter!
01:05 Khisanth source filters usually start at "suck" and doesn't get much higher
01:06 sjohnson do you speak French?
01:07 nihiliad joined #perl6
01:07 Khisanth no
01:13 snarkyboojum joined #perl6
01:16 sjohnson english is not your first language, correct?
01:18 Khisanth it might as well be
01:18 Khisanth I don't speak Chinese very well :)
01:18 sjohnson just the way you wrote: "you never heard for perl 5.10?"
01:18 Khisanth which is not really spoken by anyone ;)
01:19 sjohnson it should be "of" not for
01:22 Khisanth that was more of an attempt to multiplex multiple channels issue
01:28 hercynium joined #perl6
01:45 om454545445 joined #perl6
02:13 amoc joined #perl6
02:31 om454545445 left #perl6
02:44 jdv79 left #perl6
03:22 snarkyboojum joined #perl6
03:47 drbean_ joined #perl6
03:55 drbean joined #perl6
04:05 david__ joined #perl6
04:13 sri_kraih joined #perl6
04:13 unitxt joined #perl6
04:21 frew|work joined #perl6
04:22 unitxt left #perl6
04:25 araujo joined #perl6
04:29 davidad joined #perl6
04:54 xinming joined #perl6
04:55 lambdabot joined #perl6
05:17 PZt joined #perl6
05:26 Maghnus joined #perl6
05:53 finanalyst joined #perl6
05:53 finanalyst good morning.
05:55 finanalyst my %x=<a b c> Z 1,2,3; say %x.perl
05:56 finanalyst rakudo: my %x=<a b c>Z 1,2,3;say %x.perl
05:56 p6eval rakudo fb2fd4: OUTPUT«{"a" => 1, "b" => 2, "c" => 3}␤»
06:04 snarkyboojum joined #perl6
06:11 cls_bsd joined #perl6
06:23 ejs joined #perl6
06:39 viklund joined #perl6
06:45 xomas joined #perl6
06:57 iblechbot joined #perl6
07:08 viklund joined #perl6
07:14 M_o_C joined #perl6
07:41 finanalyst can anybody here say how {} can be disambiguated as a hash rather than code. code is {; }
07:44 finanalyst rakudo: my %x=<a b c> Z { <q w r> Z (9,8,7) },{},{};%x.perl.say
07:44 p6eval rakudo fb2fd4: OUTPUT«{"a" => { ... }, "b" => {}, "c" => {}}␤»
07:55 finanalyst rakudo: my %x=<a b c> Z { <q w r> Z (9,8,7) , },{},{}; %x.perl.say
07:55 p6eval rakudo fb2fd4: OUTPUT«{"a" => { ... }, "b" => {}, "c" => {}}␤»
07:59 xinming_ joined #perl6
08:00 finanalyst rakudo: my %x=<a b c> Z { hash <q w r> Z (9,8,7) , },{},{}; %x.perl.say
08:00 p6eval rakudo fb2fd4: OUTPUT«{"a" => { ... }, "b" => {}, "c" => {}}␤»
08:03 finanalyst rakudo: my %h=<a b c> Z 1,2,3; my %x=<p q r> Z (%h, {}, {}); %x.perl.say
08:03 p6eval rakudo fb2fd4: OUTPUT«{"p" => "a" => 1, "q" => "b" => 2, "r" => "c" => 3}␤»
08:04 finanalyst is this right?
08:05 viklund o/
08:06 finanalyst rakudo: my %h=<a b c> Z 1,2,3; my %x=%('a'=>%h, 'b'=>{});%x.perl.say
08:06 p6eval rakudo fb2fd4: OUTPUT«{"a" => {"a" => 1, "b" => 2, "c" => 3}, "b" => {}}␤»
08:10 viklund tricky
08:13 finanalyst i think there is something wrong with .perl
08:14 finanalyst i have just got another error with it, but i cant reproduce it with a small script. I am getting "no ICU lib loaded"
08:21 hanekomu joined #perl6
08:24 DemoFreak joined #perl6
08:38 clintongormley joined #perl6
08:43 barney joined #perl6
09:05 cognominal joined #perl6
09:55 pmurias joined #perl6
10:14 fridim_ joined #perl6
10:27 cls_bsd joined #perl6
10:36 DanielC joined #perl6
10:57 clintongormley DanielC: I see you said that you'd rewritten the RPN parser
10:57 DanielC hi
10:58 clintongormley can you paste the code somewhere? i'd like to take a look
10:58 DanielC It is in perl6-examples
10:58 clintongormley i keep updating rakudo, then not knowing what to write :)
10:58 clintongormley which is where?
10:58 DanielC Just so we are on the same page, I rewrote a code example from a talk from jnthn.
10:58 DanielC I didn't rewrite anything inside Rakudo.
10:59 clintongormley yes
10:59 DanielC perl6-examples is in github, give me a minute to find the URL again...
11:00 clintongormley i mean, i keep wanting to play around with perl6, then can't think what to type other than "hello".say
11:00 DanielC git clone git://github.com/perl6/perl6-examples.git
11:00 clintongormley thanks
11:01 DanielC It is in the "interpreters" directory.
11:01 clintongormley ta
11:01 DanielC I didn't know what to call the directory. The directory also has a brainfuck interpreter :)
11:01 clintongormley heh yes :)
11:02 DanielC I'm starting to learn about Perl 6 grammar features. Very cool stuff. I think I might try to make a simple lisp interpreter next.
11:02 Whiteknight joined #perl6
11:03 clintongormley the new regex stuff looks amazing
11:03 DanielC yeah
11:04 DanielC http://daniel.carrera.bz/2009/06/rpn-calculator-in-perl-6/
11:04 DanielC I just posted this (a few seconds ago).
11:04 clintongormley i last checked a few seconds before asking
11:05 DanielC Yeah. I had the blog written but I hadn't published yet.
11:05 DanielC But when you brought up the RPN calculator I figured I might as well publish the post.
11:06 DanielC The post is meant for people who don't know Perl 6 at all, so it will be very elementary for you.
11:07 DanielC I gave it to my fiancee - she is a smart person, but doesn't know Perl 5. I figured that if she could follow it, then it was at the right level.
11:07 clintongormley i'm not so sure - i float around in the background, and read the odd tutorial, but know very little about p6
11:07 DanielC s/does't know Perl 5/doesn't know any Perl/
11:08 DanielC Then this blog post is for you :-)
11:08 clintongormley you write very well
11:08 DanielC thanks
11:09 jnthn DanielC: Nice post! :-)
11:09 DanielC :-D
11:09 jnthn DanielC: Small thingy: The second toke matches numeric values.
11:09 jnthn Should that be toke*n*?
11:09 DanielC Thanks. Fixed.
11:10 jnthn :-)
11:11 clintongormley that bit about <ws> being like \s* but not matching inside words is interesting, and useful
11:13 clintongormley btw, is your Expr token correct?
11:13 clintongormley it would allow Op Op Op Op
11:13 DanielC Yes, it would.
11:14 DanielC It is possible to write incorrect RPN that fits this grammar.
11:14 clintongormley ok
11:14 clintongormley in RPN, is " 1 2 3 4 +" legal?
11:14 jnthn You could probably catch it at evaluation time with
11:14 jnthn my $v1 = @stack.pop;
11:14 jnthn A line before that
11:14 jnthn That checks there are two things on the stack
11:14 DanielC clintongormley: I don't think it is.
11:14 clintongormley or is it always two numbers followed by an op
11:15 DanielC clintongormley: What would be the result?  A list of numbers maybe?
11:15 jnthn @stack.elems >= 2 or fail('Invalid RPN expression')
11:15 lambdabot Unknown command, try @list
11:15 clintongormley no - i was thinking it'd add together everything on the stack
11:15 jnthn or something
11:16 clintongormley but i haven't used an RPN calculator since i was 12 :)
11:16 jnthn 1 2 3 4 + would leave things on the stack, afaik.
11:16 jnthn Youd' ahve 1 2 7
11:16 DanielC clintongormley:  Not necessarily two numbers and then op. For example, this is legal: "5 4 + 3 / 5 3 - *"
11:16 clintongormley ok, right
11:16 clintongormley so you could actually say "1 2 3 4 + - *"
11:16 jnthn Yes.
11:16 * clintongormley invents syntax hopefully :)
11:16 jnthn That'd fully consume all of the values.
11:17 clintongormley ok
11:17 DanielC jnthn: Yes, one could add error checking. I was trying to keep the program simple, but error checking would be a useful exercise.
11:17 jnthn AFAIK, the op consumes the two values on the top of the stack and puts one result back onto the stack.
11:17 jnthn DanielC: Sure, simple++
11:17 clintongormley right
11:18 jnthn I'm pretty sure my original slides didn't do the error checking either.
11:18 clintongormley [] captures, no?
11:18 DanielC jnthn: No. And your grammar had a few issues. You had <Value>+ <Op>*  which would not match "2 2 + 2 +" for example.
11:19 DanielC clintongormley: I believe [] does not capture.
11:20 jnthn DanielC: I think I also had <Expr>+ at the top though.
11:21 * clintongormley reads further
11:21 DanielC jnthn: You are right, you did. But for some reason (I can't remember exactly) I didn't think the program worked.
11:21 jnthn That's quite possible.
11:22 DanielC jnthn: But that could just be me not understanding it. I can't say for sure.
11:22 jnthn I did work at some point (I remember actually showing it running in some talk.)
11:22 clintongormley woaah the $/ explanation is mind-blowing
11:22 jnthn But I'd hardly be surprised if it didn't work now.
11:22 DanielC jnthn: Did it handle 2 2 + 2 + ?
11:23 clintongormley DanielC ++
11:23 DanielC :-D
11:23 clintongormley good tutorial
11:24 DanielC thanks
11:24 clintongormley your explanation of $/ shone a light on my understanding
11:24 jnthn DanielC: Yes, believe so.
11:24 jnthn DanielC: As one Expr followed by another Expr
11:24 DanielC jnthn: Then it worked.
11:25 DanielC jnthn: The program would have to do this recursively. Evaluating the first expression produces a new expression.
11:25 DanielC clintongormley: Thanks. I'm glad it was useful. I hope other people find it useful too.
11:26 clintongormley you do technical writing for a living?
11:26 jnthn DanielC: IIRC I walked the expressions list and maintained the stack between them.
11:26 jnthn Anyway, TMTOWTDI and the one you posted is nice and clean. :-)
11:26 DanielC clintongormley: Not for a living, but I have a lot of technical writing and teaching experience. I founded the OpenOffice.org user guide project and I learned a lot from a good technical writer.
11:28 DanielC clintongormley: I also taught math for several years.
11:29 clintongormley and now you're working with PHP
11:29 * clintongormley feels for DanielC
11:29 pmurias joined #perl6
11:29 DanielC And my degree is in math and physics :-)
11:29 clintongormley i loved maths at school, then went to Uni and did medicine
11:30 clintongormley now my maths ends surely after basic arithmetic
11:30 clintongormley jnthn: looking forward to your talks yapc::eu
11:30 DanielC I enjoy programming in general, and I actually enjoy making web applications a lot. But I don't enjoy PHP. It's not all bad, but it is not *interesting*.
11:31 clintongormley yes
11:31 clintongormley perl is lyrical
11:31 clintongormley i don't find that with other languages
11:31 DanielC As someone said here yesterday, PHP is entirely unremarkable.
11:31 clintongormley it's frustrating, more than anything
11:31 clintongormley so badly designed
11:32 tulcod joined #perl6
11:32 DanielC It is very badly designed. That doesn't frustrate me on a day-to-day basis. But there is not much about the language to get excited about.
11:33 clintongormley no - you can tack things together, but it doesn't uplift the soul
11:33 pmurias clintongormley: isn't PHP mostly perl 4 with loads of functions?
11:33 clintongormley beauty isn't compatible with php
11:33 DanielC Perl feels like a human language, Ruby has amazing OOP, Haskell is purely functional and lazy. All of those are interesting languages.
11:33 DanielC yeah
11:33 clintongormley pmurias: kinda, yes, but the 'extension' mechanism is to add another keyword, with possibly incompatible interfaces
11:34 clintongormley it's like english
11:34 clintongormley no rules
11:34 clintongormley just lots of exceptions
11:34 clintongormley the weird thing is that i find english movingly beautiful
11:34 clintongormley while php just makes me ack
11:34 DanielC pmurias: http://www.tnx.nl/php.html
11:35 jnthn clintongormley: Yes, I look forward to YAPC::EU. :-)
11:36 clintongormley christmas is another year closer
11:36 jnthn YAPC::EU is the start of a three month run of one conference a month. :-)
11:36 * DanielC wishes he could go to YAPC::EU but he'll be in his honey moon.
11:36 clintongormley heeeey congratulations
11:36 viklund_ DanielC: There's a bug in your blog post ;)
11:36 DanielC If I take my wife to YAPC::EU for our honey moon she'll kill me.
11:36 DanielC clintongormley: thanks
11:36 DanielC viklund_: Patches welcome :-)
11:36 viklund_ you have defined do_op as "sub do_op($op, $lhs, $rhs)" but call it like this "(do_op($v0,$v1,$item<Op>)"
11:37 jnthn DanielC: Well, there'll be YAPC another year. :-) And, congrats. :-)
11:37 DanielC viklund_: thanks!  I changed the order to make it look more like RPN...
11:37 viklund_ ;)
11:37 DanielC jnthn: thanks :-)
11:37 * jnthn is also going to YAPC::Asia and the Italian Perl Workshop. :-D
11:38 DanielC viklund_: Fixed. Thanks.
11:39 viklund_ DanielC: you also need to change it under "The full program" (that's what ppl copy paste)
11:39 DanielC ah, right...
11:40 clintongormley jnthn: do you have a day job, or are you fully funded?
11:41 DanielC viklund_: Fixed. Thanks again.
11:41 icwiener joined #perl6
11:41 viklund_ DanielC: np
11:41 om454545445 joined #perl6
11:43 jnthn clintongormley: I have various clients that I do various things for.
11:43 jnthn clintongormley: And I'm also funded to work on Perl 6.
11:43 skids_ joined #perl6
11:43 jnthn So I kinda divide my time between Perl 6, other jobs, and travel.
11:43 clintongormley yes - i know about the grants, just wasn't sure if they were sufficient for full time work
11:43 clintongormley and you travel a LOT :)
11:44 icwiener_ joined #perl6
11:45 jnthn The grants allow me to spend significantly more time on Perl 6.
11:45 clintongormley ok - back to $job
11:47 skids_ rakudo: ("\c[EIGHTH NOTE]Happy Birthday " <<~<< ("to","to","dear","to") >>~>> " skids\n").say
11:47 p6eval rakudo fb2fd4: OUTPUT«♪Happy Birthday to skids␤♪Happy Birthday to skids␤♪Happy Birthday dear skids␤♪Happy Birthday to skids␤␤»
11:48 skids_ Why thank you, rakudo, how thoghtful of you.
11:50 payload joined #perl6
11:50 jnthn Best use of hypers I've seen all week. :-)
11:50 DanielC Is today your birthday?
11:50 jnthn skids_++ # and, I guess, Happy Birthday
11:57 skids_ Yep, and D-Day, which is how I manage to remember it :-)
11:57 DanielC :-)
11:57 DanielC Happy birthday.
11:57 DanielC How old are you today?
11:58 * skids_ thankses peeples.
11:58 skids_ I lost count.
11:58 DanielC heh
12:02 realbot joined #perl6
12:02 masak joined #perl6
12:06 om454545445 joined #perl6
12:07 om454545445 left #perl6
12:07 DanielC jnthn: I added an exercise for the user at the end of the blog post - to add error checking.
12:08 xinming joined #perl6
12:08 jnthn DanielC: Nice
12:09 skids_ warn("side effects may include fail") # <-- error checking :-)
12:09 DanielC heh
12:13 realbot left #perl6
12:18 masak rakudo: grammar A { regex b { foo } }; given "foo" { when A::b { say "OH HAI" } }
12:18 p6eval rakudo fb2fd4: OUTPUT«Object must be created by a class.␤in regex A::b (/tmp/KZGwe4seyf:2)␤called from Main (/tmp/KZGwe4seyf:2)␤»
12:18 masak jnthn: look, a new funny internal Parrot error! :)
12:18 * masak submits rakudobug
12:19 jnthn lolz it's the hilarious!
12:19 masak I know that's not the way to call regexes...
12:19 masak ...but I was curious what would happen, so I tried.
12:20 masak the error is from src/pmc/object.pmc.
12:21 masak and I just assume that it's not what should happen in this case.
12:22 masak rakudo: grammar A { regex b { foo } }; "foo" ~~ A::b
12:22 p6eval rakudo fb2fd4: OUTPUT«too few arguments passed (0) - 2 params expected␤in regex A::b (/tmp/ogbFRrVCrn:2)␤called from Main (/tmp/ogbFRrVCrn:2)␤»
12:22 masak strangely, this gives a more decent error.
12:22 masak rakudo: grammar A { regex b { foo } }; $_ = "foo"; when A::b { say "OH HAI" }
12:23 p6eval rakudo fb2fd4: OUTPUT«Object must be created by a class.␤in regex A::b (/tmp/FGjCkd3KOt:2)␤called from Main (/tmp/FGjCkd3KOt:2)␤»
12:23 masak so it's something in the 'when' semantics that triggers it.
12:24 masak rakudo: regex b { foo }; $_ = "foo"; when b { say "OH HAI" }
12:24 p6eval rakudo fb2fd4: OUTPUT«Object must be created by a class.␤in regex b (/tmp/yWXKG9467P:1)␤called from Main (/tmp/yWXKG9467P:2)␤»
12:25 masak oh. even simpler.
12:28 masak skids_: happy B-day!
12:29 jnthn hmm, wonder why when is special
12:31 masak I'd like to learn more of the ways in which when is not like ~~.
12:31 masak maybe it's time to peruse the source.
12:37 om454545445 joined #perl6
12:38 om454545445 left #perl6
12:43 payload1 joined #perl6
12:53 DanielC %r = box $I0  <---  What does this mean in Parrot?
12:53 DanielC $I0 is just a variable, but what is "box" and what is that % sign?
12:53 masak DanielC: %r is a special variable in PIR blocks that enable you to give the value back to Rakudo.
12:53 DanielC ah
12:54 masak DanielC: I suppose 'box' is a way to wrap dangerous values in objects or something.
12:56 DanielC "return"
12:56 DanielC So I assume that "box" is also related to giving the value back to Rakudo? Some sort of Parrot container for a value?
12:56 DanielC ping? Am I back on IRC?
12:56 DanielC thanks
12:57 * DanielC is in the room with bad Internet access.
12:57 * DanielC loves wireless networks though.
12:57 masak DanielC: I think so. I bet you'd find the answer somewhere in the Parrot docs.
12:58 DanielC I'm reading some slides from pmichaud. "Hacking Rakudo Perl".
12:58 PerlPilot joined #perl6
12:59 jnthn box = turn a native integer into an object type (e.g. Int)
12:59 jnthn %r = the result of the inline PIR.
12:59 DanielC jnthn: thanks
13:00 DanielC pmichaud's slides say that the Rakudo team is migrating builtins from PIR to Perl 6. Is there any reason why the PIR version is not as good?
13:00 jnthn %0 and %1 and so on might appear too - if you use an inline PAST::Op node in actions.pm. Those refer to the node children.
13:00 jnthn Yes
13:00 jnthn Several
13:00 jnthn One is that it makes the built-ins more hackable by the Perl 6 community, which is helpful.
13:00 jnthn But it also means various semantic issues just go away.
13:01 DanielC Interesting. I assumed that it was best to write stuff in PIR for speed.
13:02 DanielC At least, performance-critical stuff.
13:02 jnthn Yes, there are things that we can hand-optimize.
13:02 jnthn And for a lot of things the idea is a Perl 6 sub/method wrapper around inline PIR.
13:06 pmichaud good morning, #perl6
13:06 DanielC moin
13:06 jnthn hi pmichaud
13:06 pmichaud 11:36 <jnthn> YAPC::EU is the start of a three month run of one conference a month. :-)
13:06 pmichaud for me, YAPC::EU is the end of a three month run of one conference per month. :-)
13:07 pmichaud although if anyone can support my travel to YAPC::Asia and/or the Italian Perl Workshop, we could make it a four or five month run :-)
13:12 masak :)
13:14 ace1 joined #perl6
13:14 clintongormley pmichaud: why don't we cut out the middle man. i can just fly you to barcelona, and you can give me personal tutorials!
13:14 pmichaud works for me!
13:15 amoc joined #perl6
13:15 * clintongormley checks the bank balance
13:15 clintongormley :(
13:16 DanielC I would love it if the next conference was in Barcelona. I'd love to see the city.
13:16 clintongormley i see the Granada mongers are trying to get 2010
13:17 clintongormley the PM group here in barcelona is quite small
13:17 kidd_ we (at barcelona.pm) talked about doing something like a YAPC or at least a perl workshop, but unfortunately it ended to nothing :(
13:18 clintongormley kidd_: you're in barcelona.pm?
13:18 clintongormley hi!
13:18 DanielC Cuantos hispanos hay aqui?
13:18 kidd_ yup :) . A young perler myself, but trying to get into it.
13:18 clintongormley soy sudafricano
13:19 DanielC Pero estás en Barcelona?
13:19 kidd_ sip
13:19 clintongormley si - me he casado aquí
13:20 DanielC Ya entiendo. Yo estoy en Alemania por el mismo motivo.
13:35 jnthn Granada es bonita. :-)
13:40 beggars joined #perl6
13:40 masak rakudo: my %translations = "Alemania" => "Germany", "el" => "the", "en" => "in", "entiendo" => "understand", "estoy" => "am", "mismo" => "same", "motivo" => "reason", "por" => "for", "Ya" => "I", "Yo" => "I"; sub translate($word) { $word ~~ /(\w*)(\W*)/; return %translations{$0} ~ $1 }; my $spanish-sentence = "Ya entiendo. Yo estoy en Alemania por el mismo motivo."; my $english-sentence = ~(map { translate($_) },
13:40 masak $spanish-sentence.words); say $english-sentence
13:40 p6eval rakudo fb2fd4: OUTPUT«No result object␤in Main (src/gen_setting.pm:2660)␤»
13:40 masak dang :)
13:43 masak rakudo: my %translations = :Alemania<Germany>,:el<the>,:en<in>,:entiendo<understand>,:estoy<am>,:mismo<same>,:motivo<reason>,:por<for>,:Ya<I>,:Yo<I>;sub translate($word) {$word ~~ /(\w*)(\W*)/; return %translations{$0}~$1 }; my $spanish-sentence = "Ya entiendo. Yo estoy en Alemania por el mismo motivo."; my $english-sentence = ~(map { translate($_) }, $spanish-sentence.words); say $english-sentence
13:43 p6eval rakudo fb2fd4: OUTPUT«I understand. I am in Germany for the same reason.␤»
13:43 masak there you go. :)
13:43 jnthn Well, could to see Rakudo got the same translation as I did. :-)
13:43 jnthn *good...
13:44 jnthn No he hablado Espanol en mucho tiempo. :-(
13:44 masak lunch &
13:48 FurnaceBoy joined #perl6
13:49 sitaram joined #perl6
13:56 tulcod joined #perl6
13:58 mberends joined #perl6
13:58 ace1 left #perl6
14:18 meppl joined #perl6
14:21 PacoLinux DanielC: mas de los que te piensas :) !
14:22 DanielC :)
14:22 PacoLinux Sevilla por aqui :)
14:41 snarkyboojum joined #perl6
14:43 ruoso joined #perl6
14:47 icwiener-_- joined #perl6
14:51 sri_kraih joined #perl6
14:54 ruoso rakudo: multi a (Str $a, $Str $b) { [+$a, +$b] }; multi a (Array $a, $b where '+') { [+] @($a) }; ('1', '2', '+').reduce: &a;
14:54 p6eval rakudo fb2fd4: OUTPUT«Unable to parse multisig; couldn't find final ')' at line 2, near "$b) { [+$a"␤in Main (src/gen_setting.pm:0)␤»
14:54 ruoso rakudo: multi a (Str $a, Str $b) { [+$a, +$b] }; multi a (Array $a, $b where '+') { [+] @($a) }; ('1', '2', '+').reduce: &a;
14:54 p6eval rakudo fb2fd4: OUTPUT«Unknown introspection value 'pos_required'␤in method Any::reduce (src/gen_setting.pm:3226)␤called from Main (/tmp/MvPkx61zJn:2)␤»
14:54 ruoso is that known?
14:59 finanalyst hi. is any one here a moderator on the perl6-users list? If so, could you please blacklist Alexey Grebenschikov dimid@mail.ua for his annoying white-listing requests.
15:01 jnthn ruoso: Looks like bug in reduce, but it's hardly unknown that reduce on multis is interesting...
15:02 ruoso jnthn, I wrote a multi based RPN
15:02 jnthn Using reduce?
15:02 ruoso yes'
15:02 jnthn I'm not sure, what the spec says on how to handle that, or if it says anything at all
15:03 jnthn I suspect that .arity on multis or maybe .count, whichever reduce is looking at, may be doing something odd.
15:03 jnthn (They're not implemented on Multi yet...)
15:04 jnthn Then, I'm not sure how they should be implemented. Returning a junction maybe. :-S
15:05 ruoso but I made it with all variants with the same arity
15:05 ruoso because I knew the problem of varying-arity wasn't solved yet
15:06 ruoso maybe declaring a proto would help?
15:06 jnthn Well, I'm not sure the general problem of reduce + multi is solved.
15:06 jnthn No
15:07 jnthn It's still a multi, and they just don't do anything sensible with .arity and .count yet.
15:09 ruoso jnthn, er... reduce+multi is how [+] 1,2,3 works, isn't it?
15:10 pmurias ruoso: hi
15:11 skids_ rakudo: class A {}; multi sub infix:<+>(A $a, A $b) {}; 1 + 1;
15:11 p6eval rakudo fb2fd4: OUTPUT«Null PMC access in find_method()␤in Main (/tmp/K3KeK6krlF:2)␤»
15:11 skids_ rakudo: class A {}; sub infix:<+>(A $a, A $b) {}; 1 + 1;
15:11 p6eval rakudo fb2fd4: OUTPUT«Parameter type check failed; expected something matching A() but got something of type Int() for $a in call to infix:+␤in sub infix:+ (/tmp/b1Q6LkF8GH:2)␤called from Main (/tmp/b1Q6LkF8GH:2)␤»
15:11 skids_ Can that be worked around in Q:PIR or only pure PIR?
15:12 jnthn skids_: No known workaround for that at the moment.
15:12 skids_ (for those of us who just cannot wait)
15:12 skids_ Oh.
15:12 ruoso hi pmurias
15:12 jnthn Or at least I don't know one.
15:12 jnthn I know why it's a problem though.
15:12 jnthn The first one is the one that should work, btw.
15:13 skids_ Yeah, the second is just hitting it with a bat out of frustration :-)
15:13 jnthn Yeah, you just globally overrode infix:+
15:14 pmurias ruoso: in the runtime bootstraping scheme it's only worth compiling the CORE in a higher --target-stage if the higher level implementation is faster (for example JITed)?
15:14 jnthn ruoso: Hmm, true. I can only guess that there's something done differently in reduce the function rather than the meta-op...
15:15 ruoso pmurias, not at all... it will build the type using a more complete system...
15:15 ruoso jnthn, I guess it is, since the meta-op is not working with custom infixes
15:15 jnthn skids_: Basically it's a conflict between Parrot's multi-dispatch and Perl 6's. Really, operators need to be moved to the setting..
15:15 bloonix morning
15:15 jnthn ruoso: It works to some degree with them...
15:16 jnthn rakudo: sub infix:<wtf> { $^a ~ "wtf" $^b }; say [wtf] <omg bbq>;
15:16 p6eval rakudo fb2fd4: OUTPUT«Statement not terminated properly at line 2, near "$^b }; say"␤in Main (src/gen_setting.pm:0)␤»
15:16 jnthn Hmm.
15:17 jnthn oh
15:17 ruoso rakudo: multi infix:<rpn> (Int $a, Int $b) { return [$a, $b] }; multi infix:<rpn> (Array $a, Str $b where '+') { return [+] @($a) }; say [rpn] (1, 2, '+')
15:17 p6eval rakudo fb2fd4: OUTPUT«3␤»
15:17 jnthn rakudo: sub infix:<wtf> { $^a ~ "wtf" ~ $^b }; say [wtf] <omg bbq>;
15:17 p6eval rakudo fb2fd4: OUTPUT«omgwtfbbq␤»
15:17 ruoso ahn?
15:17 skids_ jnthn: Is that something that would get pushed if sent in, or would it be a case of "we're really not ready to do that yet, wait for lift"?
15:18 jnthn skids_: We already have an RT ticket, and we know what needs doing.
15:18 jnthn skids_: In fact, there's already some progress in that direction. Just not quite there yet. :-)
15:18 skids_ Ah, I'll find the RT, thanks :-)
15:18 jnthn ruoso: Looks like that worked?
15:19 ruoso jnthn, how?
15:19 jnthn ruoso: Erm, because it cave the output 3?
15:19 ruoso I just had an example that didn't...
15:19 jnthn *gave
15:19 ruoso heh
15:19 jnthn 1 2 + is 3
15:19 ruoso ah
15:19 ruoso no... I know that... I mean... I had a code that wasn't working
15:19 ruoso then I posted that snippet to show you it wasn't
15:20 ruoso and suddenly it worked
15:20 jnthn Oh, with the reduce method.
15:20 jnthn Yes, we already estanblished that is doing something different (don't knwo why...)
15:20 ruoso ok... I have my RPN working now...
15:20 pasteling "ruoso" at 189.97.60.4 pasted "multi-reduce based RPN calculator" (33 lines, 653B) at http://sial.org/pbot/37075
15:20 jnthn heh, cool example.
15:21 ruoso actually the first sig is wrong
15:21 jnthn Why Array $a and not the @a ?
15:22 ruoso not sure...
15:25 * jnthn afk for a bit
15:25 pasteling "ruoso" at 189.97.60.4 pasted "simplified syntax for multi-reduce-based-RPN-calc" (28 lines, 472B) at http://sial.org/pbot/37077
15:25 masak joined #perl6
15:27 masak finanalyst: hello. I'm not a moderator of p6u, but I'd like to chime in with the request to ban dimid@mail.ua, a repeat-offending whitelist spammer on that list.
15:29 finanalyst i had some questions this morning, but no one seemed awake. How to disambiguate a hash?
15:29 finanalyst rakudo: my %x=<a b c> Z { <q w r> Z (9,8,7) },{},{};%x.perl.say
15:29 p6eval rakudo fb2fd4: OUTPUT«{"a" => { ... }, "b" => {}, "c" => {}}␤»
15:29 masak finanalyst: hold on, I'll try to find the exact answer in the spec.
15:30 finanalyst rakudo: my %h=<a b c> Z 1,2,3; my %x=<p q r> Z (%h, {}, {}); %x.perl.say
15:30 p6eval rakudo fb2fd4: OUTPUT«{"p" => "a" => 1, "q" => "b" => 2, "r" => "c" => 3}␤»
15:30 finanalyst rakudo: my %h=<a b c> Z 1,2,3; my %x=%('a'=>%h, 'b'=>{});%x.perl.say
15:30 p6eval rakudo fb2fd4: OUTPUT«{"a" => {"a" => 1, "b" => 2, "c" => 3}, "b" => {}}␤»
15:31 finanalyst there seems to be an inconsistency here
15:33 DanielC Hi all. Where can I find a list of stuff that Rakudo doesn't do yet? (e.g. builtins that are not implemented).
15:33 TimToady the first one has %h in list context, so it flattens
15:33 ascent_ rakudo: my %h=<a b c> Z 1,2,3; my %x=<p q r> Z ({%h}, {}, {}); %x.perl.say
15:33 p6eval rakudo fb2fd4: OUTPUT«{"p" => { ... }, "q" => {}, "r" => {}}␤»
15:33 FurnaceBoy joined #perl6
15:34 TimToady now {%h} is a closure
15:34 TimToady rakudo: my %h=<a b c> Z 1,2,3; my %x=<p q r> Z (item(%h), {}, {}); %x.perl.say
15:34 p6eval rakudo fb2fd4: OUTPUT«{"p" => "a" => 1, "q" => "b" => 2, "r" => "c" => 3}␤»
15:35 masak finanalyst: ah. S04:1256.
15:35 TimToady rakudo: my %h=<a b c> Z 1,2,3; my %x=<p q r> Z (\%h, {}, {}); %x.perl.say
15:35 p6eval rakudo fb2fd4: OUTPUT«{"p" => {"a" => 1, "b" => 2, "c" => 3}, "q" => {}, "r" => {}}␤»
15:35 sri_kraih_ joined #perl6
15:36 TimToady hmm, I guess the inside of item() is also a list
15:38 finanalyst rakudo: my %x=<a b c> Z { hash <q w r> Z (9,8,7) , },{},{}; %x.perl.say
15:38 p6eval rakudo fb2fd4: OUTPUT«{"a" => { ... }, "b" => {}, "c" => {}}␤»
15:39 finanalyst rakudo: my %x=<a b c> Z  hash(<q w r> Z (9,8,7)) ,{},{}; %x.perl.say
15:39 p6eval rakudo fb2fd4: OUTPUT«{"a" => "q" => 9, "b" => "w" => 8, "c" => "r" => 7}␤»
15:40 TimToady that looks right to me
15:40 finanalyst the aim was to have 'a' => {'q'=>9,'w'=>8,'r'=>7}
15:41 TimToady the hash returned by hash() is in list context, so flattens for Z
15:41 finanalyst ah
15:41 TimToady so I believe that's correct according to current semantics
15:41 TimToady try \hash
15:42 finanalyst rakudo: my %x=<a b c> Z  \hash(<q w r> Z (9,8,7)) ,{},{}; %x.perl.say
15:42 p6eval rakudo fb2fd4: OUTPUT«{"a" => {"q" => 9, "w" => 8, "r" => 7}, "b" => {}, "c" => {}}␤»
15:43 finanalyst \ looks like p5 reference syntax
15:43 TimToady rakudo: my %x=<a b c> Z $(hash(<q w r> Z (9,8,7))) ,{},{}; %x.perl.say
15:43 p6eval rakudo fb2fd4: OUTPUT«{"a" => "q" => 9, "b" => "w" => 8, "c" => "r" => 7}␤»
15:43 TimToady hmm, looks like inside of $() is list context too
15:44 TimToady I guess the \ isn't entirely useless yet
15:45 TimToady rakudo: my $h = hash(<q w r> Z (9,8,7)); my %x=<a b c> Z $h ,{},{}; %x.perl.say
15:45 p6eval rakudo fb2fd4: OUTPUT«{"a" => {"q" => 9, "w" => 8, "r" => 7}, "b" => {}, "c" => {}}␤»
15:46 TimToady rakudo: my $h := hash(<q w r> Z (9,8,7)); my %x=<a b c> Z $h ,{},{}; %x.perl.say
15:46 p6eval rakudo fb2fd4: OUTPUT«{"a" => "q" => 9, "b" => "w" => 8, "c" => "r" => 7}␤»
15:47 TimToady I don't like that $h interpolates the hash there
15:48 pasteling "skids" at 71.192.212.78 pasted "having fun poking Parrot's 'Rational' with a stick" (179 lines, 3.5K) at http://sial.org/pbot/37078
15:56 payload joined #perl6
16:09 justatheory joined #perl6
16:09 pmichaud 15:33 <DanielC> Hi all. Where can I find a list of stuff that Rakudo doesn't do yet? (e.g. builtins that are not implemented).
16:09 pmichaud http://rakudo.org/status
16:10 pmichaud it's not a complete list, but it gets some of the major items
16:11 DanielC pmiichaud:  thanks
16:14 beggars joined #perl6
16:15 DanielC make spectest  1397.02s user 60.66s system 174% cpu 13:55.70 total  <--- How can a process use more than 100% of the cpu?
16:15 TimToady multicore
16:17 DanielC I think my laptop is too old to be multicore...
16:18 pmichaud less /proc/cpuinfo
16:18 pmichaud (if on Linux)
16:18 TimToady darn, you beat me to it
16:18 TimToady I had to go looking :)
16:19 DanielC Golly, I think you guys are right. I appear to have a multicore.
16:19 skids_ It's not how much CPU you use, it's how much cat hair you pull in the intake.
16:19 TimToady you're twice the man you thought you were...
16:20 DanielC processor 0 => GenuineIntel ... processor 1 => GenuineIntel
16:20 TimToady would be really funny if the second one said FakeIntel
16:20 fridim_ joined #perl6
16:20 skids_ could be "fake multicore" a.k.a. hyperthread.
16:20 DanielC heh
16:21 TimToady don't think you'd have got all of 174% with hyperthreading
16:21 hanekomu_ joined #perl6
16:21 TimToady hyperthreading isn't normally a huge win
16:22 * skids_ would hardly blame /proc/cpuinfo for saying "FakeIntel" on a hyperthreaded die, actually
16:22 TimToady oh, hyperthreading is genuine Intel, all right...
16:22 TimToady it's just fake threading :)
16:22 skids_ Maybe IntelFake
16:26 nihiliad joined #perl6
16:31 Psyche^ joined #perl6
16:40 unitxt joined #perl6
16:49 AzureStone joined #perl6
17:10 om454545445 joined #perl6
17:16 Khisanth joined #perl6
17:18 pasteling "ruoso" at 189.97.60.4 pasted "multi-reduce based RPN calculator, now supporting stacked operations" (46 lines, 872B) at http://sial.org/pbot/37085
17:20 jnthn ruoso: It runs on Rakudo?
17:20 ruoso oh yeah!
17:20 ruoso rakudo++
17:20 jnthn Yay!
17:20 jnthn ruoso: BTW, if you didn't already and have a moment, do file a bug on function reduce not behaving...
17:21 ruoso it still has the issue of '2+2' instead of '2 + 2'
17:21 ruoso the split needs a better regex to catch that
17:21 ruoso I did already
17:21 jnthn ruoso++: Thanks.
17:22 clintongormley joined #perl6
17:22 ruoso I guess that if we had multi-dimensional signatures, we could do something like
17:23 ruoso multi infix:<rpn> ( $ls, $rs, *@rest; $op where '/' ) { return [ @rest, $ls / $rs ] }
17:24 ruoso std: multi infix:<rpn> ( $ls, $rs, *@rest; $op where '/' ) { return [ @rest, $ls / $rs ] }
17:24 p6eval std 27013: OUTPUT«##### PARSE FAILED #####␤Can't put required parameter after variadic parameters at /tmp/kAUKPc4tcF line 1:␤------> [32m<rpn> ( $ls, $rs, *@rest; $op where '/' [31m) { return [ @rest, $ls / $rs ] }[0m␤    expecting any of:␤    post_constraint␤  standard stopper␤
17:24 p6eval ..terminator␤FAILED 00:…
17:24 ruoso hmm... I wasn't expecting that...
17:24 ruoso the slurpy was in one dimension only...
17:25 skids_ could just move the @a.shifts into the return.
17:25 jnthn Not quite sure I grasp what a multi-dimensional signature is. :-)
17:25 jnthn ruoso: Did you mean ;;?
17:25 ruoso skids_, I was unsure about the order the shifts would happen
17:25 jnthn Oh, no
17:25 ruoso jnthn, that means something else
17:26 jnthn ruoso: ; was potentially also going to have a meaning too, though not in 6.0.0, iirc.
17:26 ruoso ok... the current code is not bad, after all
17:26 jnthn oh what, you wanted to do an unpack?
17:26 jnthn There's syntax for that.
17:27 jnthn std: multi infix:<rpn> ( [$ls, $rs, *@rest], $op where '/' ) { }
17:27 p6eval std 27013: OUTPUT«ok 00:02 37m␤»
17:27 jnthn Though Rakudo doesn't implement that. :-(
17:28 ruoso hah!
17:28 ruoso that's cool
17:28 jnthn Yeah, I love the unpack syntax.
17:28 jnthn But it's kinda blocked on giving signatures a good reworking.
17:28 * ruoso supermarket &
17:29 jnthn Well, signature binding at least...and that depends on Parrot getting its act together on calling conventions refactors..
17:30 * skids_ thinks of sorting status "unimplemented" list by features that most impact the way code ends up looking.
17:30 skids_ loop return values would top that list IMO.
17:30 jnthn loop return values?
17:31 skids_ rakudo: @a = for 1..3 { .Str }; @a.say;
17:31 p6eval rakudo fb2fd4: OUTPUT«Statement not terminated properly at line 2, near "{ .Str }; "␤in Main (src/gen_setting.pm:0)␤»
17:31 skids_ erm, well, something akin to that then.
17:31 om454545445 left #perl6
17:38 TimToady rakudo: @a = do for 1..3 { .Str }; @a.say;
17:38 p6eval rakudo fb2fd4: OUTPUT«Symbol '@a' not predeclared in <anonymous> (/tmp/sXfVZq4AMa:2)␤in Main (src/gen_setting.pm:3226)␤»
17:39 TimToady rakudo: my @a = do for 1..3 { .Str }; @a.say;
17:39 p6eval rakudo fb2fd4: OUTPUT«-1␤»
17:40 jnthn Ah, that.
17:40 TimToady rakudo: my @a = map { .Str }, 1..3; @a.say;
17:40 p6eval rakudo fb2fd4: OUTPUT«Int()<0xb6c2a948>Int()<0xb6c2a828>Int()<0xb6c2a708>␤»
17:40 TimToady o_O
17:40 jnthn wtf
17:40 jnthn rakudo: my @a = map { ~$_ }, 1..3; @a.say;
17:40 p6eval rakudo fb2fd4: OUTPUT«123␤»
17:41 jnthn TimToady: Should prefix:~ by default be calling .Str?
17:41 TimToady yes, I think so
17:41 TimToady or at least doing the same thing...
17:42 TimToady rakudo: my @a = map -> $_ { .Str }, 1..3; @a.say;
17:42 p6eval rakudo fb2fd4: OUTPUT«Int()<0xb6c34a80>Int()<0xb6c348e8>Int()<0xb6c347c8>␤»
17:42 TimToady rakudo: my @a = map <-> $_ { .Str }, 1..3; @a.say;
17:42 p6eval rakudo fb2fd4: OUTPUT«Int()<0xb6ca0520>Int()<0xb6ca0400>Int()<0xb6ca02b0>␤»
17:42 TimToady not that
17:42 skids_ lol
17:42 TimToady rakudo: my @a = map { $^a.Str }, 1..3; @a.say;
17:42 p6eval rakudo fb2fd4: OUTPUT«Int()<0xb6cc3c08>Int()<0xb6cc3ad0>Int()<0xb6cc39b0>␤»
17:43 skids_ rakudo: my @a = map { $^a.Str }, 1,2,3; @a.say;
17:43 p6eval rakudo fb2fd4: OUTPUT«Int()<0xb6cffd38>Int()<0xb6cffc18>Int()<0xb6cffaf8>␤»
17:43 TimToady rakudo: my @a = map { my $x = $_+0; $x.Str }, 1..3; @a.say;
17:43 p6eval rakudo fb2fd4: OUTPUT«Int()<0xb6c3fad8>Int()<0xb6c3ea28>Int()<0xb6c3dc90>␤»
17:43 TimToady rakudo: my @a = map { my $x = $_+0; $x }, 1..3; @a.say;
17:44 p6eval rakudo fb2fd4: OUTPUT«123␤»
17:44 TimToady obviously a problem in .Str
17:44 skids_ rakudo: 1.Str.say
17:44 p6eval rakudo fb2fd4: OUTPUT«Int()<0xb621fba8>␤»
17:44 TimToady yep
17:44 jnthn Yeah, I think we currently have a bunch of prefix:<~>
17:45 jnthn And no override for Str
17:45 TimToady parrot confusion between typenames and strings, perhaps?
17:45 jnthn No, I just suspect that we didn't override Str in String.
17:45 jnthn It's calling Object.Str
17:46 jnthn rakudo: class Dog { }; say Dog.new.Str
17:46 p6eval rakudo fb2fd4: OUTPUT«Dog()<0xb6add7e0>␤»
17:46 jnthn Aye, just the default Str fallback...
17:46 TimToady should probably just carp about no Str method
17:46 TimToady I suspect the conversion done by print/say is even lower than Str
17:47 TimToady and that's where an object without a Str method would Dog()ify
17:48 jnthn Could be that way too, yeah.
17:48 TimToady that's where junctions also stringify, I think
17:48 jnthn Right, because .Str on a junction would auto-thread by default?
17:48 TimToady since $junction.Str should autothread
17:48 jnthn rakudo: say (1 | 2 | 3).Str
17:48 p6eval rakudo fb2fd4: OUTPUT«Junction()<0xb6b55ee8>␤»
17:49 jnthn rakudo: say (1 | 2 | 3).Str.eigenvalues
17:49 p6eval rakudo fb2fd4: OUTPUT«Method 'eigenvalues' not found for invocant of class 'String'␤»
17:49 jnthn Ouch.
17:49 jnthn Rakudo fail.
17:49 TimToady so Object::Str is really pretty bogus
17:49 jnthn I suspect we may be defining a Junction::Str...
17:50 jnthn rakudo: (1 | 2 | 3).^methods>>.say
17:50 p6eval rakudo fb2fd4: OUTPUT«perl␤true␤ACCEPTS␤!type␤eigenstates␤␤»
17:50 jnthn Oh no.
17:50 TimToady I think print/say call last_ditch_stringify() or some such :)
17:50 skids_ hahah.  obscurity worked!
17:51 jnthn TimToady: Don't tempt me to implement it with that name. I might just. :-P
17:51 TimToady please do :) * .1
17:52 TimToady hmm "last ditch" is seemingly a WW1 metaphor...
17:52 jferrero joined #perl6
17:53 TimToady nope, was apparently coined in 1715
17:53 TimToady but was indeed about battlements
17:53 skids_ By a ditch salesman?
17:54 TimToady you can never have too many
17:54 skids_ While supplies last.
17:54 TimToady the ditch pitch
18:01 DanielC joined #perl6
18:15 DanielC my @b = [8,9,1],2,3,4; say @b[0]; # I love Perl 6.
18:15 DanielC In Perl 5 you would have written @{$b[0]}  ugh...
18:23 viklund pmurias RPN calculator inspired me to shorten P08 in 99-problems i perl6-examples
18:23 viklund http://gist.github.com/124951
18:23 viklund I thought that a reduce would fit the bill yesterday but didn't manage to write the sub correctly
18:23 viklund now it works like a charm ;)
18:25 DanielC What is P08 ?
18:25 viklund it
18:25 viklund it should remove duplicate elements from a list
18:25 viklund <a a a a b c c a a d e e e e> => <a b c a d e>
18:26 DanielC cool
18:26 DanielC I remember seen that problem before in Haskell.
18:26 DanielC Hmm... I notice that 99-problems/ doesn't have 99 problems :-)
18:27 viklund no, it hasn
18:27 viklund hasn't
18:27 viklund (small keyboard, I often miss ' and press
18:27 viklund instead)
18:28 DanielC Ah... these problems come from Lisp. That explains why I've seen it before in the context of Haskell.
18:28 viklund yes
18:28 viklund i'd like to commit that to perl-examples, but I don't have access to that repo...
18:29 DanielC pmichaud can hook you up with access.
18:29 viklund ok
18:29 viklund pmichaud: please, could you give me access to perl6-examples?
18:31 dalek rakudo: 97f1415 | pmichaud++ | src/ (4 files):
18:31 dalek rakudo: Refactor assignment in terms of STORE.  This brings us somewhat
18:31 dalek rakudo: closer to the spec, eliminates the multi-variants of infix:<=>,
18:31 dalek rakudo: eliminates a few "isa" checks, and paves the way for better
18:31 dalek rakudo: rw and postcircumfix handling.
18:31 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/97f1415cb64f7b0dba9bf37a9b69a85f8d237b6b
18:32 pmichaud viklund: github id?
18:32 viklund viklund
18:32 pmichaud Added.
18:32 viklund pmichaud: ty
18:48 lichtkind joined #perl6
18:50 icwiener_ joined #perl6
18:52 pmurias joined #perl6
18:54 mberends lichtkind: hi, Appendix A almost 50% done (from Z upwards), take a look
18:55 lichtkind mberends: great i did some things on tutorial
18:55 lichtkind mberends: are you interested in november too?
18:55 cotto joined #perl6
18:55 mberends lichtkind: yes I am :)
18:56 * jnthn looks at pmichaud++'s refactor
18:56 lichtkind im the first user you can become second :)
18:56 mberends lichtkind: I was the first user several months ago :)
18:56 pmichaud jnthn: start with assign.pir -- the rest makes sense after that
18:57 lichtkind mberends: so they lied to me :)
18:57 lichtkind mberends: what you written?
18:57 jnthn pmichaud: I see in the patch you didn't remove the :multi(_,_) - is that to allow others to override it too?
18:58 pmichaud jnthn: maybe.  I think TimToady++ said yesterday that operators tend to want to be multis, so I left it that way.
18:58 jnthn OK
18:58 jnthn It's probably the right thing.
18:58 pmichaud Of course, the way it is now, we could even move infix:<=> into the setting :-)
18:58 mberends lichtkind: I did only a small edit of the main page, it was about 4 months ago
18:58 pmichaud but I'm going to leave it in PIR for efficiency reasons :-)
18:59 jnthn pmichaud: *nod*
18:59 lichtkind mberends: my current plan is to change november into a newbee friendly intro in perl 6 projects & lang with lot of pointers
18:59 jnthn pmichaud: Why is !STORE in List, not Array?
19:00 pmichaud Array has one also.
19:00 pmichaud (always has.)
19:00 pmichaud storing to a List is different from storing to an Array
19:00 jnthn oh, I see what it's doing...
19:00 pmichaud List handles the   ($x, $y) = ...   case
19:00 jnthn Right I was thinking "wait, List is immutable"...
19:00 pmichaud Array handles the   @a = ...
19:01 mberends lichtkind: excellent. on that subject, I wondered what you thought about adding references to Synopses into that Appendix A.
19:01 jnthn OK, and (1,2,3) = (4,5,6) will fail since 1, 2 and 3 aren't containers.
19:01 pmichaud well, it'll eventually fail when I get the rw stuff in, yes :-)
19:01 pmichaud currently it still succeeds :-/
19:01 jnthn aww
19:01 lichtkind mberends: never thought about that but i think links are not fine grained enough
19:01 jnthn We have to make Rakudo fail!
19:01 pmichaud That's masak++'s job.
19:01 jnthn :-)
19:02 jnthn I so hate that we need .macro fixup_cloned_sub(orig, copy) *sigh*
19:03 jnthn We might instead want to subclass Sub, hll_map it and just have an ATTR for hanging the signautre off.
19:03 lichtkind mberends: so you have already nov account?
19:04 jnthn (And yes, I know I introduced the macro...that was to not copy-paste bits all over..)
19:04 pmichaud I looked at that -- I think we can clean it up
19:04 pmichaud I did at least remove the isa checks
19:04 pmichaud I figure that getprop is much less expensive than isa
19:04 jnthn Probably yes.
19:05 mberends lichtkind: yes, I have a November account. you're right, Synopsis links would not be able to point to the exact paragraph, the reader would have to do some searching. I'm mainly worried that the appendix is a 'dead end' when searching for info.
19:05 om454545445 joined #perl6
19:05 pmichaud does cloning a (parrot) Sub also clone its 'proxy' attribute?
19:05 lichtkind mberends: true maybe as a see also addition
19:06 lichtkind mberends: like (reference) which is than a link
19:06 jnthn pmichaud: Confused.
19:06 om454545445 left #perl6
19:06 jnthn pmichaud: The Parrot Sub is what is stored in the proxy attribute.
19:06 lichtkind but in our wiki we can set jumpoint like we need and explain it in a way we like
19:06 pmichaud sorry, I should rephrase
19:06 pmichaud if we subclass Parrot Sub  (e.g. Code)
19:06 pmichaud then instances of Code get a 'proxy' attribute
19:06 pmichaud when we clone those instances
19:07 pmichaud do they share the same 'proxy' ?
19:07 jnthn No
19:07 jnthn The proxy is cloned too.
19:07 pmichaud should they?
19:07 pmichaud or do we envision those objects to be mutable somehow?
19:07 jnthn Probably, otherwise Block.clone won't clone the Parrot Sub and then our closures wouldn't work.
19:08 pmichaud hmmm.
19:08 pmichaud that sounds right.
19:08 jnthn .wrap does take advantage of the fact that we can swap out the proxy though.
19:08 pmichaud okay.
19:08 unitxt left #perl6
19:08 jnthn Which feels naughty but actually works out fairly neatly.
19:08 pmichaud It is naught.
19:08 pmichaud *naughty.
19:09 pmichaud Bordering on Evil.
19:09 pmichaud So I like it.  :-P
19:09 jnthn Phew!
19:09 jnthn For a moment I thought you were going to make me re-write .wrap. Again. :-P
19:09 lichtkind mberends: i also wanted to talk with you about appendix b
19:09 pmichaud I may still do that but it will be some time hence.
19:10 pmichaud (if ever.  Not likely.)
19:10 jnthn The big deal is that it uses the candidate list now.
19:10 pmichaud correct.
19:10 rindolf joined #perl6
19:10 jnthn I need to think a bit about interactions between candidate lists if you dispatch to a wrapped method and callnext from there.
19:10 viklund sometime git does strange stuff...
19:10 jnthn It may Just Work already.
19:11 lichtkind mberends: ist stubid because thats parts we can copy out of synopses, most of them
19:11 jnthn But I didn't try it and I have a niggling feeling that it won't.
19:11 viklund sometimes*
19:11 viklund but it usually works out
19:11 lichtkind mberends: appendix b are tables for short look
19:11 lichtkind mberends: should we add there an complete operator ?
19:12 lichtkind mberends: and third thing please look at http://www.perlfoundation.org/perl6/index.cgi?perl_6_tutorial_part_1 since i started stranslating
19:15 mberends lichtkind: just reading Appendix B now. In many cases Appendix A can have a link to an exact point in Appendix B, and Appendix B can link to the Synopses. It's very useful to organize definitions in lists :)  I'll look at part_1 now..
19:15 lichtkind mberends: maybe we open perl6doc channel :)
19:17 mberends lichtkind: not yet, there are too few of us, and it's good to keep people in #perl6 up to date with developments. you should see if literal++ is interested in content for his grok utility.
19:17 lichtkind moritz_ has also some atememtp going on with his p6code commenting script
19:18 pmichaud afk for a bit
19:20 * skids_ wonders what's german for "grok" :-)
19:22 mberends wonder no more, google says it's also "grok" in german, so that's official :-)
19:22 skids_ wow, it's Tetris's birthday too.  I Did Not Know That (tm)
19:23 mberends oh, yes, many happy return(skids_)
19:25 skids_ thanks!
19:26 lichtkind skids_ verstehen
19:27 skids_ lichtkind: but does it also mean to eat? :-)
19:27 lichtkind skids_ no that im aware of
19:28 hanekomu joined #perl6
19:28 lichtkind skids_ its in german the other way arrounf swollow is also understood as comprehend
19:28 lichtkind but thats an different word
19:28 lichtkind schlucken
19:29 mberends in .nl 'slikken' is swallow, and can imply 'accept'
19:29 skids_ Ah.  English closest to grok might be "digest"
19:30 lichtkind mberends: it implies also believing , and grok
19:31 cottoo joined #perl6
19:43 Jedai joined #perl6
19:56 pasteling "ruoso" at 189.97.60.4 pasted "multi-reduce based RPN calculator, fixed bug pointed by DanielC" (52 lines, 1K) at http://sial.org/pbot/37088
20:00 * lichtkind wonders id TimToady saw UFO pictures at JPL
20:01 TimToady ruoso: why use split instead of comb?
20:01 ruoso er... perl5 mindset?
20:01 TimToady or .words
20:02 TimToady since .comb defaults to chars now
20:03 ruoso TimToady, but that still needs to have the "2 2+" issue fixed
20:03 TimToady JPL discovers all sorts of unidentified flying objects
20:03 TimToady and then gives them names
20:04 TimToady ruoso: I can't be answerable for a stupid spec :)
20:05 pasteling "ruoso" at 189.97.60.4 pasted "multi-reduce based RPN calculator, now using .words instead of split -- prettier trace" (52 lines, 980B) at http://sial.org/pbot/37089
20:06 lichtkind TimToady: but you know that a polititians answer :)
20:06 TimToady well, I could tell you, but then they'd turn off my brain implant
20:08 lichtkind TimToady: and we both wont that :)
20:09 lichtkind TimToady: did you recognized Gary McKinnon case?
20:23 lichtkind ouch the brain implant went off
20:23 TimToady conspiracy nuts continually insult the integrity of the vast majority of scientists; I include young earth creationists in this category
20:23 TimToady it does not please me
20:26 Khisanth didn't you write the specs? :P
20:27 antiphase joined #perl6
20:29 lichtkind TimToady: excse me, doesnt ment to discomfort you,  i just brought up becaue he actually used perl so it was hot topic on perlmonks, but to be honest i believe the more intelligent scientist arent insulted when challenged
20:30 TimToady someone merely fishing to feed their confirmation bias is not a challenge, but a pain in the butt
20:31 ejs joined #perl6
20:32 lichtkind TimToady: true, heavy preconceptions are never easy dto deal with
20:36 TimToady now all you have to do is classify everyone who disagrees with you as having heavy preconceptions, and then it's easier to ignore your own.  :)
20:37 pmichaud rakudo:   my $x = * - 3 + 4;   say $x(7);
20:37 p6eval rakudo 97f141: OUTPUT«Use of uninitialized value␤invoke() not implemented in class 'Float'␤in Main (/tmp/jhajwKf6ij:2)␤»
20:37 pmichaud rakudo:   my $x = * *3 + 4;   say $x(7);
20:37 p6eval rakudo 97f141: OUTPUT«get_number() not implemented in class 'Sub'␤in Main (/tmp/HALNrlQxHp:2)␤»
20:38 pmichaud rakudo:   my $x = * / 3 + 4;   say $x(6);
20:38 p6eval rakudo 97f141: OUTPUT«get_number() not implemented in class 'Sub'␤in Main (/tmp/2lOvG5LgAd:2)␤»
20:38 pmichaud what should happen there?
20:38 TimToady mix in Code with Whatever, perhaps
20:38 TimToady or have a Whatever with an arithy
20:38 TimToady *arity
20:38 simcop2387 joined #perl6
20:38 pmichaud I don't quite understand.
20:38 pmichaud * / 3 returns a Code object
20:38 pmichaud so it's the same as
20:39 pmichaud my $x = { $_ / 3 } + 4
20:39 TimToady if it returned something that was also Whatever, it could rewrap
20:39 pmichaud and Rakudo doesn't like that.
20:39 pmichaud oh, I understand.
20:39 pmichaud It's a Whatever that's invokable.
20:39 TimToady bare * has arity 0, if it has an arity
20:39 pmichaud so, Whatever is really a type of Code object, now?
20:39 TimToady maybe not *
20:40 TimToady but * + 1 could be a mixin
20:40 pmichaud mixin code in Parrot is going to be ... tricky :-(
20:40 TimToady or some predefined type that is both Code and Whatever
20:40 pmichaud WhateverCode, I guess.
20:41 TimToady good enough for now
20:41 pmichaud class WhateverCode does Whatever does Code ....   # might work
20:41 nbrown joined #perl6
20:43 pmichaud or, more likely s/does/is/
20:43 pmichaud I'll play with that a bit.
20:45 jan_ joined #perl6
20:50 pmichaud seems like it might be kinda nice if   *.($x)  returns $x
20:50 pmichaud if that's at all possible.
20:51 TimToady still have to keep it distinct typewise, or .[*] can't turn into a range
20:51 pmichaud sure
20:51 pmichaud it's still a Whatever
20:52 pmichaud oh, I see.
20:52 TimToady yes, it's a bit like our Int vs Int:D vs Int:U
20:53 TimToady sometimes you want the subset, and sometimes you don't
20:55 TimToady in any case, we probably want to distinguish by type and not just by arity
20:55 pmichaud agreed.
20:55 TimToady something MMD can get fast on
20:57 pmichaud multi sub infix:<+>(Whatever, $x --> WhateverCode ) { -> $_ { $_ + $x }
20:57 pmichaud }
20:57 pmichaud multi sub infix:<+>(WhateverCode $code, $x --> WhateverCode ) { -> $_ { $code($_) + $x } }
20:57 pmichaud modulo my returns syntax, perhaps.
20:58 sjohnson rakudo:  my @a = 'a'..'z'; my $b = @a.pick;  say @a.count;
20:58 p6eval rakudo 97f141: OUTPUT«Method 'count' not found for invocant of class 'Perl6Array'␤»
20:59 sjohnson rakudo:  my @a = 'a'..'z'; my $b = @a.pick;  say @a.scalar;
20:59 p6eval rakudo 97f141: OUTPUT«Method 'scalar' not found for invocant of class 'Perl6Array'␤»
20:59 pmichaud sjohnson: .elems
20:59 sjohnson rakudo:  my @a = 'a'..'z'; my $b = @a.pick;  say @a.elems;
20:59 p6eval rakudo 97f141: OUTPUT«26␤»
20:59 sjohnson rakudo:  my @a = 'a'..'z'; my $b = @a.=pick;  say @a.elems;
20:59 p6eval rakudo 97f141: OUTPUT«1␤»
21:00 sjohnson rakudo:  my @a = 'a'..'z'; my $b = @a.=pick;  print "$b "; say @a.elems;
21:00 p6eval rakudo 97f141: OUTPUT«j 1␤»
21:00 jnthn (WhateverCode) Yes, getting MMD fast on arity would be a pain.
21:00 sjohnson rakudo:  my @a = 'a'..'z'; my $b = @a.=pick;  print "$b "; say @a.elems;
21:00 p6eval rakudo 97f141: OUTPUT«f 1␤»
21:00 sjohnson rakudo:  my @a = 'a'..'z'; my $b = @a.=pick(5);  print "$b "; say @a.elems;
21:00 p6eval rakudo 97f141: OUTPUT«u e x k s 5␤»
21:01 sjohnson rakudo:  my @a = 'a'..'z'; my @b = @a.=pick(5);  print "@b "; say @a.elems;
21:01 p6eval rakudo 97f141: OUTPUT«@b 5␤»
21:01 pmichaud array interpolation doesn't work yet in rakudo.
21:01 pmichaud try {@b}
21:01 sjohnson rakudo:  my @a = 'a'..'z'; my @b = @a.=pick(5);  print @b." "; say @a.elems;
21:02 p6eval rakudo 97f141: OUTPUT«Method ' ' not found for invocant of class 'Perl6Array'␤»
21:02 * jnthn wishes he'd had less of a headache today and coulda done something interesting.
21:02 sjohnson rakudo:  my @a = 'a'..'z'; my @b = @a.=pick(5);  print {@b}." "; say @a.elems;
21:02 p6eval rakudo 97f141: OUTPUT«Method ' ' not found for invocant of class 'Block'␤»
21:02 pmichaud jnthn: I have most of postcircumfix:<[ ]>  refactoring done
21:02 sjohnson rakudo:  my @a = 'a'..'z'; my @b = @a.=pick(5);  print "{@b} "; say @a.elems;
21:02 p6eval rakudo 97f141: OUTPUT«a e z h k 5␤»
21:02 sjohnson rakudo:  my @a = 'a'..'z'; my @b = @a.=pick(5);  print @b.perl
21:02 jnthn pmichaud: Sounds good. Did you split it out into a bunch of multis?
21:02 p6eval rakudo 97f141: OUTPUT«["h", "y", "m", "z", "b"]»
21:02 pmichaud jnthn: yes, in the Positional role
21:02 jnthn OK, great.
21:03 nbrown_ joined #perl6
21:03 jnthn Which means the parametric type stuff probably should still be pretty intact.
21:03 pmichaud yes.
21:03 jnthn Well, if not, the tests will say so. ;-)
21:03 pmichaud I haven't spectested yet, but it seems pretty straightforward since we just need the lexical lookup on T
21:03 jnthn Anyway, it's only a lexical lookup.
21:03 jnthn Right.
21:03 pmichaud and it only has to do it in one of the multi's (the one handing Int)
21:04 pmichaud *handling
21:04 om454545445 joined #perl6
21:04 jnthn Ah, nice.
21:05 jnthn I wanted to start clearing up the introspection bugs a bit today. Ah well, maybe tomorrow.
21:06 pmichaud tomorrow is fine.  :-)
21:06 jnthn I'm gone-ish on Thursday and really gone from Friday onwards.
21:06 om454545445 left #perl6
21:06 jnthn So if there's anything you want my thoughts/hacking on before then, let me know.
21:07 pmichaud will do.
21:07 jnthn (Already know I need to respond to chromatic's email.)
21:07 pmichaud my week will be interrupted by lots of little errands but otherwise I should be around
21:07 jnthn OK.
21:07 payload joined #perl6
21:07 jnthn I've got the bulk of the dispatch refactor in, which is something.
21:08 pmichaud indeed!
21:09 jnthn Still not sure about how to implement the :D/:U type stuff, but think it just needs a little time to settle...
21:09 pmichaud I'd wait until you get back for that :-)
21:09 pmichaud is it in STD.pm yet?
21:09 jnthn I mean, I can think of *a* way, but the obvious one will kill performance.
21:09 jnthn Not that I've noticed. And also I'm not sure it made a spec doc yet either.
21:09 pmichaud right.
21:09 pmichaud I'd wait for those.
21:10 jnthn Right. It could change. :-)
21:10 jnthn Like coercion. :-)
21:10 jnthn Gonna wait on spec doc commits for that too.
21:11 pmichaud I'll probably work on that a bit if it comes in.
21:11 pmichaud (but you're welcome to beat me to it)
21:11 jnthn Sure, if it's something you want to hack on. :-)
21:11 pmichaud I'm really happy with the assign changes I checked in this morning.  Several things will be cleaned up as a result.
21:11 jnthn Otherwise I'll catch it at some point.
21:11 pmichaud We may even have lazy ranges by the end of the weekend.
21:12 jnthn Yes, they looked good.
21:12 jnthn Oh, nice. :-)
21:12 jnthn Is the list refactor still in the works?
21:12 jnthn Or postponed?
21:12 pmichaud yes, but that depends on a capture refactor.
21:12 jnthn OK.
21:12 pmichaud it's still in the works.
21:13 pmichaud I want to get some of these other array/iterator issues out of the way first.
21:13 pmichaud it'll be easier to clean up the list refactor then.
21:14 jnthn OK, makes sense.
21:14 jnthn I'm hoping in the time I'm away TimToady++ will work out what we're going to do on traits too.
21:15 jnthn Would really like to get those bits done in July.
21:15 pmichaud There's a reasonable chance that I'll handle the trait_aux trait_verb changes between now and then.
21:15 pmichaud (since they're just trait_mod)
21:15 pmichaud s/just/now/
21:16 jnthn That's fine.
21:18 pmichaud I know that most of next week (the first week you're gone) I'll likely be busy preparing for PVWM and YAPC::NA
21:18 pmichaud also, that's the week of the release.
21:19 jnthn Yes, you've got quite a lot of talking at both of those, I think?
21:19 pmichaud yes.
21:19 jnthn Ah well, at least it'll make YAPC::EU seem easy to prepare for talk wise. ;-)
21:19 pmichaud YAPC::EU is already easy -- I only have one talk.
21:20 jnthn Same.
21:20 pmichaud Actually, that might make YAPC::EU more difficult, as I have to fit everything into only one talk :-P
21:21 jnthn Just speak reallyreallyfast.
21:21 jnthn And don't put a lolcat between every slide.
21:21 jnthn ;-)
21:21 pmichaud hellothisisrakudoperl6it'swrittenbasedonparrotandpctwhicharereallycoolandwenowpasslotsoftestskthxbye
21:22 pmichaud maybe I'll write all of my slides as Perl 6 code
21:22 jnthn Extreme lightning talk delivery: not allowed to take a breath during the whole presentation.
21:22 jnthn Ooh, that could be cool.
21:23 jnthn Haven't figured out exactly what I'm going to do in my talk yet.
21:25 jnthn pmichaud: btw see comment from Infinoid just on #parrot
21:28 lichtkind mberends: ping
21:28 mberends lichtkind: pong
21:29 lichtkind mberends: greate work but one thing
21:29 lichtkind in apendix a i started with a klassification
21:30 lichtkind this is meta op and so on
21:30 lichtkind this is array meth etc
21:30 lichtkind want we keep that
21:30 om454545445 joined #perl6
21:31 mberends I may have been erratic in sometimes dropping the classification :(
21:32 lichtkind mberends: thatswhy i ask
21:32 lichtkind just to sync goals
21:32 om454545445 left #perl6
21:32 lichtkind if you dont mind i translated some lines at the top
21:32 om454545445 joined #perl6
21:33 viklund lichtkind | mberends: Where are you working on this document
21:33 viklund ?
21:33 lichtkind viklund perl 6 wiki of the tpf
21:33 mberends http://www.perlfoundation.org/perl6 and then Perl Tablets
21:34 viklund ty
21:34 lichtkind viklund whats ty?
21:34 lichtkind mberends: do you currently editing?
21:34 viklund thank you
21:35 mberends just saved after completing A-Z, still symbols todo
21:35 nbrown joined #perl6
21:35 lichtkind can i insert something now?
21:35 om454545445 left #perl6
21:35 mberends yes :)
21:36 lichtkind mberends: done
21:36 lichtkind something else
21:36 lichtkind mberends: if something has more than one meaning do we make 2 entries or one long one?
21:37 mberends lichtkind: the existing examples where you made 2 entries look better
21:38 mberends it's less clutter, easier to read
21:39 om454545445 joined #perl6
21:39 synth joined #perl6
21:39 lichtkind mberends: yes currently i tend also in this direction
21:39 lichtkind its much more fun if your not alone with this :)
21:39 pmichaud afk for a bit
21:40 om454545445 left #perl6
21:41 mberends lichtkind: I'll continue upward through the symbols, and then finish for the night.
21:41 lichtkind i helped you bit with that
21:41 om454545445 joined #perl6
21:42 mberends yes, thanks for that.
21:44 lichtkind currently translating some text for appendix b
21:44 om454545445 left #perl6
21:44 viklund it was fun reading some of the german...
21:44 viklund I should pick that up someday
21:46 lichtkind mberends: do you know how to get .pre but with larger font?
21:46 mberends likewise it's fun trying to grok swedish
21:46 viklund ;)
21:47 mberends lichtkind: try a CSS style for the .pre maybe?
21:51 lichtkind mberends: how do import that into the wiki?
21:51 mberends :/
21:51 lichtkind haha
21:51 lichtkind mberends: can i insert something into appendix A?
21:51 mberends wikis may do strange transformations to your upload
21:52 mberends ok, saved
21:54 lichtkind i tried to introduce navigation like in the german part but i make that later
21:54 lichtkind i saved
21:55 mberends ok, thanks
21:55 om454545445 joined #perl6
21:55 lichtkind yes i made some minor translations
22:04 om454545445 left #perl6
22:05 om454545445 joined #perl6
22:07 viklund std: method test($s=5 is rw) { ... }
22:07 p6eval std 27013: OUTPUT«##### PARSE FAILED #####␤Unable to parse multisig; couldn't find final ')' at /tmp/XX7EqnkI6V line 1:␤------> [32mmethod test($s=5 [31mis rw) { ... }[0m␤    expecting any of:␤   infix or meta-infix␤      infix stopper␤    param_sep␤       standard stopper␤  terminator␤FAILED
22:07 p6eval ..00:02 37m␤»
22:07 viklund std: method test($s is rw=5) { ... }
22:07 p6eval std 27013: OUTPUT«ok 00:02 37m␤»
22:08 viklund |o|
22:08 mberends good guess
22:10 viklund my gut feeling is the first one, but then when looking at what the rw is going to be applied to the second one looks better
22:10 viklund you kind of want them both directly after the var
22:11 mberends yeah, 50/50 on sequence priority
22:11 jnthn viklund: Yeah, I think that's probably why they go there.
22:11 pmichaud the "is rw" modifies the $s, not the 5.
22:11 jnthn Right.
22:12 pmichaud the = 5  is what is done to the "$s is rw"
22:12 * jnthn wonders what you can get away with on the rhs of the =
22:12 pmichaud consider:
22:12 pmichaud method test($s as Str = 5) { ... }
22:12 pmichaud method test($s = 5 as Str) { ... }
22:12 viklund yes, but '$s is rw=5' looks strange
22:12 jnthn <EXPR(item %item_assignment)>
22:13 mberends it makes a case for an 'is rw' twigil
22:13 viklund but so do '$s=5 is rw' (huh a rw 5??)
22:13 viklund $+s?
22:13 jnthn windsok: Consider that it doesn't make any sense in this case.
22:13 jnthn $a is rw = 5 is still rather awkward semanticly.
22:13 viklund yes
22:15 nbrown joined #perl6
22:17 jnthn <blorst> # lol, sounds like a posh person saying "blast!"
22:17 jnthn STD++
22:22 mberends lichtkind: stopping editing now, will return after sleep
22:22 lichtkind mberends: i just had my hands on appendix B
22:22 pmichaud NO SLEEP!  KEEP WORKING!!  *crack whip*
22:22 lichtkind but im also finished for today
22:22 lichtkind hahaha pmichaud ++
22:23 mberends ugh, there's no link from Appendix A to Appendix B. ouch!
22:23 lichtkind mberends: as i toold i will make that tomorrow
22:24 lichtkind TimToady: i see that you only know one side of this conflict, if your interested in other perspectives let me know
22:26 * mberends simulates a network failure to cover his sleep break
22:26 lichtkind hahaha
22:26 nihiliad joined #perl6
22:26 sparc joined #perl6
22:26 c9s joined #perl6
22:31 pmichaud git diff
22:31 pmichaud ww
22:42 bhs joined #perl6
22:44 brando joined #perl6
22:44 brandon76 joined #perl6
22:53 brandon76 perl6: my Int @a=(1,2,3); say @a;
22:53 p6eval elf 27013, pugs, rakudo 97f141: OUTPUT«123␤»
22:53 pancake joined #perl6
22:54 pancake how is qx() or system() in p6?
22:54 xinming_ joined #perl6
22:55 jnthn qx
22:55 jnthn oh, well
22:55 jnthn qx if you want to capture output, iirc
22:55 jnthn I think if you don't want to, then just use run (which is like Perl 5's system)
22:55 pancake it is not yet supported by rakudo
22:56 jnthn rakudo: qx{ls}
22:56 p6eval rakudo 97f141: OUTPUT«operation not permitted in safe mode␤in Main (lib/Safe.pm:25)␤»
22:56 pancake oh run works
22:56 jnthn Note qx with curlies, not parens.
22:56 pancake oh with {}
22:56 pancake why?
22:57 jnthn It's a quoting construct.
22:57 jnthn something_here() is always a sub call in Perl 6.
22:57 pancake ok
22:57 jnthn std: qx() # I think
22:57 p6eval std 27013: OUTPUT«Undeclared routine:␤   qx used at 1 ␤ok 00:02 35m␤»
22:57 jnthn Yeah
22:57 * jnthn is happy when STD agrees with him :-)
23:00 pancake :)
23:04 om454545445 joined #perl6
23:12 david__ joined #perl6
23:12 pmichaud note that  qx (ls)   works, though.
23:13 pmichaud std:  qx (ls)
23:13 om454545445 left #perl6
23:13 p6eval std 27013: OUTPUT«ok 00:03 36m␤»
23:13 pmichaud rakudo:  qx (ls)
23:13 p6eval rakudo 97f141: OUTPUT«operation not permitted in safe mode␤in Main (lib/Safe.pm:25)␤»
23:13 pmichaud but yes, curlies are safer.
23:16 jnthn pmichaud: Dumb question: how does it know to parse that as a qoute constuct? Just because of the qx out front?
23:17 pmichaud yes
23:17 jnthn Since normally it'd parse it as a call to ls..
23:17 jnthn OK.
23:17 pmichaud same with qq, rx, q, etc.
23:17 pmichaud rakudo:  say qq (ls)
23:17 p6eval rakudo 97f141: OUTPUT«ls␤»
23:17 jnthn Ah, OK. I'd somehow managed to not see the form with the space in and parens before...
23:17 jnthn Or never taken note of it at least.
23:17 pmichaud parens are a valid quote/bracket char :-)
23:17 pmichaud they just can't occur next to the quote prefix
23:18 pancake for qx{ls}.split("\n") { '  ' if $_ ~~ m/parrot/i; } segfaults rakudo
23:18 jnthn Ouch.
23:19 pmichaud that /i doesn't work out well there
23:19 jnthn True, but a segfault is a bit of a harsh way to say so. :-)
23:19 M_o_C joined #perl6
23:19 pmichaud I suspect it's trying to divide the result by 0+1i
23:20 pmichaud anyway, I'm not getting a segfault here.
23:20 pancake rakudo git?
23:20 pancake with --gen-parrot
23:20 pmichaud oh wait, yes I am.
23:21 pmichaud for me it fails twice with "too many params", then it segfaults.
23:21 pmichaud I don't get a segfault if the 'i' isn't there
23:21 pmichaud actually, it looks to me like it's parsing it as
23:22 pmichaud ...   (m/parrot/).i
23:22 pmichaud std:  3i
23:22 p6eval std 27013: OUTPUT«ok 00:02 35m␤»
23:22 pmichaud std:  (3)i
23:22 p6eval std 27013: OUTPUT«ok 00:02 36m␤»
23:22 jnthn segfault here too
23:22 pmichaud std:  (m/parrot)/i
23:22 p6eval std 27013: OUTPUT«Undeclared routines:␤  m used at 1 ␤     parrot used at 1 ␤ok 00:03 38m␤»
23:22 pmichaud std:  (m/parrot/)i
23:22 p6eval std 27013: OUTPUT«ok 00:02 36m␤»
23:22 pmichaud std:  m/parrot/i
23:22 p6eval std 27013: OUTPUT«##### PARSE FAILED #####␤Obsolete use of suffix regex modifiers; in Perl 6 please use prefix adverbs instead at /tmp/JfOA3v7Wfn line 1:␤------> [32mm/parrot/i[31m[0m␤Other potential difficulties:␤  Possible obsolete use of /i; in Perl 6 please use :i instead at /tmp/JfOA3v7Wfn
23:22 p6eval ..l…
23:23 pmichaud std:  m/parrot/ i
23:23 p6eval std 27013: OUTPUT«##### PARSE FAILED #####␤Syntax error (two terms in a row?) at /tmp/CSFu8oSXyo line 1:␤------> [32mm/parrot/ [31mi[0m␤    expecting any of:␤      infix or meta-infix␤      infix stopper␤    standard stopper␤ statement modifier loop␤  terminator␤FAILED 00:02 35m␤»
23:23 pmichaud nice.
23:23 pmichaud I should do something similar here.
23:23 pancake how is :i used?
23:23 pmichaud right now the only way rakudo recognizes it is inside the /
23:23 pmichaud m/:i parrot/
23:24 jnthn segfault is inside the calling conventions implementation.
23:24 pancake sounds weird syntax
23:24 pmichaud jnthn: try    m/parrot/.i
23:25 pmichaud I bet that segfaults also
23:25 pmichaud oh, nyi
23:25 jnthn oh ewwww
23:25 pmichaud hmmm.
23:25 jnthn nasty nasty nasty
23:25 jnthn It actually crashes when trying to print the nice Perl 6 backtrace
23:25 pmichaud heh
23:25 jnthn When the .backtrace() PCC Method on Exception PMC returns the data structure it's built.
23:26 jnthn I can only imagine that when the exception saying "oh noes argument passing fail" happens, it leaves the calling system in an inconsistent state.
23:26 jnthn And then the next attempt to return something through PCC explodes as a result.
23:26 jnthn Yes, looks very much like that...
23:26 jnthn eww
23:27 jnthn My headache is bad enough, I'm not hunting this one down tonight.
23:27 pancake sorry for reporting O:)
23:27 jnthn pancake: Oh, report is welcome. :-)
23:28 jnthn pancake: Just know that the particular bit of Parrot it has made segfault is not a nice bit to go debugging in.
23:28 pancake yep, i see
23:29 jnthn I'm happy for the segfault to be rakudo-bugged anyway. It's invalid syntax, but a segfault is always a bad way to fail.
23:30 pancake yep, is not a nice way to inform that the syntax is not correct
23:30 jnthn Aye.
23:32 kate21de joined #perl6
23:33 DanielC Is there any difference between @a = 1,2,3 and @b = [1,2,3] and @c = (1,2,3) ?  They seem to all do the same thing.
23:34 jnthn The second I think should be different.
23:34 DanielC I'm confused as to the syntactic meaning of [] and ()
23:34 DanielC rakudo: my @a = [1,2,3]; my @b = 1,2,3; my @c = (1,2,3); say @a.WHAT ~ " : " ~ @b.WHAT ~ " : " ~ @c.WHAT
23:34 p6eval rakudo 97f141: OUTPUT«Array() : Array() : Array()␤»
23:34 jnthn rakudo: my @a = 1,2,3; my @b = [1,2,3]; say @a.perl; say @b.perl;
23:34 p6eval rakudo 97f141: OUTPUT«[1, 2, 3]␤[[1, 2, 3]]␤»
23:34 jnthn Note the difference in the .perl
23:34 jnthn [1,2,3] is always an array that doesn't flatten
23:35 jnthn so @b = [1,2,3] means @b has one element.
23:35 jnthn rakudo: my @a = 1,2,3; my @b = [1,2,3]; say @a.elems; say @b.elems;
23:35 p6eval rakudo 97f141: OUTPUT«3␤1␤»
23:35 jnthn So you use [ ... ] to build up nested data structures.
23:35 DanielC ???  That doesn't make sense... [1,2,3] looks like an array.
23:36 pmichaud DanielC: consider:   my @a = [1,2,3],4;
23:36 DanielC pmichaud: What about @a = (1,2,3),4;  What's the diff?
23:36 pmichaud the difference is that [...] doesn't interpolate into a list
23:37 pmichaud while (...) does.
23:37 pmichaud rakudo:  my @a = [1,2,3],4;  say @a.elems;
23:37 p6eval rakudo 97f141: OUTPUT«2␤»
23:37 pmichaud rakudo:  my @a = (1,2,3),4;  say @a.elems;
23:37 p6eval rakudo 97f141: OUTPUT«4␤»
23:37 DanielC It's as if the ( ) is not there at all.
23:37 pmichaud correct.
23:38 pmichaud in list context, the parens tend to be ignored.  Same as p5.
23:38 DanielC Should I think of [ .. ] as an "array reference"? Kind of like \@array ?  Or is that the wrong way to look at it?
23:38 pmichaud sure, thinking of it as an array reference works
23:38 pmichaud (fsvo "works")
23:39 DanielC Can you explain what it is if it is not an array reference? Or is it something complicated?
23:39 pmichaud I tend to think of it as "an array acting as a scalar"
23:40 pmichaud I can't explain it much better than that because the spec recently changed on this issue and I haven't had a chance to work it all through yet
23:40 DanielC rakudo: my $a = [1,2,3]
23:40 p6eval rakudo 97f141:  ( no output )
23:40 DanielC rakudo: my $a = [1,2,3]; say $a[1]
23:40 p6eval rakudo 97f141: OUTPUT«2␤»
23:40 DanielC hm
23:40 DanielC rakudo: my $a = 1,2,3; say $a[1]
23:40 p6eval rakudo 97f141: OUTPUT«2␤»
23:40 DanielC :-P
23:40 pmichaud That's a rakudo fail.
23:40 pmichaud The answer should be "undef"
23:41 DanielC ok
23:41 pmichaud we don't have item assignment yet.
23:41 ruoso DanielC, the difference is that () is a Capture builder... while [] is an array builder
23:41 pmichaud essentially the above is should be the same as
23:41 gegloe joined #perl6
23:41 DanielC Should rakudo allow me to say $a = 1,2,3?
23:41 pmichaud (my $a = 1), 2, 3
23:41 pmichaud whereas if the lhs of = is an array, it would be
23:41 pmichaud (my @a = 1,2,3)
23:42 ruoso DanielC, the main difference is when you try to take them as flatten lsits
23:42 DanielC ruoso: Can  you show me where I can learn what captures are? I hear that word thrown around a lot, but I don't know what it is.
23:42 ruoso DanielC, we're still missing S08, which will cover Captures...
23:42 ruoso but...
23:42 ruoso Captures are "values with no context"
23:43 pmichaud jnthn: yes, the backtraces are causing lots of double-free errors.
23:43 ruoso or "values that will have some context applied later"
23:44 ruoso DanielC, so (1,2,3) is a capture containing 1,2,3, which, if used in item context will act like an array
23:44 DanielC ruoso: So I can say $a = (@arr) and that @arr is not automatically evaluated in a scalar context?
23:44 jnthn pmichaud: Nasty. Is there a correlation between the types of fail and the occurence of a double-free?
23:44 pmichaud jnthn: haven't noticed one.
23:44 pmichaud I currently have rakudo-special backtracing turned off, though, and I still see the double-frees
23:44 pmichaud so I think it must be a parrot issue more than a rakudo backtrace one
23:45 pmichaud DanielC: yes,     $a = (@arr)   will cause @arr to be evaluated in item context
23:45 ruoso DanielC, in that case you hit a shortcut in the capture so that captures with just one item automatically get that item instead
23:45 jnthn pmichaud: I rather suspected so.
23:45 ruoso pmichaud, but only because the Capture DWIM exception
23:46 pmichaud ruoso: it would be true even for   $a = @arr
23:46 DanielC pmichaud: What is "item" context? I know scalar and array context.
23:46 pmichaud DanielC: "item" context is what p5 used to call "scalar" context
23:46 DanielC ah
23:46 ruoso pmichaud, but $a = (@arr, 2) is different
23:46 pmichaud ruoso: agreed.
23:47 ruoso DanielC, the parens are not require mostly... but it's really like if they were there
23:48 ruoso they're removed just as syntax... but semantically, it's like if they were still there
23:48 ruoso DanielC, the issue is really on how () and [] behave when coerced to lists
23:48 DanielC ok...
23:49 ruoso () will be flattened
23:49 ruoso [] won't
23:49 ruoso so...
23:49 ruoso my @a = (1,(2,(3,4))); will produce (1,2,3,4)
23:49 ruoso while
23:49 ruoso my @a = 1,[2,[3,4]]; will produce 1,[2,[3,4]]
23:50 DanielC It looks almost as if (  ) are white space.
23:50 ruoso they can be omitted when they are obvious
23:50 ruoso DanielC, but, also note that...
23:50 DanielC rakudo: my @a = (3,4); @a = (2,@a); @a = (1,@a); say @a.perl
23:50 p6eval rakudo 97f141: OUTPUT«[1, 2, 3, 4]␤»
23:51 DanielC weird
23:51 pmichaud DanielC: same as p5
23:51 ruoso that's correct... because you're using in list context
23:51 ruoso and list context will flatten
23:52 DanielC rakudo: my @a = [3,4]; @a = [2,@a]; @a = [1,@a]; say @a.perl
23:52 p6eval rakudo 97f141: OUTPUT«[[1, [2, [3, 4]]]]␤»
23:53 DanielC Interesting.
23:53 DanielC rakudo: my @a = 3,4; @a = 2,@a; @a = 1,@a; say @a.perl
23:53 p6eval rakudo 97f141: OUTPUT«[1, 2, 3, 4]␤»
23:53 ruoso DanielC, to this point, it works just like p5
23:54 DanielC ok...
23:54 ruoso the interesting part goes when you can access 1,(2,(3,4)) without causing the flattening
23:54 ruoso pugs: my @@a = 1,(2,(3,4)); say @@a[1;1;1]
23:54 p6eval pugs: OUTPUT«*** ␤    Unexpected ";"␤    expecting "_", fraction, exponent, term postfix, operator or "]"␤    at /tmp/m79q0jis6p line 1, column 32␤»
23:55 ruoso pugs: my @@a = (1,(2,(3,4))); say @@a[1;1;1]
23:55 p6eval pugs: OUTPUT«*** ␤    Unexpected ";"␤    expecting "_", fraction, exponent, term postfix, operator or "]"␤    at /tmp/U21pPzw6a9 line 1, column 34␤»
23:55 ruoso pugs: my @@a = (1,(2,(3,4))); say @@a[1;1]
23:55 p6eval pugs: OUTPUT«*** ␤    Unexpected ";"␤    expecting "_", fraction, exponent, term postfix, operator or "]"␤    at /tmp/hHR73Kxd7s line 1, column 34␤»
23:55 * jnthn -> sleep, night all
23:55 ruoso blah
23:55 ruoso rakudo: my @@a = (1,(2,(3,4))); say @@a[1;1]
23:55 p6eval rakudo 97f141: OUTPUT«Malformed declaration at line 2, near "@@a = (1,("␤in Main (src/gen_setting.pm:0)␤»
23:55 pmichaud rakudo doesn't know @@
23:55 ruoso I thought pugs did
23:55 DanielC Daniel doesn't know @@ either.
23:56 pmichaud well, pugs obviously parses @@ okay, I don't think it knows slice context
23:56 pmichaud (i.e., the semis in brackets)
23:56 ruoso DanielC, anyway... you'll be able to navigate in the still-unflattened data...
23:56 ruoso pugs: my @@a = (1,(2,(3,4))); say @@a[1][1][0]
23:56 p6eval pugs: OUTPUT«*** Can't modify constant item: VUndef␤    at /tmp/dZj29mzdqj line 1, column 29 - line 2, column 1␤»
23:56 ruoso pugs: my @@a = (1,(2,(3,4))); say @@a[1][1]
23:56 p6eval pugs: OUTPUT«␤»
23:56 DanielC So @@a is like an array without flattening?
23:57 ruoso DanielC, yes... but you're accessing the Capture
23:57 ruoso not an array
23:57 DanielC ok
23:57 DanielC Not that I can see any difference...
23:58 ruoso and... the sigil will probably be different, since captures also support named members
23:58 DanielC And @@a[1;1] means @@a[1][1] ?
23:58 ruoso DanielC, yes.. the difference is that captures also support named members
23:58 DanielC ('name' => 'Daniel', 2,3,4)  ?
23:58 ruoso yes
23:58 DanielC AHHHH
23:58 DanielC That's new.
23:58 ruoso yes, it is
23:59 pmichaud note that DanielC's example does not have a named member
23:59 ruoso it's still unclear in which situation it will be seen as named members
23:59 pmichaud (name => 'Daniel', 2, 3, 4)   # named member
23:59 DanielC ok
23:59 pmichaud yes, it's not completely decided yet
23:59 ruoso and when it will be a pair in position 0
23:59 DanielC @@a = (name => 'Daniel', 2, 3, 4); say @@a<name>

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

Perl 6 | Reference Documentation | Rakudo