»ö« | perl6-projects.org/ | nopaste: sial.org/pbot/perl6 | evalbot: 'perl6: say 3;' | irclog: irc.pugscode.org/ | UTF-8 is your friend!
Set by Tene on 14 May 2009.
00:16 meppuru joined 00:19 frew|work joined 00:23 xinming_ joined 00:24 justatheory left 00:32 meppl left 00:35 xinming left 00:41 gegloe left
sjohnson Khisanth: that too :) 00:41
00:42 snarkyboojum left 00:45 Aisling left, Aisling joined 00:53 meppuru left
sjohnson anyone else noticed that the core module Switch; in p5 is as unrealiable as an alcoholic employee? 01:00
i cant wait will p6 has it's given/when technology in place 01:03
its*
Khisanth you never heard for perl 5.10? 01:04
and of course Switch sucks, it's a source filter! 01:05
source filters usually start at "suck" and doesn't get much higher
sjohnson do you speak French? 01:06
01:07 nihiliad joined
Khisanth no 01:07
01:13 snarkyboojum joined 01:14 frew|work left
sjohnson english is not your first language, correct? 01:16
Khisanth it might as well be 01:18
I don't speak Chinese very well :)
sjohnson just the way you wrote: "you never heard for perl 5.10?"
Khisanth which is not really spoken by anyone ;)
sjohnson it should be "of" not for 01:19
Khisanth that was more of an attempt to multiplex multiple channels issue 01:22
01:23 hercynium left 01:28 hercynium joined 01:42 snarkyboojum left 01:45 om454545445 joined 02:12 amoc left 02:13 amoc joined 02:31 Chillance left, om454545445 left 02:44 jdv79 left 02:46 FurnaceBoy left 02:54 jferrero left 03:22 snarkyboojum joined 03:24 cls_bsd left 03:32 JDlugosz left 03:46 Limbic_Region left 03:47 drbean_ joined, snarkyboojum left 03:55 drbean joined 04:05 david__ joined 04:07 drbean_ left 04:12 sri_kraih left, nihiliad left 04:13 sri_kraih joined, unitxt joined 04:15 skids_ left 04:21 frew|work joined 04:22 unitxt left 04:25 araujo joined 04:28 Util left 04:29 davidad joined 04:54 xinming joined 04:55 xinming_ left, lambdabot joined 05:15 PZt left 05:17 PZt joined 05:26 Maghnus joined 05:53 finanalyst joined
finanalyst good morning. 05:53
my %x=<a b c> Z 1,2,3; say %x.perl 05:55
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 06:11 cls_bsd joined 06:23 ejs joined 06:39 viklund joined 06:40 ejs left 06:44 xomas left 06:45 xomas joined 06:54 Lectus left 06:57 iblechbot joined 07:08 viklund left, viklund joined 07:14 M_o_C joined
finanalyst can anybody here say how {} can be disambiguated as a hash rather than code. code is {; } 07:41
07:42 sri_kraih left
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" => {}}␤»
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
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" => {}}␤»
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}␤»
finanalyst is this right? 08:04
viklund o/ 08:05
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" => {}}␤»
viklund tricky 08:10
finanalyst i think there is something wrong with .perl 08:13
08:13 xinming left
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:14
08:21 hanekomu joined 08:24 DemoFreak joined 08:38 clintongormley joined 08:43 barney joined 09:05 cognominal joined, frew|work left 09:12 snarkyboojum left 09:21 barney left 09:55 pmurias joined 10:00 cls_bsd left 10:14 fridim_ joined 10:23 pmurias left 10:27 cls_bsd joined 10:29 payload left 10:36 DanielC joined
clintongormley DanielC: I see you said that you'd rewritten the RPN parser 10:57
DanielC hi
clintongormley can you paste the code somewhere? i'd like to take a look 10:58
DanielC It is in perl6-examples
clintongormley i keep updating rakudo, then not knowing what to write :)
which is where?
DanielC Just so we are on the same page, I rewrote a code example from a talk from jnthn.
I didn't rewrite anything inside Rakudo.
clintongormley yes 10:59
DanielC perl6-examples is in github, give me a minute to find the URL again...
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
clintongormley thanks
DanielC It is in the "interpreters" directory. 11:01
clintongormley ta
DanielC I didn't know what to call the directory. The directory also has a brainfuck interpreter :)
clintongormley heh yes :)
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
11:02 Whiteknight joined
clintongormley the new regex stuff looks amazing 11:03
DanielC yeah
daniel.carrera.bz/2009/06/rpn-calcu...in-perl-6/ 11:04
I just posted this (a few seconds ago).
clintongormley i last checked a few seconds before asking
DanielC Yeah. I had the blog written but I hadn't published yet. 11:05
But when you brought up the RPN calculator I figured I might as well publish the post.
The post is meant for people who don't know Perl 6 at all, so it will be very elementary for you. 11:06
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
DanielC s/does't know Perl 5/doesn't know any Perl/
Then this blog post is for you :-) 11:08
clintongormley you write very well
DanielC thanks
jnthn DanielC: Nice post! :-) 11:09
DanielC :-D
jnthn DanielC: Small thingy: The second toke matches numeric values.
Should that be toke*n*?
DanielC Thanks. Fixed.
jnthn :-) 11:10
clintongormley that bit about <ws> being like \s* but not matching inside words is interesting, and useful 11:11
btw, is your Expr token correct? 11:13
it would allow Op Op Op Op
DanielC Yes, it would.
It is possible to write incorrect RPN that fits this grammar. 11:14
clintongormley ok
in RPN, is " 1 2 3 4 +" legal?
jnthn You could probably catch it at evaluation time with
my $v1 = @stack.pop;
A line before that
That checks there are two things on the stack
DanielC clintongormley: I don't think it is.
clintongormley or is it always two numbers followed by an op
DanielC clintongormley: What would be the result? A list of numbers maybe? 11:15
jnthn @stack.elems >= 2 or fail('Invalid RPN expression')
lambdabot Unknown command, try @list
clintongormley no - i was thinking it'd add together everything on the stack
jnthn or something
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.
Youd' ahve 1 2 7
DanielC clintongormley: Not necessarily two numbers and then op. For example, this is legal: "5 4 + 3 / 5 3 - *"
clintongormley ok, right
so you could actually say "1 2 3 4 + - *"
jnthn Yes.
clintongormley invents syntax hopefully :)
jnthn That'd fully consume all of the values.
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.
jnthn AFAIK, the op consumes the two values on the top of the stack and puts one result back onto the stack.
DanielC: Sure, simple++
clintongormley right
jnthn I'm pretty sure my original slides didn't do the error checking either. 11:18
clintongormley [] captures, no?
DanielC jnthn: No. And your grammar had a few issues. You had <Value>+ <Op>* which would not match "2 2 + 2 +" for example.
clintongormley: I believe [] does not capture. 11:19
jnthn DanielC: I think I also had <Expr>+ at the top though. 11:20
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.
jnthn That's quite possible.
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.)
clintongormley woaah the $/ explanation is mind-blowing
jnthn But I'd hardly be surprised if it didn't work now.
DanielC jnthn: Did it handle 2 2 + 2 + ?
clintongormley DanielC ++ 11:23
DanielC :-D
clintongormley good tutorial
DanielC thanks 11:24
clintongormley your explanation of $/ shone a light on my understanding
jnthn DanielC: Yes, believe so.
DanielC: As one Expr followed by another Expr
DanielC jnthn: Then it worked.
jnthn: The program would have to do this recursively. Evaluating the first expression produces a new expression. 11:25
clintongormley: Thanks. I'm glad it was useful. I hope other people find it useful too.
clintongormley you do technical writing for a living? 11:26
jnthn DanielC: IIRC I walked the expressions list and maintained the stack between them.
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.
jnthn Anyway, TMTOWTDI and the one you posted is nice and clean. :-)
DanielC clintongormley: I also taught math for several years. 11:28
clintongormley and now you're working with PHP 11:29
clintongormley feels for DanielC
11:29 pmurias joined
DanielC And my degree is in math and physics :-) 11:29
clintongormley i loved maths at school, then went to Uni and did medicine
now my maths ends surely after basic arithmetic 11:30
jnthn: looking forward to your talks yapc::eu
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*.
clintongormley yes 11:31
perl is lyrical
i don't find that with other languages
DanielC As someone said here yesterday, PHP is entirely unremarkable.
clintongormley it's frustrating, more than anything
so badly designed
11:32 tulcod joined
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:32
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?
DanielC Perl feels like a human language, Ruby has amazing OOP, Haskell is purely functional and lazy. All of those are interesting languages.
clintongormley beauty isn't compatible with php
DanielC yeah
clintongormley pmurias: kinda, yes, but the 'extension' mechanism is to add another keyword, with possibly incompatible interfaces
it's like english 11:34
no rules
just lots of exceptions
the weird thing is that i find english movingly beautiful
while php just makes me ack
DanielC pmurias: www.tnx.nl/php.html
jnthn clintongormley: Yes, I look forward to YAPC::EU. :-) 11:35
clintongormley christmas is another year closer 11:36
jnthn YAPC::EU is the start of a three month run of one conference a month. :-)
DanielC wishes he could go to YAPC::EU but he'll be in his honey moon.
clintongormley heeeey congratulations
viklund_ DanielC: There's a bug in your blog post ;)
DanielC If I take my wife to YAPC::EU for our honey moon she'll kill me.
clintongormley: thanks
viklund_: Patches welcome :-)
viklund_ you have defined do_op as "sub do_op($op, $lhs, $rhs)" but call it like this "(do_op($v0,$v1,$item<Op>)"
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...
viklund_ ;)
DanielC jnthn: thanks :-)
jnthn is also going to YAPC::Asia and the Italian Perl Workshop. :-D
DanielC viklund_: Fixed. Thanks. 11:38
viklund_ DanielC: you also need to change it under "The full program" (that's what ppl copy paste) 11:39
DanielC ah, right...
clintongormley jnthn: do you have a day job, or are you fully funded? 11:40
DanielC viklund_: Fixed. Thanks again. 11:41
11:41 icwiener joined
viklund_ DanielC: np 11:41
11:41 om454545445 joined, om454545445 left
jnthn clintongormley: I have various clients that I do various things for. 11:43
clintongormley: And I'm also funded to work on Perl 6.
11:43 skids_ joined
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
and you travel a LOT :)
11:44 icwiener_ joined
jnthn The grants allow me to spend significantly more time on Perl 6. 11:45
clintongormley ok - back to $job
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␤␤»
skids_ Why thank you, rakudo, how thoghtful of you. 11:48
11:50 payload joined
jnthn Best use of hypers I've seen all week. :-) 11:50
DanielC Is today your birthday?
jnthn skids_++ # and, I guess, Happy Birthday
11:52 ST47 left
skids_ Yep, and D-Day, which is how I manage to remember it :-) 11:57
DanielC :-)
Happy birthday.
How old are you today?
skids_ thankses peeples. 11:58
I lost count.
DanielC heh
12:00 icwiener left 12:02 realbot joined, masak joined 12:06 om454545445 joined 12:07 om454545445 left
DanielC jnthn: I added an exercise for the user at the end of the blog post - to add error checking. 12:07
12:08 xinming_ left, xinming joined
jnthn DanielC: Nice 12:08
skids_ warn("side effects may include fail") # <-- error checking :-) 12:09
DanielC heh
12:13 realbot left
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)␤»
masak jnthn: look, a new funny internal Parrot error! :)
masak submits rakudobug
jnthn lolz it's the hilarious! 12:19
masak I know that's not the way to call regexes...
...but I was curious what would happen, so I tried.
the error is from src/pmc/object.pmc. 12:20
and I just assume that it's not what should happen in this case. 12:21
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)␤»
masak strangely, this gives a more decent error.
rakudo: grammar A { regex b { foo } }; $_ = "foo"; when A::b { say "OH HAI" }
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.
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)␤»
masak oh. even simpler. 12:25
skids_: happy B-day! 12:28
jnthn hmm, wonder why when is special 12:29
masak I'd like to learn more of the ways in which when is not like ~~. 12:31
maybe it's time to peruse the source.
12:37 om454545445 joined 12:38 om454545445 left 12:43 payload1 joined, payload left
DanielC %r = box $I0 <--- What does this mean in Parrot? 12:53
$I0 is just a variable, but what is "box" and what is that % sign?
masak DanielC: %r is a special variable in PIR blocks that enable you to give the value back to Rakudo.
DanielC ah
masak DanielC: I suppose 'box' is a way to wrap dangerous values in objects or something. 12:54
DanielC "return" 12:56
So I assume that "box" is also related to giving the value back to Rakudo? Some sort of Parrot container for a value?
ping? Am I back on IRC?
thanks
DanielC is in the room with bad Internet access. 12:57
DanielC loves wireless networks though.
masak DanielC: I think so. I bet you'd find the answer somewhere in the Parrot docs.
DanielC I'm reading some slides from pmichaud. "Hacking Rakudo Perl". 12:58
12:58 PerlPilot joined, PerlJam left
jnthn box = turn a native integer into an object type (e.g. Int) 12:59
%r = the result of the inline PIR.
DanielC jnthn: thanks
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.
Yes
Several
One is that it makes the built-ins more hackable by the Perl 6 community, which is helpful.
But it also means various semantic issues just go away.
DanielC Interesting. I assumed that it was best to write stuff in PIR for speed. 13:01
At least, performance-critical stuff. 13:02
jnthn Yes, there are things that we can hand-optimize.
And for a lot of things the idea is a Perl 6 sub/method wrapper around inline PIR.
pmichaud good morning, #perl6 13:06
DanielC moin
jnthn hi pmichaud
pmichaud 11:36 <jnthn> YAPC::EU is the start of a three month run of one conference a month. :-)
for me, YAPC::EU is the end of a three month run of one conference per month. :-)
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:07
masak :) 13:12
13:14 amoc left, ace1 joined
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
clintongormley checks the bank balance 13:15
:(
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
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 :(
clintongormley kidd_: you're in barcelona.pm? 13:18
hi!
DanielC Cuantos hispanos hay aqui?
kidd_ yup :) . A young perler myself, but trying to get into it.
clintongormley soy sudafricano
DanielC Pero estás en Barcelona? 13:19
kidd_ sip
clintongormley si - me he casado aquí
DanielC Ya entiendo. Yo estoy en Alemania por el mismo motivo. 13:20
jnthn Granada es bonita. :-) 13:35
13:40 beggars joined
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
$spanish-sentence.words); say $english-sentence
p6eval rakudo fb2fd4: OUTPUT«No result object␤in Main (src/gen_setting.pm:2660)␤»
masak dang :)
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.␤»
masak there you go. :)
jnthn Well, could to see Rakudo got the same translation as I did. :-)
*good...
No he hablado Espanol en mucho tiempo. :-( 13:44
masak lunch &
13:46 masak left 13:48 FurnaceBoy joined, Whiteknight left 13:49 sitaram joined 13:56 tulcod left, tulcod joined 13:58 mberends joined, ace1 left 14:05 cls_bsd left 14:18 meppl joined, fridim_ left
PacoLinux DanielC: mas de los que te piensas :) ! 14:21
DanielC :) 14:22
PacoLinux Sevilla por aqui :)
14:24 clintongormley left 14:38 hercynium left 14:41 snarkyboojum joined 14:43 ruoso joined 14:47 icwiener-_- joined, snarkyboojum left 14:48 beggars left 14:51 sri_kraih joined
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)␤»
ruoso rakudo: multi a (Str $a, Str $b) { [+$a, +$b] }; multi a (Array $a, $b where '+') { [+] @($a) }; ('1', '2', '+').reduce: &a;
p6eval rakudo fb2fd4: OUTPUT«Unknown introspection value 'pos_required'␤in method Any::reduce (src/gen_setting.pm:3226)␤called from Main (/tmp/MvPkx61zJn:2)␤»
ruoso is that known?
finanalyst hi. is any one here a moderator on the perl6-users list? If so, could you please blacklist Alexey Grebenschikov [email@hidden.address] for his annoying white-listing requests. 14:59
jnthn ruoso: Looks like bug in reduce, but it's hardly unknown that reduce on multis is interesting... 15:01
ruoso jnthn, I wrote a multi based RPN 15:02
15:02 icwiener_ left
jnthn Using reduce? 15:02
ruoso yes'
jnthn I'm not sure, what the spec says on how to handle that, or if it says anything at all
I suspect that .arity on multis or maybe .count, whichever reduce is looking at, may be doing something odd. 15:03
(They're not implemented on Multi yet...)
Then, I'm not sure how they should be implemented. Returning a junction maybe. :-S 15:04
ruoso but I made it with all variants with the same arity 15:05
because I knew the problem of varying-arity wasn't solved yet
maybe declaring a proto would help? 15:06
jnthn Well, I'm not sure the general problem of reduce + multi is solved.
No
It's still a multi, and they just don't do anything sensible with .arity and .count yet. 15:07
15:07 sitaram left
ruoso jnthn, er... reduce+multi is how [+] 1,2,3 works, isn't it? 15:09
pmurias ruoso: hi 15:10
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)␤»
skids_ rakudo: class A {}; sub infix:<+>(A $a, A $b) {}; 1 + 1;
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)␤»
skids_ Can that be worked around in Q:PIR or only pure PIR?
jnthn skids_: No known workaround for that at the moment. 15:12
skids_ (for those of us who just cannot wait)
Oh.
ruoso hi pmurias
jnthn Or at least I don't know one.
I know why it's a problem though.
The first one is the one that should work, btw.
skids_ Yeah, the second is just hitting it with a bat out of frustration :-) 15:13
jnthn Yeah, you just globally overrode infix:+
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...
ruoso pmurias, not at all... it will build the type using a more complete system... 15:15
jnthn, I guess it is, since the meta-op is not working with custom infixes
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..
bloonix morning
jnthn ruoso: It works to some degree with them...
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)␤»
jnthn Hmm.
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
jnthn oh
p6eval rakudo fb2fd4: OUTPUT«3␤»
jnthn rakudo: sub infix:<wtf> { $^a ~ "wtf" ~ $^b }; say [wtf] <omg bbq>;
p6eval rakudo fb2fd4: OUTPUT«omgwtfbbq␤»
ruoso ahn?
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"?
jnthn skids_: We already have an RT ticket, and we know what needs doing. 15:18
skids_: In fact, there's already some progress in that direction. Just not quite there yet. :-)
skids_ Ah, I'll find the RT, thanks :-)
jnthn ruoso: Looks like that worked?
ruoso jnthn, how? 15:19
jnthn ruoso: Erm, because it cave the output 3?
ruoso I just had an example that didn't...
jnthn *gave
ruoso heh
jnthn 1 2 + is 3
ruoso ah
no... I know that... I mean... I had a code that wasn't working
then I posted that snippet to show you it wasn't
and suddenly it worked 15:20
jnthn Oh, with the reduce method.
Yes, we already estanblished that is doing something different (don't knwo why...)
ruoso ok... I have my RPN working now...
pasteling "ruoso" at 189.97.60.4 pasted "multi-reduce based RPN calculator" (33 lines, 653B) at sial.org/pbot/37075
jnthn heh, cool example.
ruoso actually the first sig is wrong 15:21
jnthn Why Array $a and not the @a ?
ruoso not sure... 15:22
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 sial.org/pbot/37077
15:25 masak joined
masak finanalyst: hello. I'm not a moderator of p6u, but I'd like to chime in with the request to ban [email@hidden.address] a repeat-offending whitelist spammer on that list. 15:27
15:29 icwiener-_- is now known as icwiener
finanalyst i had some questions this morning, but no one seemed awake. How to disambiguate a hash? 15:29
rakudo: my %x=<a b c> Z { <q w r> Z (9,8,7) },{},{};%x.perl.say
p6eval rakudo fb2fd4: OUTPUT«{"a" => { ... }, "b" => {}, "c" => {}}␤»
15:29 FurnaceBoy left
masak finanalyst: hold on, I'll try to find the exact answer in the spec. 15:29
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}␤»
finanalyst rakudo: my %h=<a b c> Z 1,2,3; my %x=%('a'=>%h, 'b'=>{});%x.perl.say
p6eval rakudo fb2fd4: OUTPUT«{"a" => {"a" => 1, "b" => 2, "c" => 3}, "b" => {}}␤»
finanalyst there seems to be an inconsistency here 15:31
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
ascent_ rakudo: my %h=<a b c> Z 1,2,3; my %x=<p q r> Z ({%h}, {}, {}); %x.perl.say
p6eval rakudo fb2fd4: OUTPUT«{"p" => { ... }, "q" => {}, "r" => {}}␤»
15:33 FurnaceBoy joined
TimToady now {%h} is a closure 15:34
rakudo: my %h=<a b c> Z 1,2,3; my %x=<p q r> Z (item(%h), {}, {}); %x.perl.say
p6eval rakudo fb2fd4: OUTPUT«{"p" => "a" => 1, "q" => "b" => 2, "r" => "c" => 3}␤»
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
p6eval rakudo fb2fd4: OUTPUT«{"p" => {"a" => 1, "b" => 2, "c" => 3}, "q" => {}, "r" => {}}␤»
15:35 payload1 left, sri_kraih_ joined
TimToady hmm, I guess the inside of item() is also a list 15:36
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" => {}}␤»
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}␤»
TimToady that looks right to me 15:40
finanalyst the aim was to have 'a' => {'q'=>9,'w'=>8,'r'=>7}
TimToady the hash returned by hash() is in list context, so flattens for Z 15:41
finanalyst ah
TimToady so I believe that's correct according to current semantics
try \hash
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" => {}}␤»
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
p6eval rakudo fb2fd4: OUTPUT«{"a" => "q" => 9, "b" => "w" => 8, "c" => "r" => 7}␤»
TimToady hmm, looks like inside of $() is list context too
I guess the \ isn't entirely useless yet 15:44
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" => {}}␤»
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}␤»
TimToady I don't like that $h interpolates the hash there 15:47
pasteling "skids" at 71.192.212.78 pasted "having fun poking Parrot's 'Rational' with a stick" (179 lines, 3.5K) at sial.org/pbot/37078 15:48
15:56 payload joined, sri_kraih left 16:09 justatheory joined
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
rakudo.org/status
it's not a complete list, but it gets some of the major items 16:10
DanielC pmiichaud: thanks 16:11
16:14 beggars joined
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
DanielC I think my laptop is too old to be multicore... 16:17
pmichaud less /proc/cpuinfo 16:18
(if on Linux)
TimToady darn, you beat me to it
I had to go looking :)
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.
TimToady you're twice the man you thought you were...
DanielC processor 0 => GenuineIntel ... processor 1 => GenuineIntel 16:20
TimToady would be really funny if the second one said FakeIntel
16:20 fridim_ joined
skids_ could be "fake multicore" a.k.a. hyperthread. 16:20
DanielC heh
16:21 beggars left
TimToady don't think you'd have got all of 174% with hyperthreading 16:21
16:21 hanekomu_ joined
TimToady hyperthreading isn't normally a huge win 16:21
skids_ would hardly blame /proc/cpuinfo for saying "FakeIntel" on a hyperthreaded die, actually 16:22
TimToady oh, hyperthreading is genuine Intel, all right...
it's just fake threading :)
skids_ Maybe IntelFake
16:26 nihiliad joined 16:31 Psyche^ joined 16:36 meppl left 16:38 hanekomu left 16:40 unitxt joined, amoc left 16:48 Patterner left, Psyche^ is now known as Patterner 16:49 AzureStone joined, AzureStone_ left 17:10 om454545445 joined 17:16 Khisanth left, Khisanth joined
pasteling "ruoso" at 189.97.60.4 pasted "multi-reduce based RPN calculator, now supporting stacked operations" (46 lines, 872B) at sial.org/pbot/37085 17:18
jnthn ruoso: It runs on Rakudo? 17:20
ruoso oh yeah!
rakudo++
jnthn Yay!
ruoso: BTW, if you didn't already and have a moment, do file a bug on function reduce not behaving...
ruoso it still has the issue of '2+2' instead of '2 + 2' 17:21
the split needs a better regex to catch that
I did already
17:21 DanielC left
jnthn ruoso++: Thanks. 17:21
17:22 clintongormley joined
ruoso I guess that if we had multi-dimensional signatures, we could do something like 17:22
multi infix:<rpn> ( $ls, $rs, *@rest; $op where '/' ) { return [ @rest, $ls / $rs ] } 17:23
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:␤------> <rpn> ( $ls, $rs, *@rest; $op where '/' ) { return [ @rest, $ls / $rs ] }␤ expecting any of:␤ post_constraint␤ standard stopper␤
..terminator␤FAILED 00:…
ruoso hmm... I wasn't expecting that...
the slurpy was in one dimension only...
skids_ could just move the @a.shifts into the return. 17:25
jnthn Not quite sure I grasp what a multi-dimensional signature is. :-)
ruoso: Did you mean ;;?
ruoso skids_, I was unsure about the order the shifts would happen
jnthn Oh, no
ruoso jnthn, that means something else
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
jnthn oh what, you wanted to do an unpack?
There's syntax for that.
std: multi infix:<rpn> ( [$ls, $rs, *@rest], $op where '/' ) { } 17:27
p6eval std 27013: OUTPUT«ok 00:02 37m␤»
jnthn Though Rakudo doesn't implement that. :-(
ruoso hah! 17:28
that's cool
jnthn Yeah, I love the unpack syntax.
But it's kinda blocked on giving signatures a good reworking.
ruoso supermarket &
jnthn Well, signature binding at least...and that depends on Parrot getting its act together on calling conventions refactors.. 17:29
skids_ thinks of sorting status "unimplemented" list by features that most impact the way code ends up looking. 17:30
loop return values would top that list IMO.
17:30 masak left
jnthn loop return values? 17:30
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)␤»
skids_ erm, well, something akin to that then.
17:31 om454545445 left
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)␤»
TimToady rakudo: my @a = do for 1..3 { .Str }; @a.say; 17:39
p6eval rakudo fb2fd4: OUTPUT«-1␤»
jnthn Ah, that. 17:40
TimToady rakudo: my @a = map { .Str }, 1..3; @a.say;
p6eval rakudo fb2fd4: OUTPUT«Int()<0xb6c2a948>Int()<0xb6c2a828>Int()<0xb6c2a708>␤»
TimToady o_O
jnthn wtf
rakudo: my @a = map { ~$_ }, 1..3; @a.say;
p6eval rakudo fb2fd4: OUTPUT«123␤»
jnthn TimToady: Should prefix:~ by default be calling .Str? 17:41
TimToady yes, I think so
or at least doing the same thing...
rakudo: my @a = map -> $_ { .Str }, 1..3; @a.say; 17:42
p6eval rakudo fb2fd4: OUTPUT«Int()<0xb6c34a80>Int()<0xb6c348e8>Int()<0xb6c347c8>␤»
TimToady rakudo: my @a = map <-> $_ { .Str }, 1..3; @a.say;
p6eval rakudo fb2fd4: OUTPUT«Int()<0xb6ca0520>Int()<0xb6ca0400>Int()<0xb6ca02b0>␤»
TimToady not that
skids_ lol
TimToady rakudo: my @a = map { $^a.Str }, 1..3; @a.say;
p6eval rakudo fb2fd4: OUTPUT«Int()<0xb6cc3c08>Int()<0xb6cc3ad0>Int()<0xb6cc39b0>␤»
skids_ rakudo: my @a = map { $^a.Str }, 1,2,3; @a.say; 17:43
p6eval rakudo fb2fd4: OUTPUT«Int()<0xb6cffd38>Int()<0xb6cffc18>Int()<0xb6cffaf8>␤»
TimToady rakudo: my @a = map { my $x = $_+0; $x.Str }, 1..3; @a.say;
p6eval rakudo fb2fd4: OUTPUT«Int()<0xb6c3fad8>Int()<0xb6c3ea28>Int()<0xb6c3dc90>␤»
TimToady rakudo: my @a = map { my $x = $_+0; $x }, 1..3; @a.say;
p6eval rakudo fb2fd4: OUTPUT«123␤» 17:44
TimToady obviously a problem in .Str
skids_ rakudo: 1.Str.say
p6eval rakudo fb2fd4: OUTPUT«Int()<0xb621fba8>␤»
TimToady yep
jnthn Yeah, I think we currently have a bunch of prefix:<~>
And no override for Str 17:45
TimToady parrot confusion between typenames and strings, perhaps?
jnthn No, I just suspect that we didn't override Str in String.
It's calling Object.Str
rakudo: class Dog { }; say Dog.new.Str 17:46
p6eval rakudo fb2fd4: OUTPUT«Dog()<0xb6add7e0>␤»
jnthn Aye, just the default Str fallback...
TimToady should probably just carp about no Str method
I suspect the conversion done by print/say is even lower than Str
and that's where an object without a Str method would Dog()ify 17:47
jnthn Could be that way too, yeah. 17:48
TimToady that's where junctions also stringify, I think
jnthn Right, because .Str on a junction would auto-thread by default?
TimToady since $junction.Str should autothread
jnthn rakudo: say (1 | 2 | 3).Str
p6eval rakudo fb2fd4: OUTPUT«Junction()<0xb6b55ee8>␤»
jnthn rakudo: say (1 | 2 | 3).Str.eigenvalues 17:49
p6eval rakudo fb2fd4: OUTPUT«Method 'eigenvalues' not found for invocant of class 'String'␤»
jnthn Ouch.
Rakudo fail.
TimToady so Object::Str is really pretty bogus
jnthn I suspect we may be defining a Junction::Str...
rakudo: (1 | 2 | 3).^methods>>.say 17:50
p6eval rakudo fb2fd4: OUTPUT«perl␤true␤ACCEPTS␤!type␤eigenstates␤␤»
jnthn Oh no.
TimToady I think print/say call last_ditch_stringify() or some such :)
skids_ hahah. obscurity worked!
jnthn TimToady: Don't tempt me to implement it with that name. I might just. :-P 17:51
TimToady please do :) * .1
hmm "last ditch" is seemingly a WW1 metaphor... 17:52
17:52 jferrero joined
TimToady nope, was apparently coined in 1715 17:53
but was indeed about battlements
skids_ By a ditch salesman?
TimToady you can never have too many 17:54
skids_ While supplies last.
TimToady the ditch pitch
18:01 DanielC joined 18:07 payload left
DanielC my @b = [8,9,1],2,3,4; say @b[0]; # I love Perl 6. 18:15
In Perl 5 you would have written @{$b[0]} ugh...
viklund pmurias RPN calculator inspired me to shorten P08 in 99-problems i perl6-examples 18:23
gist.github.com/124951
I thought that a reduce would fit the bill yesterday but didn't manage to write the sub correctly
now it works like a charm ;)
DanielC What is P08 ? 18:25
viklund it
it should remove duplicate elements from a list
<a a a a b c c a a d e e e e> => <a b c a d e>
DanielC cool 18:26
I remember seen that problem before in Haskell.
Hmm... I notice that 99-problems/ doesn't have 99 problems :-)
viklund no, it hasn 18:27
hasn't
(small keyboard, I often miss ' and press
instead)
DanielC Ah... these problems come from Lisp. That explains why I've seen it before in the context of Haskell. 18:28
viklund yes
i'd like to commit that to perl-examples, but I don't have access to that repo...
DanielC pmichaud can hook you up with access. 18:29
viklund ok
pmichaud: please, could you give me access to perl6-examples?
dalek kudo: 97f1415 | pmichaud++ | src/ (4 files):
Refactor assignment in terms of STORE. This brings us somewhat

