Parrot 0.8.1 "Tio Richie" Released | parrot.org | 24 TT | 648 RT
Set by moderator on 10 December 2008.
00:03 allison joined
dalek r33816 | tewk++ | trunk: 00:04
: [js] parses whitespace
diff: www.parrotvm.org/svn/parrot/revision?rev=33816
r33817 | cotto++ | trunk: 00:09
: [imcc] IMCC_subst_constants uses r[2], so make sure r has enough elements (CID #173)
diff: www.parrotvm.org/svn/parrot/revision?rev=33817
cotto me-- #should CID #174 00:10
jonathan But you++ for fixing it. 00:11
dalek r33818 | cotto++ | trunk: 00:14
: [imcc] IMCC_subst_constants uses r[2], so make sure r has enough elements (CID #171)
diff: www.parrotvm.org/svn/parrot/revision?rev=33818
r33819 | cotto++ | trunk: 00:23
: [debug] close a leaked filehandle (CID #176)
diff: www.parrotvm.org/svn/parrot/revision?rev=33819
00:27 davidfetter joined 00:36 alvar joined 01:21 Eevee joined
TiMBuS if i want to define a token for function names, how do i make it do they can't be specific names? like my current rule is defined as: [ \\w | '-' | '?' | '=' ]+ 01:37
but i want to specifically disallow '=='
should i just check to see if it matches '==' in actions.pm? 01:38
lathos Something like <! '==' > 01:44
Infinoid maybe a <!before '='> ?
lathos One of those.
purl hmmm... one of those is a return value.
Infinoid I wouldn't really know. everything I know about perl 6 regexes I learned from 20 seconds of reading en.wikipedia.org/wiki/Perl_6_rules 01:45
(which is very possibly out of date.)
lathos Ah, I learnt from 20 seconds of reading dev.perl.org/perl6/doc/design/syn/S05.html , which while still possibly out of date at least shouldn't be. 01:46
Eevee "Perl 6 rules" is a great title for an article
lathos (Also: another factor is how much Rakudo actually implements.)
chromatic Everything I know about Perl 5 parsing I learned from forgetting to run regen_perly.pl.
Oh, and it has a hand-rolled lexer too.
lathos The best kind. 01:47
chromatic When adding a new keyword, don't forget to put it in the nested nested nested switch statement corresponding to the length of said keyword.
Bonus points for guessing *which* keyword.
lathos I tried writing a grammar for TT3 last night, but it all got a bit explody.
What Perl 6 libraries do we need right now? I'm in a library writing|porting mood. 01:49
chromatic File::Temp
purl rumour has it File::Temp is generally portably enough, yes. or annoying
lathos Right-oh. 01:50
chromatic Hmm.
By the time Perl 5's parser knows it has a block, it looks like a little bit late to change the package of said block.
lathos Oh, chromatic, I had an idea. I figured I'd write NCI.pm, with a wee tiny NCI.pir part, to make it possible to wrap libraries in Perl 6. 01:51
chromatic That would also be lovely.
lathos Currently using dynamic libraries means building up big arrays of names and signatures and that's horrible in PIR.
chromatic It is. 01:52
Hmm, during the parse can I change a block's package? 01:53
lathos Don't think so.
01:53 Lorn joined
chromatic Do stashes get assigned at parse time? 01:54
lathos PL_compcv is saved away during startsub.
Although, hrm, that doesn't matter.
chromatic Suppose I want to add a grammar rule something like PACKAGE NAME block and have the package set only inside the block. 01:55
That's not exactly what I want to do, but it's close enough that you should understand what I'm trying to do without giving away the sekrit.
lathos Hold on, are we talking 5 or 6 here? 01:56
chromatic 5
lathos Oh, sure. 01:59
Just save PL_compcv, then reassign it. It'll just unsaved at the end of the block.
chromatic I don't follow. 02:00
I want to write the equivalent of: 02:01
package Foo {
sub bar { ... }
}
and have Foo::bar.
TiMBuS <lathos> Something like <! '==' > 02:02
this doesnt work, but <! ['=='] > does, but it seems to cause a lot of problems, possibly to do with backtracking im not sure =/
i think ill just check in actions.pm, where things make more sense to me 02:03
lathos temp_package: PACKAGE temp_package_name block 02:04
temp_package_name: WORD { savefreeSV(PL_compcv); package($1); }
chromatic Ah, clever. 02:05
If only I'd studied CS and parsers.
tewk_ lathos: NCI.pm?
lathos Yep.
tewk_ perl6 or perl5? 02:06
lathos 6.
Who writes Perl 5 any more?
Infinoid
tewk_ chromatic attempted perl5 nci
lathos use 6; use NCI; %sigs = ( foo => "ii", bar => "pv"); NCI::wrap("somelib", %sigs); # Or similar 02:07
chromatic Succeeded too, in proof of concept.
lathos Enough of a proof of concept to make it worthwhile doing for Parrot.
mugwump That would be O for awesome 02:08
chromatic lathos, that doesn't return to the parent package at the end, sadly. 02:09
Let me stare at the code again for a moment.
I need to restore the current stash in the new PACKAGE rule. 02:10
lathos Yeah.
Eevee NCI == automagical C lib wrapping?
wait that's "native call interface" isn't it
lathos I thought there was a magical save rule to do it for you, but there isn't.
02:11 jimmy joined
Infinoid Eevee: yes and yes 02:11
lathos chromatic: Is by any chance your "package" token spelt "class"?
chromatic I cannot say; what would make you think such a thing? 02:12
The fact that I seem to *enjoy* kicking over beehives on p5p, perhaps?
lathos Haven't read p5p for years, it's just... well, that's what I would do. 02:13
chromatic Strange how our minds work similarly.
I could return an op from temporize_package_name in the correct package though. 02:19
02:34 kid51 joined
chromatic Aha. 02:45
Now to shock and amaze the world. 02:47
02:52 particle joined
chromatic lathos, thanks for the help. This should be... interesting. 02:59
tewk_ PGE help.rule arguments { '(' <expression>? ')' } 03:07
parses
rule arguments { '(' <expression>? ')' {*} } doesn't parse
do all {*} have to have #= keys ? 03:08
dalek r33820 | jkeenan++ | testparrottest: 03:22
: Restore original order of POD and subroutines, to make diff-ing easier.
diff: www.parrotvm.org/svn/parrot/revision?rev=33820
r33821 | jkeenan++ | testparrottest: 03:29
: Small cleanups.
diff: www.parrotvm.org/svn/parrot/revision?rev=33821
r33822 | jkeenan++ | testparrottest: 03:34
: Continue to restore previous order of subroutines.
diff: www.parrotvm.org/svn/parrot/revision?rev=33822
03:35 alvar joined 03:53 particle joined 03:57 galf joined 04:01 elmex_ joined 04:41 gaurav joined
pmichaud Rakudo is now passing 5004 tests. 05:03
Great work, everyone.
jimmy so much fast. 05:05
nopaste "pmichaud" at 72.181.176.220 pasted "Current spectest results, r33822" (17 lines) at nopaste.snit.ch/14916
GeJ the twitter feed jumped from 6 followers yesterday to 48.
jimmy pmichaud++ and Tene++ and Others++
05:05 particle joined
pmichaud particle: you just missed my note 05:06
05:03 <pmichaud> Rakudo is now passing 5004 tests.
05:05 <nopaste> "pmichaud" at 72.181.176.220 pasted "Current spectest results, r33822" (17 lines) at nopaste.snit.ch/14916
jimmy Why there is not S18 or S19 05:07
05:07 dngor joined
particle YAY! 05:08
pmichaud++
i just got internet back after a miles-wide outage 05:09
PerlJam jimmy: the synopsis numbers were originally intended to correspond to chapters of the Camel book.
particle pmichaud: i was just looking at the skip messages for the test suite, seeing what i could do about any of them
PerlJam jimmy: maybe those chapters are no longer relevant or maybe it's just that no one has written them yet :)
Hinrik what twitter feed? 05:10
particle rakudo twitter feed?
particle pokes purl 05:11
purl pokes particle back!
dalek r33823 | particle++ | trunk:
: [rakudo] parse submethod declarations
diff: www.parrotvm.org/svn/parrot/revision?rev=33823
Hinrik can one see a twitter feed without signing up?
jimmy seems that other Synopses doesn't have been implemented
pmichaud Hinrik: twitter.com/rakudoperl 05:12
Hinrik jimmy: Jerry Gay recently got a grant from The Perl Foundation to get started on writing S19
pmichaud purl, twitter?
purl twitter is just designed wrong
jimmy particle++
particle hinrik: i'm him, and i'm pod-formatting my draft *right now*
pmichaud purl: no, twitter is twitter.com/rakudoperl
purl okay, pmichaud.
Hinrik oh, I see 05:13
pmichaud purl: rakudo twitter is twitter.com/rakudoperl
purl OK, pmichaud.
Hinrik what Pod formatter is being used to turn S26 into HTML? 05:14
jimmy pmichaud: how to build the result at nopaste.snit.ch/14916 ? 05:15
particle Hinrik: it's written in perl 5 pod, but i've no idea 05:16
Hinrik particle: no, it's written in Perl 6 pod :)
particle jimmy: tools/test_summary.pl 05:17
Hinrik all the other ones are written in Perl 5 pod
particle hinrik: ah, my mistake, i confused 26 and 29
i think damian wrote a cpan module for it
jimmy where is S26?
purl S26 is perlcabal.org/syn/S26.html
jimmy purl++
Hinrik ah, Perl6::Perlpod I presume 05:18
Perldoc, even
05:23 allison joined
jimmy Can't open perl script "t/spec/fudgeall": No such file or directory ,where is it? 05:25
fudgeall ?
pmichaud jimmy: do "make t/spec" first.
jimmy pmichaud: thanks,svn.pugscode.org/pugs/t/spec/ is what i want 05:27
05:29 ffwonko joined 05:40 petdance joined
petdance Is anyone lookin' at the Intel parallel-supporting compilers? 05:44
particle as in icc? 05:47
occasionally, but not regularly
06:05 Theory joined
GeJ /win 5 06:31
06:48 Hadi joined, Hadi left 06:59 TonyC joined 07:11 uniejo joined
dalek r33824 | pmichaud++ | trunk: 07:41
: [rakudo]: spectest-progress.csv update: 240 files, 5004 passing, 1 failing
: Failure summary:
: S04-statements/given.rakudo 17 - should not fall into default in this case
: NOTE: This update also changes the ordering of columns in the file,
: see the new headers line for the new ordering.
diff: www.parrotvm.org/svn/parrot/revision?rev=33824
r33825 | pmichaud++ | trunk: 07:43
: [rakudo]: Updates to test_summary.pl and progress-graph.pl scripts.
: * Revise the summary output to be csv compliant (easier spreadsheet import)
: * Reorder columns
: * Update progress-graph.pl to use new column ordering and labels
diff: www.parrotvm.org/svn/parrot/revision?rev=33825
petdance particle: I ask 'cause there's a newer release just came out and it is supposed to be much better at parallelization. Also only runs on Windows & Linux and they have no p.lans to move to the Mac. 07:50
particle wonders how much faster spectest would run if we could cache the emitted parse|past for the tests 08:03
...and wanders in to bed &
'course, we'd still have to parse the parse|past
so maybe convert emitted pir to bytecode? 08:04
08:04 iblechbot joined 08:45 Hadi joined, Hadi left 09:10 Hadi joined
dalek r33826 | cotto++ | trunk: 09:12
: [imcc] whitespace fix
diff: www.parrotvm.org/svn/parrot/revision?rev=33826
09:21 bacek joined 09:30 gaurav joined
bacek hi there 09:42
purl hey, bacek.
bacek congratulations everyone!
09:48 Theory joined 09:54 alvar joined
cotto yay! congratulations us! 10:05
what's the occasion?
moritz I suspect rakudo passing 5k spectests 10:08
10:08 ffwonko joined
bacek moritz: indeed 10:11
moritz: will you mind to apply patch from #61210? 10:13
moritz bacek: will do 10:14
bacek moritz: thanks
10:15 tomyan joined
bacek moritz: and don't forget to run autounfudge. It will give few passing tests more :) 10:16
10:17 kj joined
moritz bacek: running spectest now... 10:17
dalek r33827 | fperrad++ | trunk: 10:24
: [Lua]
: - fix test io_33
diff: www.parrotvm.org/svn/parrot/revision?rev=33827
bacek moritz: ok. autounfudge should be run with --unskip. It doesn't epicly fail with this patch. It just fail is some cases
e.g. S29-str/chomp.t
dalek r33828 | fperrad++ | trunk: 10:25
: [Lua]
: - fix many tests (just a stupid typo)
diff: www.parrotvm.org/svn/parrot/revision?rev=33828
r33829 | moritz++ | trunk: 10:30
: [rakudo] Test.pm fix calls to proclaim() in is_deeply, bacek++
: Patch courtesy by Vasily Chekalkin. Closes RT #61210.
diff: www.parrotvm.org/svn/parrot/revision?rev=33829
10:45 nopaste joined, TonyC joined 10:47 bacek joined 10:58 ruoso joined 11:01 Lorn joined
jonathan Woo, we made over 5000! :-) 11:31
sjn yay! \\o/ 11:35
bacek rakudo: my @a; @a = 1;
polyglotbot RESULT[[1]]
bacek hm...
rakudo: my @a; @a = 1, 2;
polyglotbot RESULT[[1, 2]]
bacek rakudo: my @a; @a ,= 1, 2;
polyglotbot OUTPUT[get_iter() not implemented in class 'Integer'␤current instr.: 'prefix:=' pc 16420 (src/builtins/misc.pir:17)␤called from Sub '_block11' pc 38 (EVAL_12:21)␤called from Sub 'parrot;PCT;HLLCompiler;eval' pc 892 (src/PCT/HLLCompiler.pir:508)␤called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc
..1216 (src/PCT/HLLCompiler.pir:669)␤called from S...
12:29 ffwonko joined 12:48 masak joined
jonathan pmichaud: ping 14:00
pmichaud pong
jonathan OH HAI
So, I want to dig into doing some of the Hague Grant stuff. :-) 14:01
Namely, I want to start on registering stuff in the namespace as we compile.
We've talked a bit before about putting some kinda "place holder" thingy in the NS.
Did you have any more thoughts on the nature of that? 14:02
pmichaud it doesn't have to be anything special, I don't think. Even Bool::True would be sufficient.
jonathan Like, do we have a UnderConstructionProto that, say, throws an exception if you call .new on it?
Well, I wanted to put something a little bit more substantial in.
Most notably, I think to do this right, we need to put something in that does the Abstraction role. 14:03
pmichaud sure, but we need to know what that "more substantial needs to do"
jonathan I think we know that you're not going to be allowed to instantiate it or do it, in the case of classes and roles.
pmichaud ...but it's not going to live for very long.
jonathan But when we get to having BEGIN blocks inside classes, I think it's fair enough that you should be able to introspect what is constructed so far.
The "does Abstraction" is the important thing to me. 14:04
Because that's how we can say "is the thing in the namespace a type".
As opposed to, say, a sub.
pmichaud this sounds fine to me.
jonathan Would going so far as subclassing proto make sense? 14:05
And overriding the things you're not allowed to do yet to throw exceptions?
pmichaud I don't know that you need to subclass proto 14:06
it might be simpler to just create a UnderConstructionProto class (normally)
the methods in that class will override the built-in protoobject ones anyway (such as .new)
jonathan True.
pmichaud I'd start with that
jonathan OK. 14:07
I also wanted to ask about metaclass stuff.
pmichaud if there's something where we really need it to be a subclass of Proto, then we can easily switch. But I'd rather this not be the only case where we're subclassing proto
i.e., if we don't have to do it, let's use the same model that all the other classes use.
jonathan OK, makes sense.
pmichaud okay, metaclass stuff.
purl metaclass stuff is goggley gook that only moose devs will use.
pmichaud <-- uses metaclasses. Not a moose dev. (moose++) 14:08
jonathan We need to build classes using the metaclass interface.
So we can make knowhow etc work.
pmichaud what exactly is 'knowhow' ?
jonathan knowhow lets you (I will probably epic fail on the terminology here) define a new type of metaclass. 14:09
Perl 6 has a default one, which the "class" keyword uses.
pmichaud okay. iiuc, while supporting knowhow is a key goal for smop, it's not high-priority in-and-of-itself for rakudo at the moment (more) 14:10
jonathan I think the idea is that you can add a new package_declarator (through macros, but we pondered something nicer).
pmichaud that said, I agree that we want to implement the metaclass interface for the metaclass(es) we do have.
jonathan My position is... 14:11
* I don't really need knowhow itself just yet either
* We should try and work towards matching the interface so knowhow will be trivial later on
* And I want to use !^dispatch on the metaclass to handle dispatching 14:12
pmichaud I think we're saying the same thing (thus far)
jonathan Er, ^dispatch
erm, what the API says :-)
Basically, I need to do some stuff on dispatch, and I think it'd make sense to do it in the way that it looks like things are headed. 14:13
pmichaud agreed, totally.
jonathan I'm still pondering exactly what that dispatcher will handle precisely.
(Like, where conceptually does auto-threading belong. I don't think it's in there.)
pmichaud that's okay, we do at least know that we need the metaclass interface 14:14
seems to me like it belongs in P6object
jonathan dispatch?
purl dispatch is done by _DISPATCH
pmichaud no, metaclass interface
metaclass interface belongs in P6object
jonathan Well, this is the other question I had.
There is going to end up being some Perl 6 specific stuff in the metaclass.
14:14 gryphon joined
pmichaud ...like? 14:15
jonathan Like, the dispatcher is going to have to know about submethods.
And callsame, blah.
Plus compose_role will have Perl 6 specific stuff.
pmichaud my gut is that we can do P6object without too much of that Perl 6 specific stuff in the metaclass, but I don't know the details well enough to say for certain
jonathan Like, the type non-conflict trixy stuff. 14:16
(two attrs of the same name don't conflict if the types match exactly...)
I can say for certain that there will be Perl 6 specific stuff.
I can't see any way there wouldn't be.
pmichaud ...in which case I would want to subclass P6metaclass 14:17
jonathan The question is, how much is too much?
Right. That's what I was expecting.
How hard is that?
pmichaud shouldn't be hard at all.
at minimum all one has to do is override .HOW
jonathan On the metaclass, or somewhere else?
pmichaud I don't remember the details at the moment (more)
jonathan Like, how do I use my subclass? 14:18
Ah, OK.
pmichaud but I do know that I was expecting that P6metaclass could be subclassed -- that was kinda the point.
oh, yes.
easy.
jonathan OK, good.
pmichaud you create an instance of RakudoMetaclass, it overrides 'new_class' method, and you use that object instead of the P6metaclass object we currently keep in p6meta/$!P6META 14:19
then all of the metaclass interface is in terms of RakudoMetaclass
(and it can inherit from P6metaclass as appropriate)
anyway, that's the general approach.
jonathan Ah, great.
Yes, I'm quite sure I can work out any details.
pmichaud but to the extent that we can, I'd like P6object to support the "generic" metaclass interface 14:20
jonathan *nod*
pmichaud i.e., those things that aren't terribly Perl 6 specific
jonathan OK, I will keep that in mind.
knowhow P6Metaclass ;-)
pmichaud right. :-) 14:21
jonathan OK, sounds good.
I guess the only other thing I now need to figure out is what we stick in the NS when compiling a sub...
(So we can do re-definition detection, auto-multi stuff when a proto is in scope, etc) 14:22
pmichaud I think the same general idea, but I'd focus on types first.
I'd wait to do subs until after types are working.
jonathan Oh, sure, it comes second.
UnderConstructionSub is likely.
pmichaud and re-definition detection really needs to come also from the NameSpace PMC 14:23
jonathan Hmm.
pmichaud because sometimes we'll be loading pre-compiled subs
jonathan Oh, I see what you mean.
pmichaud so if we try to add a sub and one already exists, we should get an exception.
jonathan Ahhhh...yes, good point. 14:24
pmichaud (if we try to add a multi, it should silently dtrt)
jonathan We could easily have our own namespace PMC to do whatever we wanted, if we had .HLL support...
pmichaud yes, I'm expecting that is what we will end up doing.
because we have other operations that need to be performed on namespaces as well
jonathan Yup. 14:25
pmichaud in fact....
purl in fact is an 8% savings in developer time ... caseu "Moose" is shorter to type than "Object"
jonathan OK, seems like we're agreeing on stuff. :-)
moritz purl: forget in fact
purl moritz: I forgot in fact
pmichaud it's entirely possible that UnconstructedTypeProto is really just a RakudoNameSpace PMC
because it also needs to do package stuff as well _anyway_
jonathan Hmm. True. 14:26
pmichaud but that's something that's easily tweaked as we get into implementation details and guts
jonathan Sure.
BTW, I think I've also figured out how to very muchly unify multi-dispatch and parametric roles. 14:27
PerlJam pm: Is there a way to specify unicode characters to PCT in the grammar? I want to do something like <ws-[\\u2345\\u2346]>
jonathan (At the implementation level.)
pmichaud perljam: <ws-[\\x2345\\x2346]> might work
jonathan Which, if I can pull it off, would make me quite happy. :-)
pmichaud PerlJam: I don't know if \\x is supported in [...] yet 14:28
PerlJam: also, I think it now has to be <+ws-[...]>
(to do a composition)
PerlJam okay
pmichaud jonathan: it would make me very happy also
PerlJam: you can certainly do token badchar { \\x2345 | \\x2346 } and then <+ws-badchar> 14:29
but it would be better to use the [...] form if that works.
masak pmichaud: ooh, I'll have to remember that trick.
pmichaud reading the code... PGE doesn't yet support \\x in character enums 14:30
I should make it do so.
(not too hard to do)
out of curiosity, what are you hoping for <+ws-[\\x2345\\x2346]> to do? That construction looks a bit weird to me, depending on how ws is being defined 14:31
PerlJam pm; <ws> would contain all whitespace characters, the other thing would just be a couple of characters less. 14:33
pmichaud <ws> doesn't mean "all whitespace chars" by default, though.
(granted you can make it do that.)
PerlJam sure, but I'm going to try to make it so
pmichaud okay 14:34
part of the issue is that <+ws-[\\t]> does *not* mean "all whitespace characters except tab" when using standard-like definitions of <ws>
in particular, <+ws-[\\t]> would still match " \\t " 14:35
PerlJam Is there a way to do that with the standard <ws> def?
pmichaud the difference is that <ws> means "zero or more ws chars" while -[\\t] effectively means "not a tab" 14:36
i.e., -[\\t] is a single character matcher, but <ws> is a multi char matchers
PerlJam right.
but is there a way to "look inside" ws at the character classy parts and remove one or two?
pmichaud inside of the ws rule, you can specify that you want to match \\s but not \\t 14:37
no, not really -- at least not that I can think of at the moment.
PerlJam Hmm.
dalek r33830 | kjs++ | trunk: 14:38
: [pirc] some refactoring of the reg.allocator. Reg.allocator is now run after each sub, instead of after the parse.
: + this can improve memory usage
: + it should be slightly faster I think
: + it allows to update the actual register usage in the current_sub, which is needed.
diff: www.parrotvm.org/svn/parrot/revision?rev=33830
pmichaud first cut at improved .sort: 14:39
> my %h = <a 7 b 1 c 4 d 3 e 8>; say %h.pairs.sort({ .value }).perl;
[("b" => "1"), ("d" => "3"), ("c" => "4"), ("a" => "7"), ("e" => "8")]
PerlJam that seems problematic in the general case. In order to effectively use character classes in a set-like fashion, you need to know the implementation details of the rules you're adding/subtracting
pm: cool.
pmichaud PerlJam: no, you just need rules that represent single characters instead of "one or more"
<+space-[\\u2345]>* # works fine 14:40
<+alpha-[aeiou]> # works fine 14:41
masak pmichaud: re .sort: cool
pmichaud <+ident-[aeiou]> # probably not what you expect.
however, one can also do: 14:42
[ <ident> && <-[aeiou]>+ ] # identifiers not containing a vowel 14:43
and that works just fine.
PerlJam && is actually implemented?
pmichaud > my %h = <a 7 b 1 c 4 d 3 e 8>; say %h.pairs.sort({ .key }).perl;
[("a" => "7"), ("b" => "1"), ("c" => "4"), ("d" => "3"), ("e" => "8")]
I know && was implemented at one time, yes. I don't know how well tested it is, as it hasn't been often used 14:44
but for your example, you can have [ <.ws> && \\X2345* && \\X2346* ]
14:44 cognominal joined
pmichaud which is "whitespace but not if it contains \\x2345 or \\x2346" 14:44
afk for a bit 14:45
dalek r33831 | fperrad++ | trunk: 14:54
: [Lua]
: - fully disable traceback (see segfault in RT #60206)
diff: www.parrotvm.org/svn/parrot/revision?rev=33831
lathos I don't understand Moose. 15:01
masak lathos: I don't either. but the parts I've used I like very much. 15:10
moritz masak: does p5w use Moose?
lathos I mean I don't understand why anyone would use it.
masak seems like a stable, powerful, easy-to-use object system.
moritz: no, not yet.
moritz: (zarah does, however.) 15:11
moritz lathos: so what would you use instead? plain blessed hashrefs?
lathos No.
People don't program in an object system, they program in a language. If I want a language that has a stable powerful easy-to-use object system I use Ruby or Perl 7.
6
(Sssh, sekrit)
masak lathos: I like the combination of Perl 5 and Moose, that's all. 15:12
lathos Fair enough. I shall continue to not understand you. :)
moritz lathos: I don't see why an object system can't or shouldn't be a library, just like regex engines are in many programs
masak lathos: understanding is not a prerequisite to using my software. :)
lathos That's OK, I don't use your software. :) 15:13
masak that's ok too.
but if you would, you wouldn't have to understand me. that's my point.
lathos I don't *have* to understand you. I just *don't* understand you...
masak sometimes I don't, either. :)
tewk_ pmichaud: proto 'infix:!=' is equiv('infix:==') { ... } 15:14
arge quotes here messing me up? this is an old grammar, ecmascript.
I thought I'd help out PerlJam
pmichaud I think the quote forms still work 15:15
but it should be easy to switch to whatever rakudo is currently using (and we know that works)
tewk_ is it deprecated? not a best practice. 15:16
rakudo doesn't have them
pmichaud I'm not sure if it's deprecated or not. I haven't officially deprecated it.
PGE and Perl6Grammar might accept things that wouldn't be standard Perl 6.
(because they may be used to implement languages where the Perl 6 syntax doesn't really make sense.)
that said, obviously the Perl 6 syntax will always work. :-) 15:17
so I'd recommend it if possible.
15:19 AndyA joined, jhorwitz joined
dalek r33832 | fperrad++ | trunk: 15:20
: [Lua] complex
: - fix __unm
diff: www.parrotvm.org/svn/parrot/revision?rev=33832
tewk_ pmichaud: proto infix:<==> is precedence('m=') is pasttype('chain') { ... }
is that the == operator.
I bet I need :< > now 15:21
pmichaud no, you don't 15:22
yes, infix:<==> is the == operators
but in Parrot it's still written as the "infix:==" sub
I haven't decided whether/how to change this.
PerlJam pmichaud: it could be infix:'==' too ? 15:24
pmichaud PerlJam: I don't think it accepts that syntax, no. 15:25
originally PGE always used the "infix:==" syntax
15:25 chromatic joined
pmichaud but TimToady has a strong aversion to that, and of course it's not standard Perl 6 15:25
so I added the infix:<...> and infix:Ā«...Ā» syntaxes, which simply remove the angles 15:26
the reason PGE didn't start out using the angles in the first place is that it's a pain to map angles
for example, infix:<+>, infix:<<+>>, infix:Ā«+Ā» are all the same thing in Perl 6 15:27
so I went with a "canonical" representation where the angles didn't matter.
I'm getting a new rakudo spectest failure... 15:28
t/spec/S02-builtin_data_types/arr 45 1 2.22% 19
tewk_ Ok I think ' ' quotes work just fine, cardinal uses them
ahh but cardinal uses << >> to encompass operators such as <= and >= 15:32
PerlJam pm: btw, it looks like PGE has infix:& but not infix:&& 15:33
15:35 jan joined
jonathan particle: re parse submethod declarations - I vastly prefer that we don't parse stuff that we don't implement... 15:36
PerlJam jonathan: maybe he's going to implement them too :-) 15:37
15:42 AndyA joined
nopaste "pmichaud" at 72.181.176.220 pasted "fun with sort" (34 lines) at nopaste.snit.ch/14918 15:45
15:46 Wknight8111 joined
masak pmichaud++ 15:46
tewk_ nevermind, the assignment operators were not part of the optable so it was eating the first = of my == operator 15:47
jonathan pmichaud++ indeed
Is that spec'd? ;-)
If not, it should be!
pmichaud if I add a test for it, it will be. :-) 15:48
jonathan Yay!
Block that thang.
pmichaud (yes, p6l could choose to reject this particular form.)
jonathan *blog!
pmichaud just waiting for spectest to finish so I can ci.
jonathan (what they don't know can't hurt them)
;-)
pmichaud well, if I blog it, they're likely to learn about it. :-)
masak jonathan: I'll put something in S29 about that way to .sort early next week
jonathan Great. :-) 15:49
masak jonathan: ...along with a lot of other planned S29 improvements.
pmichaud: better not tell p6l, then :P
pmichaud masak: I think the semantics should be that 2-argument closures represent comparisons (that return Increase, Same, Decrease) -- all others are closures that are used to get the values that are used in the comparison
masak makes note of that 15:50
pmichaud if not that, then 0-arity and 1-arity closures represent "get the value", 2-arity closures are "comparison function", everything else is ???
Tene pmichaud: what would a 3-argument closure to sort do?
pmichaud Tene: see "???" I just wrote. :-)
Tene how can 0-arity get a value?
pmichaud { .abs } # 0 arity
(because the $_ parameter is optional) 15:51
and I don't want to force people to write { $^a.abs } to get a 1-arity closure
also, one could do something like { rand() } :-P 15:52
which doesn't require any arguments, but would sort the list into random order :-)
jonathan pmichaud: 2 * rand() is rand returns between 1 and 0 ;-) 15:53
or rand() > 0.5
jonathan has actually used this in Perl 5. :)
dalek r33833 | jonathan++ | trunk:
: [rakudo] Add Abstraction role.
pmichaud hmmm?
dalek diff: www.parrotvm.org/svn/parrot/revision?rev=33833
jonathan pmichaud: Oh, I see 15:54
You've giving the value to sort on. :-)
Cunning!
pmichaud yes.
jonathan Perl 6 FTW.
pmichaud what's more, unlike { foo($^a) cmp foo($^b) } --- something like { foo($^a) } would compute foo(...) of each value only once for the entire sort, instead of on each comparison.
actually, I wrote it in Perl 6 to begin with... 15:55
## Algorithm as Perl 6:
## @!v = @list.map($by);
## @!slice = (0..^@list).sort: { @!v[$^a] cmp @!v[$^b]};
## return @list[ @!slice ];
masak beautiful. 15:56
purl beautiful is a love thing
pmichaud where @list is the original list to be sorted, $by is the sub to use to compute the values.
jonathan What are @!v and @!slice attributes of?
pmichaud it's pseudo-perl6
jonathan Ah.
pmichaud I should probably get rid of the !'s
## my @v = @list.map($by); 15:57
## my @slice = (0..^@list).sort: { @v[$^a] cmp @v[$^b]};
## return @list[ @!slice ];
oops, missed one.
fixed.
15:57 Theory joined
Tene I wrote .assuming in Perl 6 first, then translated to pir. 15:58
masak .assuming is implemented!?!? 15:59
pmichaud masak: you need to watch twitter.com/rakudoperl :-)
Tene masak: yes. It took me like 2 minutes to implement after jhorwitz asked for it
masak I do, only not right now when I'm writing my exam.
Tene++ 16:00
I should ask for more seemingly-difficult features, apparently.
Tene masak: yes, definitely.
pmichaud I would've thought .assuming was difficult. Tene apparently knew differently. :-)
karma Tene
purl tene has karma of 329
pmichaud that looks prime, so I won't mess it up. 16:01
jhorwitz Tene: was banging my head against pdd22io issues last night. still have to try .assuming...
Tene jhorwitz: it passes some tests, so I assume it's okay.
7*47 16:02
purl 329
Tene 331 is prime, though
pmichaud okay, 329 isn't prime, but it's still a cool set of factors :-)
jhorwitz excellent. i have uses for it. BWHAHAHAHAHA
pmichaud hmmm. $tests.pass.assuming('ok') 16:03
or
&ok.assuming($tests.pass);
Tene++ # clever, straightforward implementation of .assuming
there, you just need one more karma to be prime :-)
maybe implement ".is_prime" :-) 16:04
Tene I spent 10 minutes banging my head against a typing mistake.
method is_prime { return rand() > 0.5; }
masak Tene: I can see problems with that approach.
Tene with is_prime or .assuming? 16:05
chromatic Yes, but it's an O(1) algorithm.
masak is_prime
purl hmmm... is_prime is known imperfect.
masak works badly for large numbers, for one.
Tene See? It's known imperfect.
Infinoid gets an intermittant failure testing Tene's .is_prime on amd64, and automatically blames the GC
Tene Infinoid: very reasonable conclusion, but it's probably the JIT.
Infinoid heh. 16:06
svn.pugscode.org/pugs/t/examples/99...roblem39.t 16:09
dalek r33834 | pmichaud++ | trunk: 16:10
: [rakudo]: Fix .list method on Mapping and Hash.
diff: www.parrotvm.org/svn/parrot/revision?rev=33834
Tene masak: so what's your next item for me to implement?
masak um.
pmichaud would be nice to have infix:<cmp> working on Pairs
masak looks through the November RAKUDO comments 16:11
Tene: @$a 16:12
Tene Okay, I'll look into it. 16:13
dalek r33835 | pmichaud++ | trunk:
: [rakudo]: Add by-value sort for e.g., %hash.sort { .value }
pmichaud Tene: need to fix the grammar to properly handle desigilname
dalek diff: www.parrotvm.org/svn/parrot/revision?rev=33835
masak Tene: also, unbreaking of %*ENV
pmichaud %*ENV is a nice challenging one, though.
but actually....
masak there's a detailed RT ticket about it
pmichaud that will probably get fixed when I do postcircumfix:{ }
masak submethods, in particular BUILD. 16:14
pmichaud oh, wait. It'll be fixed when we do postcircumfix:{ } w/proxies
jonathan masak: Those ones are on my task list...submethod needs dispatcher changes.
masak uh huh.
I guessed that.
jonathan masak: It's actually in my grant project plan to do 'em though. ;-) 16:15
masak I'm just indiscriminately spouting wish list items.
jonathan :-)
pmichaud have we recently reviewed RT tickets for things that can be closed?
I suspect there may be a few.
Tene I know coke was doing it... don't know how far he got.
pmichaud oh, I meant rakudo tickets.
(sorry for being unclear there :-)
masak Tene: if you run out of things to do, you can always search for RT tickets I opened. :) 16:16
pmichaud afk for a short bit
jonathan pmichaud: I did some kind of review and closed a few last Rakudo day, but there's likely more. 16:18
pmichaud another really good thing to do would be to get +Inf and -Inf working. 16:19
(Inf should be a term or named_0ary, probably) 16:20
dalek r33836 | fperrad++ | trunk: 16:29
: [Lua] mathx
: - fix test on linux
diff: www.parrotvm.org/svn/parrot/revision?rev=33836
jonathan pmichaud: Will it not just parse as a type name? 16:30
dalek r33837 | tewk++ | trunk: 16:32
: [js] fixes for member_expression and optable assignment ops
diff: www.parrotvm.org/svn/parrot/revision?rev=33837
PerlJam pm: the 0 and 1 arity sort subs always use infix:<cmp> ? how would you affect a numeric comparison ? (yes, the obvious answer is to provide your own 2-arity sub) 16:34
moritz PerlJam: cmp dwim's if both args are numeric 16:35
masak PerlJam: remember that Perl 6 cmp ain't Perl 5 cmp
PerlJam that seems ... odd. 16:36
masak the cmp from Perl 5 is spelled 'leg' in Perl 6
moritz PerlJam: not so odd if you remember that Perl 6's scalars carry type information
PerlJam how would you do $max_length_string = [...] @strings; ? (utilize [op]) 16:50
pmichaud $max_length_string = [max] map { .chars } @strings;
or even
$max_length_string = [max] @stringsĀ».chars 16:51
PerlJam pm: doesn't that give you length, but not the string that is the max length?
pmichaud (It might be .Ā» instead)
PerlJam I want the string
pmichaud oh
just a sec
masak PerlJam: @strings.sort({ .chars })[*-1]
PerlJam: or even @strings.sort({ .chars }).end 16:52
moritz pmichaud: both Ā». and .Ā» are allowed
masak moritz: do they mean the same?
pmichaud $max_length_string = max( @strings, { .chars }) might work if we generalize what I did for sort to max
moritz masak: .end is the last index, not the last item
masak pmichaud: might be a good idea.
moritz masak: aye
masak moritz: ah. dang.
PerlJam masak: yes, I know sorting is an obvious method. I'm thinkink that [op] could use a similar trick as sort just got I just haven't thought it through yet :)
masak moritz: are you sure? 16:53
purl You still have ALL THREE lifelines left!
pmichaud PerlJam: see above max(...)
moritz rakudo: say <a b c>.end
polyglotbot OUTPUT[c␤]
masak :)
moritz uhm
masak moritz: I implemented that.
PerlJam pm: yeah, I saw. I just have a nagging feeling about it for some reason
pmichaud max has basically the same signature as sort
our List multi max( Ordering $by = &infix:<cmp>, *@values ) # out of date, but you get the picture 16:54
PerlJam pm: and I was thinking of applying it to [] as a general transform-but-keep-the-original
pmichaud writes a journal post about .sort 16:55
masak (journal posts)++
moritz masak: S29:544
Returns the final subscript of the first dimension; for a one-dimensional 16:56
array this simply the index of the final element.
PerlJam pm: I mean, what you did for sort seems like it could be used other places. It seems odd to repeat that work in all of those other places. Maybe there's a one-place it could be done and all of those other places can use it.
pmichaud pj: I agree. I was thinking it should be part of the way we handle "Ordering" in general.
moritz masak: should I open a ticket?
masak moritz: 'For non-fixed dimensions (undeclared
or explicitly declared with C<*>), the actual last element is used.'
pmichaud i.e., instead of defaulting to infix:<cmp>, we have some other function that handles the case like this. 16:57
then it could be used for max, min, sort, etc.
moritz masak: that desn't seem to make any sense to me
masak: I'll ask p6l
masak moritz: good.
I can see a use for either behaviour.
moritz masak: returning either an index or an item based on some declaration magic feels weird 16:58
masak moritz: S02:1620
moritz: indeed.
moritz masak: so it seem sthat it should just read "the index of the actual last element is used." 16:59
masak moritz: well, from S02:1620 it seems that @foo.end and @foo[*-1] are equivalent. 17:00
moritz masak: $#foo returns the last index, not the last item
masak but @foo[*-1] returns the last item. 17:01
maybe we can agree that there is confusion in the specs on this. :)
moritz aye
masak ah, so S02 doesn't seem to imply that they are equivalent. at least not necessarily. 17:02
it just provides two common patterns for the two most common uses
moritz aye 17:03
masak I think you have convinced me.
but the description in S29 is still a bit zany, and could use an email to p6l 17:04
moritz well, if I don't get some feedback I'll just make the change I suggested
masak aye 17:05
17:38 iblechbot joined
Wknight8111 how many p6 spectests are passing today? 17:39
pmichaud 5004 as of midnight.
(CST)
Wknight8111 excellent!
purl plays air guitar
pmichaud I've been playing with .sort or there would be more.
Wknight8111 I'm trying to keep track of all the progress for the release
pmichaud use.perl.org/~pmichaud/journal/38080 17:41
jonathan pmichaud: Does {{ ... }} in a regex just put the PIR directly inline? 17:42
Or does it compile it as a sub and call it?
pmichaud compile as sub 17:43
since it's a closure.
jonathan Aha.
OK. How do I fail?
pmichaud from within the {{ ... }} ?
jonathan Uh, that could be taken more than one way. :-)
Yes.
pmichaud there's not a good way to do that yet.
jonathan Ah.
What's the bad way?
pmichaud the interface for return values from called closures changed, and I haven't updated PGE to match
perhaps I should just make a good way work 17:44
masak pmichaud: you should reply to educated_foo in fw's post and link to your post, too.
pmichaud the bad way is that returning a value from the closure stops the match (this was the S05 spec), so I would return on success and then <.fail>
this is what happens in, say, the <.ws> token in Rakudo.
so: {{ return 1; }} <fail> 17:45
where return 1 indicates "yes, we found what we want" and <fail> causes us to fail otherwise.
jonathan OK, I can't quite do that here, I think.
pmichaud in your case I would create a custom subrule. 17:46
similar to what is done for <EXPR> and <quote_expression>
i.e., write it in PIR to do exactly what you want.
jonathan <name> ...thingy to check it here... {*}
pmichaud I've also been thinking that it would be really nice if there was a way to fail a match from within an action method, but I'm not sure how to do that yet.
if you do the custom subrule, it's 17:47
Tene pmichaud: "... we should do similar things for C and :"
pmichaud <name> <custom_subrule> {*}
Tene: thanks, pod doesn't work well in use.perl :-(
Wknight8111 Perl 6 is pretty fantastic
jonathan Yeah, but the custom subrule needs to know about name.
pmichaud oh, it's passed the current match object. 17:48
as its first argument
jonathan STD.pm does it as an assertion, FWIW.
pmichaud so you just do arg[name]
jonathan <?{{ ... }}>
pmichaud right, we don't have assertions yet, because we can't parse Perl 6.
jonathan Can we not have PIR assertions? ;-)
pmichaud We *could* create an assertion that runs PIR, yes.
_that's_ doable quickly, and worthwhile.
jonathan That would be perfect. 17:49
pmichaud I can't do it right now -- would tomorrow be sufficient?
jonathan When we can parse Perl 6, I'll happily upgrade the PIR to Perl 6 at the same time.
pmichaud (or later today)
jonathan Ah, I was trying to get this working today... :-)
OK, I'll find a way around it for now.
pmichaud Tene++ # catching my errors
jonathan And then modify it to use assertions when you have time to do those.
pmichaud I will add it soon, though, because assertions are commonly requested, and being able to do them in PIR is good for $other_language_implementors who don't want the Perl 6 17:51
(where "soon" means "today sometime, although possibly quite late")
masak these are indeed exciting times. 17:53
we hardly have time to try out all the features you throw on us! :) 17:54
PerlJam masak: it's ... almost ... like christmas ;)
masak says absolutely nothing.
Tene pmichaud: pct loops coming before release? 17:55
pmichaud Tene: don't know yet. 80% chance yes.
it will depend on how many family-type interruptions occur today and tomorrow
jonathan epicly breaks parsing 17:56
Tene I'm rather in a development sort of mood today. Looking for something to procrastinate pdd review with. :)
pmichaud Well, I just did .sort :-)
(i.e., I'm in the same sort of mood. :-) 17:57
and right now it's time for .lunch
masak
.oO( @tasks.sort({ .lunch }) )
18:03
18:08 ruoso joined 18:18 davidfetter joined
dalek r33838 | Whiteknight++ | trunk: 18:27
: [Book] Some updates to chapter 12 and some code examples to illustrate how some of the runcores operate.
diff: www.parrotvm.org/svn/parrot/revision?rev=33838
18:32 peters joined
peters nopaste? 18:33
clunker3 pasta.test-smoke.org/ or paste.husk.org/ or nopaste.snit.ch:8001/ or rafb.net/paste or poundperl.pastebin.com/ or paste.scsys.co.uk/
purl hmmm... nopaste is at nopaste.snit.ch/ (ask TonyC for new channels) or rafb.net/paste or poundperl.pastebin.com/ or paste.scsys.co.uk/ or App::Nopaste or tools/dev/nopaste.pl or at www.extpaste.com/ or paste.scsys.co.uk (for #catalyst, #dbix-class, #moose and others)
nopaste "peters" at 83.183.129.106 pasted "Unexpected resulr using a char range ("\\r" ~~ token { <[\\x00..\\xFF]> })" (35 lines) at nopaste.snit.ch/14921 18:36
peters perhaps I'm missing something?
rakudo: ("\\r" ~~ token { <[\\x00..\\x7F]> }) && say 'match' 18:37
polyglotbot RESULT[Method 'perl' not found for invocant of class 'PGE;Match'␤current instr.: '_block11' pc 29 (EVAL_14:16)␤called from Sub 'parrot;PCT;HLLCompiler;eval' pc 892 (src/PCT/HLLCompiler.pir:508)␤called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1216 (src/PCT/HLLCompiler.pir:669)␤called from Sub
..'parrot;PCT;HLLCompiler;command_line' pc 1392 (s...
peters rakudo: ("0" ~~ token { <[\\x00..\\x7F]> }) && say 'match'
polyglotbot OUTPUT[match␤]
tewk_ pmichaud: how do I say any character except \\n * \\ and / 18:38
Tene tewk_: negative character class 18:40
<[^...]>
should work
or is that spelled <-[...]> now?
tewk_ tene++
Tene One of those two. 18:41
purl well, one of those two is probably what you want.
Tene or whatever
particle the latter
purl rumour has it the latter is better
18:48 geof joined 18:59 cognominal joined
jonathan Yay. Working Lowercase type names. 18:59
19:00 rindolf joined
rindolf Hi all. 19:00
jonathan hi rindolf 19:05
rindolf Hi jonathan
jonathan ponders creating a branch for the changes he's working on
peters rakudo: ("\\t" ~~ token { \\x09 }) && say 'match'" 19:09
polyglotbot OUTPUT[Statement not terminated properly at line 1, near "\\""␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤called from Sub 'parrot;Perl6;Grammar;eat_terminator' pc 27549 (src/gen_grammar.pir:3364)␤called from Sub 'parrot;Perl6;Grammar;statementlist' pc
..26205 (src/gen_grammar.pir:2831)␤called from Sub 'pa...
peters rakudo: ("\\t" ~~ token { \\x09 }) && say 'match'";
polyglotbot OUTPUT[Statement not terminated properly at line 1, near "\\";"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤called from Sub 'parrot;Perl6;Grammar;eat_terminator' pc 27549 (src/gen_grammar.pir:3364)␤called from Sub 'parrot;Perl6;Grammar;statementlist' pc
..26205 (src/gen_grammar.pir:2831)␤called from Sub 'p...
peters rakudo: ("\\t" ~~ token { \\x09 }) && say 'match'
polyglotbot OUTPUT[match␤]
peters rakudo: ("\\n" ~~ token { \\x0A }) && say 'match' 19:10
polyglotbot RESULT[Method 'perl' not found for invocant of class 'PGE;Match'␤current instr.: '_block11' pc 29 (EVAL_15:16)␤called from Sub 'parrot;PCT;HLLCompiler;eval' pc 892 (src/PCT/HLLCompiler.pir:508)␤called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1216 (src/PCT/HLLCompiler.pir:669)␤called from Sub
..'parrot;PCT;HLLCompiler;command_line' pc 1392 (s...
peters is confused
jonathan wonders why it's looking for that... 19:11
peters: So am I. Something is very wrong there...
19:11 peters joined
peters sorry lost connection 19:12
jonathan peters: That looks like a really quite odd bug...
19:12 allison joined
peters I thought so too 19:12
peters is trying to write a p6 HTTP grammar 19:14
pmichaud it's looking for .perl because the bot tries to .perl the result if there's no output.
jonathan Ahhh! 19:15
That explains a lot.
pmichaud I don't know if ~~ token { ... } works.
jonathan rakudo: ("\\t" ~~ token { \\x09 }) && say 'match'
polyglotbot OUTPUT[match␤]
jonathan It can work. :-) 19:16
pmichaud okay.
peters but it fails with \\r or \\n
works with NUL =)
pmichaud rakudo: ("\\n" ~~ / \\r /) && say 'match';
rakudo: ("\\n" ~~ / \\n /) && say 'match';
peters nopaste.snit.ch/14921
polyglotbot RESULT[Method 'perl' not found for invocant of class 'PGE;Match'␤current instr.: '_block11' pc 29 (EVAL_14:16)␤called from Sub 'parrot;PCT;HLLCompiler;eval' pc 892 (src/PCT/HLLCompiler.pir:508)␤called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1216 (src/PCT/HLLCompiler.pir:669)␤called from Sub
..'parrot;PCT;HLLCompiler;command_line' pc 1392 (s...
OUTPUT[match␤]
pmichaud so far so good there.
rakudo: ("\\n" ~~ / \\x0a /) && say 'match'; 19:17
polyglotbot OUTPUT[match␤]
peters rakudo: ("\\n" ~~ token { \\x0A }) && say 'match'
polyglotbot RESULT[Method 'perl' not found for invocant of class 'PGE;Match'␤current instr.: '_block11' pc 29 (EVAL_15:16)␤called from Sub 'parrot;PCT;HLLCompiler;eval' pc 892 (src/PCT/HLLCompiler.pir:508)␤called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1216 (src/PCT/HLLCompiler.pir:669)␤called from Sub
..'parrot;PCT;HLLCompiler;command_line' pc 1392 (s...
pmichaud rakudo: ("\\n" ~~ token { \\x0a }) && say 'match'
particle short circuit
polyglotbot OUTPUT[match␤]
peters ahh
pmichaud ah, apparently it only understands the lowercase hex digis
*digits
peters thanks =)
pmichaud is surprised by that.
particle too 19:18
jonathan three
particle i wonder if i'm to blame for that error... odd.
pmichaud heh... yes, there it is -- only lowercase chars. 19:19
fixing.
peters rakudo: ("\\n" ~~ token { <[\\x00..\\xff]> }) && say 'match'
pmichaud \\x doesn't work inside of <[...]> yet.
polyglotbot RESULT[Method 'perl' not found for invocant of class 'PGE;Match'␤current instr.: '_block11' pc 29 (EVAL_14:16)␤called from Sub 'parrot;PCT;HLLCompiler;eval' pc 892 (src/PCT/HLLCompiler.pir:508)␤called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1216 (src/PCT/HLLCompiler.pir:669)␤called from Sub 19:20
..'parrot;PCT;HLLCompiler;command_line' pc 1392 (s...
peters ok
pmichaud so far only \\n\\r\\t\\f\\a\\e\\0 work there. 19:21
peters rakudo: ("\\n" ~~ token { \\x0d | \\x0a }) && say 'match' 19:22
polyglotbot OUTPUT[match␤]
particle shouldn't be hard to get \\x working without supporting \\x[...]
peters ok, I could generate that range ;)
pmichaud yes, but we already have a routine for \\x[...]
we really ought to be reusing it
particle true
pmichaud I haven't figured out a good place to put it
I can make it part of PGE, I suppose, but...
that feels funny.
particle indeed 19:23
subclass?
pmichaud subclass of what?
it's really more like its own library.
similar to the way P6object is a library for Perl 6 object behaviors
particle yeah. 19:24
pmichaud I may just put it into PGE for now.
peters: btw, you can use token { \\n } to match a logical newline
and unless you're doing unicode, <[\\x00..\\xff]> would be the same as . 19:25
peters true, but I need to specify several ABNF rules which has control character ranges 19:26
pmichaud well, you're the second person to inquire about <[\\x...]> today, so it's moving up my priority list. :-) 19:27
peters nopaste.snit.ch/14921 p6 grammar of ABNF (RFC 5234)
thanks =) 19:28
pmichaud <[\\x00..\\xff]> is just .
<[\\x21..\\x7e]> is probably <print> or <graph>
peters does . matches unicode? 19:29
pmichaud yes, if you have one.
but if the string is converted to fixed_8 beforehand, it won't be unicode.
<DIGIT> | <[A..F a..f]> is <xdigit> 19:30
<[\\x21..\\x7e]> is <graph>
peters thanks 19:31
pmichaud <[\\x01..\\x1f\\x7f]> is probably <cntrl> -- I don't know if <cntrl> includes \\x00 though.
particle didn't realize we had <graph>
Wknight8111 a google image search for "rakudo spectest" returns a very inappropriate image, if your safe search is turned off
pmichaud leaves his safe search firmly in the "on" state. 19:32
particle (:
pmichaud although the phrase "safe search is turned on" seems somehow oxymoronic.
Tene heh 19:33
chromatic Seatbelt fetishists.
They like Java too for some reason.
jonathan Oh, hmmm, yes. :-)
pmichaud writes another blog post.
jonathan OH NO it's an animated gif! 19:34
Wknight8111: Don't check the animation...
Wknight8111 it has animation!?!?!
Wknight8111 can't look at that while he's at work 19:35
particle save that talk for #perl
jonathan suggests not looking...he wishes he hadn't.
Ugh. Lots of spectest fails. 19:36
jonathan digs in to work out how he's messed up
pmichaud keep in mind that some spectests may be passing because rakudo incorrectly parses things as types (and they thus "work") afterwards 19:37
this is also a problem for some tests that may be marked "todo" 19:38
for example, +Inf would currently parse (and could be marked "todo"), but would fail to parse when strict type naming is in place.
and if it fails to parse, the whole file fails.
jonathan pmichaud: The test I'm looking at right now has *exactly* that problem.
Oh, it creates a fun point. 19:39
pmichaud right. It's going to take some work to get typenames to be recognized.
jonathan #?pugs 2 todo "feature"
ok Foo::Bar.isa(Class), "subclass.isa(Class) is false";
19:39 bacek joined
jonathan There is no Class class... 19:39
Which I guess is what this is testing.
pmichaud but there is a Class type.
jonathan Oh?
pmichaud S02, S12, bunches of them have "Class"
S02-bits.pod 19:40
947: Class Perl 6 standard class namespace
jonathan Ah, yes.
Oh, it's the type of the namespace?
what_goes_here ~~ Class to give true?
pmichaud I dunno. But it's also mentioned as part of the signature for trait_auxiliary:is(...) 19:41
1423: multi *trait_auxiliary:is(Class $base, Class $class; $arg?) {...}
jonathan Oh, that's...interesting.
jonathan ponders what to do with tests like that for now 19:43
chromatic There's always fire. 19:44
pmichaud they currently pass? 19:45
jonathan Yeah, because Class now just hands back a Failure. :-)
Well, in trunk.
particle PerlJam++ svn1.5++ (sparse checkouts)++
pmichaud so, temporarily make Class do that.
jonathan Just install a Failure proto at startup under the name Class? 19:46
pmichaud sure. 19:47
jonathan (Class gives a failure because of the autovivification, just to be clear...)
OK
pmichaud or go ahead and create src/classes/Class.pir to do it
jonathan OK
Let me look at some other failures first.
pmichaud we know that Class will eventually exist -- making it a Failure for now is a good workaround.
peters is \\n as in C or as in p5? 20:01
particle mac os line endings are not recognized 20:04
\\n\\r, that is
pmichaud in a regex, \\n represents any line ending.
peters ok, same as p5 then? 20:05
pmichaud no.
in p5, I think that \\n represents only \\x0a
in p6 regexes, \\n matches any logical newline, platform independent. 20:06
peters I thought \\n was a "logical newline " that varies depending on whis os
.. in p5
particle \\n is logical in p5
pmichaud according to S05:
particle it matches \\r\\n on windows
pmichaud C<\\n> now matches a logical (platform independent) newline not just C<\\x0a>.
peters ok, thanks
that means i can't use \\n in my grammar 20:07
pmichaud not if you want to match only one octet, correct.
peters thanks 20:08
20:19 masak joined
jonathan rakudo: say eval('want') 20:29
polyglotbot OUTPUT[Null PMC access in get_string()␤current instr.: 'print' pc 15495 (src/builtins/io.pir:22)␤called from Sub 'say' pc 15517 (src/builtins/io.pir:32)␤called from Sub '_block11' pc 37 (EVAL_13:16)␤called from Sub 'parrot;PCT;HLLCompiler;eval' pc 892 (src/PCT/HLLCompiler.pir:508)␤called from Sub
..'parrot;PCT;HLLCompiler;evalfiles' pc 1216 (src/P...
jonathan haha
jonathan is finding some amusing reasons why tests once parsed
Or didn't explode
20:35 rindolf joined
peters p6 is just beautiful, it contains everything (and feartures i didn't know I wanted) that I have longed for in p5 20:38
jonathan makes a large reduction in the number of failures 20:40
davidfetter [--] @failures; 20:45
jonathan FAIL 20:47
(-- is not infix)
--<<@failures
particle @failures>>.--
Tene @failures.>>--
davidfetter heh
particle :D
cognominal jonathan, with the grant, you are working full time on parrot? 20:51
I mean rakudo
jonathan cognominal: No. 20:52
Between various grants I'm working quite a lot of the time on Rakudo and Parrot, though. :-) 20:53
Oh, this is a fun one.
regex B {\\d+};
The test then does B.WHAT
Which tries to call B now.
I guess the test should be &B.WHAT
?
Since regexes are just like subs...
particle methods
yes, should be &B imo 20:54
masak nice one.
jonathan OK.
particle (fixing tests)++
peters rakudo: ("failure" ~~ token { \\x66 \\x61 \\x69 \\x6c \\x75 \\x72 \\x65 }) && say "success!" 20:56
polyglotbot OUTPUT[success!␤]
jonathan My oh my, this patch shakes out some things 20:57
is('1245' ~~ B, '1245', 'Match against regex');
Now fails.
jonathan checks the synopses and wonders if this is one of those "dispatch on the form" things
tewk_ does <-[]> support escape characters 20:58
dalek r33839 | masak++ | trunk:
: [rakudo] made .end return highest index, not last element
diff: www.parrotvm.org/svn/parrot/revision?rev=33839
masak let it also be known that we have no spectests for .end -- at least no unfudged ones.
tewk_ I want to say anything but \\n * \\ /, <-[\\n*\\\\\\/]>? 20:59
particle i don't think you need to escape / there 21:04
and yes, i believe that should work
rakudo: token foo { <-[\\n*\\\\\\/]>? }; say 1
rakudo: token foo { <-[\\n*\\\\/]>? }; say 1 21:05
polyglotbot OUTPUT[1␤]
GeJ Good morning everyone
masak hej GeJ
jonathan hej hej 21:07
peters rakudo: ("failure" ~~ token { \\x[66,61,69,6c,75,72,65] }) && say "success!" 21:09
polyglotbot OUTPUT[success!␤]
GeJ hej masak
peters nice syntax =) 21:10
GeJ morning jonathan
masak jonathan: so, which one do you think you'll do first, submethods or S09? :) 21:11
jonathan ...I'm doing S09?! 21:12
masak: submethods for sure though
masak thought jonathan had dibs on S09
jonathan I'm doing typed arrays.
And typed hashes.
masak ok 21:13
jonathan That's one small part of the monster. :-)
masak we'll take turns on it :)
21:14 Hadi joined
peters token { 'typed' [<array> | <hash> ] }++ 21:14
rakudo: my unint16 $foo = 10; 21:15
polyglotbot OUTPUT[Scope not found for PAST::Var '$foo'␤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:102)␤called from Sub 'parrot;PAST;Compiler;post_children' pc 1853 (src/PAST/Compiler.pir:379)␤called from Sub 'parrot;PAST;Compiler;call' pc 4042
..(src/PAST/Compiler.pir:1054)␤called from Sub 'parrot;PAST;Compiler;post_childr...
pmichaud it might be problematic to have rules named 'hash', since that's also a method on Match objects.
peters ok 21:16
token token { } # works =)
masak peters: yes, but don't do that :) 21:17
unless your in an obfu contest.
s/your/ypu're/
ga'h!
pmichaud it's not a problem of "keywords", it's an issue with "what methods do Match objects already have"
because rules in a grammar are methods 21:18
peters masak: well blame RFC 2616 (HTTP) ;P
masak peters: fair enough.
peters masak: Svensk?
masak peters: aye
peters masak: nice, me too =) 21:19
masak cool.
which part?
purl the IMPORTANT part!
masak purl: nobody likes you.
purl masak: sorry...
peters south of sweden, Helsingborg. You? 21:20
masak middle-right part. Uppsala.
peters Cool, are you a student? 21:21
jonathan is('1245' ~~ B, '1245', 'Match against regex');
masak peters: among other things, yes :)
jonathan pmichaud: In the above, what should happen?
If you have declared regex B { ... }
peters masak: =), CS?
jonathan It used to work because we were like "ah, it's uppercase, we'll get_hll_global it"... 21:22
Now we know it's not a type name, we don't...so it calls B without any parameters, which dies.
masak peters: no, Bioinformatics.
21:22 mberends joined
masak peters: you? 21:22
purl o/` You are what you is and you ain't what you not o/`
masak purl: forget you
purl masak: I forgot you
masak :)
masak wishes
jonathan pmichaud: '12345' ~~ &B works of course.
peters masak: I work as a IT manager for Siba 21:23
jonathan pmichaud: But it's not clear to me from S03 if this is a "dispatch on the form" case.
masak sounds nice. they must have quite a bit of IT.
peters: what brings you to #parrot? 21:24
peters masak: true =)
masak: I have always liked p5
so the natural step would be p6
masak might be. :) I know I like it. 21:25
peters =)
I whish Siba would be more into opensource but they really like c# and old VB =( 21:26
masak somehow I'm not surprized. 21:27
masak has a spelling malfunction today 21:28
21:28 Lorn joined
masak peters: allow me to unashamedly plug November the Perl 6 wiki, in case you haven't heard about it already. 21:29
peters: it's not yet ready for production use, but it's fun to work with, and it's a real working-today Perl 6 application :) 21:30
peters googles 21:31
github.com/viklund/november/tree/master ?
Infinoid masak++
masak peters: that's it
peters cool =)
masak developed mostly in Uppsala and Vladivostok, as it happens 21:32
particle svn.pugscode.org/pugs/docs/Perl6/Sp...ndline.pod
first draft in, time for lunch &
davidfetter wonders how many russian names start with vladi-
masak particle++
jonathan davidfetter: Two come to mind immediately... 21:33
bacek davidfetter: 4-5 :)
morning, good morning
masak bacek: evenin'
bacek masak: welcome from future :) 21:34
davidfetter wonders what people would think of americans if we prefixed city names with conquest-
masak bacek: I'm glad I'm in the past. I need to finish this essay by tomorrow. :)
Infinoid hails from conquest-#316512
masak davidfetter: it'd be kinda cool. for like 10 seconds. 21:35
davidfetter masak, that long?
Infinoid bacek: happy weekend
masak davidfetter: ...maybe.
peters sorry for my ignorance, why is there a need for a spec for @ARGV (argc, argv[]) processing? 21:36
masak peters: there's a need to spec everything in Perl 6. 21:37
so we know what to implement.
bacek lefigaro.ya.ru/replies.xml?item_no=1783
Russian text: "Discussing manhatten distance" :) 21:38
And I know this guys :)
masak small country, eh? :)
bacek masak: yeah. And photo actually made in Germany. (Or Austria may be...) 21:40
small world
purl ... but I wouldn't want to paint it.
masak :) 21:41
bacek purl: good girl! :)
purl :)
peters masak: well, that doesn't IMHO justify a spec
masak peters: please elaborate.
Tene peters: it's "These are the options that Perl 6 will accept"
Things like Perl 5's -e, -p, -I, -M, etc.
bacek afk
peters Tene: I understand that 21:42
Tene These need ot be specified so that all implementations consistently accept the same arguments to perform the same functions.
peters but I can see the usage for a "simple" spec, but aslong it leaves it to various implemenrarions to extend it
masak peters: of course.
purl Indubitably.
peters to many beers 21:43
peters can't spell right
masak I'm sober, and even I can't!
jonathan I didn't have dinner yet, let alone beer...
I am down to four spectests needing attention, however. 21:44
Unfortunately, even at that point I ain't sure if I can commit...
masak commit what?
jonathan (That is, once I sort those out.)
masak is curious
jonathan masak: I'm working on registring classes etc in the namespace as we compile 21:45
masak enabling what?
jonathan class omgitstartswithalowercaseletter { } for one
masak OMG!
jonathan and sub OMGUPPERCASE { } for another :-)
masak omg!
jonathan But also things like, detecting redifinition of classes without using is also and is instead. 21:46
(OK, it explodes now...)
masak O RLY? what happens now, I wonder?
masak tests
rakudo: class A {}; class A {} 21:47
jonathan rakudo: class A { }; class A { };
polyglotbot OUTPUT[Class A already registered!␤␤current instr.: '!keyword_class' pc 15002 (src/builtins/guts.pir:352)␤called from Sub '_block14' pc 117 (EVAL_13:47)␤called from Sub 'parrot;PCT;HLLCompiler;evalpmc' pc 830 (src/PCT/HLLCompiler.pir:475)␤called from Sub 'parrot;PCT;HLLCompiler;compile' pc 428
..(src/PCT/HLLCompiler.pir:301)␤called from Sub 'parro...
OUTPUT[Class A already registered!␤␤current instr.: '!keyword_class' pc 15002 (src/builtins/guts.pir:352)␤called from Sub '_block14' pc 117 (EVAL_12:47)␤called from Sub 'parrot;PCT;HLLCompiler;evalpmc' pc 830 (src/PCT/HLLCompiler.pir:475)␤called from Sub 'parrot;PCT;HLLCompiler;compile' pc 428
..(src/PCT/HLLCompiler.pir:301)␤called from Sub 'parro...
masak seems to work already.
jonathan Yeah, but we can detect it at compile time now. ;-)
masak oooh...
jonathan plus things like 21:48
my TypeThatDoesNotExist $x;
masak nice!
rakudo: my TypeThatDoesNotExist $a; say $a.defined 21:49
polyglotbot OUTPUT[0␤]
masak I look forward to those.
jonathan Aye.
I fear I need to properly fix use to both happen at compile time *and* not break pre-compiled modules before I commit this, though.
(Which I expected, and scribbled on my project plan for the grant...)
masak yes, please. no breaking of pre-compiled modules if it's at all avoidable. 21:50
peters rakudo: sub foo { }; sub foo {}; say "ok";
polyglotbot OUTPUT[ok␤]
jonathan peters: I'll also such things for subs in the future too. :-)
masak peters: nice one. that's a bug.
masak submits rakudobug 21:51
peters =)
jonathan Yay, file a ticket! I can have the pleasure of closing it.
In a week or so...
Hopefully. :)
masak peters: jonathan and I have a competition, you see. I open tickets and he closes them.
peters: so far I'm winning. :)
peters hehe
masak but jonathan and pmichaud makes it up by being enormously productive. this week, they implemented something like 10 new significant features. 21:53
jonathan++ pmichaud++
peters nice =)
jonathan I think I might put this stuff I'm doing in a branch.
masak has a nagging feeling he has reported that bug before... 21:54
jonathan I'm building up quite a diff...and if I've gotta do use etc.
chromatic When we have our Parrot 1.0 retrospective, my biggest handwriting is for "Force multipliers".
masak chromatic: I needed to google that. oh, military jargon. 21:58
peters not sure I dare to try it here but: rakud: token bar { }; token bar {}; #hangs on my GF's win32 machine
s/rakud/rakudo/
masak peters: I get 'Could not find non-existent sub bar' 21:59
peters has a svn export from last night
masak that's _old_! :) 22:00
peters rakudo: token bar {}; token bar {};
polyglotbot OUTPUT[Could not find non-existent sub bar␤current instr.: '_block11' pc 24 (EVAL_13:14)␤called from Sub 'parrot;PCT;HLLCompiler;eval' pc 892 (src/PCT/HLLCompiler.pir:508)␤called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1216 (src/PCT/HLLCompiler.pir:669)␤called from Sub
..'parrot;PCT;HLLCompiler;command_line' pc 1392 (src/PCT/HLLCompiler.pir...
peters good =)
masak my Rakudo build is 3,5 h old :)
jonathan mmm...bar...that's where they serve beer... 22:01
jonathan needs to eat!
bbiab
masak beer is food.
peters needs to pay attention to GF or she will not be happy 22:02
Good night folks, I'll be back later
22:03 allison joined
masak peters: 'night 22:03
22:03 peters left
mj41 Beer is liquid bread. Good night from Czech republic. 22:03
masak mj41: pivo :)
jonathan O, pijem rad pivo! 22:04
mj41 So do I. 22:05
jonathan -> nom 22:06
masak jonathan: "I like to drink beer"? but to a Russian-speaker it looks like "Oh, to drink happy beer!"...
jonathan masak: It was meant to mean, "I like to drink beer" :-) 22:08
I think it might even be right, but my Slovak is sucky.
jonathan really afk for a bit now 22:09
mj41 It seems ok to me.
masak jonathan: it might well be right. I just observed on how it looks to me who don't know Slovak.
"rad" means "glad" in Russian, as far as I know. 22:10
22:14 Hadi joined, Hadi left 22:21 Theory joined
dalek allison@perl.org | Debian chroot Setup: 22:27
link: www.perlfoundation.org/parrot/index...root_setup
r33840 | allison++ | trunk: 22:32
: [docs] Update wiki link in Debian packaging guide.
diff: www.parrotvm.org/svn/parrot/revision?rev=33840
pmichaud www.rakudo.org/2008/12/rakudo-perl-...ver-5.html 22:36
afk for a bit
masak 5000++ 22:38
22:38 gryphon joined
masak approximating from the graph, it appears we're passing as many spectests as we had sometime in early July. 22:40
22:40 uniejo joined
jonathan returns 22:49
22:50 ruoso joined
dalek r33841 | jonathan++ | rakudoreg: 22:57
: [rakudo] Create a branch to put my work on registering symbols, since the diff is getting big and I'll want to fix up some others things too (like use).
diff: www.parrotvm.org/svn/parrot/revision?rev=33841
23:01 Limbic_Region joined
pmichaud masak: that's correct 23:18
on 2008-07-03 we had 4814 spectests
jonathan pmichaud: Any comments on my question about the smartmatch? 23:25
pmichaud sorry, I miseed the question. 23:26
*missed
jonathan regex B { ... } 23:27
(ok, not really ... but something in there...)
"abc" ~~ B # does this work?
pmichaud Not as written
jonathan "abc" ~~ &B # or should it be this?
pmichaud it can't be B
jonathan Right.
That used to work.
pmichaud it could potentially be &B
but that's not official spec yet
jonathan &B will work.
OK
pmichaud it's okay for it to be &B for now 23:28
jonathan So basically if I break "abc" ~~ B, it's not a big deal.
pmichaud it's not at all a big deal for me -- I've been warning about use of that idiom for several weeks.
jonathan Great. I'll break it.
That's one less fail to worry about.
pmichaud "abc" ~~ B effectively means the same as "abc" ~~ B() 23:29
jonathan Right.
pmichaud which makes for an interesting looking smiley.
jonathan Which is, now I've got the registring of names and the updated typename rule, what it works as.
Guy wearing glasses preparing for a kiss? 23:30
pmichaud that, or some sort of monster with a wide mouth
jonathan OK, I'm a bit tired to do much more today 23:34
So, going to put what I've done so far in a branch.
pmichaud that sounds good. 23:36
could you describe to me briefly what the data structure of the .WHENCE property is supposed to look like?
e.g., for Foo{ ... } ?
23:37 AndyA joined
jonathan Is IIRC just a hash of attribute name (sigil-less) to values, but I may need to re-visit it. 23:37
pmichaud if so, that would make it very simple
jonathan sigilless and twigilless.
pmichaud I tried doing that in my Associative patch but it didn't quite work
(but I had other things going on at the time so couldn't check all that closely)
jonathan OK
In what way did it not work? 23:38
As in, what broke?
Just doing Foo{ ... }?
pmichaud one of the spectests broke, I forget which.
it didn't like the idea of just constructing the hash.
jonathan Just one test, or a bunch of related ones?
pmichaud just one test file... don't remember how many tests
jonathan Can you remember which?
pmichaud it seems to me that I should be able to do:
.sub 'postcircumfix:{ }' :method 23:39
.param pmc values :slurpy
whence = values.'hash'()
dalek r33842 | tewk++ | trunk:
: [js] added regex parsing, fixed LTM issues with numeric literals, fixed array_literals, fudged nested functions
diff: www.parrotvm.org/svn/parrot/revision?rev=33842
pmichaud # setprop the whence property
jonathan Hmmm...what are you getting passed in? 23:40
pmichaud well, for Foo{ a=>1, b=>2, c=>3 } I'd get the list of pairs
jonathan Is it an already constructed hash or a list of pairs?
Right.
23:40 ruoso joined
pmichaud and then values.'hash' would turn that into a Hash of some sort 23:40
jonathan Yes.
pmichaud anyway, I just wanted to confirm that it's support to be a simple hash and not anything special 23:41
jonathan Oh
pmichaud that's what it looked like to me, but my initial (not very deep) attempt failed and then I got sidetracked on other tasks on tuesday, including preparing for my trip.
jonathan You are also meant to clone the proto-object and attach it to the clone and return the clone.
You are doing this, right?
pmichaud right, I was doing that.
jonathan OK.
pmichaud the whence goes on the clone.
jonathan Oh!!!
# Attach the WHENCE property. 23:42
props = getattribute self, '%!properties'
unless null props goto have_props
props = new 'Hash'
have_props:
props['WHENCE'] = WHENCE
setattribute res, '%!properties', props
pmichaud yes, I was dong that too.
*doing
jonathan Why on earth are we doing it that way... :-S
pmichaud good question
purl Yeah, it is. I'm stumped.
jonathan Rather than just sticking it as a prop.
pmichaud is %!properties used for anything else?
jonathan I don't think so. I'd forgotten it existed. 23:43
pmichaud okay, I'll switch it to %!WHENCE
jonathan And setprop it on the proto?
pmichaud it _should_ be accessed in only a few places
yes, and setprop it on the proto's clone
jonathan OK
You'd need to update .new in object.
pmichaud that's another one that deserves a refactor :-)
but one thing at a time :-) 23:44
now that we have the base methods in place, it's a lot easier to (re)write a lot of these in terms of existing methods
jonathan It probably needs most if it ripping out and breaking out into CREATE and BUILD and whatever I suspect...
pmichaud for example, using .'hash'() instead of duplicating the iteration code in setting whence :-)
jonathan I'm pondering whether initial values (like has $.x = 42) actually should be going into a WHENCE. 23:45
Because I don't know if the semantics are quite the same.
pmichaud I thought that's how you were going to do it.
jonathan It's how I did it.
pmichaud oh
jonathan But
pmichaud then I think yes.
jonathan Really I'm not so happy with it as we're supposed to make a closure around the 42 23:46
And then run that to get the value
So if you do
pmichaud we only need the closure if there are any lexicals there :-)
jonathan has $.x = rand
pmichaud oh
yes, in that case also
jonathan Then you're meant to get a different value each time
pmichaud but
can't the closure be in the WHENCE ?
jonathan Yeah, but how do we know whether to run it... :-)
pmichaud if it's a block, run it? 23:47
jonathan Foo{ x => { ... }) # do we actually want to run that block?
As in, do we want to run it each time the class is created?
s/created/instantiated/
pmichaud thinking 23:48
purl Oooh he is soooo fine!!!
jonathan See also Autovivifying objects in S12
pmichaud it still feels as though whence is the correct place.
jonathan "This form is also lazily evaluated:
my $dog = Dog{ :name<Fido> };
purl okay, jonathan.
jonathan "
pmichaud aha 23:49
whence is not a Hash, it's a closure that returns a Hash
jonathan And "runs the closure if the object ever needs to be autovivified"
pmichaud i.e., whence is *always* run
it's not a hash of closures to be run, it's a closure to be run that fills in elements of the hash 23:50
jonathan Aha.
Yes.
pmichaud so in the case of Foo{ x => {...} } we aren't executing the x => closure, we're executing the outer closure
and
jonathan OK, can we easily be smart enough at compile time to say "ah, something that looks like a hash index into a proto-object" and make a closure instead? 23:51
pmichaud has $.x = 42;
has $.y = 15;
results in a whence property of { x => 42, y => 15 }
and that property gets executed to get the hash that builds the object.
jonathan Aha. 23:52
That makes sense.
pmichaud it's not the individual components that get executed
jonathan *nod*
Yes, I see that now.
pmichaud so in the case of
has $.x = rand;
we end up with { x => rand }
and invoking that closure builds the x at object construction time. 23:53
cool.
jonathan That still leaves me with the question
Dog{ tail_wag_velocity => 2000000 }
pmichaud no problem, that's just postcircumfix:{ } on Protoobject :-)
it's a method. 23:54
jonathan But it's not, because it'll evaluate the stuff in the closure?
And then call the method?
23:54 Whiteknight joined
pmichaud oh, I see what you're saying. 23:54
jonathan So Dog{ poohs_per_day => rand }
We don't want the rand called then
Otherwise it's not very random. ;-)
Whiteknight what an irregular dog
jonathan Whiteknight: Welcome to #parrot...what an opportune time to arrive. :-) 23:55
pmichaud yes, it can be done.
jonathan We statically know if we've got a typename there, I guess. 23:56
pmichaud no, that's not the way I'd do it.
jonathan The better way?
purl it has been said that The better way is checking $c->user_exists
pmichaud have postcircumfix always return a closure instead of executing things directly.
jonathan How does that play out with hash indexing? 23:57
pmichaud for a normal slice, it then just executes the closure to get the arguments.
jonathan postcircumfix:{ } has a signature of @@slice or something though?
pmichaud that's still not a big issue -- in that case the closure returns a list of captures 23:58
or something
keying off of the fact that we have a typename feels wrong.
because it's a static analysis
jonathan I've spent all day working on that. :-P 23:59
pmichaud yeah, I'm wondering about something like
my $x = Dog
my $dog = $x{ :name<Fido> }
I'd like to not preclude that if at all possible.