pugscode.org/ planetsix.perl.org/ | nopaste: sial.org/pbot/perl6 | evalbot: perl6: say 3; (or rakudo:, pugs:, elf:, etc) | irclog: irc.pugscode.org/
Set by mncharity on 5 January 2009.
pugs_svn r24817 | lwall++ | [STD] fix item assignment problem noticed by ruoso++ 00:25
pugs_svn r24818 | lwall++ | [STD] previous patch was overzealous wrt subexpressions and disallowed $($x) = 1 00:41
pugs_svn r24819 | lwall++ | [S02] clarify that Pairs and Mappings are mutable in value, but not in key 01:00
r24820 | pmichaud++ | [t/spec]: #?rakudo skip test for nameless anonymous classes
r24821 | pmichaud++ | [t/spec]: Clean up passing-hashes.t, remove unneeded "returns Void" 01:02
azawawi hi 01:41
std: "hi";
p6eval std 24821: OUTPUT«00:06 83m␤»
azawawi std: "hi";
p6eval std 24821: OUTPUT«00:07 83m␤»
pugs_svn r24822 | particle++ | [S19] delimited options use eager matching semantics, are invisible to MAIN, but are available via %+OPTS<...> 02:07
pugs_svn r24823 | particle++ | [S19] incorporate more of TimToady++'s notes, and format Notes section as proper Pod 02:20
hercynium moritz: I found the answer for what I was asking about earlier! 04:36
perl6 *does* have that syntactic sugar, in the form of binding 04:37
hercynium does a happy dance
pugs_svn r24824 | pmichaud++ | [t/spec]: #?rakudo skip an odd test in multiple.t. 06:05
mtnviewmark std: take 4 07:18
p6eval std 24824: OUTPUT«00:05 85m␤»
mtnviewmark std: my $a = take 5 07:20
p6eval std 24824: OUTPUT«00:05 86m␤»
mtnviewmark std: my $a = take 5;
p6eval std 24824: OUTPUT«00:05 86m␤»
mtnviewmark std: my $a = return 5;
p6eval std 24824: OUTPUT«00:05 86m␤»
mtnviewmark is trying to see if take and return are just functions... 07:21
rakudo: (take 5) + (take 7)
p6eval rakudo 35246: OUTPUT«Warning␤Warning␤»
eternaleye mtnviewmark: Well, return in global context is an exit() call, so that'll always _parse_ 07:25
mtnviewmark I guess my question is - are "return" and "take" treated specially by the parser - or are they really just normal functions?
seems they are treated specially
eternaleye I think they generate control exceptions 07:26
At least, return
take doesn't need to be lexically in a gather {} block (it can be in a function, which is called in the gather block), so it may just be a function 07:27
Which warns when _executed_ outside a gather block 07:28
mtnviewmark ah okay - thanks - though I'm not sure where that leaves me.... trying to decide if they belong on the operator chart... I'm guessing no 07:36
the problem is that "die" and "warn" are listed in Syn 03 as operators
but it has been pointed out that they are no different than "return" or "take"
azawawi hi 08:03
pdcawley Quick question: What's the best site to link to when referring to Perl 6 in an article? dev.perl.org/perl6/? 08:25
mberends do you mean a specific implementation of Perl 6 like Rakudo, or the Perl 6 language specification? 08:28
pdcawley Perl 6 the language
azawawi pdcawley: feather.perl6.nl/syn/
mberends yes, then what you said is best. 08:29
azawawi pdcawley: en.wikipedia.org/wiki/Perl_6
azawawi pdcawley: rakudo.org/ 08:29
pdcawley: irclog.perlgeek.de/perl6/today 08:30
is that enough? ;-)
pdcawley I think so, yes.
Matt-W worldsbestprogramminglanguage.com?
pdcawley worldsbestprogramminglanguagethati...meyet.com? Or ruby-lang.com? 08:31
:)
azawawi pdcawley: but rakudo.org/ is the coolest among them
pdcawley I shall be linking to that from the Rakudo reference.
azawawi lol that is a long .com
Matt-W I'd like to hear someone try and read that out on the radio :)
azawawi cool
pdcawley I can't remember if theofficialmonsterravinglooneypart...and.org.uk exists... 08:32
pmurias TimToady: if i want to extract the position in the orginal source file from the VAST how should i do it? 08:54
azawawi hi masak 09:11
masak azawawi: greetings.
azawawi is a bot
;-)
masak too
moritz_ ni hao 09:12
masak moritz_: nin hao
masak what's the current status of POD in Rakudo? 09:18
moritz_ it ignores it
(very much like STD.pm)
masak sounds good.
(for now)
pugs_svn r24825 | pmurias++ | [mildew] 09:21
r24825 | pmurias++ | added fcall to AST::Helpers
r24825 | pmurias++ | infix:<~> is correctly translated to a function call
r24825 | pmurias++ | [smop]
r24825 | pmurias++ | fixed a bug in LexicalScope (a non null terminated variable name was passed to printf)
pmurias TimToady: figured a (hackish way) how to make viv attach source positions 09:57
pugs_svn r24826 | pmurias++ | [viv] added VIV::SET_OPT to set some options stored in lexicals (hack) 10:16
r24826 | pmurias++ | [mildew] added a hack to print out the thing which is unimplemented when XXX is called
masak are regex, token and rule allowed outside grammars? 10:17
names ones, I mean.
moritz_ masak: yes 10:18
masak followup questions: how do I refer to them from regexes? and does it work in Rakudo?
moritz_ rakudo: regex foo { foo }; say "foo" ~~ m/<foo>/;
p6eval rakudo 35262: OUTPUT«foo␤»
masak well, that was easy. :) 10:19
moritz_++
moritz_ that's how most test do it
masak now how come when I tried it, it didn't work?
masak tries again
moritz_ you did it wrong? ;-)
btw take a look at t/spec/S05-metachars/tilde.t ;-) 10:20
masak I likely did do it wrong, yes.
I'll take a look.
moritz_ it's not very special, just nice that it works 10:21
masak :) 10:22
I think I'll use that functionality in my last sekrit project. 10:23
I agree that the last one shouldn't throw an exception. actually, regex matching in general shouldn't. :) 10:24
masak how do I do what I mean here? 10:28
rakudo: my $g = "g"; regex foo { <[a..$g]> ]; say "c" ~~ m/<foo>/
p6eval rakudo 35262: OUTPUT«␤»
moritz_ with eval()
masak oh. 10:29
that was the solution I finally arrived upon last night.
moritz_: have you seen an example of a PIR assertion? I'm a bit curious about how they work. 10:30
moritz_ masak: I think grammar.pg contains some
masak moritz_: I'll check it out. 10:31
moritz_ masak: for example in 'token ws'
masak ah, yes
moritz_ rakudo: regex recursive { '(' ~ ')' [ 'a'* <recursive>* ] }; say '(aa)' ~~ m/<recursive>/ 10:32
p6eval rakudo 35266: OUTPUT«Syntax error at line 1, near "}; say '(a"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
moritz_ rakudo: regex recursive { '(' ~ ')' [ 'a'*] }; say '(aa)' ~~ m/<recursive>/ 10:33
p6eval rakudo 35266: OUTPUT«Syntax error at line 1, near "}; say '(a"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
moritz_ rakudo: regex recursive { '(' ~ ')' 'a' }; say '(aa)' ~~ m/<recursive>/
p6eval rakudo 35266: OUTPUT«Unable to parse , couldn't find final ')'␤current instr.: 'parrot;PGE;Match;FAILGOAL' pc 2927 (compilers/pge/PGE/Regex.pir:456)␤»
moritz_ rakudo: regex recursive { '(' ~ ')' 'a'* }; say '(aa)' ~~ m/<recursive>/
p6eval rakudo 35266: OUTPUT«(aa)␤»
moritz_ rakudo: regex recursive { '(' ~ ')' ['a'*] }; say '(aa)' ~~ m/<recursive>/ 10:35
p6eval rakudo 35266: OUTPUT«Syntax error at line 1, near "}; say '(a"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
pugs_svn r24827 | pmurias++ | [mildew] the compile error context takes maximum 6 lines 10:56
pmurias ruoso: hi 11:20
ruoso hi pmurias 11:21
pmurias have you seen by hack which makes XXX display the thing that is unimplemented
? 11:23
ruoso I only saw the commit message while backlogging 11:24
pmurias ruoso: EXPORTALL exports things to the callers packages 11:26
at runtime
ruoso yes 11:27
it handles the known tags
pmurias so how do we make it export to the scope at compile time?
ruoso because EXPORTALL is run at compile-time
because use is still in a BEGIN 11:28
pmurias so it has an optional scope argument?
ruoso no, it should probably use CALLER or something
pmurias & 11:29
ruoso hmmm... last TimToady's change on STD broke item assignment in mildew 11:35
Matt-W doh
that's a little inconvenient
ruoso hmm... 11:36
actually it fixed ;)
mildew was wrong...
;)
pmurias++ # the unimplemented message is very much helpful 11:37
ruoso TimToady, there are still some things being parsed as List assignment where they are supposed to be item assignment 11:39
- $array.[1] = "something" 11:40
ruoso - $hash.{'foo'} = "something 11:40
- $a.b = $c 11:41
pmurias ruoso: how should EXPORTALL discover if it is run during compile time? 11:48
ruoso in fact... $a.b = $c needs to have its context delayed somehow, because sintatically, the context is undetermined 11:49
pmurias, why would it need to?
pmurias so it can export to a scope instead of a package?
avar C/w 13
ruoso pmurias, I presume it should be some $+VARIABLE 11:50
ruoso or $*VARIABLE 11:51
pmurias ruoso: btw. is there anything you want me to work on?
ruoso well, if you have some spare time, you could take the named arguments
I need to focus on other projects today 11:52
there's the ROADMAP/signature-named.t test 11:53
pmurias ok 11:54
pugs_svn r24828 | ruoso++ | [mildew] implement Item assignment... List assignment is currently incorrect in mildew, but STD is misparsing a lot of things as List_assignment where they are not.\ 11:55
pmurias ruoso: it might make sense if EXPORTALL received a target argument, as one might want to import thing into somewhere else 12:04
like when implementing a policy module 12:05
ruoso pmurias, there's something in the spec about ir 12:06
pmurias ir = ? 12:13
ruoso s/ir/it/ 12:24
I'll throw out an idea here, just because it's been hammering my head for some time, but I couldn't actually structure it, and maybe someone makes it usefull... Somehow I think the grammar engine could benefit a lot from treating the string as an iterator and using continuations for each "branch" in the parsing... It also occured to me that this iterator could store cache information saying "the token foo failed at this position", or "the token bar suceeded
a t this position and here's a match object"... but as I said, it's just something that I've been thinking for a while without much development...
moritz_ ruoso: I think it's already planned (or even implemented in Cursor.pm) that way 12:27
or at least that's what metholate tried to do, with the continuations in gather/take blocks
pmurias STD.pmc uses Cursor objects 12:28
pugs_svn r24829 | moritz++ | [t/spec] more tests for ~ in regexes 12:29
ruoso moritz_, but does Cursor decides which continuation to execute at which moment? that would be the center of the idea, including for LTM 12:31
moritz_ ruoso: I don't know, I'm not that familiar with STD & co 12:32
ruoso ok... well.. the idea is there for someone who, unlike me, knows what he's talking about ;)
could someone give me access to the machine that runs the pugs-commit mail (or do the change in the hook without giving me access, which would be better ;)? 12:36
pugs_svn r24830 | moritz++ | [t/spec] tests for ~ in regexes with mutually recursive rules 12:39
moritz_ ruoso: see feather.perl6.nl/ - contact Juerd 12:40
pmurias STD.pmc uses Cursor objects 12:51
sorry
pmichaud perl6: sub foo(@a) { say @a.elems; }; foo([1,2,3]); 12:56
p6eval elf 24830, pugs, rakudo 35296: OUTPUT«3␤»
pmichaud perl6: sub foo(@a) { say @a.elems; }; foo(([1,2,3]));
p6eval elf 24830, pugs, rakudo 35296: OUTPUT«3␤»
pmichaud perl6: sub foo(@a) { say @a.elems; }; foo(([1,2,3],));
p6eval pugs, rakudo 35296: OUTPUT«1␤» 12:57
..elf 24830: OUTPUT«3␤»
moritz_ is the first one correct? 12:58
pmichaud I'm thinking perhaps no.
rakudo gives a different answer in rvar.
(rakudo thinks the answer is 1)
moritz_ I can explain the current answer by assuming that [1, 2, 3] is bound to @a, not assigned
pmichaud yes, I was thinking that also. It just feels funny. 12:59
moritz_ but given that foo(1, 2, 3) certainly should give 3, it seems more logical to return 1 on foo([1, 2, 3])
perl6: sub foo(@a) { say @a.elems; }; foo(1, 2, 3)
p6eval elf 24830: OUTPUT«Can't call method "elems" without a package or object reference at (eval 121) line 4.␤ at ./elf_f line 3861␤»
..rakudo 35296: OUTPUT«too many arguments passed (3) - 1 params expected␤current instr.: 'foo' pc 86 (EVAL_14:50)␤»
..pugs: OUTPUT«*** No compatible multi variant found: "&foo"␤ at /tmp/giWgSoIR4T line 1, column 32 - line 2, column 1␤»
pmurias ruoso: if you want the named parameter extraction to be done by STD does it make much sense for me to implement named parameters in mildew now?
pmichaud no, foo(1,2,3) wouldn't match.
(3 args instead of 1) 13:00
moritz_ right
perl6: sub foo(@a) { say @a.elems; }; foo((1, 2, 3))
p6eval pugs, rakudo 35296: OUTPUT«3␤»
..elf 24830: OUTPUT«Can't call method "elems" without a package or object reference at (eval 121) line 4.␤ at ./elf_f line 3861␤»
pmichaud (I'm guessing rebuild.)
okay, there.
moritz_ perl6: sub foo(@a) { say @a.elems; }; foo(<1 2 3>)
p6eval elf 24830, pugs, rakudo 35296: OUTPUT«3␤»
masak all three agree! :) 13:01
ruoso pmurias, I think STD won't really be changed...
moritz_ masak: what a crazy randomhappenstance
masak moritz_: it's a cause for celebration! 13:02
pmichaud so, what's the right answer on the array passage? 13:05
1 element, or 3? ;-)
moritz_ "yes" *duck*
masak :) 13:06
moritz_ I just don't know
pmichaud oh, of course. it's any(1,3) :-)
masak Perl 6 is full of these mysteries.
moritz_ I think I've wrote tests for this 13:07
t/spec/S06-signature/passing-arrays.t
pmichaud rakudo currently passes those. 13:08
moritz_ sub count(@a) {
my $x = 0;
$x++ for @a;
return $x;
}
ruoso pmichaud, moritz_, foo(<1 2 3>) is one argument only
pmichaud what it had trouble with was integration/*31-49*
moritz_ is count([1, 2, 3, 4]), 1, 'count([1, 2, 3, 4])';
pmichaud ruoso: I know that -- no question there.
ruoso where's the question then?
pmichaud all of them are one argument.
moritz_ ruoso: what @a.elems should return
ruoso 3 13:09
pmichaud the question is whether foo([1,2,3]) leaves @a with a single element or with three.
ruoso [1,2,3] will leave a with 1 argumetn
moritz_ ok
ruoso s/argument/element/
for the same reason
my @a = [1,2,3]; say @a.elems also returns 1
masak seems reasonable.
ruoso perl6: my @a = [1,2,3]; say @a.elems
moritz_ that's consistent with the first test in passing-arrays.t
p6eval pugs, rakudo 35296: OUTPUT«1␤»
..elf 24830: OUTPUT«3␤»
moritz_ perl6: my @a := [1,2,3]; say @a.elems 13:10
p6eval pugs: OUTPUT«1␤»
..elf 24830: OUTPUT«syntax error at (eval 117) line 3, at EOF␤ at ./elf_f line 3861␤»
..rakudo 35296: OUTPUT«3␤»
pmichaud snickers.
moritz_ that's where we start to differ
ruoso that should be 3
pmichaud anyway, if the answer to @a.elems is 1 for the foo([1,2,3]) case, I'm very happy with that.
ruoso because you're binding... and binding means that @a will *be* the array [1,2,3] 13:11
moritz_ pmichaud: does it cause spec test (not integration) failures?
pmichaud moritz_: no, spectests are almost all working now in rvar branch.
it's just the integration tests that are left.
moritz_ the 99problems*.t aren't reviewed that thoroughly; I just looked at those that didn't work in rakudo
pmichaud (a couple of unrelated spectest failures)
ruoso the binding of a value inside a signature is different from plain binding
moritz_ maybe some need @(...) around some arguments 13:12
ruoso or (|[1,2,3]) if you really want
because using @(...) will force list context before the binding 13:13
and using (|[1,2,3]) will defer the context to the signature binding
moritz_ perl6: sub foo(@a) { say @a.elems; }; foo(|[1, 2, 3]) # I expect the worst... 13:14
p6eval elf 24830: OUTPUT«Undefined subroutine &GLOBAL::prefix__124 called at (eval 123) line 5.␤ at ./elf_f line 3861␤»
..pugs: OUTPUT«*** No compatible multi variant found: "&foo"␤ at /tmp/rXO8tCn0VK line 1, column 32 - line 2, column 1␤»
..rakudo 35296: OUTPUT«too many arguments passed (3) - 1 params expected␤current instr.: 'foo' pc 108 (EVAL_14:52)␤»
ruoso moritz_, notice that you need an extra () to make it one positional argument
otherwise you're saying that you want to expand it as the capture
moritz_ perl6: sub foo(@a) { say @a.elems; }; foo((|[1, 2, 3])) # I expect the worst...
p6eval rakudo 35296: OUTPUT«3␤»
..elf 24830: OUTPUT«Undefined subroutine &GLOBAL::prefix__124 called at (eval 123) line 5.␤ at ./elf_f line 3861␤»
..pugs: OUTPUT«*** No compatible multi variant found: "&foo"␤ at /tmp/ccXOJjtYpM line 1, column 32 - line 2, column 1␤»
ruoso rakudo++
moritz_ rakudo++ 13:15
indeed
pmichaud: I'll be gone over the weekend, but I can clean up passing TODO tests when I return on Sunday
(I just was reluctant to do it with the subst.t ones, because we should get spec clarification first) 13:16
ruoso and now STD also accepts \$foo in the signature to delay the context even more
so you can say foo(bar(baz())) where bar delays the context of the return of baz to the signature of foo 13:20
(ok, that could be done with the slurpy capture...)
but foo(bar(baz(),1,2,3)) 13:21
moritz_ it took me three attempts and to parse and understand that sentence ;)
s/and//
rakudo_svn r35300 | moritz++ | [rakudo] add test for ~ in regexes to spectest.data 14:00
pugs_svn r24831 | jnthn++ | [t/spec] Correct test count. 14:23
moritz_ jnthn: did you count them? now that test fails in trunk 14:25
jnthn moritz_: Yeah, I did.
I could see 24 tests. 14:26
moritz_: Plus running it at the command line here gives output up to a test 24 14:27
moritz_ but why does it run only 21 in trunk? /me *confused*
jnthn moritz_: I ponder if the line start my $eval1 = '{
And the 3 tests in there 14:28
Didn't get run
moritz_ ah
jnthn But we never made sure that this eval succeeded
ok eval('!try { my Num::Even $d }'), "lexically declared subtype went out of scope";
And that one then probably passed for the wrong reason.
moritz_ ok, I commited a hack that works for now 14:30
pugs_svn r24832 | moritz++ | [t/spec] hack subtypes.t to get right plan even if an eval() failed
moritz_ which isn't very good at all 14:31
but at least the plan is right in both cases
pugs_svn r24833 | jnthn++ | [t/spec] Remove some Win32-specific logic on a test that saw us flunk it on Win32, when in fact it works fine on Rakudo on Win32. 15:07
rakudo_svn r35307 | pmichaud++ | [rakudo]: spectest-progress.csv update: 279 files, 6172 passing, 0 failing 15:20
pugs_svn r24834 | pmichaud++ | [t/spec]: #?rakudo skip a test in 99problems-51-to-60.t 15:22
pugs_svn r24835 | pmichaud++ | [t/spec]: #?rakudo skip some tests that may be incorrect. 15:49
rakudo_svn r35311 | pmichaud++ | [rakudo]: Merge rvar2 branch to trunk. 16:00
r35311 | pmichaud++ | This is a major refactor of variable and parameter handling in Rakudo.
r35311 | pmichaud++ | jonathan++, particle++, and others for assistance with the branch.
rakudo_svn r35312 | infinoid++ | [cage] More trailing whitespace fixes. 16:20
pugs_svn r24836 | pmichaud++ | [rakudo]: Unfudge passing todo in assign.t.
r24837 | pmichaud++ | [t/spec]: unfudge passing rakudo test in main.t. 16:22
pugs_svn r24838 | pmichaud++ | [t/spec]: Unfudge passing todo in passing-arrays.t . 16:32
pugs_svn r24839 | pmichaud++ | [t/spec]: Unfudge passing todo test in instance.t (RT #61100) 16:37
r24840 | pmichaud++ | [t/spec]: Unfudge passing rakudo todo test from 99problems-01-to-10.t 16:38
pugs_svn r24841 | pmichaud++ | [t/spec]: Unfudge passing rakudo todo test from lexicals-and-attributes.t 16:39
r24842 | pmurias++ | [mildew] 16:43
r24842 | pmurias++ | mildew .so objects receive a back continuation
r24842 | pmurias++ | added a --valgrind option
r24842 | pmurias++ | the things the compiler hasn't implemented yet are highlighted with about 6 lines of context
pmichaud perl6: sub foo(@a) { say @a.WHAT; }; foo(1); 16:44
p6eval rakudo 35312: OUTPUT«Array␤» 16:45
..pugs: OUTPUT«Array::Const␤»
..elf 24841: OUTPUT«Int␤»
cspencer do multi methods dispatch based only on the parameter signatures, or will they also be eventually able to do so based on return types?
PerlJam cspencer: the latter 16:46
pmichaud S06-signature/passing-arrays.t:30 claims that the above should die.
cspencer thanks :)
pmurias but it's specced to be post 6.0.0
cspencer ah ok
pmichaud okay, time to close some tickets! 16:50
TimToady @a should have 3 elements 16:51
lambdabot Maybe you meant: activity activity-full admin all-dicts arr ask . ? @ v
TimToady ruoso: those are specced to be list assignments
pmichaud TimToady: you mean in my sub foo(@a) { say @a.elems; }; foo([1,2,3]); example? 16:52
TimToady yes 16:53
pmichaud ouch.
TimToady always been that way
wolverian /aw
TimToady the only reason foo((1,2,3)) works the same is by promotion of list in item context to Array
pmichaud oh, I understand that part. 16:54
I'm wondering how to distinguish foo([1,2,3]) from other uses of [1,2,3] in a list.
TimToady such as? 16:55
pmichaud foo(([1,2,3], 4)); # 2
TimToady that's a list of 2 elements
pmichaud right now rakudo has circumfix:<[ ]> returning a scalar reference to an array
so that it won't flatten in list context
as in this case: 16:56
my $a = [1,2,3]; foo($a);
TimToady yes, that seems fine
that should also say 3
pmichaud last question, then: how about foo(1)? 16:57
it autopromotes the 1 into an Array?
TimToady depends on what we decide about @a := 1
but I'd say that 1 probably doesn't provide a Positional role
so the binding fails
pmichaud okay, that answers another question I had, then :-) 16:58
TimToady and 1.[0] only works because we force the 1 to promote to something positional 16:59
not because 1 is intrinsically positional 17:00
PerlJam TimToady: Just to see what I hope is the obvious answer, would a "string" provide a Positional role?
pmichaud okay, that changes the answer I thought I had. :-)
TimToady there's no such thing as a "string" in Perl 6 :)
Str does not provide Positional, while Buf does
(as currently specced) 17:01
PerlJam makes sense to me.
pmichaud so, to recap
with sub foo(@a) { say @a.elems; } 17:02
TimToady Strs are unitary like numbers, so "foo".[0] returns "foo"
any top-level commas contribute to the Capture, not to the first arg
pmichaud foo(1) # error, 1 ~~ Positional fails 17:03
foo((1,2,3)) # outputs 3
foo([1,2,3]) # outputs 3
my $a = (1,2,3); foo($a); # outputs 3 17:04
TimToady and foo(1,2,3) fails
pmichaud and yes, foo(1,2,3) fails # too many params
okay, I can make that work.
TimToady foo([1,2,3],) should probably produce 3 too 17:05
since the top , is a Capture comma, not a List comma
but we've never said anything about extra commas in Captures...
seems like they should be allowed though 17:06
interesting that that overloading of comma goes all the way back to C 17:07
pmichaud another case
TimToady arglist comma is not operator comma
pmichaud oh, never mind.
I figured it out :-) 17:08
TimToady :D
PerlJam foo((1,2,3)) is weird though. It wants to chunk in my head as "foo (( 1,2,3 ))" which makes me want to write it that way (mildly) 17:10
pmichaud then write it as foo([1,2,3]) :-)
TimToady or as foo (1,2,3)
PerlJam TimToady: but would foo ((1,2,3)) have any adverse effects? It seems like something you'd want a warning for "Hey, this is better written as ..." 17:11
pmichaud I think that actually works out the same in this case :-) 17:12
it's eqivalent to foo [(1,2,3)]
pdcawley has recently had his head warped by Smalltalk, where comma is just another binary method so 'foo , bar' sends the message ', bar' to foo...
pmichaud *equivalent
pmichaud okay, here's another set 17:16
sub foo(%h) { ... }; foo( (a => b) );
binding error? 17:17
TimToady I think a Pair is Associative 17:19
pmichaud okay.
so (a => 'b')<a> gives 'b' 17:20
TimToady yes
and .keys differs from .key only in that it gives a list instead of an item
ruoso TimToady, I don't get it... why is "$a.[1] = 'bar'" a list assignment 17:26
?
TimToady because it's not a simple scalar *syntactically*. it has a postfix 17:27
ruoso but it's not a list also
it might be undetermined
TimToady we discovered in years past that this is a rathole :)
which is why the rule is now simple 17:28
PerlJam simplicity++
TimToady course, it's not entirely a free lunch 17:29
you still have to decide how to treat $x[1] vs $x[1,2] at run time 17:30
so $x[1] = 1,2,3 turns 1,2,3 into [1,2,3] 17:31
but $x[1,2] = 1,2,3 produces a warning about the discarded element
pmurias TimToady: is there anything i could do to make STD faster? 17:32
TimToady well, there are several possibilities for speedups 17:33
a real DFA matcher, for one
pulling out the prelude defs 17:34
but that implies a mechanism for dumping current lexpads and for starting current compile in preexisting lexical scope for prelude
having a real lazy list implementation in Perl 5 would help 17:35
having recursive regex in P5 with real closures would help :) 17:36
another thing that will speed up derived languages is not deriving all the data structures from scratch each time whenever you see a macro 17:37
there's obviously a lot of commonality between related languages that is not adequately shared 17:38
the token/fate longest token generation is currently done by patching together strings, which could be a more efficient data structure 17:39
TimToady but according to NYTProf, the using a trie matcher instead of a dfa matcher is probably what hurts the most right now 17:40
so I don't know if the answer is "yes" or "no" :) 17:41
I didn't want to tackle some of these things before gimme5 was rewritten as viv 17:42
which stalled out
ruoso TimToady, so every list assignment actually means "unknown context" 17:45
TimToady it's also possible we could speed up things by changing the parsing rules for metaoperators so as not to inflict all the variants on the LTM, but I'd rather avoid that if we can make LTM work for large token sets
yes, that was the price for not analyzing subscripts for itemicity, which led to madness 17:46
pmurias TimToady: i seem to have lost the link to the tdfa paper, could you find it again? 17:47
TimToady but this is reall only a problem for assignment, not binding
ruoso so, let's just rename it to "unknown assignment" :)
although... my @a = something has a more determined context
TimToady pmurias: um, I don't think tdfa is what we want. when I ripped out TRE it sped up twice as fast. :) 17:48
TimToady the TRE algorithm was allocating 19MB on the stack for every match! 17:50
something more like the dynamically generated state sets in egrep is what we need 17:51
where we cache the first N of those in a trielike fashion
but don't build out a full trie for \w* and such
pmurias would using a normal DFA to find the longest token and then rematching with a NFA to find which parts of the string matched what work? 17:55
TimToady well, "first N" is misleading. we should cache common words in the trie, and branch out at varying quantifies of N
*quantities
we already rematch in the recursive descent 17:56
the DFA merely has to produce the correct fate
the egrep algorithm, unfortunately, loses info on which alternative you took 17:57
bbl & 18:00
avar Is that inherent in the algorithm or just a case of egrep not keeping around that data? 18:03
ruoso wonders how to detect the context at which the assignment is made 18:04
ruoso later &
rakudo_svn r35314 | jonathan++ | [rakudo] Get rid of !TYPECHECKPARAM, and make the one thing use it just do the check itself (will go away once we get Perl 6 prelude). 18:10
azawawi std: if($n > 1) {} 18:12
p6eval std 24842: OUTPUT«############# PARSE FAILED #############␤Syntax error at /tmp/BDxNV7RkE4 line 1:␤------> if($n > 1) {}␤ expecting any of:␤ infix or meta-infix␤ infix stopper␤ standard stopper␤ statement modifier loop␤ terminator␤00:05 86m␤»
azawawi std: if ($n > 1) {}
p6eval std 24842: OUTPUT«00:05 86m␤»
azawawi I think there is a problem with STD parsing here... 18:13
moritz_: ping 18:14
std: my $n = 1; if($n > 1) {} 18:16
p6eval std 24842: OUTPUT«############# PARSE FAILED #############␤Syntax error at /tmp/ENWMYrMyzC line 1:␤------> my $n = 1; if($n > 1) {}␤ expecting any of:␤ infix or meta-infix␤ infix stopper␤ standard stopper␤ statement modifier loop␤ terminator␤00:05 86m␤»
PerlJam azawawi: er, what's the problem? if() is not the same as if ()
azawawi perljam: if() is a function?
PerlJam looks like a duck, quacks like a duck ... it's a duck :) 18:17
azawawi rakudo: my $n = 5; if($n > 1) { ">5".say; } 18:18
p6eval rakudo 35314: OUTPUT«>5␤»
azawawi std: my $n = 5; if($n > 1) { ">5".say; }
p6eval std 24842: OUTPUT«############# PARSE FAILED #############␤Syntax error at /tmp/AnWn0nOndt line 1:␤------> my $n = 5; if($n > 1) { ">5".say; }␤ expecting any of:␤ infix or meta-infix␤ infix stopper␤ standard stopper␤ statement modifier loop␤ terminator␤00:05 87m␤» 18:18
azawawi perljam: it seems like a bug
rakudo_svn r35315 | jonathan++ | [rakudo] Rip out more unused code. 18:20
r35317 | jonathan++ | [rakudo] One more unused function I missed last time that we can now rip out.
TimToady azawawi: it is fundamental in p6 that foo() is always a function call, regardless of how the language might change around it 18:35
just as it is fundamental that postfixes never allow intermediate whitespace 18:36
we need a few absolutes to keep things flexible everywhere else 18:37
azawawi TimToady: so in p5 if($x > 1) becomes in p6 if $x > 1, right?
TimToady well, I never wrote it that way in p5 :) 18:38
but yes
azawawi so it seems rakudo assumes it is a p5 if... 18:39
rakudo: my $n = 5; if($n > 1) { "greater than 1".say; }
p6eval rakudo 35317: OUTPUT«greater than 1␤»
TimToady that should fail
you're calling the "interface" function or some such :) 18:40
azawawi oh well it is win win situation... it was either an STD or rakudo bug :)
actually i was trying the factorial example in rakudo and found out that STD in Padre does not like it.
TimToady: thx 18:41
TimToady p6 also requires whitespace before the block, so if($x){...} is doubly wrong, but parses
fortunately, there's probably not an if() function
std: if($x){return} 18:42
cspencer will the "is instead" trait apply to classes as well as subroutines?
p6eval std 24842: OUTPUT«Unknown routines:␤ if called at 1 ␤00:05 86m␤»
cspencer ie) if i wanted to replace a previously declared class, i'd use: class Foo is instead { ... }
TimToady it was originally targetted at classes :) 18:43
cspencer ah ok
TimToady but then generalized
cspencer i'd seen it in the subroutine section of S06 and was wondering :)
TimToady there's a sense in which "multi" means "is also"
so I wonder what a multi class is :) 18:44
cspencer heh :)
TimToady maybe it's just a class that is documented as being extensible 18:45
so class is also is Officially Evil, which multi class is Officially Good :)
s/which/while/
azawawi rakudo: my $x = 0; if($x > 1) { say '>1' } else { say '<=1'; }
p6eval rakudo 35317: OUTPUT«<=1␤»
cspencer are classes not extensible by default? 18:46
TimToady you get a warning without "is also"
cspencer ah ok
azawawi @tell moritz_ rakudo should fail on if($x > 1) {} like STD 18:47
TimToady and maybe a multi class cannot be closed by the optimizer
lambdabot Consider it noted.
PerlJam azawawi: do you have a pugs commit bit?
azawawi perljam: yup 18:48
PerlJam azawawi: submit a test for it (if there isn't one already)
azawawi perljam: right away, Sir :) 18:49
[particle] faster! 18:55
azawawi found the related doc perlcabal.org/syn/S04.html#line_1210
lol
rakudo_svn r35318 | jonathan++ | [rakudo] Start getting the type registry stuff in place. This patch adds (currently stub) add_type and is_type method on Perl6::Grammar and inserts calls to them, following the STD.pm approach. No functional changes. 19:10
pugs_svn r24843 | azawawi++ | [t/spec] Added test for required whitespace after a built-in statement (if,for,while). 19:36
pugs_svn r24844 | particle++ | [S19] a little copy-editing 20:57
r24845 | Util++ | [t/spec] Typo - s/ precendence / precedence / 21:03
r24846 | particle++ | [S19] describe how to avoid ambiguity when nesting delimited options 21:05
pmichaud TimToady: I know I've asked this before, but I'm a bit confused again 21:11
if we have (1, 2, 3, @a) then @a flattens into the list
pmichaud if we have (1, 2, 3, [4]) then the [4] doesn't flatten into the list 21:11
presumably @a and [4] are both of type Array, so what distinguishes them?
TimToady I suspect [4] is more like \@a 21:13
or Scalar of Array maybe
pmichaud okay, that's what rakudo does now.
pugs_svn r24847 | particle++ | [S19] add notes for further design review
pmichaud basically \@a
so if we have sub foo(@x) { ... } and then call foo([4]) 21:14
@x gets bound to the Scalar of Array ?
lambdabot Maybe you meant: . ? @ v
pmichaud or we figure out that it's a scalar and de-scalarize it, or ...?
(because it's a Scalar that references a Positional)
TimToady not sure what the best way to think of it is, except that Scalar loves to hide itself from method calls 21:15
bit distracted--in a meeting (again)
pmichaud okay
you gave me enough clues to go in the right direction, I think. At least for a couple of hours.
diakopter bit distracted by irc, or bit distracted by the meeting? 21:17
TimToady the two are not mutually exclusive :)
pugs_svn r24848 | particle++ | [S19] a note on assumptions 21:18
PerlJam TimToady: Quick! Say something profound and insightful that totally derails the meeting. :) 21:22
TimToady pmurias: when I said DFA above, I really meant parallel NFA 21:36
bad habit of mine to confuse NFA with backtracking...
masak rakudo: my Any $x .= new; say $x.values 22:13
p6eval rakudo 35320: OUTPUT«Method '!flatten' not found for invocant of class 'Any'␤current instr.: 'parrot;Any;values' pc 10962 (src/builtins/any-list.pir:642)␤»
masak don't ask me how I find these.
masak submits rakudobug
TimToady rakudo: say Any.values 22:17
p6eval rakudo 35321: OUTPUT«Any␤»
TimToady rakudo: say Any.new.values 22:20
p6eval rakudo 35321: OUTPUT«Method '!flatten' not found for invocant of class 'Any'␤current instr.: 'parrot;Any;values' pc 10962 (src/builtins/any-list.pir:642)␤»
masak mberends: I am in your Pod::Parser, reviewing your code. 22:33
mberends hi, and thanks. did you pull today from github, I posted some updates 22:34
masak aye, just pulled.
mberends first, tell me if the acknowledgements are they way you suggested 22:35
masak when you write `if + @!podblocks > 0`, are you aware that `if @!podblocks` does the same thing?
mberends: I'll look.
mberends thanks, slimming is always good. that + was needed somewhere and became cargo 22:36
masak mberends: that works, I think. the November project is only 'lea' by the two of us un the sense that we were first, not in the sense that we call the shots.
mberends: it's more about using Perl's punning to your advantage than about slimming :)
masak overall, I like the compact style of your code. 22:37
mberends re November, if the other members have another view, let me know
masak I didn't think I would, but I do.
ok.
masak s/lea/lead/ 22:38
mberends I went off K&R formatting and Perl Tidy a while back. perlcritic also drove me nuts. 22:38
masak hm, you're inconsistent in where you put the opening method brace :) 22:39
mberends the idea of compact layout is to reduce eye movement and scrolling. consistency is not everything, when it becomes rigidity. 22:40
TimToady I'm consistently inconsistent
TimToady same line if it all fits on a line, and left margin otherwise 22:40
mberends indeed
TimToady well, lined up with keyword, not left margin
masak that does not seem to be the rule here, however. 22:41
here it's just sometimes same line, sometimes lined up
anyway, I'm not complaining, just pointing it out.
mberends I'm currently doing pod2xhtml and the pretty printing is not convenient, so I've bent the rules there too.
masak it's a truly impressive chunk of code. 22:42
mberends thanks, it's still evolving, there is a warning about refactoring 22:43
masak yup, saw that.
masak mberends: shouldn't you be doing that in a branch? :) 22:44
rakudo: my @a = 1,2,3,4; say @a[*-1]
p6eval rakudo 35321: OUTPUT«4␤»
masak also, what's keeping you from using [*-1] ?
mberends class A { has @!arr; method m { @!a[*-1] yada yada dies 22:45
masak oh.
should have guessed.
mberends moritz asked yesterday
masak rakudo: class A { has @!arr; ,method m { @!arr[*-1] } }; A.new.m 22:46
p6eval rakudo 35321: OUTPUT«Unable to parse block; couldn't find final '}' at line 1, near ",method m "␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
masak rakudo: class A { has @!arr; method m { @!arr[*-1] } }; A.new.m
p6eval rakudo 35321: OUTPUT«Null PMC access in find_method()␤current instr.: 'parrot;A;_block31' pc 248 (EVAL_17:106)␤»
mberends give it some data first
masak is there a ticket for this?
mberends dunno
masak rakudo: class A { has @!arr = 1,2,3; method m { @!arr[*-1] } }; A.new.m
p6eval rakudo 35321: OUTPUT«Null PMC access in find_method()␤current instr.: 'parrot;A;_block35' pc 292 (EVAL_17:114)␤»
masak strange error.
mberends you're much better at rakudobugs than I am 22:47
masak mberends: yes, but I've deluged RT with tickets lately, so I can't find needles in haystacks anymore :/
it takes some time, anyway. 22:48
mberends did you see I submitted RT#62036?
masak um, RT is slow. 22:49
mberends you may have to patch your paths, but please read and run 'make test' 22:51
masak hokay.
mberends you'll understand why I was into backtick qx() etc a few weeks back 22:52
masak I see an R#62030 submitted by you, but not an RT#62036.
mberends sorry, 62030, yes
masak grumbles 22:53
hm, yes, I remember seeing that ticket. 22:54
mberends: the instructions in your Makefile contain the line 'make spectest_regression'. that is now spelled 'make spectest'. 22:56
mberends consider it noted
masak oh, I CAN HAZ PERL6LIB? I didn't know that! 22:57
we should move some modules downstairs from p6w/, then. 22:58
mberends essential for every module developer
masak well, apparently not. :/ 22:59
make WORKSFORME. 23:02
mberends excellent. that's prove and Test::Harness in Perl 6 as well, none of this legacy nineties stuff 23:03
masak sir, you rock. 23:04
currently trying to get 'make test' to work.
needs some path tweaking, because I don't store parrot where you do.
mberends /home/me/parrot and /home/me/perl6-examples here 23:05
masak yup. not here.
guess I could just symlink for the time being.
that worked. 23:06
mberends it was a big kick to get unit tests going. In fact my dev work was thrashing without it.
masak now getting thousands of "use of uninitialized value" warnings. 23:07
mberends I'll need to sync up my parrot to feel your pain
masak not sure you will feel it yet. 23:08
might be here-specific.
masak I still get "Unable to open filehandle" here. 23:08
mberends probably directory related 23:08
masak aye, probably. 23:09
mberends insert $*ERR.say: "$stuff" for diagnostics
masak mberends: should a `prove` without arguments really do nothing? the Perl 5 variety doesn't. 23:10
mberends without arguments is wrong. maybe force in "t/*.t" 23:11
masak I know it's wrong. I just tried it.
...to see what happened, I mean. 23:12
IMO, an argumentless `prove` should recurse from the current directory, or something.
mberends I think it's a directory problem. by glob() is a bit ugly, you may workaround with an absolute pathspec. 23:13
s/by/my/
masak which line are we talking about?
pugs_svn r24849 | Util++ | [docs] Typo - s/hueristic/heuristic/ in docs/Perl6/Makefile.PL 23:14
mberends i guess prove --recurse t is drawing a blank. maybe call file_or_dir( '/home/masak/yada/t' ) 23:16
masak mberends: I don't think that is the problem. it's more along the lines of perl6 not finding ../Test.pir 23:17
masak um, perhaps not. I'll try what you suggested. 23:18
hercynium I'm playing with rakudo, and wonder if anyone can tell me what's wrong with this code:
rakudo: sub f() { my @y = <1 2 3>; my @z = <a b c>; return (\@y,\@z) }; my (@a, @b) := f(); say @a; say @b;
masak mberends: so, which line are we talking about?
p6eval rakudo 35321: OUTPUT«rtype not set␤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:102)␤»
masak hercynium: 'return' currently does not take more than one argument. 23:19
hercynium hmmm.... but it will someday, right?
masak hercynium: yes.
hercynium: for now, consider passing an array instead.
as in `return [[@y], [@z]]`. 23:20
hercynium yep... I was just scratching an itch for some syntax I dreamed up the other day and discovered is part of the spec :)
masak heh. :)
the spec and rakudo are slowly converging. 23:21
hercynium binding a ref to a var that has a sigil that shows what the ref points to is *very* nice
masak mberends: for line 11 in prove: &&= works. :) 23:23
mberends re: prove, there is a separate Makefile target for Test.pir, because I wanted the Test.pm always out of parrot, so there are other paths involved. r35321 segfaults but passes 16 tests out of 21
masak we should take Test.pm out of Parrot in November too. that's much better.
mberends: ok, I'm officially stuck. I don't know how to make those tests. 23:24
also, I'm thinking of sleep. 23:25
mberends fair enough. and tomorrow you format you hard drive and use my directory layout, ok? 23:26
masak meh
literal zoffix.com/new/GumbyBRAIN-perl-urn-engraving/
mberends meantime I'll try to specify PARROT_DIR and LIB_DIR separately. new Makefile tomorrow. 23:27
masak literal: I think that requires some explanation.
mberends: looking forward to it.
mberends thanks for being the guinea pig 23:28
masak np.
what goes around comes around. I assume you've tried to make November? :)
literal masak: GumbyBRAIN is an IRC bot, basically an interface to one of these: megahal.alioth.debian.org/ 23:29
masak literal: yes. 23:29
...and the perl6 connection?
literal it's just something he said
mberends I read the November source closely to get started with grammar, but didn't run it
masak aha.
pugs_svn r24850 | pmichaud++ | [t/spec]: Update split-simple.t to pass array arguments to list parameter. 23:30
masak mberends: looking forward to you trying :) at least 'make test'.
mberends goes around, comes around :) sure
masak sleeps
rakudo_svn r35323 | jonathan++ | [rakudo] Get an UnderConstructionProto class added, and create it. However, don't put it in the namespace just yet - that causes breakage. 23:40
cspencer rakudo: my @a = 1..4; for @a <-> $e { $e++ }; @a.join(' ').say 23:50
p6eval rakudo 35323: OUTPUT«2 3 4 5␤»
cspencer rakudo: my @a = 1..4; for @a <-> $e { $e *= 2 }; @a.join(' ').say 23:51
p6eval rakudo 35323: OUTPUT«Cannot assign to readonly variable.␤current instr.: 'die' pc 15387 (src/builtins/control.pir:204)␤»
cspencer shouldn't <-> make the $e variable rw? 23:52
perl6: my @a = 1..4; for @a <-> $e { $e++ }; @a.join(' ').say 23:58
p6eval rakudo 35323: OUTPUT«2 3 4 5␤»
..elf 24850: OUTPUT«Can't call method "flatten" without a package or object reference at (eval 119) line 4.␤ at ./elf_f line 3861␤»
..pugs: OUTPUT«*** ␤ Unexpected ">"␤ at /tmp/ClML5njBYA line 1, column 24␤»