eliminates a few "isa" checks, and paves the way for better rw and postcircumfix handling.
18:31
pmichaud viklund: github id? 18:32
viklund viklund
18:32 justatheory left
pmichaud Added. 18:32
viklund pmichaud: ty
18:48 lichtkind joined 18:50 icwiener_ joined 18:52 pmurias left, pmurias joined
mberends lichtkind: hi, Appendix A almost 50% done (from Z upwards), take a look 18:54
lichtkind mberends: great i did some things on tutorial 18:55
mberends: are you interested in november too?
18:55 cotto joined
mberends lichtkind: yes I am :) 18:55
jnthn looks at pmichaud++'s refactor 18:56
lichtkind im the first user you can become second :)
mberends lichtkind: I was the first user several months ago :)
pmichaud jnthn: start with assign.pir -- the rest makes sense after that
lichtkind mberends: so they lied to me :) 18:57
mberends: what you written?
jnthn pmichaud: I see in the patch you didn't remove the :multi(_,_) - is that to allow others to override it too?
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
It's probably the right thing.
pmichaud Of course, the way it is now, we could even move infix:<=> into the setting :-)
mberends lichtkind: I did only a small edit of the main page, it was about 4 months ago
pmichaud but I'm going to leave it in PIR for efficiency reasons :-)
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
jnthn pmichaud: Why is !STORE in List, not Array?
pmichaud Array has one also. 19:00
(always has.)
storing to a List is different from storing to an Array
jnthn oh, I see what it's doing...
pmichaud List handles the ($x, $y) = ... case
jnthn Right I was thinking "wait, List is immutable"...
pmichaud Array handles the @a = ...
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.
pmichaud well, it'll eventually fail when I get the rw stuff in, yes :-)
currently it still succeeds :-/
jnthn aww
lichtkind mberends: never thought about that but i think links are not fine grained enough
jnthn We have to make Rakudo fail!
pmichaud That's masak++'s job.
jnthn :-)
I so hate that we need .macro fixup_cloned_sub(orig, copy) *sigh* 19:02
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?
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
I did at least remove the isa checks
I figure that getprop is much less expensive than isa
jnthn Probably yes.
19:05 icwiener left
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
19:05 om454545445 joined
pmichaud does cloning a (parrot) Sub also clone its 'proxy' attribute? 19:05
lichtkind mberends: true maybe as a see also addition
mberends: like (reference) which is than a link 19:06
jnthn pmichaud: Confused.
19:06 om454545445 left
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
pmichaud sorry, I should rephrase
if we subclass Parrot Sub (e.g. Code)
then instances of Code get a 'proxy' attribute
when we clone those instances
do they share the same 'proxy' ? 19:07
jnthn No
The proxy is cloned too.
pmichaud should they?
or do we envision those objects to be mutable somehow?
jnthn Probably, otherwise Block.clone won't clone the Parrot Sub and then our closures wouldn't work.
pmichaud hmmm. 19:08
that sounds right.
jnthn .wrap does take advantage of the fact that we can swap out the proxy though.
pmichaud okay.
19:08 unitxt left
jnthn Which feels naughty but actually works out fairly neatly. 19:08
pmichaud It is naught.
*naughty.
Bordering on Evil. 19:09
So I like it. :-P
jnthn Phew!
For a moment I thought you were going to make me re-write .wrap. Again. :-P
19:09 sri_kraih_ left
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.
(if ever. Not likely.) 19:10
jnthn The big deal is that it uses the candidate list now.
pmichaud correct.
19:10 rindolf joined
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...
jnthn It may Just Work already.
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.
viklund sometimes*
but it usually works out
lichtkind mberends: appendix b are tables for short look
mberends: should we add there an complete operator ?
mberends: and third thing please look at www.perlfoundation.org/perl6/index....ial_part_1 since i started stranslating 19:12
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 :)
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
pmichaud afk for a bit 19:18
skids_ wonders what's german for "grok" :-) 19:20
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)
mberends oh, yes, many happy return(skids_) 19:23
skids_ thanks! 19:25
lichtkind skids_ verstehen 19:27
skids_ lichtkind: but does it also mean to eat? :-)
lichtkind skids_ no that im aware of
19:28 hanekomu joined
lichtkind skids_ its in german the other way arrounf swollow is also understood as comprehend 19:28
but thats an different word
schlucken
mberends in .nl 'slikken' is swallow, and can imply 'accept' 19:29
skids_ Ah. English closest to grok might be "digest"
lichtkind mberends: it implies also believing , and grok 19:30
19:31 cottoo joined 19:32 cotto left 19:33 nbrown left 19:37 cottoo is now known as cotto 19:42 Jedai left 19:43 Jedai joined 19:46 M_o_C left 19:48 hanekomu_ left
pasteling "ruoso" at 189.97.60.4 pasted "multi-reduce based RPN calculator, fixed bug pointed by DanielC" (52 lines, 1K) at sial.org/pbot/37088 19:56
lichtkind wonders id TimToady saw UFO pictures at JPL 20:00
TimToady ruoso: why use split instead of comb? 20:01
ruoso er... perl5 mindset?
TimToady or .words
since .comb defaults to chars now 20:02
ruoso TimToady, but that still needs to have the "2 2+" issue fixed 20:03
TimToady JPL discovers all sorts of unidentified flying objects
and then gives them names
ruoso: I can't be answerable for a stupid spec :) 20:04
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 sial.org/pbot/37089 20:05
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
lichtkind TimToady: and we both wont that :) 20:08
TimToady: did you recognized Gary McKinnon case? 20:09
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
it does not please me
20:26 antiphase left
Khisanth didn't you write the specs? :P 20:26
20:27 antiphase joined
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:29
TimToady someone merely fishing to feed their confirmation bias is not a challenge, but a pain in the butt 20:30
20:31 ejs joined
lichtkind TimToady: true, heavy preconceptions are never easy dto deal with 20:32
20:36 ejs left
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:36
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)␤»
pmichaud rakudo: my $x = * *3 + 4; say $x(7);
p6eval rakudo 97f141: OUTPUT«get_number() not implemented in class 'Sub'␤in Main (/tmp/HALNrlQxHp:2)␤»
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 simcop2387 left
pmichaud what should happen there? 20:38
TimToady mix in Code with Whatever, perhaps
or have a Whatever with an arithy
*arity
20:38 simcop2387 joined
pmichaud I don't quite understand. 20:38
* / 3 returns a Code object
so it's the same as
my $x = { $_ / 3 } + 4 20:39
TimToady if it returned something that was also Whatever, it could rewrap
pmichaud and Rakudo doesn't like that.
oh, I understand.
It's a Whatever that's invokable.
TimToady bare * has arity 0, if it has an arity
pmichaud so, Whatever is really a type of Code object, now?
TimToady maybe not *
but * + 1 could be a mixin 20:40
pmichaud mixin code in Parrot is going to be ... tricky :-(
TimToady or some predefined type that is both Code and Whatever
pmichaud WhateverCode, I guess.
TimToady good enough for now 20:41
pmichaud class WhateverCode does Whatever does Code .... # might work
20:41 nbrown joined
pmichaud or, more likely s/does/is/ 20:43
I'll play with that a bit.
20:45 jan_ joined 20:46 rindolf left
pmichaud seems like it might be kinda nice if *.($x) returns $x 20:50
if that's at all possible.
TimToady still have to keep it distinct typewise, or .[*] can't turn into a range 20:51
pmichaud sure
it's still a Whatever
oh, I see. 20:52
TimToady yes, it's a bit like our Int vs Int:D vs Int:U
sometimes you want the subset, and sometimes you don't 20:53
in any case, we probably want to distinguish by type and not just by arity 20:55
pmichaud agreed.
TimToady something MMD can get fast on
pmichaud multi sub infix:<+>(Whatever, $x --> WhateverCode ) { -> $_ { $_ + $x } 20:57
}
multi sub infix:<+>(WhateverCode $code, $x --> WhateverCode ) { -> $_ { $code($_) + $x } }
modulo my returns syntax, perhaps.
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'␤»
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'␤»
pmichaud sjohnson: .elems
sjohnson rakudo: my @a = 'a'..'z'; my $b = @a.pick; say @a.elems;
p6eval rakudo 97f141: OUTPUT«26␤»
sjohnson rakudo: my @a = 'a'..'z'; my $b = @a.=pick; say @a.elems;
p6eval rakudo 97f141: OUTPUT«1␤»
sjohnson rakudo: my @a = 'a'..'z'; my $b = @a.=pick; print "$b "; say @a.elems; 21:00
p6eval rakudo 97f141: OUTPUT«j 1␤»
jnthn (WhateverCode) Yes, getting MMD fast on arity would be a pain.
sjohnson rakudo: my @a = 'a'..'z'; my $b = @a.=pick; print "$b "; say @a.elems;
p6eval rakudo 97f141: OUTPUT«f 1␤»
sjohnson rakudo: my @a = 'a'..'z'; my $b = @a.=pick(5); print "$b "; say @a.elems;
p6eval rakudo 97f141: OUTPUT«u e x k s 5␤»
sjohnson rakudo: my @a = 'a'..'z'; my @b = @a.=pick(5); print "@b "; say @a.elems; 21:01
p6eval rakudo 97f141: OUTPUT«@b 5␤»
pmichaud array interpolation doesn't work yet in rakudo.
try {@b}
sjohnson rakudo: my @a = 'a'..'z'; my @b = @a.=pick(5); print @b." "; say @a.elems;
p6eval rakudo 97f141: OUTPUT«Method ' ' not found for invocant of class 'Perl6Array'␤»
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;
p6eval rakudo 97f141: OUTPUT«Method ' ' not found for invocant of class 'Block'␤»
pmichaud jnthn: I have most of postcircumfix:<[ ]> refactoring done
sjohnson rakudo: my @a = 'a'..'z'; my @b = @a.=pick(5); print "{@b} "; say @a.elems;
p6eval rakudo 97f141: OUTPUT«a e z h k 5␤»
sjohnson rakudo: my @a = 'a'..'z'; my @b = @a.=pick(5); print @b.perl
jnthn pmichaud: Sounds good. Did you split it out into a bunch of multis?
p6eval rakudo 97f141: OUTPUT«["h", "y", "m", "z", "b"]»
21:02 finanalyst left
pmichaud jnthn: yes, in the Positional role 21:02
jnthn OK, great.
21:03 nbrown_ joined
jnthn Which means the parametric type stuff probably should still be pretty intact. 21:03
pmichaud yes.
jnthn Well, if not, the tests will say so. ;-)
pmichaud I haven't spectested yet, but it seems pretty straightforward since we just need the lexical lookup on T
jnthn Anyway, it's only a lexical lookup.
Right.
pmichaud and it only has to do it in one of the multi's (the one handing Int)
*handling 21:04
21:04 om454545445 joined
jnthn Ah, nice. 21:04
I wanted to start clearing up the introspection bugs a bit today. Ah well, maybe tomorrow. 21:05
pmichaud tomorrow is fine. :-) 21:06
jnthn I'm gone-ish on Thursday and really gone from Friday onwards.
21:06 om454545445 left
jnthn So if there's anything you want my thoughts/hacking on before then, let me know. 21:06
pmichaud will do. 21:07
jnthn (Already know I need to respond to chromatic's email.)
pmichaud my week will be interrupted by lots of little errands but otherwise I should be around
jnthn OK.
21:07 payload joined
jnthn I've got the bulk of the dispatch refactor in, which is something. 21:07
pmichaud indeed! 21:08
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 :-)
is it in STD.pm yet?
jnthn I mean, I can think of *a* way, but the obvious one will kill performance.
Not that I've noticed. And also I'm not sure it made a spec doc yet either.
pmichaud right.
I'd wait for those.
jnthn Right. It could change. :-) 21:10
Like coercion. :-)
Gonna wait on spec doc commits for that too.
pmichaud I'll probably work on that a bit if it comes in. 21:11
(but you're welcome to beat me to it)
jnthn Sure, if it's something you want to hack on. :-)
pmichaud I'm really happy with the assign changes I checked in this morning. Several things will be cleaned up as a result.
jnthn Otherwise I'll catch it at some point.
pmichaud We may even have lazy ranges by the end of the weekend.
jnthn Yes, they looked good. 21:12
Oh, nice. :-)
Is the list refactor still in the works?
Or postponed?
pmichaud yes, but that depends on a capture refactor.
jnthn OK.
pmichaud it's still in the works.
I want to get some of these other array/iterator issues out of the way first. 21:13
it'll be easier to clean up the list refactor then.
jnthn OK, makes sense. 21:14
I'm hoping in the time I'm away TimToady++ will work out what we're going to do on traits too.
21:15 nbrown_ left
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.
(since they're just trait_mod)
s/just/now/
21:16 nbrown left, pmurias left
jnthn That's fine. 21:16
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
also, that's the week of the release.
jnthn Yes, you've got quite a lot of talking at both of those, I think? 21:19
pmichaud yes.
jnthn Ah well, at least it'll make YAPC::EU seem easy to prepare for talk wise. ;-)
pmichaud YAPC::EU is already easy -- I only have one talk.
jnthn Same. 21:20
pmichaud Actually, that might make YAPC::EU more difficult, as I have to fit everything into only one talk :-P
jnthn Just speak reallyreallyfast. 21:21
And don't put a lolcat between every slide.
;-)
pmichaud hellothisisrakudoperl6it'swrittenbasedonparrotandpctwhicharereallycoolandwenowpasslotsoftestskthxbye
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.
Ooh, that could be cool.
Haven't figured out exactly what I'm going to do in my talk yet. 21:23
pmichaud: btw see comment from Infinoid just on #parrot 21:25
lichtkind mberends: ping 21:28
mberends lichtkind: pong
lichtkind mberends: greate work but one thing 21:29
in apendix a i started with a klassification
this is meta op and so on 21:30
this is array meth etc
want we keep that
21:30 om454545445 joined
mberends I may have been erratic in sometimes dropping the classification :( 21:31
lichtkind mberends: thatswhy i ask 21:32
just to sync goals
21:32 om454545445 left
lichtkind if you dont mind i translated some lines at the top 21:32
21:32 om454545445 joined
viklund lichtkind | mberends: Where are you working on this document 21:33
?
lichtkind viklund perl 6 wiki of the tpf
mberends www.perlfoundation.org/perl6 and then Perl Tablets
viklund ty 21:34
lichtkind viklund whats ty?
mberends: do you currently editing?
viklund thank you
mberends just saved after completing A-Z, still symbols todo 21:35
21:35 nbrown joined
lichtkind can i insert something now? 21:35
21:35 om454545445 left
mberends yes :) 21:35
lichtkind mberends: done 21:36
something else
mberends: if something has more than one meaning do we make 2 entries or one long one?
mberends lichtkind: the existing examples where you made 2 entries look better 21:37
21:37 iblechbot left
mberends it's less clutter, easier to read 21:38
21:38 synth left 21:39 om454545445 joined, synth joined
lichtkind mberends: yes currently i tend also in this direction 21:39
its much more fun if your not alone with this :)
pmichaud afk for a bit
21:40 om454545445 left
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
mberends yes, thanks for that. 21:42
lichtkind currently translating some text for appendix b 21:44
21:44 om454545445 left
viklund it was fun reading some of the german... 21:44
I should pick that up someday
lichtkind mberends: do you know how to get .pre but with larger font? 21:46
mberends likewise it's fun trying to grok swedish
viklund ;)
mberends lichtkind: try a CSS style for the .pre maybe? 21:47
lichtkind mberends: how do import that into the wiki? 21:51
mberends :/
lichtkind haha
mberends: can i insert something into appendix A?
mberends wikis may do strange transformations to your upload
ok, saved 21:52
lichtkind i tried to introduce navigation like in the german part but i make that later 21:54
i saved
mberends ok, thanks 21:55
21:55 om454545445 joined
lichtkind yes i made some minor translations 21:55
21:56 clintongormley left 22:04 om454545445 left 22:05 om454545445 joined 22:06 om454545445 left
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:␤------> method test($s=5 is rw) { ... }␤ expecting any of:␤ infix or meta-infix␤ infix stopper␤ param_sep␤ standard stopper␤ terminator␤FAILED
..00:02 37m␤»
viklund std: method test($s is rw=5) { ... }
p6eval std 27013: OUTPUT«ok 00:02 37m␤»
viklund |o| 22:08
mberends good guess
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
you kind of want them both directly after the var
mberends yeah, 50/50 on sequence priority 22:11
jnthn viklund: Yeah, I think that's probably why they go there.
pmichaud the "is rw" modifies the $s, not the 5.
jnthn Right.
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 =
pmichaud consider:
method test($s as Str = 5) { ... }
method test($s = 5 as Str) { ... }
viklund yes, but '$s is rw=5' looks strange
jnthn <EXPR(item %item_assignment)>
mberends it makes a case for an 'is rw' twigil 22:13
viklund but so do '$s=5 is rw' (huh a rw 5??)
$+s?
jnthn windsok: Consider that it doesn't make any sense in this case.
$a is rw = 5 is still rather awkward semanticly.
viklund yes
22:14 nbrown left 22:15 nbrown joined, david__ left
jnthn <blorst> # lol, sounds like a posh person saying "blast!" 22:17
STD++
mberends lichtkind: stopping editing now, will return after sleep 22:22
lichtkind mberends: i just had my hands on appendix B
pmichaud NO SLEEP! KEEP WORKING!! *crack whip*
lichtkind but im also finished for today
hahaha pmichaud ++
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
TimToady: i see that you only know one side of this conflict, if your interested in other perspectives let me know 22:24
22:25 nihiliad left, c9s left
mberends simulates a network failure to cover his sleep break 22:26
22:26 nihiliad joined, sparc joined, c9s joined
lichtkind hahaha 22:26
22:27 rjh_ left 22:28 tulcod left 22:30 mberends left
pmichaud git diff 22:31
ww
22:42 bhs joined 22:43 bhs left 22:44 brando joined, brando left, brandon76 joined 22:50 hanekomu left 22:51 lichtkind left
brandon76 perl6: my Int @a=(1,2,3); say @a; 22:53
p6eval elf 27013, pugs, rakudo 97f141: OUTPUT«123␤»
22:53 pancake joined, viklund left
pancake how is qx() or system() in p6? 22:54
22:54 xinming_ joined
jnthn qx 22:55
oh, well
qx if you want to capture output, iirc
I think if you don't want to, then just use run (which is like Perl 5's system)
pancake it is not yet supported by rakudo
jnthn rakudo: qx{ls} 22:56
p6eval rakudo 97f141: OUTPUT«operation not permitted in safe mode␤in Main (lib/Safe.pm:25)␤»
pancake oh run works
jnthn Note qx with curlies, not parens.
pancake oh with {}
why?
jnthn It's a quoting construct. 22:57
something_here() is always a sub call in Perl 6.
22:57 fridim_ left
pancake ok 22:57
jnthn std: qx() # I think
p6eval std 27013: OUTPUT«Undeclared routine:␤ qx used at 1 ␤ok 00:02 35m␤»
jnthn Yeah
jnthn is happy when STD agrees with him :-)
22:57 xinming left
pancake :) 23:00
23:04 om454545445 joined 23:05 dfort left 23:12 david__ joined
pmichaud note that qx (ls) works, though. 23:12
std: qx (ls) 23:13
23:13 om454545445 left
p6eval std 27013: OUTPUT«ok 00:03 36m␤» 23:13
pmichaud rakudo: qx (ls)
p6eval rakudo 97f141: OUTPUT«operation not permitted in safe mode␤in Main (lib/Safe.pm:25)␤»
pmichaud but yes, curlies are safer.
23:15 brandon76 left
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
jnthn Since normally it'd parse it as a call to ls..
OK.
pmichaud same with qq, rx, q, etc.
rakudo: say qq (ls)
p6eval rakudo 97f141: OUTPUT«ls␤»
jnthn Ah, OK. I'd somehow managed to not see the form with the space in and parens before...
Or never taken note of it at least.
pmichaud parens are a valid quote/bracket char :-)
they just can't occur next to the quote prefix
pancake for qx{ls}.split("\n") { ' ' if $_ ~~ m/parrot/i; } segfaults rakudo 23:18
jnthn Ouch.
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
pmichaud I suspect it's trying to divide the result by 0+1i 23:19
anyway, I'm not getting a segfault here. 23:20
pancake rakudo git?
with --gen-parrot
pmichaud oh wait, yes I am.
for me it fails twice with "too many params", then it segfaults. 23:21
I don't get a segfault if the 'i' isn't there
actually, it looks to me like it's parsing it as
... (m/parrot/).i 23:22
std: 3i
p6eval std 27013: OUTPUT«ok 00:02 35m␤»
pmichaud std: (3)i
p6eval std 27013: OUTPUT«ok 00:02 36m␤»
jnthn segfault here too
pmichaud std: (m/parrot)/i
p6eval std 27013: OUTPUT«Undeclared routines:␤ m used at 1 ␤ parrot used at 1 ␤ok 00:03 38m␤»
pmichaud std: (m/parrot/)i
p6eval std 27013: OUTPUT«ok 00:02 36m␤»
pmichaud std: m/parrot/i
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:␤------> m/parrot/i␤Other potential difficulties:␤ Possible obsolete use of /i; in Perl 6 please use :i instead at /tmp/JfOA3v7Wfn
..l…
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:␤------> m/parrot/ i␤ expecting any of:␤ infix or meta-infix␤ infix stopper␤ standard stopper␤ statement modifier loop␤ terminator␤FAILED 00:02 35m␤»
pmichaud nice.
I should do something similar here.
pancake how is :i used?
pmichaud right now the only way rakudo recognizes it is inside the /
m/:i parrot/
23:24 icwiener_ left
jnthn segfault is inside the calling conventions implementation. 23:24
pancake sounds weird syntax
pmichaud jnthn: try m/parrot/.i
I bet that segfaults also 23:25
oh, nyi
jnthn oh ewwww
pmichaud hmmm.
jnthn nasty nasty nasty
It actually crashes when trying to print the nice Perl 6 backtrace
pmichaud heh
jnthn When the .backtrace() PCC Method on Exception PMC returns the data structure it's built.
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
And then the next attempt to return something through PCC explodes as a result.
Yes, looks very much like that...
eww
My headache is bad enough, I'm not hunting this one down tonight. 23:27
pancake sorry for reporting O:)
jnthn pancake: Oh, report is welcome. :-)
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
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:29
pancake yep, is not a nice way to inform that the syntax is not correct 23:30
jnthn Aye.
23:32 kate21de joined
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:33
jnthn The second I think should be different. 23:34
DanielC I'm confused as to the syntactic meaning of [] and ()
rakudo: my @a = [1,2,3]; my @b = 1,2,3; my @c = (1,2,3); say @a.WHAT ~ " : " ~ @b.WHAT ~ " : " ~ @c.WHAT
p6eval rakudo 97f141: OUTPUT«Array() : Array() : Array()␤»
jnthn rakudo: my @a = 1,2,3; my @b = [1,2,3]; say @a.perl; say @b.perl;
p6eval rakudo 97f141: OUTPUT«[1, 2, 3]␤[[1, 2, 3]]␤»
jnthn Note the difference in the .perl
[1,2,3] is always an array that doesn't flatten
so @b = [1,2,3] means @b has one element. 23:35
rakudo: my @a = 1,2,3; my @b = [1,2,3]; say @a.elems; say @b.elems;
p6eval rakudo 97f141: OUTPUT«3␤1␤»
jnthn So you use [ ... ] to build up nested data structures.
DanielC ??? That doesn't make sense... [1,2,3] looks like an array.
pmichaud DanielC: consider: my @a = [1,2,3],4; 23:36
DanielC pmichaud: What about @a = (1,2,3),4; What's the diff?
pmichaud the difference is that [...] doesn't interpolate into a list
while (...) does. 23:37
rakudo: my @a = [1,2,3],4; say @a.elems;
p6eval rakudo 97f141: OUTPUT«2␤»
pmichaud rakudo: my @a = (1,2,3),4; say @a.elems;
p6eval rakudo 97f141: OUTPUT«4␤»
DanielC It's as if the ( ) is not there at all.
pmichaud correct.
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?
pmichaud sure, thinking of it as an array reference works
(fsvo "works")
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"
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]
p6eval rakudo 97f141: ( no output )
DanielC rakudo: my $a = [1,2,3]; say $a[1]
p6eval rakudo 97f141: OUTPUT«2␤»
DanielC hm
rakudo: my $a = 1,2,3; say $a[1]
p6eval rakudo 97f141: OUTPUT«2␤»
DanielC :-P
pmichaud That's a rakudo fail.
The answer should be "undef"
DanielC ok 23:41
pmichaud we don't have item assignment yet.
ruoso DanielC, the difference is that () is a Capture builder... while [] is an array builder
pmichaud essentially the above is should be the same as
23:41 gegloe joined
DanielC Should rakudo allow me to say $a = 1,2,3? 23:41
pmichaud (my $a = 1), 2, 3
whereas if the lhs of = is an array, it would be
(my @a = 1,2,3)
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.
ruoso DanielC, we're still missing S08, which will cover Captures...
but...
Captures are "values with no context"
pmichaud jnthn: yes, the backtraces are causing lots of double-free errors. 23:43
ruoso or "values that will have some context applied later"
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?
jnthn pmichaud: Nasty. Is there a correlation between the types of fail and the occurence of a double-free?
pmichaud jnthn: haven't noticed one.
I currently have rakudo-special backtracing turned off, though, and I still see the double-frees
so I think it must be a parrot issue more than a rakudo backtrace one
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
jnthn pmichaud: I rather suspected so.
ruoso pmichaud, but only because the Capture DWIM exception
pmichaud ruoso: it would be true even for $a = @arr 23:46
DanielC pmichaud: What is "item" context? I know scalar and array context.
pmichaud DanielC: "item" context is what p5 used to call "scalar" context
DanielC ah
ruoso pmichaud, but $a = (@arr, 2) is different
pmichaud ruoso: agreed.
23:47 gegloe left
ruoso DanielC, the parens are not require mostly... but it's really like if they were there 23:47
they're removed just as syntax... but semantically, it's like if they were still there 23:48
23:48 kate21de1 left
ruoso DanielC, the issue is really on how () and [] behave when coerced to lists 23:48
DanielC ok...
ruoso () will be flattened 23:49
[] won't
so...
my @a = (1,(2,(3,4))); will produce (1,2,3,4)
while
my @a = 1,[2,[3,4]]; will produce 1,[2,[3,4]]
DanielC It looks almost as if ( ) are white space. 23:50
ruoso they can be omitted when they are obvious
DanielC, but, also note that...
DanielC rakudo: my @a = (3,4); @a = (2,@a); @a = (1,@a); say @a.perl
p6eval rakudo 97f141: OUTPUT«[1, 2, 3, 4]␤»
DanielC weird 23:51
pmichaud DanielC: same as p5
ruoso that's correct... because you're using in list context
and list context will flatten
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]]]]␤»
DanielC Interesting. 23:53
rakudo: my @a = 3,4; @a = 2,@a; @a = 1,@a; say @a.perl
p6eval rakudo 97f141: OUTPUT«[1, 2, 3, 4]␤»
ruoso DanielC, to this point, it works just like p5
DanielC ok... 23:54
ruoso the interesting part goes when you can access 1,(2,(3,4)) without causing the flattening
pugs: my @@a = 1,(2,(3,4)); say @@a[1;1;1]
p6eval pugs: OUTPUT«*** ␤ Unexpected ";"␤ expecting "_", fraction, exponent, term postfix, operator or "]"␤ at /tmp/m79q0jis6p line 1, column 32␤»
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␤»
ruoso pugs: my @@a = (1,(2,(3,4))); say @@a[1;1]
p6eval pugs: OUTPUT«*** ␤ Unexpected ";"␤ expecting "_", fraction, exponent, term postfix, operator or "]"␤ at /tmp/hHR73Kxd7s line 1, column 34␤»
jnthn -> sleep, night all
ruoso blah
rakudo: my @@a = (1,(2,(3,4))); say @@a[1;1]
p6eval rakudo 97f141: OUTPUT«Malformed declaration at line 2, near "@@a = (1,("␤in Main (src/gen_setting.pm:0)␤»
pmichaud rakudo doesn't know @@
ruoso I thought pugs did
DanielC Daniel doesn't know @@ either.
pmichaud well, pugs obviously parses @@ okay, I don't think it knows slice context 23:56
23:56 kate21de left
pmichaud (i.e., the semis in brackets) 23:56
ruoso DanielC, anyway... you'll be able to navigate in the still-unflattened data...
pugs: my @@a = (1,(2,(3,4))); say @@a[1][1][0]
p6eval pugs: OUTPUT«*** Can't modify constant item: VUndef␤ at /tmp/dZj29mzdqj line 1, column 29 - line 2, column 1␤»
ruoso pugs: my @@a = (1,(2,(3,4))); say @@a[1][1]
p6eval pugs: OUTPUT«␤»
DanielC So @@a is like an array without flattening?
ruoso DanielC, yes... but you're accessing the Capture 23:57
not an array
DanielC ok
Not that I can see any difference...
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] ?
ruoso DanielC, yes.. the difference is that captures also support named members
DanielC ('name' => 'Daniel', 2,3,4) ?
ruoso yes
DanielC AHHHH
That's new.
ruoso yes, it is
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
pmichaud (name => 'Daniel', 2, 3, 4) # named member
DanielC ok
pmichaud yes, it's not completely decided yet
ruoso and when it will be a pair in position 0
DanielC @@a = (name => 'Daniel', 2, 3, 4); say @@a<name>
ruoso yes