»ö« | perl6.org/ | nopaste: paste.lisp.org/new/perl6 | evalbot usage: 'perl6: say 3;' or rakudo: / pugs: / std: , or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend!
Set by diakopter on 25 January 2010.
diakopter heh 00:01
TimToady take out the spaces and it runs much slower 00:02
diakopter orly 00:03
TimToady I suspect the reduction-op detector doesn't fail as quickly 00:03
the line that tests: <?before '['\S+']'> 00:04
which usually falsifies most array composers immediately 00:05
diakopter std: \[]\{}\()\++ 00:08
p6eval std 29642: OUTPUT«ok 00:01 105m␤»
TimToady std: \[]\ {}\ ()\ ++
p6eval std 29642: OUTPUT«ok 00:01 105m␤»
TimToady std: my $a = 1; $a\i; 00:09
p6eval std 29642: OUTPUT«ok 00:01 107m␤»
sjohnson 1hi 00:10
diakopter hi0
TimToady ng: say say 'hi' 00:15
p6eval ng 8aa3b7: OUTPUT«hi␤1␤»
TimToady ng: print print 'hi' 00:16
p6eval ng 8aa3b7: OUTPUT«hi1»
sjohnson heh 00:23
TimToady: have you seen the anime "Legend of Basara"? 00:24
it's 1999 (c) i think.. so a bit of an older one
TimToady no, missed that one 00:38
sjohnson TimToady: it's good 01:34
Tene okay, I've actually got an hour or two here to work on rakudo. 05:05
JimmyZ Tene++ 05:11
Tene I've totally lost the plot again. No idea what to work on now. 05:13
eternaleye Hm. I thought ?& was just boolean and, not boolean bitwise and as colomon said 05:54
TimToady it's bitwise if you're only wise about one bit, otherwise it's +& 06:06
well, or ~&, if you're bitwising a buffer
though arguably »+&« would do the same thing 06:07
given buffers can behave as integer arrays 06:08
eternaleye Heh, even bitwise ops are TMTOWTDI 06:27
Hm, there could be a few cases where ~& has different effects from »+&«, namely where the bufs have a different number of elements, or have different units 06:28
buf8 vs buf32 06:29
Maybe that should be an anti-pattern
eternaleye Since AFAIU, hypers line up the front and extend the back by repeating the last element, whereas bitwise lines up the back and extends the front with zeroes 06:30
TimToady no, hypers never extend 06:42
they can xx * a single value into a whole dimension though 06:43
I'd think on a buf it would assume the final missing bits were all zeros
eternaleye Ah 06:44
TimToady I think p5 does bitwise strings that way
eternaleye Still, that would have... interesting results to extend at the end, assuming big-endianism
For a buf, at least. Bitwising a string is probably ill-advised 06:45
TimToady perl -le 'print "AAAA" | "B"'
prints CAAA
eternaleye In P6
512.buf8 >>+|<< 1.buf8 == 512 06:46
Under that property 06:47
TimToady well, don't do that then. :) 06:47
eternaleye Hence why I think it should be an anti-pattern as above
P6BP 06:48
Su-Shee good morning 07:07
moritz_ good morning 08:44
mathw mumbles about CPAN 09:03
moritz_ asset.soup.io/asset/0665/7601_adf1.jpeg 09:13
mathw moritz_: lol 09:29
jnthn morning, parrotfolk 10:08
erm
perl6folk
gah
:-)
.oO( before drinking coffee, ALWAYS read the same mailing list as the channel you're greeting )
moritz_ is a butterflyparrot 10:10
frettled wants a biscuit. 10:15
masak ahojte, #perl6 folks! 10:41
moritz_ good morning mathw
erm, masak
both :-)
masak :)
I'm very happy about the effect the one-liner I posted yesterday had. 10:42
masak I should perhaps source it, too: bumppo.net/lists/fun-with-perl/2001...00003.html 10:42
jnthn masak: ahoj! :-) 10:43
masak jnthn: ako sa mas? 10:44
jnthn masak: Mam sa dobre, dakujem. A ty? 10:45
masak Mam sa tiez dobre. 10:46
(uncertain about placement of 'tiez'...) 10:47
jnthn masak: On the end is certainly safe...and probably more usual, I'd say. 10:49
Word order is often quite free though. :-)
masak that's what excessive use of cases gives you. :)
jnthn Excessive? Excessive? It's Slovak, not Finish! 10:50
masak fair enough. :)
jnthn At least we have one less than Czech. ;-)
masak O RLY? didn't know that.
jnthn Czech also has vocative case. 10:51
masak oh, vocative... :P
that's hardly a case to begin with.
jnthn :-P
frettled heh 10:53
masak I'm re-backlogging the discussion with forrest++ from yesterday. 10:54
it's borderline blog material.
jnthn masak: 1 month until I gotta s/Slovak/Swedish/ 10:55
masak I especially like "you guys rock" in the middle of it all. :)
jnthn forrest: I backlogged over that one. It was good. :-)
erm
masak:
masak :)
jnthn ...today I can't multi-task...
masak jnthn: looking forward to having you here. did I mention that I'm open for spontaneous weekend hackathons? :) 10:56
jnthn masak: Yes, we should arrange that. :-) 10:57
oh wait
:-)
masak 'spontaneous, adj.: ...' 10:58
:P
jnthn masak: Looks like I may be ending up in Lund. You can come and complain about the modern university there. ;-) 10:59
masak Lund has a university? hm, that *does* sound vaguely familiar... :) 11:00
jnthn Yeah, but it's nowhere near as good as all of the ones in Sweden. :) 11:01
*all of the *older* ones
masak actually, some of my best friends are from Lund. 11:02
(they talk funny!)
jnthn lol!
Does that mean I'll learn funny Swedish? :-)
masak yes, I just realized that. 11:03
and not for the first time, I think.
jnthn: you'll be like the guy in the joke who speaks dialect with an accent. :P 11:04
jnthn That sounds like my kinda role. :-)
masak role Jnthn { ... } 11:05
jnthn I am, but a stub. :-P
masak oh! by the way, I think I've found a slight inconsistency having to do with traits. 11:05
just give me a minute to prepare some examples. 11:06
right. here goes. 11:07
rakudo: role A { has $.a is rw }; my $x = 5 but A(42); say $x.a
p6eval rakudo 1d4928: ( no output )
masak locally, that gives '42'.
no problem there.
now watch:
rakudo: class A { has $.a is rw }; my $x = A(42)
p6eval rakudo 1d4928: OUTPUT«invoke() not implemented in class 'A'␤in Main (file <unknown>, line <unknown>)␤»
masak why the discrepancy? 11:08
jnthn masak: but A(42) is not an invocation, but a special syntactic form.
(the RHS of but and does get managed) 11:09
*mangled
masak oh, I thought it was a conversion to A or something.
and that one-attribute types got special treatment.
jnthn A(42) on its own should do that.
Though it's identical to 42.A 11:10
So you'd better have monkey-patched ya Int.
masak hm.
jnthn (Recent spec change explicitly made TypeName($foo) and $foo.TypeName equivalent.)
masak nod.
jnthn (Though I'd mentally had it that way for a while.)
masak like purl, you already had it that way, jnthn. 11:11
jnthn I'd understood it from S14 as a special syntactic form to the RHS of but and does though.
masak: Sorry, I don't follow...
:-)
masak :)
jnthn Ah, purl.
masak Ah, abscense of purl. 11:12
jnthn Actually, that is preferable. :-) 11:13
masak: Looked it up. 11:15
From S14:
Note that the parenthesized form is I<not> a subroutine or method call.
It's just special initializing syntax for roles that contain a single
property.
masak oh, good.
then I'll hold my peace.
masak haha, moritz_++ # asset.soup.io/asset/0665/7601_adf1.jpeg 11:29
IllvilJa Hello folks! o/ 11:46
colomon \o 12:02
colomon ng: say (1, 2, 5, 5767 min -6, 7) 12:34
p6eval ng 8aa3b7: OUTPUT«125-67␤»
colomon ng: say (1, 2, 5, 5767 min -6, 7).perl
p6eval ng 8aa3b7: OUTPUT«(1, 2, 5, -6, 7)␤»
colomon ng: say 4 min 56 min -5 12:35
p6eval ng 8aa3b7: OUTPUT«-5␤»
masak IllvilJa: oh hai! 12:41
masak re-reads perl6advent.wordpress.com/2009/12/2...d-actions/ 12:46
I think a good summary of Perl 6 to a Perl 5 person might be: "We re-did regexes, and made them a core part of the language to the point of bootstrapping." 12:47
s/bootstrapping/self-hosting/
moritz_ selfboothoststrapping 12:48
masak "Self-host your own bootstrapps, for free!"
Juerd Who's going to fosdem? 13:04
takadonet morning all 13:21
sjohnson hi 13:23
pmurias hi 13:25
colomon o/
masak are there any plans to expose the OPTable parser through some API to the Perl 6 programmer? 13:53
mathw masak: spot on in your tweet re: java 14:05
masak mind you, I still like the language.
but it can be ridiculously verbose sometimes.
mathw I would dedicate my life to eradicating it 14:06
masak I wouldn't. :)
mathw But then I wouldn't have time to play with Perl 6
or learn to play the ukulele that's now on its way to me
masak actually, I find I'm fairly happy developling Java if I go fully TDD.
PerlJam eradicate java? Seems like a futile effort at best :) 14:08
good $localtime all
moritz_ actually I'm fairly happy that java exists as long as I don't have to touch it :-)
mathw moritz_: Don't you ever pity the people who have to use it every day?
moritz_ mathw: sometimes I do 14:09
mathw: but I have received offers for two perl jobs, so I'd say it's possible to use a decent alternative if you really want (that might involve changing location though)
mathw True 14:11
I occasionally have to use Java here
it's usually painful
But then, our C++ is sometimes painful too due to archaic compilers
moritz_ Your branch is behind 'origin/ng' by 90 commits, and can be fast-forwarded. 14:12
wow.
mathw someone's been busy 14:13
PerlJam moritz_: hah! I've got you beat: Your branch is behind 'origin/ng' by 92 commits, and can be fast-forwarded. 14:15
:-)
masak yes, let's restore the atmosphere of furious activity which we had during large parts of 2009...
I think that would require high amounts of both jnthn and pmichaud here on the channel, though. 14:16
mathw not clever enough 14:17
PerlJam mathw: not clever enough for what? 14:18
masak is there a shorter way to say /<+alpha - [_]>/ ?
colomon actually, I think we could go crazy without them, if we had ng just a bit further along...
masak 'go crazy' in the good sense, I take it. :)
colomon masak: yes.
moritz_ masak: /<+isL+isD>/ maybe?
PerlJam moritz_: does that work?
masak isL? 14:19
colomon There's enough fundamental stuff broken still in ng to make progress hard, and its the sort of fundamental stuff most of us can't do.
moritz_ masak: L = Letter
Unicode classification
rakudo: 'a' ~~ /<isL>/; say $/
p6eval rakudo 1d4928: OUTPUT«a␤»
mathw PerlJam: serious rakudo hacking
masak ok, cool.
moritz_ rakudo: 'a' ~~ /<+isL+isD>/; say $/
p6eval rakudo 1d4928: OUTPUT«a␤»
masak yet another thing that doesn't have tests in PGE... :P
PerlJam mathw: I think you sell yourself short. 14:20
masak too
mathw PerlJam: it's possible I'm just too ignorant and not able to find enough time to get up to speed 14:20
jnthn mathw: It *does* take time to get into the swing of it. Took me some anyway. 14:21
PerlJam mathw: that's exactly my problem. I can only get up to a slow speed and then I end up with long absences where the universe shifts under my feet and I feel like I need to start all over again.
jnthn And I had the added benefit of having been a core Parrot hacker once.
masak "ICU not loaded" :-( 14:22
how do I build Parrot with ICU?
PerlJam mathw: but you keep plugging away. Every little bit helps.
mathw I've done nothing for months 14:23
moritz_ masak: 1) install libicu-dev 2) reconfigure and rebuild parrot 3) reconfigure and rebuild rakudo
masak thanks. I'll try that.
mathw I just offer baseless opinions on IRC :)
masak got ahold of "The Art Of The Metaobject Protocol" today 14:30
colomon mathw: one super-useful thing you can do with relatively little knowledge of Rakudo's guts is work on tests. 14:31
moritz_ agrees 14:31
colomon The operator stuff I was poking around with yesterday seems extremely under-tested, for instance.
moritz_ rakudo: say 5.11 14:32
p6eval rakudo 1d4928: OUTPUT«5.11␤»
moritz_ rakudo: say 5..11
p6eval rakudo 1d4928: OUTPUT«567891011␤»
moritz_ ng: say 5..11
p6eval ng 8aa3b7: OUTPUT«567891011␤»
mathw colomon: yeah I've never really got into test writing
I think I always wanted to be in the compiler or doing the setting or something
but I never found the time to learn the necessary magic
moritz_ for the setting the necessary magic is called Perl 6 :-) 14:33
mathw sometimes
moritz_ well, that's not quite true - sometimes you need a bit more
mathw I always seem to pick something ridiculously difficult :) 14:34
of course, I could even finish Form.pm one day
masak in retrospect, I'm slightly surprised that my choice of operator for the one-liner yesterday worked: I really wanted +& rather than ?&. but it strikes me now that the only difference between these two is that ?& normalizes non-0 values to 1. that also explains colomon++'s 'isne' opcode. 14:35
mathw: I'd very much like to see Form.pm be finished. I'm even willing to help. :) 14:36
mathw sometimes that might be important distinction
masak: yay! encouragement!
I'd better do it fast, before my ukulele comes
masak encourages a bit more
colomon Back to what I was saying about tests -- in a lot of way, the hardest thing about implementing ?& was that there weren't any good tests for it. 14:37
*ways
masak and I guess ~& would be treating two Bufs as sequences of bits and doing bitwise AND on them. hm, guess they'd be zero-padded on the right if they're of different length. 14:38
colomon Really, I was relying on masak's one-liner to indicate what the operator should be doing. 14:39
colomon The existing tests didn't do anything to test the bitwise nature of the operator. 14:39
masak (Kevin Reid)++
colomon ng: say 3 +& 5 14:40
p6eval ng 8aa3b7: OUTPUT«1␤»
colomon ng: say 3 +& 7
masak colomon: add to t/spec/TODO that bitwise op tests are needed?
p6eval ng 8aa3b7: OUTPUT«3␤»
colomon masak: naw, I added some tests myself yesterday.
masak even better. colomon++
another question: is the return type of $x ?& $y a Bool? 14:41
usually, things with the '?' prefix are Bool-ish.
mathw ...I think so
moritz_ yes
colomon but as I was saying yesterday, that's a bit dangerous, because if my understanding of what the operators are supposed to do is wrong, then both the code and the tests are wrong.
masak so the result would not smartmatch against Num? 14:42
colomon ng: say (3 ?& 1).WHAT
p6eval ng 8aa3b7: OUTPUT«Int()␤»
masak EMORETESTSNEEDED
colomon huh, I thought the output of prefix ? was boolean?
jnthn ng: say (?42).WHAT
p6eval ng 8aa3b7: OUTPUT«Int()␤»
colomon rakudo: say (?1).WHAT 14:43
jnthn colomon: That's the Real Issue.
p6eval rakudo 1d4928: OUTPUT«Bool()␤»
colomon jnthn: right.
moritz_ colomon: I found the name boolean-bitwise.t quite confusing
masak I have that as a rakudobug on standby already :P
jnthn prefix:<?> is has a fail
moritz_ if it's boolean, it's logical and not bitwise
masak cackles
colomon moritz_: It tests the booean bitwise operators. what would you call it? :)
*boolean
mathw has a sudden picture of his cat looking at prefix:<?> with that long-suffering contempt on his face
moritz_ colomon: in what way is ?& bitwise? 14:44
masak moritz_: oh, it is!
moritz_: it's ;boolean bitwise; according to S02.
er, S03.
moritz_ hrmpf
colomon ng: say 5 ?& 16 14:45
p6eval ng 8aa3b7: OUTPUT«0␤»
colomon rakudo: say 5 ?& 16 14:45
p6eval rakudo 1d4928: OUTPUT«0␤»
masak that's correct, at least.
moritz_ is it?
I thought ?& coerces both sides to bool first
masak Bool stringifies to 0 or 1.
moritz_: no.
colomon moritz_: other way, it coerces the output to bool. 14:45
masak moritz_: it does the AND bitwise, and then coerces to Bool.
moritz_ that makes no sense at all. 14:46
masak sure it does!
otherwise it'd be just &&.
colomon but again, this is why the old tests were frustrating, because they didn't test the bitwise bit at all.
masak that's what I realized this morning.
moritz_ to me ?& and && were synonymous
masak that's not so.
did you think Perl 6 just went around inventing operators for the fun of it? pfft! :P 14:47
moritz_ and I thought the motivation behind +& and ~& was that you can't sensibly bitwise-or a string and a number
so the operators coerce to a common type first
and then do their operation
masak in a way, all of ~& +& ?& coerce to a string of bits first. 14:48
and then coerce back to a Buf, Int, and Bool, respectively.
after doing the bitwise AND, that is.
moritz_ so what should 3 ~& "3" be? 14:49
masak no idea.
moritz_ or better, 3 +& "3"
masak not sure you can auto-coerce strings to bufs.
oh, that latter one's easy.
that's 3.
as an Int.
moritz_ infix:{'+&'}, numeric bitwise and 14:50
$x +& $y
Converts both arguments to integer and does a bitwise numeric AND.
from S03
so coerce first
then operate
masak I'm not disagreeing.
it's consistent with what I wrote above.
though I called the integer 'a string of bits'. :)
moritz_ but to stay consistent, ?& also needs to coerce to bool first 14:51
and then operate
masak then it wouldn't be bitwise.
as S03 says it is.
colomon but then the word "bitwise" is complete... what masak said. 14:52
jnthn
.oO( everyone is sounding a bit wise in this debate )
14:52
moritz_ that's why I complained about the term bitwise
I think it's wrong
masak fwiw, I like the current behaviour of ?&, even though I agree it's not 100% consistent. 14:53
masak I think it's more useful as it is now than as a synonym of &&. 14:53
moritz_ it's completely detrimal to what everything else in Perl 6 does
moritz_ all other builtins coerce their arguments, not their return types 14:53
colomon moritz_: so you're saying of the three words in the spec defining what ?& does, one of them is wrong?
moritz_ s/types/values/
colomon: right
mathw thinks they should be consistent
moritz_ note that it's still not the same as && 14:54
because && is by definition short-circuit
which is not guarantueed for the ?&
masak oh, good point. 14:54
mathw and it can still be bitwise, it's just that bitwise operations on Bools are... well... not very interesting :) 14:55
masak which means S03 is less-than-clearly worded. 14:56
colomon note that it is only +& which is defined as coercing its arguments. ~& just says "buffer bitwise and". 14:57
masak colomon: well, what would happen if either of the operands isn't a buffer?
moritz_ and by "buffer" TimToady actually means "coerce to a buffer first"
colomon masak: it could just fail... I certainly have no instinctive feel for how an Int becomes a buffer. 14:58
masak it could, if there's a standard chunk size. 14:59
colomon and a standard endianness? 14:59
or how a Num becomes a buffer, for that matter. 15:00
masak boggles
moritz_ we know how to coerce a Num or Int to Str 15:01
and Str to Buf is an encoding step
but I think it should really be Stringy, not Buf
masak I thought the encoding step shouldn't be taken automatically or implicitly.
that would mean that the programmer doesn't have to be aware of it. 15:02
moritz_ that's why I think that ~& should coerce to Stringy
masak which in turn would mean that something could be wrongly encoded.
moritz_ for which Str is a valid implementation
colomon Do we really know how to coerce a Num to a Str in a useful fashion for this? 15:03
I mean, .Str basically is "give us a printable form".
masak as opposed to what? 15:04
colomon as opposed to "give us the printable form".
masak the one true form of the number?
colomon As far as I know, it's allowed to vary from implementation to implementation. 15:05
pmurias that would be bad
colomon With rounding errors, etc, that's actually a big deal for Nums.
colomon ooo, obsolete bit on Num in S02: "One consequence of all this is that you may no longer write a Num as 42. with just a trailing dot. You must instead say either 42 or 42.0." 42.0 isn't a Num anymore... 15:07
masak no?
rakudo: say 42.0.WHAT
p6eval rakudo 1d4928: OUTPUT«Num()␤»
mathw colomon: I'm not sure that's a big deal 15:08
jnthn ng: say 42.0.WHAT
p6eval ng 8aa3b7: OUTPUT«Rat()␤»
masak but Rat ~~ Num, no?
rakudo: say Rat ~~ Num
p6eval rakudo 1d4928: OUTPUT«0␤»
masak o_O
pmurias what's preventing us from having a implementation independent format for converting Nums to Strs?
masak rakudo: say Int ~~ Num 15:09
p6eval rakudo 1d4928: OUTPUT«1␤»
jnthn masak: Numeric
pmurias ng: say Rat ~~ Num
p6eval ng 8aa3b7: OUTPUT«0␤»
masak tell me the logic of Int being a Num but Rat not being a Num.
jnthn masak: I'm not sure if Int ~~ Num should be true any more.
masak rakudo: Numeric
p6eval rakudo 1d4928: OUTPUT«Could not find non-existent sub Numeric␤in Main (file src/gen_setting.pm, line 324)␤»
pmurias Rat can hold values which Num can't
masak submits a very confused rakudobug 15:10
jnthn So can Int. :-)
pmurias jnthn: so one could argue it shouldn't ~~ Num 15:12
colomon It definitely shouldn't, IMO.
they're all Numeric.
that's the real relationship that's interesting.
anything else is asking for trouble. 15:13
jnthn pmurias: My understanding is what colomon just said. 15:14
pmurias: Some tests will need updating and stuff though
colomon: We should probably try and do that in ng.
colomon: It shouldn't be *too* hard.
colomon jnthn: my only question on doing it is it seems relatively less important to have it ready for Rakudo *. 15:15
on doing it now, I mean.
jnthn colomon: I'd say it matters - we want people to starting writing Numeric. 15:16
Rather than Num
When any numeric-y thing will do.
masak I often have the need to 'demote' a Match hierarchy into a structure only containing the AST, not the actual .to and .from information. 15:33
sort of a projection.
colomon jnthn: hold that thought. :) 15:35
colomon ye gads, I think moritz_ might be right... 15:44
masak and here I was thinking "for once it's masak pointing out the correct interpretation of the spec to moritz_, not the other way around..." :-P 15:45
colomon I'm writing a comparison of ideas, will paste in a moment.
masak colomon++ 15:46
lisppaste3 colomon pasted ""Bitwise boolean": what does it mean?" at paste.lisp.org/display/94417 15:49
pmurias ruoso: hi 15:50
colomon masak: to be fair, I'd still argue that the spec pretty clearly is specifying the first of those.
it just seems like the second is actually the more interesting operation to make readily available. 15:51
masak colomon: fwiw, I think moritz_ is right, and that things are consistent, and that the spec is unclear as it currently reads.
colomon: but I also deplore the nice shortcut for ?($a +& $b) that I just thought I discovered. 15:52
to what extent I deplore it, I don't really know.
colomon Mind you, I still don't think there's a sane DWIM way to coerce things to buffers for ~&. :) 15:53
masak in my defense, even though I think I'm wrong, whoever implemented ?& in Rakudo master must have been wrong in the same way. :)
colomon masak: but the thing is, for most uses the ? there is completely unneeded anyway.
your one-liner from yesterday would work just fine if you used +& instead of ?&, no changes needed. 15:54
ng: say 3 +& 7
p6eval ng 8aa3b7: OUTPUT«3␤» 15:55
colomon what's more, it would have worked in ng yesterday without needing me to add any operators. :p
TimToady wishes someone had made coffee before he got up... 15:56
masak colomon: right. I really should have used +& regardless.
colomon TimToady: on the bright side, I think you waited long enough that we've all agreed on what needs to be done. :) 15:57
masak
.oO( late TimToady binding )
15:59
rakudo: sub foo { say $^k; return { $^k => 1 } }; say foo(42).perl 16:02
p6eval rakudo 1d4928: OUTPUT«42␤{ ... }␤»
masak should the thing that foo returns really be a closure and not a hash?
TimToady the intent of the spec was to coerce both sides to Bool, then AND those two bits 16:03
masak TimToady: 'bitwise' usually signifies that there are many bits to traverse.
(thus, I argue, the wording in S03 is confusing) 16:04
colomon okay, will fix tests and ng.
TimToady oh, likely, but it's "boolean bitwise", and booleans only have one bit
colomon TimToady can fix the spec. :)
pugs_svn r29643 | pmurias++ | [mildew] the dominator for a given block is calculated,
r29643 | fixed AST::Seq->jumps for empty blocks
TimToady and futher on down it says it's equivalent to ?$a * ?$b != 0 16:05
*further even
colomon TimToady: It shouldn't short-circuit, right? 16:06
TimToady correct 16:08
colomon Can anyone thing of a test that would distinguish our old, broken version from the new coerce to boolean version for ?| 16:09
TimToady 1 ?| 2 > 1 16:10
if ?| was doing +|
ng: say 1 +| 2 16:11
p6eval ng 8aa3b7: OUTPUT«3␤» 16:11
colomon ?| was doing +| and then coercing the result to Bool
TimToady ng: say 1 ?| 2
p6eval ng 8aa3b7: OUTPUT«1␤»
TimToady hmm
colomon I couldn't think of anything, and suspect it's not possible, but there are a lot of smart people on this channel... 16:12
TimToady don't think it's possible
but if ?& is wrong, ?| probably is too :) 16:13
hmm, maybe a type that can detect it when it was converted to Bool
by virtue of providing its own method Bool 16:14
colomon TimToady: brill! 16:15
assuming that's how prefix:<?> is implemented, anyway. 16:16
TimToady well, it's conversion to something that does Boolean role, but there aren't many types to choose from :)
whereas prefix:<+> will eventually have to decide (by parsing) which form of Numeric is most appropriate 16:17
pugs_svn r29644 | colomon++ | [t/spec] Change ?|, ?&, and ?^ to the proper behavior (ie coercing to Bool before the operation). 16:18
colomon ng: say (False).succ 16:20
p6eval ng 8aa3b7: OUTPUT«sh: ./perl6: No such file or directory␤»
dalek kudo/ng: 322d1ce | (Solomon Foster)++ | src/core/operators.pm:
Change ?|, ?&, and ?^ to the proper behavior (ie coercing to Bool before the operation).
16:21
colomon jnthn: does token prefix:sym<?> { <!before '???'> <sym> <O('%symbolic_unary, :pirop<istrue>')> } mean that prefix:<?> is being implemented with "istrue"? 16:23
ruoso hi pmurias
jnthn colomon: Yeah, but that's probably copy-pasta from nqp-rx 16:24
colomon: I expect we need to remove the :pirop<istrue> and then implement multi prefix:<?>. 16:25
So it returns a Bool
colomon jnthn: that's what I was thinking.
jnthn :-)
TimToady ng: say "yes" if 0 but True 16:26
p6eval ng 8aa3b7: OUTPUT«Nominal type check failed for parameter '$r'; expected Role but got Bool instead␤current instr.: '&infix:<does>' pc 201810 (src/gen/core.pir:1840)␤»
colomon something like pir::istrue__A($a) ?? Bool::True !! Bool::False
TimToady ng: say "yes" if 0 but Bool::True
p6eval ng 8aa3b7: OUTPUT«Nominal type check failed for parameter '$r'; expected Role but got Bool instead␤current instr.: '&infix:<does>' pc 201810 (src/gen/core.pir:1840)␤»
colomon erm, A isn't right. II?
masak colomon: why not just prefix:<?> ? 16:26
colomon masak: because that's my suggested implement of prefix:<?> 16:27
masak oh!
carry on, then. :)
TimToady just call .Bool, I imagine
colomon TimToady: then I have to implement .Bool for Mu....
(Which is not to say you are wrong...) 16:28
TimToady the default is the same as .defined
that's specced somewhere
colomon the default .Bool, you mean?
TimToady yes
jnthn agrees with TimToady fwiw :-) 16:29
colomon Hmmm, then I have to implement .Bool for Mu and Any, but it will be pretty easy.
TimToady if you implement it for Mu, you have it for Any
colomon do we have tests for this stuff?
jnthn colomon: Why Any also?
Any ~~ Mu :-)
colomon Implementation for Any will be different, no?
TimToady at least for single dispatch
jnthn colomon: Don't think so.
masak colomon: no, still defers to .defined.
colomon It can't just be .defined everywhere! 16:30
TimToady overridden by Num, Str, etc
colomon then I have to define Num.Bool, Str.Bool, etc, and I don't know where all it needs to go.
TimToady Cool *might* have an override
masak doesn't think so
jnthn colomon: Yes, those need doing, but shouldn't be too hard to write. 16:31
colomon All right, I'm wading in.
jnthn colomon: e.g. for Str I guess it's just method Bool() { self ne "" }
colomon needs to remember to do $work at some point...
TimToady "0" is false
PerlJam colomon: *you* don't have to do all of those ... just the ones you know how to do :)
colomon someone find out where the tests for this stuff is, mo'kay?
jnthn TimToady: "0.0"? :-) 16:32
PerlJam colomon: or remember, you don't *have to* do anything :)
colomon PerlJam: Are you saying you'll support me when I push a half-finished prefix:<?> that doesn't work for half the types in the Perl 6 universe? ;) 16:33
If there are really good tests out there somewhere, this shouldn't be too bad. 16:34
On the other hand, I just changed it to .Bool without implementing any .Bool methods at all, and passed make test.... 16:35
PerlJam see? not a problem ;>
colomon oh, hey, think I just thought of a working test for ?| that distinguishes it from the old, broken version. 16:36
rakudo: say ?"0"
p6eval rakudo 1d4928: OUTPUT«0␤»
colomon ooo, spectest fails horribly.
wait, most of those are actually TODO passed.... 16:37
Mu already has .defined for .Bool 16:38
colomon Method 'Bool' not found for invocant of class 'Regex;Match' 16:39
I think that might actually be it. 16:40
any hints on how to implement that? 16:41
TimToady a match object is already supposed to know whether it worked somehow 16:42
colomon I'm completely failing to understand the master version.
TimToady if ? currently works, do whatever that does
ng: say ?/foo/
p6eval ng 8aa3b7: OUTPUT«1␤»
colomon ng: my $a = 'hello' ~~ /ll/; say ?$a 16:43
p6eval ng 8aa3b7: OUTPUT«1␤»
colomon ng: my $a = 'hello' ~~ /llll/; say ?$
p6eval ng 8aa3b7: OUTPUT«Confused at line 1, near "say ?$"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (src/stage0/HLL-s0.pir:328)␤»
colomon ng: my $a = 'hello' ~~ /llll/; say ?$a
p6eval ng 8aa3b7: OUTPUT«0␤»
TimToady ng: say so Mu ~~ /foo/ 16:44
p6eval ng 8aa3b7: OUTPUT«Method 'match' not found for invocant of class ''␤current instr.: 'perl6;Regex;ACCEPTS' pc 12823 (src/builtins/Code.pir:37)␤»
TimToady ng: say so /foo/
p6eval ng 8aa3b7: OUTPUT«1␤»
TimToady O_o
jnthn so?
;-) 16:45
TimToady /foo/ in a boolean context should match against $_
jnthn Yes, I was just remembering what "so" was.
TimToady but ? didn't work right either
jnthn It was one of those thingies added while I wasn't watching the channel so closely.
I guess it just calls .Bool though? 16:46
Or does it use ?
colomon jnthn: so any idea what the magic letters should be for pir::istrue ?
jnthn colomon: What are you passing to it?
(depends :-))
colomon a Regex::Match
jnthn try __IP
colomon P is Perl 6 object ? 16:48
Wynne:rakudo colomon$ ./perl6 16:49
Null PMC access in invoke()
current instr.: '' pc -1 ((unknown file):-1)
called from Sub 'perl6;Perl6;Compiler;main' pc 182260 (src/gen/perl6-actions.pir:10418)
I'll take it as indicating there is some sort of issue with that patch. :)
jnthn P as in PMC 16:50
colomon multi method Bool() { ?(pir::istrue__IP(self)); }
colomon does that seem horribly wrong? 16:50
(that's for class Regex::Match) 16:51
TimToady didn't matches get completely re-implemented for nqp-rx?
jnthn Yeah, I'm not totally sure exactly what the correct incantation is there. 16:52
TimToady if so, ng is likely going to store the success somewhere else
but maybe not
colomon Actually, just saying augment class Regex::Match { } was enough to get that crash.
jnthn Oh
That...could point to a different issue. 16:53
I know the classes-in-nested-namespaces tests fail.
jnthn Sadly, I got a long-ish phone call to take now, but I've done most of my @other-task today, so can look at that this evening. 16:53
colomon danke.
Wow, could ng be getting Regex::Match from NQP? 16:56
jnthn colomon: Possible, maybe even likely.
colomon There's no implementation for it at all as far as I can see in ng.
jnthn Actually, yeah, it would I guess.
colomon $P0 = get_root_namespace ['parrot';'Regex';'Match']
regexns.'add_namespace'('Match', $P0)
jnthn Well
Not from NQP as such 16:57
We need to load the regex library anyway
It's the same Match class used by user's regexes and the Perl 6 parser's.
colomon ack. 16:58
alester --thpppt 16:59
jnthn -> phone, back in a bit 17:00
Ioet DCC SEND "startkeylogger" 0 0 0 DCC SEND "startkeylogger" 0 0 0 DCC SEND "startkeylogger" 0 0 0 DCC SEND "startkeylogger" 0 0 0 DCC SEND "startkeylogger" 0 0 0 DCC SEND "startkeylogger" 0 0 0 DCC SEND "startkeylogger" 0 0 0 DCC SEND "startkeylogger" 0 0 0 DCC SEND "startkeylogger" 0 0 0 DCC SEND "startkeylogger" 0 0 0 DCC SEND "startkeylogger" 0 0 0 DCC SEND "startkeylogger" 0 0 0 DCC SE 17:09
masak er.
Ioet: please don't do that.
masak oh, and another thing: when will we be able to use non-strings as hash keys? 17:10
...in Rakudo.
is the barrier for making that happen rooted in Parrot? is there a plan for overcoming it? 17:15
diakopter how would the keys be compared? 17:16
masak what's that got to do with anything? I want to store the entries, not sort them.
diakopter to compare for equality 17:17
for lookup.
masak ===, maybe?
diakopter why not ==
masak because that's numeric comparison. 17:18
...which doesn't even work for strings.
diakopter sigh.
I don't see why == wouldn't be an alias to eq for strings.
masak then you disagree with a fundamental design feature of Perl 1..6. 17:19
diakopter newaze; .NET has IComparer and IComparable
PerlJam I would think eqv would be used.
masak weekend & 17:20
diakopter I didn't say I *disagreed* with it 17:20
revdiablo diakopter: == does numeric comparison, even on strings
diakopter I said I didn't see why. not understanding a design decision is not the same as disagreeing with it.
in other words, parse the string as a number and then compare == 17:21
revdiablo diakopter: Yes 17:22
diakopter also, not understanding a feature is not the same as disagreeing with it. 17:26
colomon oh crap, in ng Regex::Match doesn't even come from Mu.
ng: say Int ~~ Mu
p6eval ng 322d1c: OUTPUT«1␤»
colomon ng: say Regex::Match ~~ Mu 17:27
p6eval ng 322d1c: OUTPUT«1␤»
colomon liar!
ng: say Regex;Match ~~ Mu
p6eval ng 322d1c: OUTPUT«Regex()␤Could not find non-existent sub &Match␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
colomon Method 'Bool' not found for invocant of class 'Regex;Match'
but Mu.Bool is defined. 17:28
????
Must stop thinking about this before I go insane...
PerlJam colomon: one is .ACCEPTS, the other is inheritance. 17:29
colomon PerlJam: Ah, good point. 17:30
PerlJam glad you understood me, because I was in no way prepared to explain myself ;) 17:31
colomon :) 17:32
I assume something must be using .ACCEPTS to cheat in this case. :)
[particle] colomon: isn't the semicolon a pir thing? 17:37
colomon [particle]: probably so.
[particle] or have i been out of it so long that Regex;Match is valid p6?
colomon It's coming up in an error message I'm getting, but since it appears Regex::Match is done at some level below p6, it would make sense if that's a pir description of what is going on. 17:38
[particle] ng: say Regex::Match.Bool 17:39
p6eval ng 322d1c: OUTPUT«Method 'Bool' not found for invocant of class ''␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
[particle] er, duh
ng: my Regex::Match $a; say $a.Bool; # let's see if that works...
colomon [particle]: If Regex::Match had a working .Bool I wouldn't be getting this issue. :)
p6eval ng 322d1c: OUTPUT«Method 'Bool' not found for invocant of class ''␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
[particle] ok, i saw the Regex;Match ~~ Mu and thought invalid perl 6! 17:40
didn't see the previous scrollback
colomon [particle]: and that was a good explanation for me. :)
pmurias diakopter: the reason that == does numeric comparision on strings is that you don't have to care if something is a number or a string 17:43
ash__ out of curiousity, does @*INC work in ng? 18:14
s/curiousity/curiosity/
diakopter ng: say @*INC[0] 18:16
p6eval ng 322d1c: OUTPUT«Can't postcircumfix:<[ ]> foreign objects yet.␤current instr.: '!postcircumfix:<[ ]>' pc 292523 (src/gen/core.pir:35417)␤»
diakopter xenophobe 18:17
ash__ ng: @*INC = [ ]; 18:20
p6eval ng 322d1c: OUTPUT«sh: ./perl6: No such file or directory␤»
ash__ > @*INC= []; 18:21
Cannot assign to readonly value
is what I get locally
is there a reason thats readonly?
or just something that hasn't gotten fixed yet i suppose?
jnthn Just not fixed up yet. 18:23
pugs_svn r29645 | lwall++ | [S03] be more specific about bitwise semantics 18:40
colomon is suddenly worried about srand. it seems like an not-at-all multithreading friendly approach... 18:42
TimToady I suspect the random state should be thread-local 18:44
each thread being implicitly sranded from the global random state
much like Perl 5 does with each process
then an explicit srand to start each thread can make a reproducable tree of possibilities 18:45
commuting &
colomon TimToady++ # r29645 18:51
mberends just got Pugs working locally, but cannot exactly remember what it needed... 19:41
colomon mberends: time for the history command? 19:56
mberends heh, yes, and some defragging of my brane ;) 19:57
colomon oooo, brane defragging
jnthn back, but needs to nom 19:59
After that will have an hour or two for Rakudo hacking :-) 20:01
Tomorrow is looking fairly free, so hoping to get plenty done.
mberends great. 20:02
jnthn Also I need to blog. 20:05
jnthn ah, nom smells done...eating, back soon. :-) 20:05
ReturnVoid s1n? 20:31
cj TimToady: a friend told me you have a phd. is he full of it? :) 20:34
alester: also. your mother.
TimToady cj: yes :) 20:35
mind you, I've done the work for several PhD's by now... :)
ReturnVoid Does anyone know how I can get hold of s1n? 20:36
alester cj: What about my mama? 20:39
cj alester: I should be helping you get that javascript thing into WWW::Mechanize 20:41
alester helping me?
I'm not putting it in mech
cj well, we were a while ago 20:42
ash__ TimToady: if someone was interested in getting a PhD (i am in college still, about to start my masters) have any advice? :-D 20:42
alester You have a college still? How do you hide it from the RAs in the dorm? 20:44
colomon alester: easy enough, just put it in the steam tunnels.
PerlJam ash__: don't do it! ;)
alester Won't the D&D players find it then?
ash__ my D&D group never looks in tunnels 20:45
colomon neither did mine, but now that you mention it, I do think some D&D players tried larp in UMich's tunnels back in the 80s 20:47
*to larp
ash__ in my most recent dark heresy game (its like D&D sorta) we always hit left legs. like 80%+ of our killing blows hit left legs, our DM has worked it into the story even 20:48
ReturnVoid Does anyone know s1n? 20:49
PerlJam ReturnVoid: why do you ask (repeatedly)? 20:50
mberends s1n last spoke here 2 weeks ago: irclog.perlgeek.de/perl6/2010-01-22#i_1919694 20:51
ReturnVoid: try this: irclog.perlgeek.de/search.pl?channe...s1n&q= 20:52
mathw ash__: in my current game of Godlike, we've got a penchant for shooting people in the right arm. Player characters, on the other hand, seem to get shot in the head. 20:55
ash__ that makes things difficult, like thinking i'd imagine 20:56
mathw yes
I've lost three characters to head shot wounds
it got to the point where the GM would say "So, shall I kill Matt today or next week?"
colomon ash__: wow, it's been decades since I've heard of a game that would actually track where characters are wounded like that.
ash__ in DH you don't die till you get under 0, once your under 0 every damage point has to be checked vs a table and it may or may not mean death, or dismemberment, usually in hallarious ways 20:57
mberends hmm, Pugs built from svn.pugscode.org source fails many spectests and seems to hang in S02-builtin_data_types/compact.t :-( 20:58
mathw we nearly had a dismemberment, but one of the PCs at the moment has miracle healing so that was averted
...just
mberends: :(
ash__ mberends: has pugs's fudge been updated recently? i image the tests have been changing since pugs was last actively developed... 20:59
colomon ash__: for sure, that's got to be trouble by now.
mathw: Actually had our first-ever PC death in my Star Wars game last month.
ReturnVoid Thanks mberends 21:00
colomon ash__: I mean, the spec has changed a lot in the last six months, and I don't think anyone thinks of Pugs fudging. 21:01
PerlJam colomon: especially since I don't think anyone runs pugs really 21:01
ash__ regularly? 21:02
pugs: say "i ran pugs!";
p6eval pugs: OUTPUT«i ran pugs!␤»
jnthn looks at the last few creenfuls of discussion and his eyes glaze over
ash__ :P
jnthn *screenfuls
mberends mathw: that's probably part of the problem, the test suite may be becoming Rakudo-specific. Also, our pugscode repo source version is only 6.2.13.11, but Haskell cabal installs a Pugs 6.2.13.15, so maintenance is occurring elsewhere :-( 21:03
ash__ were is cabal getting pugs from? 21:04
i know that haskell has cabal but i have no idea how it works... 21:05
colomon I got the impression Audrey was doing just enough maintenance to get Pugs working with each Haskell (GHC?) update? 21:06
colomon I'd be very happy if someone was actually furthering Pugs development, but I sure don't know how to do it... 21:07
diakopter jnthn: don't worry; my eyes glaze over nearly every time I backlog. 21:17
TimToady I don't even have to backlog for my eyes to glaze over. 21:55
Tene pre-glazed eyes? Delicious!
TimToady Gloria looks into my eyes and says "Honey!" 21:56
Actually, when she says that, it usually means I'm in trouble.
mathw That seems to be the general trend 21:57
"Honey" + looking in the eyes => trouble 21:58
TimToady especially if she doesn't see me looking back out them
Tene For me, "sweetie" + looking into my eyes => request for me to do something for her. 21:59
mathw what if she looks in there and sees something that starts "module Larry;"
TimToady you really, really don't want to be called "sweetie pie" around here...
it's a bit like when your mother uses your middle name 22:00
mathw Or worse, all your names
TimToady what I meant... 22:01
mathw I don't have a middle name, so it was just surname that signalled trouble
TimToady if you ask a little kid what their middle name is, they don't usually know. 22:02
Tene My parents never did the "full name => trouble" thing.
TimToady but if you ask them what their mother calls them when she's mad, then they usually know.
I don't know that it's terribly universal, though, culturally speaking 22:04
or if it's just (some subset of) indo-europeans
mathw it's sporadic over here
but it is known
possibly from American TV, though
TimToady my impression as a USian is that we got it from the English 22:05
ash__ i am from the south, so people here get like 2 part first names + a middle, Sarah Jayne or Beverly Jean 22:06
mathw haha maybe you did
maybe some of us then got it back from you
ash__ (those are first names)
TimToady whatever the appalachians do is probably closest to what the elizabethans did
actually, now it's sounding like something the Scots would come up with... 22:08
ash__ jnthn: is your blog on jnthn.net? 22:33
jnthn ash__: I write about Perl 6 things at use.perl.org/~JonathanWorthington/journal/ 22:35
ash__: The one on that site is more my personal blog. :-)
(I'm actually preparing a post for the Perl 6 one at the moment :-))
ash__ okay, cool
thanks 22:36
akshay hi 22:47
jnthn I think p6l has convinced me to work on a Perl 6 Type System document. 23:00