»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend! | tinyurl.com/p6contest
Set by moritz_ on 28 December 2010.
dalek tpfwiki: (Herbert Breunung)++ | www.perlfoundation.org/perl6/index....eta_tablet 00:03
snarkyboojum is off to linux.conf.au in a couple of weeks.. a few perl talks happening, but no perl6 :| 00:13
will see if I can find a few surreptitious perl6 hackers tho :)
and drag them into #perl6 :) 00:16
coldhead linux.conf.au is on the banks of the river that flooded... 00:18
one of the* 00:19
fingers crossed
snarkyboojum yep.. it's still going ahead though.. not the ideal scenario, but things are settling down in brisbane after the floods
lichtkind p5=> is gone? 02:54
i think yes
i remember
thanks
dalek tpfwiki: (Herbert Breunung)++ | www.perlfoundation.org/perl6/index....kup_tablet 02:57
tpfwiki: (Herbert Breunung)++ | www.perlfoundation.org/perl6/index....tor_tablet 03:03
tpfwiki: (Herbert Breunung)++ | www.perlfoundation.org/perl6/index....tor_tablet 03:08
dalek tpfwiki: (Herbert Breunung)++ | www.perlfoundation.org/perl6/index....tor_tablet 03:14
coldhead wait wait wait wait 05:34
petdance.com, sister site to rakudo.org, is host to the big black/rapeman archive? 05:35
:O
petdance.com/actionpark/ 05:36
i am stunned
perigrin petdance.com is the sistersite to rakudo.org? 06:28
coldhead same "webmaster" 06:29
perigrin right
but beyond that how are they possibly related? 06:30
other than Andy hosts both of them?
coldhead well i was down on andy for rakudo.org stability problems. but now all is forgiven
i'm mostly surprised at what a small world it can be, perl6 & a venerable big black site 06:31
old & new, etc. nevermind
perigrin :) 06:32
moritz_ good morning 07:25
snarkyboojum moaning 08:23
dalek kudo: 388eed7 | moritz++ | docs/ChangeLog:
another ChangeLog entry
08:30
snarkyboojum moritz_: that test harness you included in niecza recently.. is that supposed to be able to be run with t/run_spectests? 08:41
snarkyboojum because it ain't workin' no mo' :P 08:56
Tene anyone have any idea what sorear needs from me, re his post in #phasers? 08:59
masak oh hai, #perl6 09:27
snarkyboojum masak: o/ 09:38
jnthn morning, #perl6 09:40
snarkyboojum jnthn: o/
heh
lopnor hello, 09:59
snarkyboojum hi lopnor
lopnor i have a question about regex in perl6,
can I ask?
masak yes. always.
snarkyboojum please do.
lopnor i'd like to get 'not tab strings' 10:00
in perl5, i'll write $str =~ /[^\t]+/
or something,
jnthn Maybe \T+ works...
masak / ^ \T* $ /
lopnor then,
not 'tab or newline' 10:01
jnthn <-[\t\n]>
lopnor will be /<[\T\N]>+/ or something?
jnthn: i tried with rakudo,
jnthn No, need a negated char class for that I think...
lopnor it matched 't' and 'n' 10:01
masak lopnor: yes, that won't work.
lopnor: everything matches <[\T\N]> 10:02
jnthn [\T & \N]+ # is probably along the lines of what you were trying to do with the char class, but it's no doubt slow as well... :) 10:03
masak [<!before \n> \T]*
lopnor ah, 10:04
jnthn masak: What I just wrote almost boils down to the same thing, fwiw.
masak guess so, yes. 10:04
jnthn masak: As in, I think & is implemented either very much like before or maybe even in terms of it.
masak not in PGE.
jnthn Yes, but I didn't read the source to that. :P 10:05
lopnor thank you!
i understand now! thank you everyone!
masak & has the additional restriction that the two operands need to match the same length substring.
lopnor: come back for more questions anytime.
jnthn masak: True
lopnor masak: thank you. i will.
masak jnthn: I remember being flabbergasted at the complexity of &, and then it all fell into place. in the end it was trivial to implement; just let backtracking handle all of the logic. 10:07
in the end, it's because of backtracking that & is expensive. it does backtracking in both operands, a bit like X does.
jnthn Makes sense. 10:09
snarkyboojum so this doesn't work? 10:12
jnthn "this"?
snarkyboojum rakudo: my $text = "\t"; if $text ~~ /<-[\t]>+/ { say "no tabs" }
p6eval rakudo c664e8: OUTPUT«no tabs␤»
snarkyboojum I'm misunderstanding something :)
jnthn oh, ETOOIMPATIENT :) 10:13
snarkyboojum could be bier and regex don't match :P
jnthn snarkyboojum: huh, I'd expect that to work too...
Oddness
masak it's a known bug.
jnthn Oh.
masak nqp-rx doesn't recognize backslashed things in charclasses. 10:14
snarkyboojum ah, that's what I thought our friend lopnor was raising
masak++ # the human bug database
masak that's what lopnor was experiencing. I didn't want to bring it in and confuse the matter. :) 10:16
we should really fix that bug.
masak here: rt.perl.org/rt3/Ticket/Display.html?id=81168 10:17
but I don't think that's the latest one. I think moritz_++ submitted the original one.
snarkyboojum oh goody.. I wonder how hard it is to fix 10:18
jnthn isn't sure off hand
masak aye, here: rt.perl.org/rt3/Ticket/Display.html?id=73698
masak sees about merging the two 10:19
snarkyboojum: moritz_++ has some wording on the thing in his ticket.
snarkyboojum interesting reading
takadonet morning all 13:05
masak takadonet: \o 13:06
takadonet long time since I seen that rakudo pass all the spectest :) 13:43
masak <sorear> Container is nonsense 13:50
I agree. I'd say Scalar is the same kind of nonsense.
flussence takadonet: it fails 3 on mine, and nobody else's apparently, I've no idea what causes it :(
takadonet i always have failed tests but no one else did... looks like we changed places 13:51
masak some things have been platform-dependent, such as the PID bug. 13:52
[Coke] FYI, when building rakudo with 3.0.0 : trac.parrot.org/parrot/ticket/1977 13:55
moritz_++ has reported this in the past, I believe.
jnthn If Scalar exists it's as a container type like Array or Hash. my Scalar $x would mean you're declaraing a Scalar containing a Scalar container. 13:56
Which is, like my Array @x, not what you usually want. 13:57
colomon o/ 13:59
masak \o 14:00
colomon jnthn: what would Scalar mean if it was a container? 14:11
masak colomon: sounds like it would be kind of like an Array with exactly one element. 14:19
masak (and none of the regular Array methods) 14:19
colomon masak: but an element of an Array can be anything, right? 14:21
including another Array... 14:22
masak sure.
colomon It seems like it would be much more useful if it were something like 14:23
subset Any where { !~~ Array & Hash }
(realized halfway through I had no idea how to make that legal code, but I hope the idea comes through) 14:24
masak subset Any where { $_ ~~ none(Array, Hash) } 14:26
so it's OK for it to be a Set, a Bag, or an EnumMap?
flussence (huh, "given $input { ok .indent($a), $result }" does the complete opposite of what I expected...) 14:32
(oh, I'm an idiot, that's why.)
masak flussence++ # implementing .indent
flussence I'm staring at the code thinking "wtf", when I should've used "is" there :)
raihjken Hai :S ? 14:33
dalek tpfwiki: util++ | www.perlfoundation.org/perl6/index....l_6_tablet 14:33
masak wow, a drive-by hai-er.
flussence and now that I'm using the right test function, it still does the complete opposite... but more usefully
(if I'm understanding right, it's doing is($_, .indent...) 14:34
masak flussence: 'is .indent, $result' means 'is($_.indent, $result)' 14:36
flussence it helps if I look at the right got/expected lines :) 14:36
masak spectests PASS here as well. \o/ 14:42
dalek tpfwiki: util++ | www.perlfoundation.org/perl6/index....lta_tablet 14:43
dalek kudo: 13b405c | pmichaud++ | build/PARROT_REVISION:
Bump PARROT_REVISION to 3.0.0 release.
14:48
tpfwiki: util++ | www.perlfoundation.org/perl6/index....lta_tablet
colomon masak: Array, Hash was meant purely to illustrate. Positional, Associative might make more sense. Or something else altogether. 14:49
or it's just as likely the entire idea of Scalar is nonsense. :) 14:50
pmurias niecza: say "hi" 14:51
p6eval niecza v1-149-g56c80b0: OUTPUT«Unhandled exception: Unable to resolve method keys in class Array␤ at /home/p6eval/niecza/boot/lib/SAFE.setting line 922 (SAFE keys @ 2)␤ at /home/p6eval/niecza/src/Metamodel.pm6 line 192 (Metamodel Namespace.list_stash @ 7)␤ at
../home/p6eval/niecza/src/Metamodel.pm6 line 603 (Me…
pmurias who runs the evalbot?
masak colomon: all I can say is I don't see the point of Scalar, and nothing in the spec makes me see the point of it. 14:52
pmichaud Scalar is the name of the type for Scalar containers, I suspect. 14:53
flussence masak: it's mentioned as the return type for Array.pop, is there any other way of doing that?
pmichaud Array.pop should return Mu, I think. 14:53
pmichaud defining Array.pop to return Scalar is almost certainly wrong. 14:53
flussence: where did you see that for Array.pop, ooc? 14:54
mux what is Mu?
flussence S32/Containers:603 (and 680)
pmichaud "Mu" corresponds to what other languages call "Object"
flussence and there's a similar one in S32/Str:512
pmichaud i.e., it's the "most general" type
mux oh, Isee, forall a. a 14:55
:-)
masak flussence: that's just plain wrong.
pmichaud the primarily way to think of Scalar at the moment is: my $x is Scalar
"is Scalar" is the default type associated with the $ sigil
just like "is Array" is the default type associated with the @ sigil
masak as opposed to what?
colomon but can't a $ sigil'd variable hold absolutely anything? 14:56
pmichaud as opposed to: my $x is TiedHash
mux funny that perl 6 calls this Mu
masak ah.
pmichaud note the difference between "my $x is Scalar" and "my $x of Foo"
"is" identifies the container type. "of" defines the value constraint
my Int $x is basically like my $x is Scalar of Int 14:57
my $x is TiedHash of Int would say that $x is a TiedHash that is constrained to hold Int values
masak *nod* 14:58
pmichaud so, at the moment "Scalar" is the name we give to the default scalar container type
and no, it doesn't get used much 14:59
dalek tpfwiki: util++ | www.perlfoundation.org/perl6/index....lta_tablet
masak it definitely shouldn't be used in S32 siggies. 15:01
flussence S29:680/724 say "S32-setting-library/Scalars.pod", but that file doesn't exist. kinda worries me...
masak there might have been one at one point, but it got renamed or fractured into other parts.
pmichaud S32 and S29 were drafted long before we had good clarity on the container/value model. 15:02
so I suspect any mention of "Scalar" in those documents was highly speculative
masak also, neither of S29 or S32 should be taken as absolute truth.
flussence oh I see, it looks like all the stuff in that section is inside S32/Basics
masak granus salis applies.
masak more than a granus, even. 15:03
pmichaud I like spicy specs. 15:03
flussence rakudo: say 1 ~~ Scalar 15:04
p6eval rakudo 388eed: OUTPUT«Could not find sub &Scalar␤ in main program body at line 22:/tmp/GKyQe7RQK0␤»
flussence well at least I don't have to worry about it in rakudo :)
dalek tpfwiki: util++ | www.perlfoundation.org/perl6/index....lta_tablet 15:05
mux the only time I've heard of "Mu types" is in the context of recursive types, where Mu is often given to the type-level fixed-point combinator
I really wonder why they chose this name in Perl 6
mathw there was a reason 15:07
but I can't remember what it was
flussence everything's an object, but it's shorter to type "Mu" than "Object" every time 15:08
masak it was TheDamian who suggested it, and TimToady liked it.
mux that's a reason for the existence of "Mu", not a reason for its name
masak in Japanese, 'Mu' means 'nothingness'.
mux ah
pmichaud "Mu" is meant to also indicate a level of undefinedness
masak it's the punchline of an old koan.
mux that makes sense, thanks
pmichaud i.e., it's the most undefined type
flussence also there's the concept of µ meaning small, and there's almost nothing attached to a Mu object by itself
pmichaud indeed, "Mu" is a bit of an anagram for "most undefined" 15:09
masak it can be seen as standing for a number of thing, among others 'Most Undefined'.
mux I should learn more japanese
masak not anagram; initialism.
mux masak: I thought this was called an acronym
masak aye.
pmichaud right, acronym 15:10
or initialism
pay no attention to my ramblings this morning :)
flussence and it's a nicer name than "UNIVERSAL"
mux sure is 15:11
pmichaud hears a sinusoidal hum coming from his desktop tower and thinks the fan may be about to fail
masak Perl 7 will bring in the best of Perl 5 and Perl 6, and will call it "MUniversal". :P
mux I would have called it "Top", but that's probably because I like CS-oriented names :-) 15:12
masak mux: are you implying that deriving a class is a downwards act? half of the CS people would disagree :) 15:13
after all, Base is at the bottom of things.
mux masak: in theory, what perl 6 calls "Mu" and other languages call "Object" is the top type
this is not me making things up
masak I didn't say it was. 15:14
masak I'm saying there's no perfect consensus. 15:14
mux simply because any other type is a subtype of it
anyways, I like the reference to japanese
mathw it's both ways
pmichaud I'm not certain that Perl 6 has a "top type", though.
Yes, Mu is the base class for nearly everything -- I just don't know how big "nearly" is :) 15:15
masak mux: MJD has a post where he defends 'derived == upwards', but I can't find it right now. 15:15
Util tadzik: ping
masak pmichaud: we won't know until Parrot lets Rakudo talk to other implementations.
dalek tpfwiki: util++ | www.perlfoundation.org/perl6/index....tor_tablet 15:16
mux masak: this makes sense; I'm just following the usual CS conventions myself. 15:17
pmurias masak: re best of Perl 5 and Perl 6, Perl 6 is intended the best of Perl 5
s/intended/intended to be/
mux wonders how many years will pass until he gets to write Perl 6 code for companies 15:18
Util masak, mux: MJD post is blog.plover.com/CS/contravariant.html
pmichaud masak: even Parrot doesn't have a "most base" type :-(
flussence an object hierarchy with a defined top and bottom won't make sense when you're coding in a zero-G environment anyway. 15:19
masak Util: thank you.
mux Util: cheers
makes me wonder, does Perl 6 allows covariant/contravariant type annotations?
masak pmurias: yes. I might not have been entirely serious.
mux: there's nothing to enforce Liskov et al. in Perl 6. 15:20
mux: feels like a module or some tooling could, though.
mux poor Barbara ;-)
masak looks forward to getting his hands on an implementation that does PRE and POST on methods 15:23
maybe I should get into Niecza development and try to put that in place...
or I could just push Yapsi in that direction.
or Rakudo. so many choices! :)
mux never been a huge fan of contract programming, I guess I never stumbled upon a good use of it yet
pmurias votes for Niecza ;)
moritz_ votes against democracy :-) 15:24
masak mux: reason I thought about it was that you mentioned covariance/contravariance, and PRE and POST do those. 15:25
mux masak: I don't quite see how pre- and postconditions gains you covariance/contravariance 15:26
mux but then again, I'm not very familiar with those 15:26
mux or did you mean that you could use pre- and postconditions to enforce covariance/contravariance on methods? 15:27
masak mux: consider inheritance. a subclass should honour at least all the POSTs of the parent class(es), and may loosen their PREs. 15:27
mux alright, but then it's as I said, you can use such constructs to implement covariance/contravariance, but it does not come for free 15:28
pmurias mux: what do you mean by having convariance and contravariance implemented? 15:29
mux pmurias: being able to say that such method is covariant or contravariant in its return type -- the usual meaning as far as I know 15:30
masak yeah, Perl 6 doesn't by default.
should be addable to Real Perl 6 as a pragma, though.
and implementable in pure Real Perl 6, too. 15:31
mux I'm not blaming Perl 6 for not having it, I'm mostly being curious about Perl 6, I know very little about it yet
masak mux: you give off very strong Haskell vibes. I like that. :) 15:32
mux heh. :)
masak mux: part of the reason it's not being enforced, I believe, is that the Perl 6 type system is too "powerful", and enforcing co/contravariance in the general case would get one sucked into the Halting Problem. 15:38
but I might be wrong, and rambling.
mux masak: if you have pointer to discussions about it, I'd be interested 15:39
masak not really. 15:41
mux it seems there is stuff about it in perlcabal.org/syn/S06.html 15:41
masak just that things like 'where' clauses tend to destroy the "purity" (from a H-M point of view) of the type system.
mux masak: what kind of 'where' clauses are we talking about? those I know about don't do that 15:43
masak rakudo: subset Even of Int where { $_ %% 2 }; say 42 ~~ Even
p6eval rakudo 388eed: OUTPUT«Bool::True␤»
jnthn pmichaud: (base for nearly everything) you can have more than one strange loop in the model. :) 15:44
masak rakudo: subset Even of Int where { $_ %% 2 }; subset DivisibleByFour of Int where { $_ %% 4 }; say DivisibleByFour ~~ Even
p6eval rakudo 388eed: OUTPUT«Bool::True␤»
mux masak: okay
masak o.O
jnthn: ^^
mux that's way over my head
need more introductory perl 6 material 15:45
masak mux: it's all in S12, I believe.
pmurias mux: that's a bug
jnthn masak: Subset is based on Int. Int numifies to 0. 0 is divisible by four. 15:45
masak jnthn: I meant to do something like a type inclusion test.
jnthn You did. 15:46
It just treated the LHS like a value.
masak yes, but between subtypes.
jnthn Remember that 4 ~~ Numeric and Int ~~ Numeric are really the same operation. 15:46
masak ok. 15:47
jnthn Since type objects are just empty instances.
masak not saying I like it, though.
jnthn I suspect the subset one maybe should warn but it boils down to whether my Int $a; say $a %% 4 warns.
rakudo: my Int $a; say $a %% 4
p6eval rakudo 388eed: OUTPUT«Bool::True␤»
jnthn Anyway, computing subset inclusion is the halting problem. :) 15:48
masak what I said.
jnthn So there's little point in drawing out special case semantics for a :U on the LHS, imho.
mux you know, type inference in haskell is undecidable, just like the halting problem. it doesn't cause much problems in practice :-)
jnthn As one couldn't make it do anything that useful anyway. 15:49
masak mux: by analogy, it should be possible to do some type inference in Perl 6 as well. and as far as I understand, jnthn is building towards that. :) 15:50
mux that sounds cool
masak walk & 15:51
jnthn Yes, it's in with the whole bunch of type goodness I@m building the foundations for. 15:52
mux yay for type goodness :-)
pmurias jnthn: what sort of type inference do you plan to implement 15:53
?
jnthn pmurias: Haven't thought about it in great detail yet, tbh. Will probably start out with some really simple cases (like, variable that's only ever assigned once from a literal). 15:59
pmurias do you want to that for optimalisation purposes or catching type errors? 16:01
jnthn Both
I suspect a lot of the analysis for the two is the same or very similar. 16:02
pmurias jnthn: it will be interesting to see how does the usefullness catching stuff that is guaranteed to be incorrect compare with preventing stuff that might fail 16:30
colomon jnthn: I've got to say, I'm not very comfortable with my Int $a; say $a %% 4 not warning, and completely spooked that my Rat $al; say $a %% 4 is a hard crash instead. 16:32
colomon rakudo: my Rat $a; say $a %% 4 16:32
p6eval rakudo 388eed: OUTPUT«Type objects are abstract and have no attributes, but you tried to access $!numerator␤ in 'infix:</>' at line 4197:CORE.setting␤ in 'infix:<%>' at line 3711:CORE.setting␤ in 'infix:<%%>' at line 501:CORE.setting␤ in main program body at line 22:/tmp/X2FoRkP5vu␤»
colomon Speaking for my own programming, I think I'd generally rather have the Int version fail as well. 16:34
jnthn colomon: I agree they should be consistent.
colomon I kind of feel like they should be consistent and the consistent behavior should be user-selectable. 16:36
TimToady is right that if you're doing a big hyper operation or something, you don't want one piece of data killing the entire operation. 16:37
jnthn Well, it should warn rather than die.
colomon But by the same token, declaring a variable and then using its value without initializing it is probably an error in normal circumstances.
I'm not convinced at a warning is useful at all. 16:38
TimToady I think the only good argument for a warning is that it's what a P5er would expect 16:39
but we'd probably be better off settling on failure semantics 16:40
colomon Just as a for instance, I was routinely running 1000+ test cases for masak's p4. If one warning had crept in there, I probably wouldn't even have noticed it. 16:40
colomon maybe if you could easily log warnings, or something like that... 16:42
TimToady well, you can supposedly catch warning exceptions 16:46
jnthn -> home 16:48
tadzik ~ 17:04
Util: pong
arnsholt likes the TimToady quote in the GNU awk manual 17:16
A loaded Uzi indeed ^_^
tadzik link? 17:18
arnsholt www.gnu.org/manual/gawk/gawk.html#Array-Intro 17:18
dukeleto there is a typo in the quote "tryinng" 17:38
otherwise, hilarious :)
Util tadzik: added META.info for Perl6-Math-Quaternion module - github.com/Util/Perl6-Math-Quatern.../META.info 17:54
thundergnat Rakudo: use Test; is ~(42,).sort: { 0 }, "42"; 17:57
tadzik Util++
thundergnat: "Rakudo".lcfirst
thundergnat tadzik: oops 17:58
rakudo: use Test; is ~(42,).sort: { 0 }, "42";
p6eval rakudo 388eed: OUTPUT«Too many positional parameters passed; got 3 but expected between 1 and 2␤ in 'Parcel::sort' at line 1401:CORE.setting␤ in main program body at line 22:/tmp/eEFl3q57vQ␤»
thundergnat Is this a precedence / parsing issue rather than an error?
rakudo: use Test; is ~((42,).sort: { 0 }), "42";
p6eval rakudo 388eed: OUTPUT«ok 1 - ␤»
thundergnat That is a fudged test in roast. 17:59
github.com/perl6/roast/blob/master...ort.t#L202
Seems like the test itself is faulty. 18:00
std: use Test; is ~(42,).sort: { 0 }, "42"; 18:02
p6eval std 625303c: OUTPUT«Compiled lib/Test.pm6␤ok 00:01 123m␤»
thundergnat BTW tadzik: I've added META.info files to my modules in ecosystem as well. 18:04
tadzik thundergnat: on it
yay, versions 18:05
pushed, thundergnat++ 18:07
thundergnat tadzik: is there any recommendations anywhere for META.info files, or is it "figure it out from S22."? 18:08
I mostly just looked at others and copied them...
tadzik thundergnat: well, that's until I do and specify it a bit 18:09
thundergnat ah... :-) 18:10
tadzik you're welcome to write specs too, or just a start 18:11
arnsholt It never ceases to amaze me how Python and Ruby don't see the utility of name declaration
tadzik you mean declaration with my/our? 18:12
arnsholt Yeah. I hate how I can't do the equivalent of use strict in Python and Ruby
tadzik everytime I'm tempted to try Ruby/Python there's just too many things missing to me
But I may be biased ;)
arnsholt Hehe 18:13
Python is ok, as long as the philosophical differences (one way to do it, rather than more than one) don't drive you nuts 18:14
At least python.org has a set of easy-to-use spec and standard lib docs
Ruby is a bit harder to get along with for me, since it's so hard to find authoritative docs that don't drive me nuts =) 18:15
thundergnat I've been messing around with the sort method/sub, trying to get support for arrays of comparators working. 18:18
thundergnat I've got something that works and still passes passes roast sort tests ( github.com/perl6/roast/blob/master...ist/sort.t ) 18:18
masak thundergnat: when you do '.sort:' like that, the whole rest of the statement becomes arguments to the .sort method. 18:19
thundergnat At least, it passes all the tests that unmodified Rakudo does plus a bunch of test for comparator arrays.
But it's dismally slow. And ugly.
masak thundergnat: that little subtlety was what made me use the invocant colon (for calling) a *lot* more restrictively.
in other words, the string "42" is sent in to .sort as well. 18:20
thundergnat masak: makes sense, I'm just pointing out that that test is in roast, and fugded because it is failing.
masak thundergnat: the test is wrong.
thundergnat nod 18:21
arnsholt masak: I started doing the same, a bit. But I'm still a bit sad you can't use the colon for invoking normal subs as well =)
jnthn hem 18:23
masak "hemma" :)
thundergnat Anyway, if anyone is interested, here is my comparator array trial: gist.github.com/784835 sub/method is named msort so as not to collide with built in sort.
colomon #Phasers in 37m?
jnthn extracts more free Swedish edukashun from masak++
colomon: Yes, I think so. 18:24
masak arnsholt: hum? without the colon, you already have that semantics for listop subs...
thundergnat Comment / criticism welcome.
masak colomon: thanks for reminding me.
colomon masak: That's a big part of the reason why I ask here. ;)
jnthn :)
jnthn had actually remembered, for once.
arnsholt masak: Excellent point =) 18:25
masak colomon: how tactful of you :)
tadzik > 60% of modules on META.list :)
masak wow. 18:26
colomon tadzik: \o/
tadzik well, that's not me actually :)
Util++ and thundergnat++ did it today
jnthn signs up for YAPC::EU 2011 o/
masak tadzik: what's a quick way to learn how to write a META.list for one's project?
tadzik masak: that's META.info. My blag toast is a quick introduction 18:27
colomon Oooo, that reminds me, I may have volunteered to do a Perl talk / workshop at Penguicon this year.
masak tadzik: ok, I've seen that one. 18:28
tadzik masak: sadly, not much more is written. I promised myselt to write a kinda-spec after all this mess on my Uni
masak :) 18:29
masak signs up for YAPC::EU 2011 o/
dukeleto Riga sounds fun... 18:30
jnthn It is.
tadzik where does one sign up? 18:31
jnthn tadzik: yapceurope.lv/
masak Riga is one of my absolute favourite latvian capitals.
jnthn Yeah. The others just don't cut it.
masak literally.
jnthn I mean, where other Latvian capital has an Asparagus Boulevard? 18:32
masak Asparagus Boulevard \o/
and quite nice steamed buns. and a way underappreciated Indian place.
jnthn Oh, yes. That Indian place rocked.
We can go again. \o/
masak \o/ 18:33
twice!
jnthn And to the pay-by-weight nommery with the many nice things. :)
masak yes, those were the ones with the buns.
jnthn Ah, yes, that's right. :)
It had other things too though :)
masak (Rigan nommeries)++
<< This commercial was brought to you by Moscow.pm >> 18:34
jnthn :D
jnthn nips to the shop before #phasers 18:35
takadonet /join #phashers 18:38
...
tadzik Password:
tadzik signed in for YAPC::EU too 18:44
jnthn tadzik: Yay! :) 18:49
tadzik (and then I saw the prize :)) 18:51
jnthn tadzik: Submit a talk, get it accepted and you get in free. :) 18:54
tadzik heh 18:56
I think I'll just sit and listen in the first year :) 18:57
masak tadzik: you should do a lightning talk. if you don't want to do one alone, I'll do one with you. :) 19:27
tadzik how is lightning talk different from a normal one, besides being lightspeed and not buying me a ticket? :) 19:28
masak: that'd be an awesome experience :)
masak tadzik: it doesn't take as much preparation, and thus the barrier of entry is smaller. 19:29
tadzik fair enough. Works for me :)
masak tadzik: first YAPC I went to, viklund and I unveiled November in a lightning talk :)
masak I'm still getting warm fuzzies from the reception it got :) 19:30
tadzik yet the only thing coming to my mind (for today) is the modules stuff 19:31
although many things will probably happen til august 19:32
masak ...you could become a Yapsi contributor... 19:33
...or I could hook you on Druid...
tadzik that sounds fun :)
tadzik (yapsi) 19:33
masak ...or show you the awesomeness of GGE...
masak ...or convert you to pls... 19:33
tadzik hmm 19:34
maybe after neutro/metainfo becomes neutro/master, it's time for neutro/pls to come
Zach_Mazolt Which GUI toolkit binding will be used in perl six?
tadzik but! exams first
masak neutro is proto resurrected. pls is what proto would've been if I'd known better at the time.
Zach_Mazolt: any toolkit that someone writes bindings for. 19:35
tadzik Zach_Mazolt: whatever gets implemented. I don't think there'll be any Main Toolkit
masak Zach_Mazolt: pmichaud says that whenever someone asks "what's the official..." the answer is "no".
except for "...spec" and "...spectest suite". 19:36
Zach_Mazolt i mean no official but any. i thought there was some work someone did so i can participate 19:37
dalek tpfwiki: util++ | www.perlfoundation.org/perl6/index...._s_notepad
masak Zach_Mazolt: people come in sometimes asking the question. 19:42
Zach_Mazolt: I guess that'll keep happening until someone gets motivated enough to start :)
Zach_Mazolt masak: assume I will start on one, which one you see more appropriate? qt, tk, wx? 19:44
masak answering this might require some research. 19:45
anything with C bindings is at least possible through zavolaj.
tadzik Zach_Mazolt: you have to be aware of zavolaj aka NativeCall's current limitations
Zach_Mazolt I guess I will start by doing the research then.. 19:46
tadzik ++Zach_Mazolt 19:47
masak looking forward to seeing some cool proof-of-concept. :)
didn't Su-Shee++ do something GUI-y with Perl 6 a year or so ago?
Su-Shee no, I've tried out Tene's enlightenment lib stuff and discussed perl 6 and gui here and there 19:48
I think the last common denominator was to go with dammit how was it called.. 19:49
GIR!
masak would like a GUI toolkit called "dammit"
masak :) 19:49
and then Teratogen would use it to put up a dialog box asking "When is Perl 6 going to be released?" :P 19:50
Su-Shee well the GIR thing from all the gtk libs makes it exceptionally easy as far as I've read about.. they managed to bind entire gnome basically against js that way ("seed" it's called)
jnthn :D
Zavolaj's main limitation at the moment for GUI stuff, afaik, is lack of callbacks. 19:51
Su-Shee I think you might not need to bridge zavolaj and gtk but zavolaj and GIR
Zach_Mazolt now I am feeling tempted to do some work.. :) 19:52
masak cheers Zach_Mazolt on
Su-Shee "gnome/gtk libs and stuff" export symbols and stuff via GIR, GIR gets "handled somehow" in the target lang. 19:53
Su-Shee and gir is something xml-ish afaik. so it'll probably be a gir grammar.. 19:53
so if this works, you can take either gtk (3) and make that a p6 widget binding or write you own because you decide to bind clutter instead. or both. 19:55
Zach_Mazolt Su-Shee: thanks for the insight. 19:58
Su-Shee well that was just gtk. :) there's also qt available to write bindings for. ;) 20:00
or really do something native.
flussence the problem I see (with GTK stuff) is that interaction's mostly callback-based... I have no idea how that works via NativeCall.
masak it doesn't, last I heard.
tadzik when "last heard" is 9 minutes ago :) 20:01
flussence needs to read the whole log next time :)
flussence getting the GladeXML stuff to run should be pretty easy though. That only needs about half a dozen functions to display a window, iirc 20:02
Su-Shee Zach_Mazolt: that's deprecated. go for what's it called.. gtkbuilder I think.. 20:03
flussence oh right, yeah
masak tadzik: ah. oh. ...I didn't hear that one. :)
Zach_Mazolt :)
flussence (I haven't done any GTK in a year or two)
Zach_Mazolt my contact is mazt.zach at gmail.com . I may not be here so often but I will be back if something worked. feel free to contact me anytime. you know what i will be working on :) 20:04
Su-Shee go ask #gtk-perl (gtkperl?), there's emanuelle bassi who is a core gtk devel anyways _and_ does a couple of perl modules. he should really know how to go about the best way
flussence good luck with it, anyway
Su-Shee (irc.perl.org)
Zach_Mazolt Su-Shee: heading there in a moment
tadzik Zach_Mazolt: how about opening a public git repo on github so we can watch the process? 20:05
Zach_Mazolt tadzik: sure. 20:05
Su-Shee ugh, emmanuele ;)
Zach_Mazolt: have a little patience, they idle for hours sometimes ;) 20:06
Zach_Mazolt: and here's basic reading: live.gnome.org/GObjectIntrospection
Zach_Mazolt: and here's how it's actually done (js) library.gnome.org/devel/seed/unstable/ 20:07
Zach_Mazolt Su-Shee: Sounds fun.. I hope I will see some active community in #introspection 20:08
Su-Shee browse through seed. it's _amazing_ what they've managed in like.. short under 2 years I think. it's basically everything from gnome to network to dbus wrapped in js 20:09
tadzik jnthn: does Configure.pl build a proper Makefile for you in nqp-rx/nom? 20:10
jnthn: I think #370 needs a proper tab
jnthn tadzik: oh, dar 20:10
n
masak dar\n :) 20:11
jnthn tadzik: My make program doesn't care for such differences.
dukeleto are there any perl6/nqp syntax highlighters?
jnthn Yes, yes, I'm just a big pile of whitespace fail. :P
masak jnthn: the black space of the family...
moritz_ the blank space of the family :-) 20:12
jnthn tadzik: Feel free to commit a fix if you have a moment.
tadzik dukeleto: si
jnthn: Makefile is generated by Configure.pl somehow, I don't know where to look. Plus I have no commit bit anyway
jnthn build/Makefile.in
Oh
hugme: add tadzik to nqp-rx 20:13
hugme jnthn: You need to register with freenode first
dukeleto tadzik: where do they live? 20:13
moritz_ hugme: add tadzik to nqp-rx
hugme moritz_: ERROR: Can't add tadzik to nqp-rx: HTTP/1.1 401 Unauthorized
jnthn hugme: add tadzik to nqp-rx
moritz_ fuck
hugme jnthn: ERROR: Can't add tadzik to nqp-rx: HTTP/1.1 401 Unauthorized
jnthn darn
tadzik dukeleto: good question, I don't remember
github somewhere. Perl6.org should have some links
jnthn OK, I fix itlater.
moritz_ jnthn: it's because perl6 is an organization account now
jnthn (not hugme, I mean. the whitespace) 20:14
dukeleto there is a new organization API on github
tadzik dukeleto: perl6.org/whatever/ there
moritz_ added tadzik via web interface
tadzik thank you moritz_
Zach_Mazolt nice to meet you gents. see you soon.
tadzik but that's 6model
jnthn tadzik: No, I added you there already :) 20:15
masak Zach_Mazolt: ladies and gents. :)
jnthn Then realized...wrong repo :)
diakopter missed #phasers 20:16
Zach_Mazolt masak: don't recall seeing ladies here. but I wish them a nice day too :)
masak Su-Shee is one. :) 20:17
dalek p-rx/nom: 88e53e7 | tadzik++ | build/Makefile.in:
Fix a whitespace-o in Makefile.in
Zach_Mazolt o so I forgot to thank the one who helped the most. thanks Su-Shee :) 20:20
tadzik jnthn: running ./nqp gives me PARROT VM: Could not initialize new interpreterPackFile_Header_validate: This Parrot cannot read bytecode files with version 10.0. 20:23
fresh checkout
jnthn tadzik: Did you use --gen-parrot? 20:26
moritz_ tadzik: seems like there's an old installation somewhere
tadzik jnthn: in rakudo, yes
tadzik moritz_: yep. But my ~/src/rakudo/parrot_install/bin is higher in $PATH 20:26
[Coke] does no one listen to me? ;)
moritz_ [Coke]: of course not. What did you say? 20:27
tadzik what? :)
[Coke] tadzik, jnthn: please either 1) update to a parrot that fixes that bug (post 3.0.0, sadly), or remove your parrot install dir and try again.
jnthn fwiw, it works here :)
Oh
PARROT_REVISION may be awfully out of date in nqp-rx/nom
moritz_ it likely is 20:28
[Coke] until just now, if you had a preinstalled parrot and installed a new one over it, the libparrot symlink didn't update on re-install.
simon__ hey, can someone explain to me why there is a colon required for higher order methods? 20:47
colomon simon__: example? 20:47
simon__ like (1,2,3).map: *+1 20:48
instead of just (1,2,3).map *+1
jnthn simon__: You could call that with (1,2,3).map(*+1) too
masak simon__: for methods, you must use either parens or colon.
jnthn It's not to do with higher orderness. It's just to do with method argument parsing.
simon__ oh so it's simply a shortcut for when the only argument is a block? 20:49
jnthn No, it applies generally
colomon It's only a shortcut, but the argument doesn't have to be a block.
tylercurtis rakudo: $*OUT.say: 1, 2, 3
jnthn rakudo: say ("omg", "bbq").join: "wtf"
colomon like @array.push: 10
simon__ ah, i see, thanks
p6eval rakudo 388eed: OUTPUT«123␤»
rakudo 388eed: OUTPUT«omgwtfbbq␤»
masak '(1,2,3).map *+1' doesn't work because a term may never follow upon another term in Perl 6.
masak std: 1 2 20:50
p6eval std 625303c: OUTPUT«===SORRY!===␤Two terms in a row at /tmp/an9jrDKioO line 1:␤------> 1 ⏏2␤ expecting any of:␤ bracketed infix␤ infix or meta-infix␤ statement modifier loop␤Parse failed␤FAILED 00:01 119m␤»
masak std: (1,2,3).map *+1
p6eval std 625303c: OUTPUT«ok 00:01 121m␤»
colomon doh!
masak o.O
tadzik ha-ha
jnthn lol
masak TimToady!
oh wait.
jnthn masak: (1,2,3).map * +1
masak aye. :)
not what I wanted, but it does parse :)
jnthn rakudo: (1,2,3).map * +1
masak TimToady: never mind. :)
tadzik I don't get it
p6eval rakudo 388eed: OUTPUT«No candidates found to invoke for method 'map' on object of type 'Parcel'; available candidates have signatures:␤:(Mu : &block;; *%_)␤:(Mu : %block;; *%_)␤␤ in main program body at line 22:/tmp/oUzgYa5ESn␤»
jnthn :)
But it's a runtime error. :) 20:51
tadzik map with no arguments?
masak right.
jnthn yeah
tadzik so "copy this array for me"?
colomon oh, so it's like (1, 2, 3).map() * +1
?
tadzik si
colomon not even "copy this array", the answer will be 3, right? 20:52
rakudo: say (1, 2, 3).map() * +1
p6eval rakudo 388eed: OUTPUT«No candidates found to invoke for method 'map' on object of type 'Parcel'; available candidates have signatures:␤:(Mu : &block;; *%_)␤:(Mu : %block;; *%_)␤␤ in main program body at line 22:/tmp/R7SWeV6occ␤»
jnthn colomon: map requires an argument.
colomon rakudo: say (1, 2, 3).map(+*) * +1
p6eval rakudo 388eed: OUTPUT«3␤»
colomon I think I was imagining it would be ...
tadzik is map with no args a LHF?
colomon rakudo: say (1, 2, 3).map({}) * +1 20:53
jnthn tadzik: I think it should be an error.
p6eval rakudo 388eed: OUTPUT«Can't call map() with a Hash argument, Callable required␤You probably wrote a Hash composer accidentally - try to␤disambiguate it with a ; directly after the opening brace␤ in 'Any::map' at line 1483:CORE.setting␤ in main program body at line 22:/tmp/lodE0OmOeu␤»
colomon rakudo: say (1, 2, 3).map({;}) * +1
p6eval rakudo 388eed: OUTPUT«3␤»
tadzik jnthn: so why should (1,2,3).map * +1 work?
jnthn tadzik: It shouldn't.
tadzik ah, it should just parse?
jnthn tadzik: std says that it parses. Rakudo agrees.
tylercurtis tadzik: it is syntactically valid, though.
tadzik I see
jnthn tadzik: But std doesn't know about whether it'll work at runtime. :)
tadzik std can run code too :) 20:54
std: say "ok 00:01 {150.rant.Int}m"
p6eval std 625303c: OUTPUT«ok 00:01 119m␤»
tadzik whoops
jnthn :P
tadzik (maybe no one will notice) 20:55
jnthn .rant should be, like, an alias for .uc.say
rod rakudo: say "ok 00:01 {150.rant.Int}m" 20:56
p6eval rakudo 388eed: OUTPUT«Method 'rant' not found for invocant of class 'Int'␤ in main program body at line 22:/tmp/NhwvNKIwSu␤»
rod std: say relog 20:58
p6eval std 625303c: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'relog' used at line 1␤Check failed␤FAILED 00:01 118m␤»
tadzik std: 150.rant 20:59
p6eval std 625303c: OUTPUT«ok 00:01 118m␤»
tadzik hrm, *
rod std: say rebot 21:00
p6eval std 625303c: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'rebot' used at line 1␤Check failed␤FAILED 00:01 118m␤»
rod std: say block "24"
p6eval std 625303c: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'block' used at line 1␤Check failed␤FAILED 00:01 119m␤»
rod std: .map({:}) 21:02
p6eval std 625303c: OUTPUT«===SORRY!===␤Preceding context expects a term, but found infix : instead at /tmp/nS1pvGvhOG line 1:␤------> .map({⏏:})␤Parse failed␤FAILED 00:01 120m␤»
rod std: .map({1-4}) 21:03
p6eval std 625303c: OUTPUT«ok 00:01 120m␤»
rod std: .map({1-9})
p6eval std 625303c: OUTPUT«ok 00:01 120m␤»
rod std: .map({^})
p6eval std 625303c: OUTPUT«===SORRY!===␤Prefix requires an argument at /tmp/j59vhI5Xwz line 1:␤------> .map({^⏏})␤Parse failed␤FAILED 00:01 119m␤» 21:04
V15170R hello 21:06
tadzik hello 21:07
masak hello, visitor.
V15170R i was looking at some perl6 code and i saw things like ":=" and "map:" and i wonder.... what's the colon for?
masak different things.
tadzik it depends
PerlJam V15170R: depends on the context.
tadzik := is a binging rather than an assignment 21:08
PerlJam V15170R: in ":=" it's part of the binding operator
V15170R like some sort of "symbolic link"?
PerlJam tadzik: heh, are you saying that microsoft is influencing Perl design with the binging op? :)
V15170R: something like that.
tadzik rakudo: my $a = 5; my $b := $a; $a += 2; say $b
p6eval rakudo 388eed: OUTPUT«7␤»
tadzik PerlJam: ah :)
V15170R and in "map" or "reduce", whats the effect? 21:09
tadzik that saves you typing the parens
my @a; @a.push: 5 is the same as @a.push(5)
PerlJam V15170R: That's just the invocant designator. The stuff before the : is the invocant, the stuff after is an arg
V15170R perl6: my $a = 5; my $b := a; $b = 9; say $a;
p6eval niecza v1-149-g56c80b0: OUTPUT«Unhandled exception: Unable to resolve method keys in class Array␤ at /home/p6eval/niecza/boot/lib/SAFE.setting line 922 (SAFE keys @ 2)␤ at /home/p6eval/niecza/src/Metamodel.pm6 line 192 (Metamodel Namespace.list_stash @ 7)␤ at
../home/p6eval/niecza/src/Metamodel.pm6 line 603 (Me…
..rakudo 388eed: OUTPUT«Could not find sub &a␤ in main program body at line 22:/tmp/UZDVwpO3eK␤»
..pugs: OUTPUT«*** No such subroutine: "&a"␤ at /tmp/pXRtOXyLVO line 1, column 12-22␤»
tadzik wooooo 21:10
V15170R perl6: my $a = 5; my $b := $a; $b = 9; say $a;
p6eval pugs, rakudo 388eed: OUTPUT«9␤»
..niecza v1-149-g56c80b0: OUTPUT«Unhandled exception: Unable to resolve method keys in class Array␤ at /home/p6eval/niecza/boot/lib/SAFE.setting line 922 (SAFE keys @ 2)␤ at /home/p6eval/niecza/src/Metamodel.pm6 line 192 (Metamodel Namespace.list_stash @ 7)␤ at
../home/p6eval/niecza/src/Metamodel.pm6 line 603 (Me…
tadzik forgive niecza, it's still broken on the evalserver
PerlJam V15170R: actually binding is more like a hard link than a symbolic one. You could think of it as an aliasing operator. It gives one thing two names. 21:11
V15170R: Also, you might want to use rakudo: rather than perl6: to execute code here :) 21:12
V15170R oh thanks... ok a hard link.... isn't that, like, dangerous? can you bind to another program's variable? or a variable in another package/namespace? 21:13
masak sure, but the normal scoping restrictions apply. 21:15
dalek tpfwiki: util++ | www.perlfoundation.org/perl6/index...._s_notepad 21:27
tylercurtis V15170R: Binding to a variable in another package/namespace is only dangerous if you then modify it, in which case it's exactly as dangerous as directly modifying it. 21:39
V15170R can you do a "read only" bind?
rakudo: my @a=<a b c>; sub test { return 9 }; @a[1] := &test; @a.say; 21:41
p6eval rakudo 388eed: OUTPUT«atestc␤» 21:42
colomon rakudo: my @a=<a b c>; sub test { return 9 }; @a[1] := &test; @a.say; @a[1]().say 21:44
p6eval rakudo 388eed: OUTPUT«atestc␤9␤» 21:45
tylercurtis infix<::=> is a readonly bind, although I'm not sure exactly how it's supposed to work in the case of $foo ::= $bar where $bar is not readonly.
masak rakudo: my $a := 42; say $a; $a = 5; say $a
p6eval rakudo 388eed: OUTPUT«42␤Cannot modify readonly value␤ in '&infix:<=>' at line 1␤ in main program body at line 22:/tmp/MGCApxaqVB␤»
masak V15170R: that bind could be considered "read-only".
V15170R: since it's directly to a value, not to another variable. 21:46
tylercurtis V15170R: if you simply want to create a readonly variable, the "is readonly" trait on the variable declaration works. 21:49
rakudo: my $foo is readonly; my $bar := $foo; $bar++;
p6eval rakudo 388eed: OUTPUT«Cannot modify readonly value␤ in '&infix:<=>' at line 1␤ in main program body at line 7386:CORE.setting␤»
colomon Not to speak for V15170R, but it seems to me the interesting question would be about how to make a readonly binding to a readwrite variable. 21:50
V15170R yep... that is, exactly
masak colomon: pass it to a subroutine? :) 21:51
colomon something like my $bar = 42; my $foo is readonly := $bar; $bar++; $foo++; # first works, second is an error
masak rakudo: my $bar = 42; my $foo is readonly := $bar; $bar++; $foo++
p6eval rakudo 388eed: ( no output )
colomon masak: would signature binding be endough?
rakudo: my $bar = 42; my $foo is readonly := $bar; say $bar++; say $foo++
p6eval rakudo 388eed: OUTPUT«42␤43␤»
masak colomon: hm, I've never done that manually...
V15170R rakudo: my $a = 10; my $b ::= $a; say $b; $a = 20; say $b; 21:52
p6eval rakudo 388eed: OUTPUT«10␤20␤»
colomon V15170R: I suspect what masak and I just did is the right way to do it, but the readonly check there is not yet implemented in Rakudo.
jnthn rakudo: my $a = 10; my $b ::= $a; say $b; $b = 20; say $b
p6eval rakudo 388eed: OUTPUT«10␤Cannot modify readonly value␤ in '&infix:<=>' at line 1␤ in main program body at line 22:/tmp/Fp38MVlKG4␤»
jnthn There, $a is rw but $b is readonly 21:53
colomon what is ::= ?
jnthn rakudo: my $a = 10; my $b := $a; say $b; $b = 20; say $b
p6eval rakudo 388eed: OUTPUT«10␤20␤»
jnthn There it's OK
jnthn ::= creates a readonly binding 21:53
iirc
colomon jnthn++
well, it seems to work that way, anyway. ;)
jnthn I think the real point is that if the compiler sees ::= it can make a bunch more assumptions. 21:54
Or at least, a point. :)
sorear good * #perl6 22:07
jnthn o/ sorear 22:08
colomon \o 22:09
simon__ do metaoperators always apply or only for a predefined set of operators? 22:11
for instance, if infix <= weren't defined, would $a <= $b be equivalent to $a = $a < $b? 22:12
jnthn simon__: It's down to the meta-operator.
simon__: Some of them look at various traits of the op to decide whether the meta-op applies to it. 22:13
simon__ and is there a way to use them when they are overwritten by an infix function?
jnthn You can use the bracketed infix syntax, but that doesn't get around the constraints. 22:15
e.g. R[+] is the same as R+
simon__ k thanks
jnthn To understand the trait requirements better see in STD.pm, e.g. around line 3329/3330 there's an example
Meta-ops generally boil down to higher order function calls, fwiw. 22:16
simon__ p6eval: my $a = 1; my $b = 2; $a ,= $b; 22:24
what's happening here? it says recursion depth exceeded 22:25
jnthn rakudo: my $a = 1; my $b = 2; $a = $a, $b; say "alive"
p6eval rakudo 388eed: OUTPUT«alive␤»
jnthn rakudo: my $a = 1; my $b = 2; $a ,= $b; say "alive"
p6eval rakudo 388eed: OUTPUT«alive␤»
jnthn simon__: Those two should be equivalent... 22:26
jnthn wonders what they produce
Oh wait
I don't think they quite are...
rakudo: my $a = 1; my $b = 2; $a = ($a, $b); say "alive"
p6eval rakudo 388eed: OUTPUT«alive␤»
jnthn That is same as $a ,= $b 22:27
rakudo: my $a = 1; my $b = 2; $a = ($a, $b); say $a.perl
p6eval rakudo 388eed: OUTPUT«maximum recursion depth exceeded␤ in 'Block::count' at line 6077:CORE.setting␤ in 'Block::count' at line 6077:CORE.setting␤ in 'Any::join' at line 1␤ in 'List::perl' at line 2792:CORE.setting␤ in <anon> at line 2792:CORE.setting␤ in 'Any::join' at line 1␤ in
..'List::perl' at …
jnthn rakudo: my $a = 1; my $b = 2; $a ,= $b; say $a.perl
p6eval rakudo 388eed: OUTPUT«maximum recursion depth exceeded␤ in 'Block::count' at line 6077:CORE.setting␤ in 'Block::count' at line 6077:CORE.setting␤ in 'Any::join' at line 1␤ in 'List::perl' at line 2792:CORE.setting␤ in <anon> at line 2792:CORE.setting␤ in 'Any::join' at line 1␤ in
..'List::perl' at …
jnthn Bug.
masak a known one, no? 22:28
jnthn masak: I dunno, you're the human bug database. :P
masak rakudo: my $a = 1; my $b = 2; $a ,= $b; say 'alive!' 22:28
p6eval rakudo 388eed: OUTPUT«alive!␤»
masak it's a bug in .perl -- how boring.
masak submits, Justin Case 22:29
jnthn rakudo: my $a = 1; my $b = 2; $a ,= $b; $a.say
p6eval rakudo 388eed: ( no output )
jnthn That looks...rather dubious too
masak rakudo: my $a = 1; $a ,= 2; say $a.perl
jnthn rakudo: my $a = 1; my $b = 2; $a ,= $b; say ~$a
p6eval rakudo 388eed: OUTPUT«maximum recursion depth exceeded␤ in 'Block::count' at line 6077:CORE.setting␤ in 'Block::count' at line 6077:CORE.setting␤ in 'Any::join' at line 1␤ in 'List::perl' at line 2792:CORE.setting␤ in <anon> at line 2792:CORE.setting␤ in 'Any::join' at line 1␤ in
..'List::perl' at …
rakudo 388eed: OUTPUT«maximum recursion depth exceeded␤ in 'List::at_pos' at line 2872:CORE.setting␤ in 'List::at_pos' at line 2872:CORE.setting␤ in 'Any::postcircumfix:<[ ]>' at line 1761:CORE.setting␤ in 'Any::join' at line 1464:CORE.setting␤ in 'Any::join' at line 1469:CORE.setting␤ in
..'List::S…
jnthn It's more than just .perl it seems
masak aye. 22:30
jnthn++
jnthn suspected so
masak let's call it a bug in ,=
jnthn :(
wait
masak waits
jnthn rakudo: my $a = 1; my $b = 2; $a = ($a, $b); say ~$a
p6eval rakudo 388eed: OUTPUT«maximum recursion depth exceeded␤ in 'List::at_pos' at line 2872:CORE.setting␤ in 'List::at_pos' at line 2872:CORE.setting␤ in 'Any::postcircumfix:<[ ]>' at line 1761:CORE.setting␤ in 'Any::join' at line 1464:CORE.setting␤ in 'Any::join' at line 1469:CORE.setting␤ in
..'List::S…
jnthn Darn.
It's a bug in parcel construction and assignment when the parcel contains the assignee it seems... :/
Or something.
Well, maybe. 22:31
I note that stack trace has join in it, and the .perl one did too.
rakudo: my $a = 1; my $b = 2; $a = ($a, $b); say $a.WHAT
p6eval rakudo 388eed: OUTPUT«Seq()␤»
jnthn rakudo: my $a = 1; my $b = 2; $a = ($a, $b); say $a[0]
p6eval rakudo 388eed: ( no output ) 22:32
jnthn rakudo: my $a = 1; my $b = 2; $a = ($a, $b); say $a[1]
p6eval rakudo 388eed: OUTPUT«2␤»
jnthn I wonder if something that should decontainerize is failing to do so.
Though if so, it's hard to say what. Since l-value parcels surely shouldn't decontainerize on construction, or we break list assignment forms like ($a, $b) = 1,2 22:33
jnthn 's brain asplodes
Well, file it. :)
masak the bug's in the bag. 22:35
jnthn masak++ 22:36
V15170R damn, perl6 is so cool.... we use a lot the Mod 11 Check Digit algorithm in my country... now here is on one line!!!!! 22:44
sorear If that kind of stuff interests you you should check out J
V15170R rakudo: my $rut = "13294087"; my $checksum = (0 .. 9,'K', 0)[ 11 - ( [+] $rut.split('').reverse <<*>> (2..7) ) % 11 ]; say $rut~'-'~$checksum;
p6eval rakudo 388eed: OUTPUT«13294087-8␤»
sorear jnthn: in ideal TimToadian Perl 6, that line doesn't crash, because = calls .item and Parcel.item decontainerizes while converting to Seq 22:48
jnthn sorear: Oh, *that's* where it should decontainerize.
sorear: Thanks.
sorear: It's doing the Seq conversion, just not the decontainerizing. 22:49
I suspect I can fix that.
sorear OTOH, .perl really ought to do cycle detection
colomon sorear: you think? That seems like a lot of conceptual overhead to add to each .perl method... 22:58
sorear conceptually, .perl is already chained to the standard parser, since it's defined in terms of parsable Perl 6 23:16
pmurias sorear: .perl definitly should handle cycles 23:32
otherwise we will need a Data::Dumper
masak +1 23:33
colomon okay, here's an example .perl: 23:35
multi method perl() '[' ~ self.map({ $^a.perl }).join(', ') ~ ']'; }
How do you change that to properly detect and handle cycles?
(remembering also that we want to make .perl a reasonably easy method for people to add to their own classes.) 23:36
colomon is really hoping TimToady or sorear has a brilliant answer to this question....
TimToady the question is where you're gonna store the state 23:37
TimToady probably in a contextual 23:38
colomon does that work? what happens when you do >>.perl? 23:40
TimToady so it'll look something like $*seen{self.WHICH} ?? fake_tag(self) !! $*seen{self.WHICH} = what you have there already
sorear colomon: .perl can't be a simple homomorphism 23:42
colomon TimToady: How do you make fake_tag(self) do the right thing? 23:44
TimToady just has to generate a tag based on the identity of self 23:45
coulda passed self.WHICH to that too, probably
hmm, that's not really quite right 23:46
it's only a boolean flag whether we've seen it
don't have to store the existing tag, assuming it's reproducable from the self's identity 23:47
so just $*seen{self.WHICH}++ ?? fake_tag(self) !! what you had already
TimToady where $*seen probably needs a better name like $*PERLSEEN or some such 23:48
$*seen-by-perl
whatever
TimToady could get rid of that 23:48
hid the variable 23:49
TimToady so it's just seen-by-perl(self) || '[' ~ self.map({ $^a.perl }).join(', ') ~ ']'; 23:49
and seen-by-perl either returns a tag or false
TimToady if the method is in mu, we could have .seen-by-perl || .. 23:50
*... 23:51
TimToady well, maybe 'or' is better than || 23:51
so it won't be much of a burden for anyone to add ".seen-by-perl or" to their perl method 23:52
colomon I like where this is going. 23:54
masak I've now reviewed all the p1 submissions. but I'm tired now, and will put off blogging till the morning. 23:55
'night, #perl6.
colomon But (even ignoring threading issues that scare me), it seems like more is still needed? at least, what are the strings that .perl returns going to look like in these cases? 23:55
Like the my $a = 1; my $b = 2; $a = ($a, $b); example. what would $a.perl look like? 23:57
Tene itym := 23:59