Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-01-26

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:20 kid51 joined #perl6
00:31 spx2 joined #perl6
00:53 legis joined #perl6
00:56 mtnviewmark left #perl6
01:07 mtnviewmark joined #perl6
01:11 kanru joined #perl6
01:13 wknight8111 joined #perl6
01:16 jhuni rakudo: given 'asdf' { print; }
01:16 p6eval rakudo 36011: OUTPUT«print requires an argument at line 1, near "; }"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
01:16 jhuni pugs: given 'asdf' { print; }
01:16 p6eval pugs: RESULT«Bool::True»
01:17 jhuni pugs: given 'asdf' { print $_; }
01:17 p6eval pugs: OUTPUT«asdf»
01:17 jhuni ...
01:19 avar pugs: given 'asdf' { .print; }
01:19 p6eval pugs: OUTPUT«asdf»
01:20 avar jhuni: that's the perl6 way to do it
01:20 jhuni oh
01:20 jhuni sorry
01:21 avar Perl 6 accepts your apology
01:21 icwiener joined #perl6
01:21 jhuni thank you
01:21 avar :)
01:22 jhuni lol
01:42 alester joined #perl6
01:45 pugs_svn r25030 | putter++ | [elfparse] Continued adding STD.pm idiom support, and unpodding std.pm.
01:54 shinobi-cl joined #perl6
01:54 TimToady @tell mncharity I'm going to be checking in a change that may break emitters based on STD. A) list assoc defaults to right assoc on operator change (incl : vs ,) and B) arglists that allow semicolon use semiarglist wrapper now
01:54 lambdabot Consider it noted.
01:55 TimToady @tell pmurias I'm going to be checking in a change that may break emitters based on STD. A) list assoc defaults to right assoc on operator change (incl : vs ,) and B) arglists that allow semicolon use semiarglist wrapper now
01:55 lambdabot Consider it noted.
02:05 shinobi-cl joined #perl6
02:13 shinobi-cl perl6: given
02:13 p6eval pugs: OUTPUT«*** ␤    Unexpected end of input␤    expecting "=" or expression␤    at /tmp/PFWgiLwjBj line 2, column 1␤»
02:13 p6eval ..elf 25030: OUTPUT«Undefined subroutine &GLOBAL::given called at (eval 119) line 3.␤ at ./elf_h line 4333␤»
02:13 p6eval ..rakudo 36011: OUTPUT«Could not find non-existent sub given␤current instr.: '_block14' pc 53 (EVAL_16:38)␤»
02:19 Eevee joined #perl6
02:27 shinobi-cl joined #perl6
02:27 * kid51 nods at #perl6 and gives him a small kipper
02:28 Sepheebear joined #perl6
02:40 mtnviewmark joined #perl6
03:27 shinobi-cl left #perl6
03:51 shinobi-cl joined #perl6
04:06 pugs_svn r25031 | lwall++ | [STD, S03] more operator alignment and cleanup
04:16 rhr joined #perl6
04:17 ruoso joined #perl6
04:38 REPLeffect joined #perl6
04:40 shinobi-cl left #perl6
05:09 frew how do I find out the class of something in perl6?
05:13 frew Also, I did a svn up && make realclean && perl Configure.pl && perl Make.PL && make && cd lang/perl6 && make spectest and all of the tests still fail for me
05:13 frew saying no plan found in TAP output
05:13 [particle] joined #perl6
05:24 ruoso joined #perl6
05:26 masak joined #perl6
05:32 justatheory joined #perl6
05:44 meppl joined #perl6
06:00 |jedai| joined #perl6
06:24 DemoFreak joined #perl6
06:25 _jedai_ joined #perl6
06:30 Khisanth joined #perl6
06:33 mtnviewmark joined #perl6
06:34 kisu_ joined #perl6
06:37 ashizawa joined #perl6
06:53 frew I have this in a test file: sub l ($a) { my StrLen $l = StrLen.new($a); return $len };  and I get a huge error but it seems the salient part is Scope not found for PAST::Var '$len' in l.  What gives?
06:54 masak frew: do you declare $len?
06:55 masak anyway, you shouldn't get that error.
06:55 masak rakudo: sub l($a) { my StrLen $l = StrLen.new($a); return $len }; say l("OH HAI")
06:55 p6eval rakudo 36017: OUTPUT«Scope not found for PAST::Var '$l' in l␤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:102)␤»
06:56 masak curious error.
06:56 masak the $l is right there. :)
06:57 masak rakudo: my $a = "a"; say "a" ~~ /$a/
06:57 p6eval rakudo 36017: OUTPUT«Null PMC access in get_string()␤current instr.: 'parrot;PGE;Grammar;' pc 249 (EVAL_17:107)␤»
06:57 * masak submits rakudobug
06:58 masak rakudo: my $a = /a/; say "a" ~~ /$a/
06:58 p6eval rakudo 36017: OUTPUT«Null PMC access in get_string()␤current instr.: 'parrot;PGE;Grammar;' pc 394 (EVAL_17:165)␤»
07:05 |jedai| joined #perl6
07:12 araujo joined #perl6
07:12 masak don't we have tests for this? :/
07:13 moritz_ masak: say() is undertested, due to TAP's nature
07:13 masak moritz_: is the error in say()?
07:13 moritz_ dunno
07:13 masak I thought it was the variable interpolation in the regex.
07:14 masak moritz_: good morning, btw.
07:14 moritz_ did that ever work?
07:14 masak maybe not.
07:14 aindilis` joined #perl6
07:22 masak but why shouldn't it?
07:23 masak by which I mean, I keep wanting that functionality to be there. :)
07:23 moritz_ PGE limitation, I guess :/
07:23 masak oh, but pmichaud has a PGE safari pending, ISTR.
07:23 masak maybe it'll get fixed then.
07:24 masak buubot: spack StrLen
07:24 buubot masak: S02-bits.pod:4 S29-functions.pod:1
07:27 pugs_svn r25032 | lwall++ | [STD] improved error messages on prec errors, misplaced invocant colons
07:27 pugs_svn r25032 | lwall++ | [syntax.t] string can't end $s!"
07:31 araujo joined #perl6
07:53 pugs_svn r25033 | lwall++ | [STD] make stupid special case normal
07:54 Tene_ joined #perl6
08:01 pugs_svn r25034 | lwall++ | [binding-scalars.t] can't use 'and' to mean tighter than comma
08:02 iblechbot joined #perl6
08:05 _jedai_ joined #perl6
08:08 pbuetow joined #perl6
08:19 pugs_svn r25035 | masak++ | [u4x] fixed typo in README
08:20 pugs_svn r25036 | masak++ | [u4x] added TODO with an enumeration of everything to be documented
08:21 pugs_svn r25037 | masak++ | [u4x] added reference to TODO in README
08:25 pugs_svn r25038 | masak++ | [u4x] added a few cultural terms TODO items -- I'm sure there are more
08:27 |jedai| joined #perl6
08:34 pugs_svn r25039 | lwall++ | [STD] allow whitespace at end of semiarglist
08:42 ruoso joined #perl6
08:50 aindilis` joined #perl6
08:55 masak rakudo: my $a if 0; say $a
08:55 p6eval rakudo 36019: OUTPUT«Null PMC access in isa()␤current instr.: 'parrot;List;!flatten' pc 5804 (src/classes/List.pir:287)␤»
08:55 masak mwhahaha.
08:55 * masak submits rakudobug
08:58 Matt-W eep
08:58 masak Matt-W: :)
08:59 Matt-W although
08:59 Matt-W what should it do?
08:59 Matt-W undefined variable?
08:59 masak Matt-W: it should throw a compiler error, IMHO.
08:59 moritz_ no, it's fine
08:59 moritz_ my() has a compile-time effect
09:00 masak oh, ok.
09:00 moritz_ which is scoped to the block
09:00 moritz_ no block => the variable persists to the end of the current scope
09:00 masak so the 'if 0' is just a no-op.
09:00 moritz_ I think so, yes
09:00 Matt-W that's...
09:00 Matt-W weird
09:00 Matt-W attaching conditionals as statement modifiers to declarations is bound to make a mess, but I wouldn't expect them to be ignored
09:01 moritz_ std: my $x if 0;
09:01 p6eval std 25039: OUTPUT«00:05 83m␤»
09:02 masak rakudo: my $a = 5; my $a = $a + 1 for ^10; say $a;
09:02 p6eval rakudo 36019: OUTPUT«Redeclaration of variable $a␤»
09:03 schmalbe joined #perl6
09:03 masak what? no answer?
09:03 moritz_ sh: line 1:  3464 Bus error
09:03 masak on my box, I get the warning and 15.
09:03 moritz_ rakudo: my $a = $a + 1 for ^10; say $a;
09:04 p6eval rakudo 36019: OUTPUT«Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Lexical
09:04 p6eval ..'$...
09:04 masak haha
09:04 masak it's a bit inconsistent that 'my .. for' loops but 'my .. if 0' doesn't ignore.
09:05 masak rakudo: my $a = 42 for (); say $a
09:05 p6eval rakudo 36019: OUTPUT«Lexical '$a' not found␤current instr.: '_block14' pc 141 (EVAL_17:67)␤»
09:05 jhuni There is no elements so that block never happened
09:06 masak jhuni: what block?
09:06 Matt-W Following consequences here, if I were to say ".do_something() for @things;" would $_ be the last element of @things when the next line executed?
09:06 jhuni {my $a = 42}
09:06 moritz_ jhuni: the declaration should happen at compile-time, the 'my' statement doesn't have to "run"
09:06 moritz_ jhuni: and there's no implicit block around the my either
09:07 moritz_ (that's different from perl 5)
09:07 masak jhuni: if it really were a block, the $a wouldn't be visible outside.
09:07 masak the other examples show that it is.
09:11 Matt-W So I guess the conditional only really applies to any initialisation which might happen - the variable itself should get declared regardless
09:11 masak aye.
09:12 moritz_ Matt-W: that's my understanding, yes
09:12 Matt-W okay
09:17 ruoso joined #perl6
09:24 jferrero joined #perl6
09:30 aindilis` joined #perl6
10:00 ejs1 joined #perl6
10:02 legis_ joined #perl6
10:06 |jedai| joined #perl6
10:09 ejs1 joined #perl6
10:10 zamolxes joined #perl6
10:14 masak rakudo: role A { my $.a = 42 }; class B does A {}; say B.a
10:14 p6eval rakudo 36019: OUTPUT«Use of uninitialized value␤␤»
10:14 masak should that work?
10:15 moritz_ rakudo: role A { my $.a = 42 }; class B does A {}; say B.b
10:15 p6eval rakudo 36019: OUTPUT«Could not locate a method 'b' to invoke on class 'B'.␤current instr.: 'die' pc 16767 (src/builtins/control.pir:204)␤»
10:16 masak .b ?
10:17 moritz_ rakudo: role A { my $.a = 42; method b { $.a = 23 } }; class B does A {}; my $x = B.new; $x.b; say $x.a
10:17 p6eval rakudo 36019: OUTPUT«Cannot assign to readonly variable.␤current instr.: 'die' pc 16767 (src/builtins/control.pir:204)␤»
10:17 moritz_ rakudo: role A { my $.a = 42; method b { $!a = 23 } }; class B does A {}; my $x = B.new; $x.b; say $x.a
10:17 p6eval rakudo 36019: OUTPUT«No such attribute '$!a'␤current instr.: 'parrot;A[];b' pc 357 (EVAL_20:131)␤»
10:17 moritz_ rakudo: role A { my $.a = 42; method b { $a = 23 } }; class B does A {}; my $x = B.new; $x.b; say $x.a
10:17 p6eval rakudo 36019: OUTPUT«Scope not found for PAST::Var '$a' in b␤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:102)␤»
10:17 moritz_ so how should I set $.a?
10:17 masak don't ask me!
10:18 masak I just find silly examples, I don't have any answers...
10:26 literal moritz_: what do you use to highlight Perl 6 code in your blog posts?
10:27 moritz_ literal: Text::VimColor and perl6.vim
10:27 literal ok, cool
10:27 literal thought the highlighting looked familiar :P
10:31 literal I see you've made smart links stand out in the comments though
10:32 * moritz_ didn't do anything :-)
10:33 kanru joined #perl6
10:36 masak rakudo: say * ~~ 1
10:36 p6eval rakudo 36019: OUTPUT«Use of uninitialized value␤0␤»
10:36 masak whence the warning?
10:36 braceta joined #perl6
10:37 moritz_ * is undef
10:37 moritz_ and since the RHS is an Int, it uses == for comparison
10:37 masak ah.
10:37 * masak closes yet another RT ticket
10:37 moritz_ rakudo: say 1 ~~ *
10:37 p6eval rakudo 36019: OUTPUT«1␤»
10:40 literal moritz_: hm, really? I wonder why the smartlinks look different then
10:41 literal ah, I didn't notice that they were in a pod block
10:44 * moritz_ claims innocence on the whole charge
10:45 moritz_ but at least now I know that some people read my blog :-)
10:45 moritz_ (actually I wrote it in reply to a question per mail on how and why to move tests)
10:46 moritz_ rakudo: say 700/30
10:46 p6eval rakudo 36020: OUTPUT«23.3333333333333␤»
10:46 moritz_ I did some statistics about rakudo's progress since Mai 2008 (start of spectest-progress.csv)...
10:47 moritz_ and it made an average progress of 23 tests passing per day, or 700 per month
10:48 masak 23 tests per day doesn't sound too bad.
10:48 moritz_ no, it'll be hard to keep up the progress
10:49 moritz_ 2/3 of the test suite are migrated, and writing new tests is much more time-consuming than migrating
10:49 masak we need more test writers.
10:49 moritz_ aye
10:49 masak it's a fairly parallelizable task.
10:49 moritz_ but it also requires some fair Perl 6 knowledge
10:50 masak we need to educate people, then. :)
10:50 masak rakudo: ("bac" ~~ /a/).WHAT
10:50 p6eval rakudo 36020: RESULT«Match»
10:50 * masak closes yet another ticket
10:51 masak seems many tickets were fixed but not closed.
10:51 moritz_ aye
10:51 moritz_ pmichaud mentioned that in a recent design minutes thing
10:51 moritz_ my last pass over the RT revealed about 4 such tickets
10:51 moritz_ but it wasn't very thorough
10:52 masak I'm just picking things at random, testing them and closing them.
10:52 masak I think I've done 7 already.
10:52 moritz_ masak++
10:54 masak moritz_: did you see today's TODO file addition in u4x?
10:54 moritz_ masak: no
10:54 masak I basically combed STD.pm and wrote stuff down.
10:54 masak I'm sure there are obvious omissions.
10:55 masak feel free to add them if you see them.
10:55 masak planning what to do takes much less effort than actually doing it. :P
10:55 moritz_ :-)
10:55 moritz_ masak: have you reached any decision wrt markup format?
10:56 masak moritz_: Perl 6 Pod, I think.
10:56 masak using as much of its inherent capabilities as possible.
10:56 moritz_ masak: without any further additions? (like tags)
10:56 masak moritz_: still undecided.
10:56 masak I'll have to play around with it a bit first.
10:56 masak but I'm leaning towards as little of that as possible.
10:57 literal markup format for what?
10:57 Matt-W Perl 6 POD seems the way to go to me
10:57 masak literal: http://use.perl.org/~masak/journal/38279
10:57 Matt-W Just have to learn it...
10:58 masak Matt-W: lesson one: it's "Pod", not "POD" :)
10:58 Matt-W okay
10:58 masak (see S26.)
10:58 Matt-W I've not read S26 for a while
10:58 Matt-W Still at least 30% in Perl 5 land
10:59 spx2 joined #perl6
10:59 literal any news on when/if Damian submit his radical changes to S26?
11:00 masak not that I know of.
11:01 literal I really like Perl 6 Pod as it is, but I could see the usefulness of Python-like docstrings and such, which I think was one of the things he was going to add
11:01 masak that was the critique he got on his first draft, at least.
11:02 masak I'm content as long as tools can connect Pod with a class or a method.
11:02 Matt-W yes that would help
11:03 Matt-W Perl 5's wasn't very good for documenting code really
11:03 moritz_ Perl 5 subs/methods don't have signatures, so there was no point in including the declaration in the code
11:04 literal It was very good for user documentation, which I think is slightly more important. Reading javadoc and things like that which have all these code-hooks is horrible, the docs are like they were written for a machine.
11:05 Matt-W javadoc is great for API documentation
11:05 moritz_ and when I started to write Perl 6 class with documetation, and I found myself repeating the signature in the Pod, so I wrote a mail that started an whole avalanche of threds
11:05 literal where Perl 5 was lacking in that regard, you could just look at the code :P
11:05 Matt-W but you can't really use it for anythign else
11:05 moritz_ Matt-W: aye
11:06 Matt-W the ideal system would give you javadoc's API documenting capabilities (or better, preferably better) and also nice prose documentation for doing things like writing Programming Perl 6
11:06 literal it would be best if Perl could write most of the javadoc-like stuff for you, now that we have these nice sub/method signatures n' all
11:08 Matt-W well all we should need to provide are human-readable descriptions of what the routine is for and anything necessary about the parameters
11:08 Matt-W and side effects, return values etc.
11:09 ruoso joined #perl6
11:13 elmex joined #perl6
11:19 pugs_svn r25040 | hinrik++ | [util/perl6.vim] highlight two more functions
11:20 |jedai| joined #perl6
11:22 spx2 joined #perl6
12:07 masak moritz_: I'm planning to revisit that thread, but I don't really know what you envision. it would be interesting to see an example.
12:17 mncharity joined #perl6
12:20 mncharity TimToady: re "checking in a change that may break emitters", very no problem.  Don't ever want elf to interfere with STD work.
12:20 lambdabot mncharity: You have 1 new message. '/msg lambdabot @messages' to read it.
12:23 moritz_ masak: I don't envision something in particular. I just want to use my signatures in both code and Pod as easy as possible
12:25 masak moritz_: I'm just curious what you think would be an improvement over just listing your parameters.
12:25 masak mncharity: hello!
12:26 moritz_ masak: not duplicating anything (because duplication is the enemy of the programmer)
12:29 pugs_svn r25041 | putter++ | [STD.pm] When parsing $0 et al, capture the index.
12:29 mncharity masak: hi
12:31 masak moritz_: exactly. and how are you going to pull off that. how will you identify the parameters if you don't repeat their names.
12:31 mncharity TimToady: re $<index> , feel free to rename, punt, whatever.  It seemed likely to be a ~zero performance hit for gimme5, and made the elf node processing very slightly less ugly.
12:31 masak mncharity: how's elf doing these days?
12:32 mncharity slowly learning to parse/AST->IR/run STD.pm.
12:32 moritz_ masak: one approach would be something like =take :upto< { >\n method foo ($bar, :$baz) { ... }
12:32 moritz_ masak: that would tell the Pod parser to include everything up to the next { as Pod, and the compiler will still take it as code
12:33 masak moritz_: ah, I understand what you want to do now.
12:33 masak you simply want the param list in the code to be included in the Pod output.
12:33 moritz_ right.
12:34 masak you don't want to mention it explicitly in the Pod itself.
12:34 moritz_ same for attributes, since they generate public accessors
12:37 masak moritz_: I agree completely. S26 should mention this.
12:37 masak I don't think anything complicated is called for.
12:38 moritz_ Mark Overmeer seemed to think differently
12:38 masak just output the method signature/attribute in all its glory.
12:38 masak moritz_: ISTR, yes.
12:38 masak will re-read.
12:38 rindolf joined #perl6
12:45 masak did Kwid disappear entirely?
12:48 * moritz_ thinks so
12:49 masak pity.
12:56 aindilis` joined #perl6
12:59 AzureStone joined #perl6
13:00 pugs_svn r25042 | putter++ | [elfparse] Added <?{ }> and $0.  Now more tolerant of untagged AST nodes (for $<foo>=[]'s).  Not synced with current STD.pm.
13:00 mncharity g'day all &
13:15 masak moritz_: in the meantime, why not just use an appropriate symbol in Pod, akin to {*}, as a placeholder saying 'this is where I'd like the method signature to be'?
13:19 masak grassroots standardization. "we didn't have time to let the big guys settle on a format, so we made this in the meantime."
13:21 pmurias joined #perl6
13:21 pmurias ruoso: hi
13:21 lambdabot pmurias: You have 4 new messages. '/msg lambdabot @messages' to read them.
13:47 Matt-W * sigh * another person who thinks Perl 6.0.0 will postdate the heat death of the universe
13:55 masak Matt-W: some people think that. there's not much to do about that. except perhaps submitting bugs/patches/tests, writing scripts and generally thinking about Perl 6.
13:55 Matt-W yes
13:56 masak it doesn't help against complainers, but it does help in getting Perl 6 ready for Christmas.
13:56 Matt-W from where I sit, it looks like things are moving nicely towards that magical moment
13:57 Matt-W but I guess if people aren't paying attention it looks like nothing's happening
13:58 moritz_ I know I'm not the brightest optimist, but I don't think we'll see feature complete Perl 6 release this year.
13:58 moritz_ but I strongly believe that rakudo will be *very* useful *this* christmas
14:00 masak me too.
14:00 masak it's very useful today.
14:00 Matt-W oh I wouldn't say this year
14:00 Matt-W next year maybe, but this year would be very optimistic
14:00 Matt-W maybe if somebody donated ten million dollars to fund full-time developers
14:01 masak I'm not sure we'll have macros this year.
14:01 Matt-W (no I don't have ten million dollars lying around)
14:01 masak the other stuff... probably.
14:01 Matt-W macros are hard
14:01 masak let's go shopping!
14:05 Matt-W buy chocolate
14:05 moritz_ chocolate - good idea :-)
14:11 bacek joined #perl6
14:21 ruoso joined #perl6
14:37 Exodist joined #perl6
14:37 masak rakudo: ord(""); say "Alive"
14:37 p6eval rakudo 36030: OUTPUT«Cannot get character of empty string␤current instr.: 'parrot;Any;ord' pc 14758 (src/builtins/any-str.pir:1198)␤»
14:38 masak should Rakudo really die here?
14:38 * masak thinks not
14:39 moritz_ I think it should fail()
14:40 masak meaning what? that it should stop execution?
14:40 [particle] return a Failure
14:40 masak S29 doesn't mention this case AFAICS.
14:40 [particle] see what perl 5 does
14:40 masak good. we agree.
14:40 * masak submits rakudobug
14:41 [particle] you could submit a rakudopatch
14:41 [particle] it's not hard to fix this
14:41 masak [particle]: I believe you. however, I get more done this way.
14:52 pasteling "masak" at 130.238.45.242 pasted "I'm at a loss for how to trawl this Match object for information. Could someone help?" (15 lines, 533B) at http://sial.org/pbot/34713
14:55 moritz_ `say "b ", $<coords><col_letter>;
14:55 moritz_ masak: is there any hidden difficulty somewhere?
14:55 masak no :/
14:55 masak I just suck at this.
14:56 masak and I think I suffer from the lack of feedback from the Match object.
14:56 masak moritz_: anyway, your suggestion doesn't work in my code.
14:56 PerlJam Match objects still don't have .perl methods do they?
14:57 masak PerlJam: no. :/
14:57 masak they are like little puzzles of their own.
14:58 pasteling "moritz_" at 132.187.31.74 pasted "for masak: works for me" (13 lines, 307B) at http://sial.org/pbot/34714
14:59 moritz_ in the first case you create a match object belowe $<coords>, in the second case an array
14:59 PerlJam masak: you could implement .perl on Match   :-)
15:00 masak PerlJam: I 'should' do a lot of things.
15:00 masak moritz_: works for me too, but not in the sub where I need to use it.
15:00 * masak goes back to reason with Rakudo
15:01 moritz_ you can get rid of the $<coords> prefix with $/ := $<coords> (at least it worked last time I tried)
15:02 masak moritz_: would <.coords> in the original regex have the same effect?
15:02 masak oh, nvm.
15:02 moritz_ masak: no, that wouldn't capture it at all
15:02 masak that would just no register anything, would it?
15:02 masak right.
15:03 masak it's starting to work now. :)
15:04 masak and the code actually becomes more readable, compared to the substr calls that were there before.
15:04 masak (Perl 6 regexes)++
15:05 thei0s joined #perl6
15:10 masak huh. it works, but it's inexplicably slow and I introduced an off-by-one error somewhere.
15:10 masak me--
15:11 schmalbe joined #perl6
15:13 thei0s perl6: token AA { 'aa' }; say ( 'abaaba' ~~ AA ) ?? "match" !! "no match";
15:13 p6eval elf 25042: OUTPUT«Unknown rule: infix:conditional␤It needs to be added to ast_handlers.␤ at ./elf_h line 2036␤»
15:13 p6eval ..pugs: OUTPUT«*** No compatible multi variant found: "&AA"␤    at /tmp/YIQA7HDreH line 1, column 26-41␤»
15:13 p6eval ..rakudo 36031: OUTPUT«too few arguments passed (0) - 2 params expected␤current instr.: 'AA' pc 122 (EVAL_16:60)␤»
15:14 thei0s did the syntax for using grammars, rules and tokens change since rakudo 0.8.1?
15:14 masak thei0s: 'abaaba' ~~ /<AA>/, not AA
15:14 masak thei0s: yes, the syntax you used has been deprecated for a long time.
15:15 thei0s so, for grammars then: ~~ /<GRAMMARNAME::AA>/ ?
15:15 masak 'xactly.
15:15 thei0s 10x
15:15 masak yw.
15:16 moritz_ rakudo: grammar A { token TOP { ^ (a)(b) $ };}; my $m = A.parse('ab'); say $m.what; say $m.[1];
15:16 p6eval rakudo 36032: OUTPUT«Method 'what' not found for invocant of class 'A'␤current instr.: 'parrot;P6metaclass;dispatch' pc 287 (src/classes/ClassHOW.pir:145)␤»
15:16 moritz_ rakudo: grammar A { token TOP { ^ (a)(b) $ };}; my $m = A.parse('ab'); say $m.WHAT say $m.[1];
15:16 p6eval rakudo 36032: OUTPUT«Statement not terminated properly at line 1, near "say $m.[1]"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
15:16 moritz_ rakudo: grammar A { token TOP { ^ (a)(b) $ };}; my $m = A.parse('ab'); say $m.WHAT; say $m.[1];
15:16 p6eval rakudo 36032: OUTPUT«A␤b␤»
15:17 moritz_ so I can access the captures, but .WHAT says it's an A?
15:18 masak does '0 <= $row & $column < $size' DWIM?
15:19 finanalyst joined #perl6
15:19 moritz_ depends on WYM :-)
15:19 moritz_ it's a Junction
15:19 masak I want to check whether $row and $column are within bounds.
15:19 masak should I put a ?() around it, p'haps?
15:20 masak it's the expression in a statement-ending unless :)
15:20 moritz_ why not just use && ?
15:21 masak moritz_: that was my first thought.
15:21 masak I'll do that.
15:21 masak just got curious whether this also works.
15:21 moritz_ but unless() provides boolean context, so it should also work with a junction
15:21 masak aye.
15:21 masak gotta go.
15:22 finanalyst joined #perl6
15:26 thei0s is there a way to dump a Match object? in rakudo 0.8.1 $/.perl did the trick, but now it's not defined anymore (Method 'perl' not found for invocant of class 'Match')
15:26 thei0s (I mean for debugging purposes)
15:26 moritz_ thei0s: no way atm :(
15:27 moritz_ patches very welcome
15:29 thei0s porting the old buggy Match .perl method from 0.8.1 wouldn't be a good patch, would it? :)
15:31 spx2 joined #perl6
15:32 thei0s anyway... a sub in perl6 for printing only lists and hashes shouldn't be a problem and would allow debugging of Match objects... hm, lets write it
15:35 finanalyst moritz_ on tests. from your sun blog, do i take it that reviewed tests are deleted from t/ ?
15:35 moritz_ finanalyst: they are moved  to t/spec/
15:36 moritz_ finanalyst: that implies deleting them, and recreating somewhere else
15:36 finanalyst thought so, but just checking
15:36 finanalyst to try this process, do I need a comit bit?
15:37 moritz_ thei0s: emitting somethign like Match.new (from => $num, to => $num, named_captures => %hash, position_captures => @list, text => string)...
15:37 moritz_ thei0s: ... would be immensly helpful
15:37 moritz_ finanalyst: yes. Just /msg me your email address and desired nick, and you can get one.
15:39 finanalyst moritz_: just sent a /msg to moritz_. did u receive?
15:41 moritz_ yes, just a sec
15:42 moritz_ ok, mail sent, you should test your commit bit by adding yourself to the AUTHORS file
15:56 frodwith joined #perl6
15:58 thei0s moritz_: it seems that there is a runtime parrot Data::Dumper module in development (or maybe I don't know how to use it)... anyway: the Match object imports PGE/Dumper.pir and there are various dump methods available, dump_str() seems like the thing I was looking for
15:59 moritz_ thei0s: if you could send in a patch that makes that available from within perl 6, that would be really great
15:59 thei0s it already works in rakudo 0.9.0 -- just use: $/.dump_str()
15:59 moritz_ rakudo: ("a" ~~ m/(.)/).dump_str()
16:00 p6eval rakudo 36033: RESULT«": <a \@ 0> 0\n[0]: <a \@ 0> 0\n"»
16:10 Eevee joined #perl6
16:12 pugs_svn r25043 | finanalyst++ | added self to authors
16:13 pjcj joined #perl6
16:16 stephenlb joined #perl6
16:16 pjcj joined #perl6
16:17 finanalyst moritz_: looking at caller.t. found these lines# caller exposes a bug in the MMD mechanism where directy using autogenerated
16:17 finanalyst # accessors on an object returned by a factory, rather than storing the object
16:17 finanalyst # in an intermediate variable, works only when you chain methods with an
16:17 finanalyst # explicit () between them: caller().subname - ok; caller.subname - error.
16:17 vixey joined #Perl6
16:17 finanalyst presumably these comments need removing?
16:18 finanalyst or are they pugs related and so there should be a fudge #?pugs directive?
16:20 avarab joined #perl6
16:35 mtnviewmark joined #perl6
16:43 icwiener joined #perl6
16:57 TimToady rakudo: my $x = ord(""); say "Alive"
16:57 p6eval rakudo 36035: OUTPUT«Cannot get character of empty string␤current instr.: 'parrot;Any;ord' pc 14758 (src/builtins/any-str.pir:1198)␤»
16:58 TimToady okay, a Failure should die in void context, but it's dying even when assigned, so a real bug
16:59 mtnviewmark because the failure should be captured into the assigned variable -- and only manifest when that variable'
16:59 mtnviewmark when that variable's value is used?
16:59 TimToady yes, or when it's thrown away
16:59 mtnviewmark if manifests on being thrown away?  or just evaporates?
16:59 TimToady and void context throws it away immediately
17:00 TimToady yes, end of block throws it, in theory
17:00 TimToady when $x disappears
17:00 TimToady but after the say-alive
17:00 TimToady I believe that's how it's currently specced
17:01 mtnviewmark My language Wheat had error values like this -- we found it useful that as further operations on the value that were in contexts where the error didn't manifest, that the error value should "accumulate" information about where it was again used... sort of keeping track of "insult after injury"
17:02 mtnviewmark btw I applied all changes from the latest STD.pm back to the chart: nor more \ operator, moved ff and fff and friends back to Conditional (but that does make them associative, which seems odd...)
17:02 TimToady yes, that's the intent, more or less, except we just up and throw the exception at certain times, I think
17:02 TimToady the ff move is more to allow && and || on either side
17:02 mtnviewmark I'm almost done with the chart -- any major changes planned for operators or STD.pm expected in the next week or two?
17:03 TimToady I never know when major changes are about to happen :)
17:03 mtnviewmark :-O
17:03 TimToady I delegate planning to other people :)
17:03 mtnviewmark though, now that ff is associative... you can write something like /abc/ ff /def/ ff /ghi/
17:04 mtnviewmark but I have no idea what that might mean....
17:04 TimToady you can, but it doesn't really do what you mean, unless you think very oddly
17:04 mtnviewmark thank goodness you don't deal with physical artifacts... they tend to have harder time requirements!  :-)
17:04 TimToady because of the implied negative on the 2nd arg
17:05 mtnviewmark right - the second argument to the first ff is not a very useful value
17:05 TimToady but it's also there because it's an operator that has implicit thunks that only get run part of the time
17:06 mtnviewmark right - I see how they are VERY like ?? and !!
17:06 TimToady basically ??!! with a state variable
17:06 mtnviewmark (on the chart they are humerously called the Ambivalents)
17:06 TimToady you note that list assoc are now right assoc when operator changes?
17:07 mtnviewmark er - yes- they are no listed as Infix, Right assoc
17:07 mtnviewmark er *now
17:07 TimToady so $a : $b , $c  turns into $a : ($b , $c)
17:08 TimToady and it seems to map better onto Lisp S-Exprs  :)
17:08 TimToady likewise @a X @b Y @c is now @a X (@b Y @c)
17:09 mtnviewmark Yes - I saw that in the STD.pm -- but, that piece of info isn't on the chart -- though I suppose I could add it
17:09 TimToady but it was mainly the invocant colon that drove the issue
17:09 aindilis` joined #perl6
17:09 TimToady one of those "major changes" I didn't see coming at all :/
17:10 PerlJam TimToady: humans are better at recognizing patterns than they are at predicting or creating patterns.
17:10 PerlJam :-)
17:10 TimToady and we now think of a && b && c as a && (b && c)
17:11 hercynium joined #perl6
17:11 TimToady when you think about it, right associativity fits better with list processing left-to-right
17:12 [particle] $head, @tail
17:13 mtnviewmark odd observation: in Haskell, right associative list operations are generally more efficient than left: foldr is to be preferred over foldl
17:15 TimToady which means that [op] really wants to like right-assoc operators
17:15 TimToady I must have been living an unexamined life to think that left associativity was somehow "better" :)
17:16 mtnviewmark as in   [+] @a minmax @b minmax @c
17:16 TimToady but I think I compartmentalize my Lisp knowledge in a giant pair of parentheses...
17:17 TimToady mtnviewmark: I don't see where associativity makes any difference to that
17:17 mtnviewmark if only keyboards had giant (and medium, and normal, and tiny) pairs of parenthesis
17:17 mtnviewmark it would make lnaguage design SO much simpler
17:18 TimToady the minmaxes will be tighter than the [+]
17:18 TimToady yes, you don't know how hard it's been to keep non-Latin-1 brackets out of standard p6...
17:19 justatheory joined #perl6
17:19 mtnviewmark hmmm.... there is only one infix at the same level as [op] -- list =, so how can assoc. matter to it?
17:20 mtnviewmark in every language design I've ever done.... lack of brackets has always been a constraint -- I blame Gauss -- since he stole the parenthesis for function arguments
17:21 TimToady I just didn't know why you said [+] @a minmax @b minmax @c
17:23 mtnviewmark I wasn't thinking.... I was trying to come up with an example where "[op] really wants to like right-assoc operators" was evident
17:38 kisu joined #perl6
18:11 zamolxes_ joined #perl6
18:12 meppuru joined #perl6
18:34 frodwith joined #perl6
18:43 Psyche^ joined #perl6
18:46 icwiener joined #perl6
19:12 pugs_svn r25044 | lwall++ | [S02] clarify that .perl always represents an object as an item
19:15 spx2 joined #perl6
19:21 spx2 joined #perl6
19:27 spx2 joined #perl6
19:33 spx2 joined #perl6
19:43 kisu_ joined #perl6
19:58 rob joined #perl6
20:11 mberends joined #perl6
20:22 jan_ joined #perl6
20:25 kisu joined #perl6
20:25 PZt joined #perl6
20:33 aindilis joined #perl6
20:36 Tene joined #perl6
20:37 tigreton joined #perl6
20:37 tigreton hi
21:20 mberends joined #perl6
21:24 moritz_ hi
21:31 moritz_ TimToady: t/regex/from_perl6_rules/properties.t assumes that Unicode properties like Perl 5's \p{L} are spelled <isL> or <isLetter> etc. in Perl 6 - is that still valid?
21:39 PerlJam moritz_: the only place they're mentioned that I can see is in S05:1628-1632
21:39 PerlJam so, I assume that means it's still valid
21:47 ejs joined #perl6
21:49 moritz_ PerlJam++
22:04 TimToady haven't seen any reason to change that
22:05 moritz_ so it's <isL> or <letter>, but not <Letter>, right?
22:05 TimToady don't want to collide with other user-defined assertions
22:05 TimToady so a prefix of some sort is good
22:05 TimToady possibly <uniL> or <uniLetter> would be better, but also worse :)
22:06 moritz_ I think the is-prefix isn't bad when used as rule, but looks weird in combined char classes
22:07 moritz_ ie <+isL+isDigit>
22:10 TimToady well, common ones like <digit> and <alpha> we presumably have in short form already
22:10 pugs_svn r25045 | moritz++ | [t] move properties.t (Unicode props) to spec/
22:11 TimToady well, if we stick with uppercase for Unicode, we can probably rely on that not conflicting with user-defined things that are typically lowercase
22:11 TimToady so <L> and <Letter> are probably okay
22:12 TimToady unless we start using typenames as assertions...
22:13 TimToady course, if we were of the typical standards mindset we'd make it <Unicode_Character_Property_Letter> or some such
22:13 moritz_ omg
22:14 TimToady why string two nouns together when you can string four or eight...
22:14 moritz_ s/_/-/g
22:14 TimToady hmm, that's a problem with the +/- notation
22:14 moritz_ that's bad
22:14 moritz_ because it means that we don't allow all identifiers in regex names
22:15 TimToady alternately, require whitespace in <+Letter -Greek>
22:15 moritz_ maybe all combined character classes should start with + or -?
22:16 TimToady I'll let you retract that :)
22:17 * moritz_ follows the wise man's advise ;-)
22:18 iblechbot joined #perl6
22:19 moritz_ can we assume that regex/p6regex/p6regex.t is obsoleted by spec/S05-mass/rx.t?
22:20 TimToady ENOKLOO
22:21 TimToady looks like /<+foo -bar>/ parses okay, though the tree loses the '-' somewhere
22:21 TimToady but /<+foo-bar>/ does parse it with foo-bar as the identifier...
22:23 pugs_svn r25046 | moritz++ | [t] moved named_chars.t to spec/
22:23 meppuru good night
22:24 spx2 joined #perl6
22:26 moritz_ rakudo: "\n" ~~ m/\c[LINE FEED (LF)]/
22:26 p6eval rakudo 36039: OUTPUT«perl6regex parse error: Alphanumeric metacharacters are reserved at offset 11, found 'c'␤current instr.: 'parrot;PGE;Perl6Regex;parse_error' pc 10167 (compilers/pge/PGE/Perl6Regex.pir:1219)␤»
22:27 moritz_ TimToady: \c and \C aren't mentioned in S05, but they could easily be defined in analogy to \x and \X
22:28 moritz_ (and I promise, I'll stop bother you after this one for today ;-)
22:31 TimToady \c and \C are defined in S02
22:31 TimToady since \c is useful outside of regexen
22:31 moritz_ ah, ok
22:33 pugs_svn r25047 | moritz++ | [t/spec] smartlink for named-chars.t
22:47 * mtnviewmark likes requiring whitespace for <+Letter -Greek>
22:47 * mtnviewmark (mostly because he likes Unicode-Character-Property-Letter)
23:01 ruoso joined #perl6
23:02 ruoso HellO!
23:13 * mberends wonders whether Nordic Perl Workshop will consider his just submitted very very late Pod 6 talk proposal
23:15 tigreton bye
23:25 spx2 joined #perl6
23:33 Amateurbr joined #perl6
23:33 Amateurbr Can't locate Config/File.pm
23:33 Amateurbr how to fix it?

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo