Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-08-27

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:07 bacek joined #perl6
00:33 [particle] joined #perl6
00:33 SamB joined #perl6
00:43 a-jing joined #perl6
00:43 a-jing left #perl6
00:48 Lichtkind joined #perl6
00:48 Lichtkind slurp closes immidiatly?
00:50 ruoso @tell pmurias, alright... that should be ok... so let's think in the m0ld code that would initialize the class...
00:50 lambdabot Consider it noted.
01:00 [particle] joined #perl6
01:18 cognominal joined #perl6
01:22 stef__ joined #perl6
01:29 hercynium joined #perl6
01:38 meppl good night
01:43 bacek_ joined #perl6
01:44 bacek joined #perl6
02:52 s1n moritz_: maybe you're a better person to ask. i've been pestering pmichaud for a while and he seems extremely busy right now
02:52 s1n i want to start hackin on rakudo itself, not just the test suite, but i'm looking for guidance as to where to begin
02:53 s1n i've looked through the roadmap, but not really understanding what it says is needed, i don't really know where to start on any of those things
02:53 s1n moritz_: can you help me in this department?
03:02 elmex_ joined #perl6
03:02 PZt joined #perl6
03:06 PerlJam s1n: Do you know how to use NQP?  PIR?  C?
03:08 PerlJam s1n: were I you, I'd look at some of the items in the roadmap that are estimated at just a few hours and don't really depend on anything and start hacking on those.
03:08 PerlJam In fact, I may just do that myself since I may have time to do it soon :)
03:28 zch051383471952 joined #perl6
03:33 bacek joined #perl6
03:48 a-jing1 joined #perl6
04:26 cognominal_ joined #perl6
04:27 a-jing1 left #perl6
04:42 BinGOs_ joined #perl6
04:43 penk joined #perl6
05:05 alanhaggai joined #perl6
05:26 Psyche^ joined #perl6
05:39 sri_work joined #perl6
05:41 PZt joined #perl6
05:48 smtms joined #perl6
06:04 ashizawa joined #perl6
06:46 pmurias joined #perl6
06:50 c1sung joined #perl6
06:51 cls_bsd joined #perl6
07:06 pmurias ruoso: i'm not sure what hello world should look like in m0ld
07:15 Ehtyar joined #perl6
07:19 pmurias_ joined #perl6
07:20 pmurias joined #perl6
07:32 pmurias ruoso: and i think classes are created at BEGIN time
07:36 masak joined #perl6
07:45 pmurias ruoso: but if we move them to runtime the should desugar to method calls
08:37 iblechbot joined #perl6
08:41 pen1 joined #perl6
08:43 larsen_ joined #perl6
08:55 moritz_ masak: are you (or november) blocking on RT #58352? if so, I could revert that change (although it seems right to me)
08:55 masak moritz_: no, s'ok
08:56 masak but it was the first "fix" in rakudo to trigger an addition of a workaround in november :)
08:56 moritz_ :/
08:56 moritz_ which clearly means that we need more tests
08:57 masak I implemented recursive HTML Template directives yesterday evening
08:57 moritz_ if it were tested properly my "fix" would have been caught
08:57 moritz_ cool ;)
08:57 masak ...and discovered another bug in rakudo which I'm reporting now
08:57 moritz_ as always :/
08:57 masak currently checking in svn history whether it's been with us since the beginning of time
08:58 masak my guess is yet
08:58 masak s/t/s/
08:59 * masak should really write a script that does binary search on svn revisions
08:59 moritz_ or you get a git mirror, and use git-bisect
08:59 masak yes.
08:59 moritz_ which seems to be *much* more efficient
09:00 moritz_ since you don't have to contact the server every time
09:00 masak right. no net latency.
09:00 masak still have to compile, though
09:00 masak that's the real bottleneck
09:00 moritz_ that's where dual core + ccache start to help ;)
09:00 masak :)
09:01 masak sorry, what were your make flags again? -j2 and something
09:01 moritz_ yes
09:01 moritz_ make realclean && perl Configure.pl --cc='ccache gcc' && TEST_JOBS=2 make -j 2 test
09:01 masak ah, dz
09:01 moritz_ (for bisecting you'll don't need the test target, of course)
09:02 masak no.
09:03 moritz_ btw matching in the condition of a while-loop works - you just can't access $/ after that :/
09:03 masak moritz_: I know.
09:03 masak I hope that's what the bug description says, too
09:04 masak otherwise I have to clarify
09:04 moritz_ oh, right
09:04 moritz_ I should actually read what you write ;)
09:04 masak it's been known to help :)
09:07 penk joined #perl6
09:09 pugs_svn r22038 | moritz++ | [t/spec] tests for RT #58352
09:10 masak moritz_++ # writing more tests
09:11 masak I should do it myself, but I find myself being occupied with classifying bugs :)
09:13 pugs_svn r22039 | moritz++ | [t/spec] add tests for junctions in boolean context, from RT #58302
09:13 riffraff joined #perl6
09:15 pugs_svn r22040 | moritz++ | [t/spec] junction tests need explicit ?(...) to force boolean context,
09:15 pugs_svn r22040 | moritz++ | otherwise ok() autothreads on it
09:16 masak ah, so ?(...) collapses the quantum wave
09:17 moritz_ yes, it's a measurement ;)
09:17 moritz_ which always collapses a wave function to an Eigenvalue
09:17 masak "you changed the outcome by measuring it!"
09:17 masak futurama++
09:17 moritz_ (quantum physics)++
09:17 masak cats++
09:22 masak heh, when bifurcating in a known integer range, the current integer carries informaion about all integers tested before it, and about the range of remaining uncertainty
09:23 moritz_ yes, but only if you know the limits of the range
09:23 masak yes.
09:24 masak and the exact conditions for rounding up and down.
09:24 moritz_ I was about to add that as well ;)
09:25 fridim_ joined #perl6
09:31 pugs_svn r22041 | moritz++ | [t/spec] fudged boolean-context.t for rakudo.
09:31 pugs_svn r22041 | moritz++ | This is a bit ugly, because fudge doesn't understand the test syntax
09:31 moritz_ STD.pm doesn't like t/spec/S03-junctions/boolean-context.t
09:31 moritz_ Obsolete use of undef as a verb; in Perl 6 please use undefine function instead
09:32 moritz_ it doesn't look like a verb to me, in that context
09:32 wknight8111 joined #perl6
09:33 moritz_ today's xkcd is great ;)
09:34 kanru joined #perl6
09:35 dr_df0 joined #perl6
09:35 masak moritz_: what doesn't look like a verb? 'undefine'? it does to me.
09:36 moritz_ ok !(undef&1), '...'
09:36 moritz_ that's what STD.pm complains about
09:36 moritz_ and in that context undef doesn't look like a verb, IMHO
09:36 zamolxes joined #perl6
09:43 cls_bsd_ joined #perl6
09:44 masak moritz_: I concur.
09:44 masak STD is at fault.
09:44 masak unless a space is required before the '&' for it to be treated as a binary op
09:45 moritz_ I think only when disambiguating
09:45 moritz_ and I don't know from what it needs disambiguation
09:46 moritz_ since there's no postfix or postcircumfix that starts with &
09:49 rakudo_svn r30590 | moritz++ | [rakudo] more junction tests for spectest_regression, (Stephen Simmons)++
09:56 a-jing joined #perl6
09:56 a-jing left #perl6
10:11 fridim_ joined #perl6
10:14 kst joined #perl6
10:20 alanhaggai joined #perl6
10:23 riffraff joined #perl6
10:40 dr_df0 joined #perl6
10:51 dr_df0 i've got problems running make test on pugs (latest version from svn)
10:51 dr_df0 'make test' stops with: Can't locate Test/Harness/Results.pm in @INC .... at inc/Test/Harness/Straps.pm line 12
10:52 dr_df0 i'm able to run pugs
10:53 elmex joined #perl6
10:59 yahooooo joined #perl6
11:01 Bzek joined #perl6
11:05 meppl joined #perl6
11:14 a-jing joined #perl6
11:15 a-jing left #perl6
11:20 zamolxes joined #perl6
11:22 fridim__ joined #perl6
11:26 BinGOs joined #perl6
11:35 a-jing1 joined #perl6
11:35 a-jing1 left #perl6
11:37 a-jing2 joined #perl6
11:40 a-jing2 left #perl6
11:56 BinGOs joined #perl6
12:13 moritz_ cpan Task::Smoke
12:14 penk joined #perl6
12:23 a-jing joined #perl6
12:23 a-jing left #perl6
12:31 jan_ joined #perl6
12:33 a-jing1 joined #perl6
12:33 a-jing1 left #perl6
12:33 fridim_ joined #perl6
12:40 rakudo_svn r30591 | moritz++ | [rakudo] add subs pass and fail to Test.pm
12:41 masak perl6: sub f($l) { return() if $l<=0; print $l; for 1..3 { f($l-1); print "." } }; f(2); say
12:41 p6eval rakudo 29834: OUTPUT[␤]
12:41 p6eval ..elf 22041, pugs: OUTPUT[21....1....1....␤]
12:41 masak that's the right output!
12:42 masak on my box (r30590) it outputs "21......"
12:42 moritz_ so what's the problem? the return()?
12:42 moritz_ or the 'if as a statement modifier'?
12:43 masak no, I get a completely different result locally
12:43 masak "21......"
12:43 abra joined #perl6
12:43 * moritz_ rebuilds parrot, and tries again
12:44 masak I've reported this to rakudobug, because it's a bit of a showstopper for one of my new tests
12:44 masak the one with nested for templates
12:44 masak it kinda needs recursion in for loops to work
12:44 masak but it's VERY strange that the perl6 bot thinks everything is ok
12:45 moritz_ does it?
12:45 abra joined #perl6
12:45 masak yes, that output looks fine
12:45 moritz_ empty output looks fine?
12:45 moritz_ 14:41 < p6eval> rakudo 29834: OUTPUT[␤]
12:45 masak empty output?
12:45 moritz_ just an \n
12:45 masak oh
12:45 masak it was pugs that reported ok
12:46 masak then I see.
12:46 masak that's congruent with my bug report
12:46 masak in newer rakudo versions, it gives an output, but the wrong one
12:46 moritz_ didn't we talk about reading earlier today? ;-)
12:46 * masak blushes
12:47 moritz_ locally it says 21......
12:47 masak up until 29883, rakudo outputs nothing
12:47 masak after 29884, it outpus 21......
12:47 masak *outputs
12:47 moritz_ and I wonder why rakudo lacks so far behind
12:47 moritz_ we're at 30590 now
12:47 masak yes
12:48 masak strange thing is, r29884 was really just a cleanup commit
12:48 moritz_ building Rakudo at Wed Aug 27 12:45:01 2008
12:48 moritz_ svn: Working copy '.' locked
12:48 moritz_ svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
12:48 masak ah.
12:48 Lichtkind joined #perl6
12:49 TimToady the problem with undef&1 is that &1 is a valid sub name in Perl 5, and undef may be used on subs
12:49 TimToady we could restrict it to sub names starting with alpha
12:49 TimToady or undef & 1 would also be a good way to avoid the problem
12:50 * moritz_ wonders if he'll ever grok those two weird programming languages
12:52 masak TimToady: how would I go about declaring such a sub in Perl 5? 'sub 1 { ... }' obviously doesn't work
12:52 moritz_ masak: *1 = sub { ... }
12:53 masak ah.
12:53 TimToady admittedly it's an uncommon name for a sub :)
12:53 TimToady so we can certainly fix the warning
12:53 moritz_ or even $::{'1'} = ...
12:53 masak moritz_: of course :)
12:53 pugs_svn r22042 | moritz++ | [t/spec] some whitespace disambiguations
12:53 moritz_ in the symbol table anything is fair game
12:53 TimToady but we're also encouraging the use of whitespace around most binary operators
12:54 moritz_ the golfers will hate us
12:54 masak indeed. but Perl 6 is not just for them.
12:54 masak also, there's op overloading and macros :)
12:55 moritz_ I was about to say that Abigail will hate Perl 6, but I think that's nothing new ;)
12:55 TimToady we're not requiring it where it's unambiguous, but we expect more such ambiguities to arise as the language gets extended
12:55 moritz_ but sub infix:<+> is just too long for a good golf ;)
12:57 TimToady well, it's not like you can even name that operator in p5
12:58 rdice joined #perl6
13:03 masak perl6: if 5 -> $a { say $a }
13:03 p6eval pugs: OUTPUT[*** Cannot bind to non-existing variable: "$a"␤    at /tmp/ZYUNaYXv2k line 1, column 1␤]
13:03 p6eval ..elf 22042: RESULT[CODE.new(!!!)␤]
13:03 p6eval ..rakudo 29834: OUTPUT[Null PMC access in get_string()␤current instr.: 'parrot;P6metaclass;add_parent' pc 95 (runtime/parrot/library/P6object.pir:126)␤]
13:04 masak haha -- globally unsupported :)
13:04 moritz_ elf++ for creativity
13:11 Lichtkind_ joined #perl6
13:14 alanhaggai joined #perl6
13:46 cmarcelo joined #perl6
13:47 Lunchy joined #perl6
13:49 ggoebel joined #perl6
14:04 cmarcelo left #perl6
14:13 moritz_ masak: that rakudo bug is... really weird
14:14 masak the recursive one?
14:14 moritz_ yes
14:14 masak it is.
14:15 masak also, it's the most urgent rakudo bug I know of in the RT system right now
14:15 moritz_ I'm turning it into a test
14:16 masak great.
14:16 masak moritz_++
14:16 TJCRI joined #perl6
14:20 pugs_svn r22043 | moritz++ | [t/spec] test for RT #58392, masak++
14:21 masak one of the first bugs I don't know how to work around.
14:22 masak I guess I could simulate the correct stack fram behaviour with an array...
14:22 masak s/fram/frame/
14:28 pugs_svn r22044 | moritz++ | [t/spec] fail() is acutally called flunk()
14:31 pugs_svn r22045 | moritz++ | [t] move statements/if.t to spec/
14:31 rakudo_svn r30592 | moritz++ | [rakudo] remove fail() from Test.pm, it's a duplicate of flunk()
14:33 moritz_ I think 'if 1; 2' isn't valid syntax, right?
14:35 pugs_svn r22046 | moritz++ | [t/spec] fudged if.t for rakudo; cleared up one test
14:37 SamB joined #perl6
14:37 masak moritz_: in Perl 6? I'd say no -- if is followed by an expression and then a pointy block, not an expression and a semicolon.
14:38 moritz_ I was rather confused by that test
14:39 moritz_ it was isnt eval('if 1; 2'), 2, 'test if 1; 2'; # WTF?
14:39 Jedai joined #perl6
14:39 rakudo_svn r30593 | moritz++ | [rakudo] added S04-statements/if.t to spectest_regression
14:40 masak moritz_: haha :)
14:40 masak I liked 'test if 1; 2'
14:41 masak it's like the Chinese wordbook I have at home. it's entirely in Chinese. so when you look up a character, you're greeted with an explanation consisting of characters.
14:41 masak I'm looking forward to the day that book will be useful to me.
14:42 pugs_svn r22047 | moritz++ | [t] moved unless.t to spec/; simplified quotes.
14:46 hercynium joined #perl6
14:47 alanhaggai joined #perl6
14:47 fridim__ joined #perl6
14:50 pugs_svn r22048 | moritz++ | [t] moved loop.t to spec/
14:54 moritz_ wtf?
14:54 moritz_ is($loopvar, $loopvar, "bare loop iterates $loopvar");
14:54 masak typo?
14:54 moritz_ there's no other variable to compare against
14:54 kanru joined #perl6
14:55 masak one might rightly wonder what the test was expected to test
14:55 [particle] this one does so wonder
14:55 masak would undef fail such a test in Perl 6?
14:55 pugs_svn r22049 | moritz++ | [t/spec] loop.t: fudged for rakudo, removed non-sensically test
14:55 moritz_ rakudo: say  (undef eq undef)
14:55 p6eval rakudo 29834: No output (you need to produce output to STDOUT)
14:56 masak hm, shouldn't that at least print a newline?
14:56 moritz_ masak: that variable can't even become undef
14:56 masak oki
14:56 moritz_ masak: yes
14:56 moritz_ well, it terminates with a segfault
14:56 moritz_ sh: line 1: 29916 Segmentation fault      ./parrot languages/perl6/perl6.pbc /tmp/xJQw2zMkG8 >> /tmp/v4cClTSoMF 2>&1
14:58 masak mine doesn't.
14:59 masak maybe fixed since r29384?
15:00 moritz_ I'm realcleaning the parrot dir now
15:02 moritz_ uhm, Configure is really slow on that server
15:02 moritz_ building now
15:02 masak I get the answer '1' on both 'eq' and '=='
15:03 masak I get '0' on '==='
15:03 masak and 'eqv' insn't implemented yet
15:03 moritz_ they are all correct, IMHO
15:03 moritz_ except that I'm not sure what === should actually return, the more I think of it
15:04 masak :)
15:04 masak where's Sartre and Heidegger when you need them?
15:04 moritz_ well no, it's actually correct
15:05 Exodist joined #perl6
15:12 rakudo_svn r30594 | moritz++ | [rakudo] two more S04-statement/ files for spectest_regression
15:13 masak tonight is november hacking night.
15:13 masak I'll be back in an hour, probably with viklund in tow
15:13 moritz_ cool
15:13 masak and then we'll hack :)
15:13 masak till then
15:19 meteorjay joined #perl6
15:33 abra joined #perl6
15:37 penk left #perl6
15:41 donaldh joined #perl6
16:08 masak joined #perl6
16:17 iblechbot joined #perl6
16:22 masak how do I override the behaviour of ~(...) for a class?
16:23 moritz_ in Perl 6 or in Rakudo?
16:23 [particle] prefix:<~> ?
16:23 masak in Rakudo, for now.
16:23 moritz_ uhm
16:23 masak not possible?
16:23 * masak feels a rakudobug forming...
16:24 moritz_ > class A { method get_string { "foo" }; }; say A.new
16:24 moritz_ get_string() not implemented in class 'A'
16:24 lambdabot Parse error at "class" (column 1)
16:24 moritz_ that has a certain irony ;)
16:24 masak indeed
16:24 masak a question of levels, I guess
16:24 moritz_ yes
16:24 [particle] in nqp, ~ is get_string
16:25 [particle] what does perl6 --target=pir -e"say ~(1)" give you?
16:25 moritz_ it should be either a prefix:<~> multi or a .Str
16:25 masak [particle]: checking.
16:25 [particle] you don't even need say there
16:26 pasteling "moritz_" at 89.13.242.53 pasted "pir for ~(1)" (28 lines, 576B) at http://sial.org/pbot/32009
16:26 masak assign $P15, 1\n$P16 = "prefix:~"($P15)
16:26 masak those are the relevant lines
16:26 [particle] yep
16:27 [particle] so you need to implement prefix:<~>
16:27 masak how hard can it be? :)
16:27 moritz_ and in PIR you can write .sub 'prefix:<~>', but I doubt that rakudo parses that
16:28 moritz_ maybe a valid workaround would be to make Any.prefix:<~> call self.Str for now
16:28 masak could I inject a .sub 'prefix:<~>' into the class post-compilation?
16:28 masak into the compiled PIR, I mean
16:28 moritz_ perhaps
16:29 masak we'll figure out a way :)
16:29 masak s'not critical or anything
16:32 moritz_ can I give a pir .sub multi(_) a multi variant with a Perl 6 type?
16:35 [particle] not sure, but jonathan has done some work in that direction
16:35 moritz_ .sub 'prefix:~' :multi('Junction')
16:35 moritz_ in Junction.pir
16:36 [particle] there you go
16:42 alanhaggai joined #perl6
16:45 moritz_ anyway, my attempts don't work
16:45 masak moritz_++ # for trying
16:45 moritz_ which might be due to the fact that my parrot knowledge is nearly non-existant
16:46 [particle] sorry, i wish i had a checkout to help
16:46 pasteling "moritz_" at 89.13.242.53 pasted "this is what I've tried (seems to have no effect)" (16 lines, 345B) at http://sial.org/pbot/32010
16:47 masak moritz_: what do you imagine x will be at the point of call?
16:47 moritz_ masak: the parameter to prefix:~
16:48 moritz_ which is the object we want to stringify
16:48 masak ah -- .param
16:48 * masak blind
16:48 masak for, like, the third time today
16:48 moritz_ I still get get_string() not implemented in class 'Foo'
16:48 moritz_ so it seems that parrot doesn't even look at prefix:~
16:48 masak dang.
16:49 moritz_ which is why I tried to call that thing .sub 'get_string' :method :vtable
16:49 masak not only can't you declare it in rakudo -- when you sneak it in, it's still ignored!
16:49 moritz_ which blew up about any test
16:52 masak next question: is there any test or other working code wherein a new() method is successfully overridden?
16:53 masak more specifically, I want to limit access to the new() method
16:53 moritz_ rakudo: class Foo { method new { say %_.perl }; }; Foo.new(a => 1);
16:53 p6eval rakudo 30596: OUTPUT[{"a" => 1}␤]
16:54 moritz_ but then new doesn't create an object anymore
16:54 masak p6eval: hello, updated rakudo
16:54 masak moritz_: is there a way to override new(), yet allow objects of that class to be created?
16:55 moritz_ masak: I think the standard way of it doing it is with submethod BUILD, which new() calls (NYI in rakudo)
16:55 masak right.
16:55 masak IOW, Not Right Now
16:56 moritz_ and I think there's a way to invoke the method from the super class
16:56 masak yay! the test for reading HTML templates from file passes!
16:56 masak and on my first attempt, to boot
16:57 masak I'm soon ready to merge my branch here
16:58 masak just going to work the new HTML::Template into november
16:59 moritz_ masak++
17:01 masak moritz_++ # just as much
17:01 moritz_ I only did the fun parts ;-)
17:01 masak moritz_: that's your design, your grammar, your tests
17:01 masak I only did the minimal gruntwork
17:02 moritz_ we can spend all day acknowledging the other's work, and downplaying the own contribution ;)
17:03 masak it still won't change the fact that you did most of it :)
17:03 larsen_ joined #perl6
17:03 * moritz_ sighs
17:05 [particle] this discussion is off topic, please join #mutual-admiration-society
17:05 [particle] :P
17:06 moritz_ or short #mas
17:06 masak [particle]: I got kicked out of that room :/
17:07 [particle] :)
17:09 ruoso joined #perl6
17:12 pasteling "masak" at 130.243.195.243 pasted "any comments on this API syntax before I finalize it?" (6 lines, 202B) at http://sial.org/pbot/32012
17:13 moritz_ do you have to pass a hash ref?
17:13 Lichtkind_ do you open a dir also with open?
17:13 moritz_ Lichtkind: I doubt that
17:13 [particle] from_file preferred instead of new_from_file?
17:13 masak [particle]: I think so, yes
17:14 moritz_ well, I guess that's a hack anyway until new() works as desired
17:14 [particle] and as opposed to .new( :file<...>
17:14 masak exactly
17:14 Lichtkind but slurp closes as soon after reading?
17:14 masak [particle]: I plan to support that when it's possible
17:14 [particle] gotcha
17:14 masak as an alternative syntax
17:14 * moritz_ just would like to use named arguments if possible
17:14 moritz_ but I guess that can be added afterwards as well
17:14 masak moritz_: if you can make it work, I'd happily accept it
17:15 masak probably not a problem to make both approaches work
17:15 moritz_ masak: %_ worked for me, last I looked
17:15 * masak investigates
17:15 moritz_ Lichtkind: slurp hides the opening/closing/reading from the user
17:15 moritz_ rakudo: sub foo { say %_.perl } ; foo(a => 2, b => 4)
17:15 p6eval rakudo 30596: OUTPUT[{"a" => 2, "b" => 4}␤]
17:16 moritz_ so you can make .param look like the one in p5's HTML::Template
17:16 masak whee!
17:17 * moritz_ wonders if that is tested properly
17:18 masak moritz_: you told me to ping you once I got the tests passing for HTML::Template, so that you could contribute the escape part
17:18 masak did I do that clearly enough yesterday? :)
17:19 moritz_ masak: dunno, but at least you did now ;)
17:19 moritz_ ok %_ is tested
17:20 abra joined #perl6
17:20 masak moritz_: seems the idea of sending in nameds might be fundamentally incompatible with the test suite
17:20 moritz_ rakudo: sub foo { say %_.perl } ; my %f = (a => 1, b => 2); foo(%f)
17:20 p6eval rakudo 30596: OUTPUT[positional inside named args at position 1␤current instr.: 'foo' pc 100 (EVAL_13:33)␤]
17:20 moritz_ rakudo: sub foo { say %_.perl } ; my %f = (a => 1, b => 2); foo(!%f)
17:20 p6eval rakudo 30596: OUTPUT[positional inside named args at position 1␤current instr.: 'foo' pc 111 (EVAL_13:34)␤]
17:20 moritz_ rakudo: sub foo { say %_.perl } ; my %f = (a => 1, b => 2); foo(|%f)
17:20 p6eval rakudo 30596: OUTPUT[Statement not terminated properly at line 1, near "(|%f)"␤␤current instr.: 'parrot;PGE::Util;die' pc 119 (runtime/parrot/library/PGE/Util.pir:82)␤]
17:21 moritz_ eek
17:21 masak :/
17:21 moritz_ we can add a multi later ;)
17:21 masak haha
17:21 * masak leaves it as it is for now
17:24 moritz_ is there a reason for name TMPL_IF insertion, while TMPL_FOR is called for_statement etc?
17:24 masak TMPL_VAR is named insertion
17:24 moritz_ erm, yes
17:24 masak TMPL_IF is named if_statement
17:24 moritz_ TMPL_FOR is named for_statement
17:24 masak I've tried to name them after what they do.
17:25 masak or what they are, rather
17:26 masak ah -- code is much shorted with the new module
17:28 moritz_ I assume you have a HTML escape sub lying around somewhere?
17:28 masak not at all
17:28 masak oh, you mean in Wiki.pm?
17:28 masak hold on
17:29 masak yes, method quote
17:29 masak but I can't give guarantees about its completeness
17:31 moritz_ rakudo: my $x = 'a<b<'; while $x.subst(/'<'/, '&lt;') { 1; }; say $x
17:31 p6eval rakudo 30596: No output (you need to produce output to STDOUT)
17:31 masak moritz_: it's not mutating
17:32 masak the .= form is
17:32 moritz_ rakudo: my $x = 'a<b<'; while $x.=subst(/'<'/, '&lt;') { 1; }; say $x
17:32 p6eval rakudo 30596: OUTPUT[MMD function __concatenate not found for types (160, -98)␤current instr.: 'parrot;Perl6;Grammar;Actions;dotty' pc 111170 (src/gen_actions.pir:5274)␤]
17:32 masak (but that doesn't work in rakudo)
17:32 moritz_ rakudo: say "sanity"
17:32 p6eval rakudo 30596: OUTPUT[sanity␤]
17:32 masak moritz_: also, had that worked, you'd probably had an infinite loop on your hands
17:33 moritz_ yes
17:34 Lichtkind moritz_: in other words yes :)
17:35 moritz_ masak: where should common subs go?
17:35 moritz_ like a general HTML escaper
17:35 masak uhm
17:35 masak hm
17:35 moritz_ Text::Escape? ;-)
17:35 [particle] how about creating a package for it
17:35 [particle] yep
17:36 masak sure, why not
17:36 moritz_ I'll first stuff it into HTML::Template, and when it works I'll factor it out
17:36 masak here's our chance to grab all the good names before anyone else :)
17:36 [particle] :)
17:36 * masak claims DBI
17:36 * moritz_ claims Perl - oh, too late
17:37 * [particle] claims STD
17:37 masak :)
17:37 moritz_ who wants sexually transmitted deceases anyway? ;)
17:38 [particle] you can have Crab::Lice
17:38 * masak does a double take on STDIN and STDOUT
17:38 moritz_ masak: go ahead, those are called $*IN and $*OUT now anyway ;)
17:39 masak dang.
17:41 masak I guess I have to make to with the namespaces Sub, Code, Regex, Array and Hash, then...
17:41 masak s/make to/make do/
17:43 moritz_ my escaping code works, for <>", but when I use it for & also it segfaults :/
17:44 masak moritz_: mind the recursion
17:44 moritz_ masak: iterative
17:44 masak still might cause problems.
17:44 masak infinite expansion
17:45 moritz_ THIS IS NO FUN
17:45 masak hehe
17:45 rindolf joined #perl6
17:45 * masak has been where moritz_ is, about twice
17:46 moritz_ http://sial.org/pbot/32014
17:46 lambdabot Title: Paste #32014 from "moritz_" at 89.13.242.53
17:46 masak viklund says that he likes our old one better :)
17:47 moritz_ rakudo: say 'abc'.subst(/b/, { $_ x 3 })
17:47 p6eval rakudo 30596: OUTPUT[a_block18c␤]
17:47 moritz_ that would be *really* helpful
17:47 masak indeed.
17:47 moritz_ then we could just do a hash lookup
17:48 pmurias joined #perl6
17:48 masak we could now too, but not with subst
17:48 moritz_ yes
17:48 masak possibly with ~~
17:49 * moritz_ tries
17:49 masak still a bit tricky to avoid the expansion stuff
17:50 masak I guess one could check that $/.from has advanced, or sumth'n
17:51 moritz_ YES
17:51 masak :)
17:51 pasteling "moritz_" at 89.13.242.53 pasted "working HTML escape" (21 lines, 430B) at http://sial.org/pbot/32015
17:52 masak we're getting there :)
17:52 masak with ~~, you won't need to iterate every position in the string
17:53 moritz_ so how does that work without :g ? deconstruct the string?
17:53 masak also, viklund adds that your impl might miss the last few chars
17:53 Myoma joined #PERL6
17:53 masak moritz_: I was thinking looping, and using ~~ to find the next char of interest
17:54 moritz_ viklund: do you have a test case where it looses the last char(s)?
17:54 moritz_ masak: yes, but ~~ always starts from... the start
17:54 masak moritz_: viklund doesn't have a keyboard right now. he's holding the baby :)
17:54 masak I might give an example
17:54 moritz_ lol
17:55 masak '<<<<<<<<<<<'
17:55 masak .oO( pair programming: one at keyboard, one holds baby )
17:55 moritz_ prints &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; for me
17:56 moritz_ which is right, IMHO
17:56 masak oh -- is $str.chars - 1 dynamically eval'ed?
17:56 masak in that case, nvm
17:56 moritz_ no, $str never changes
17:56 [particle] what about '&amp;'
17:56 masak moritz_: oh, right
17:56 masak sry
17:57 masak [particle]: see recent insight about $str never changing
17:57 moritz_ [particle]: is turned into &amp;amp;
17:57 [particle] good
17:58 [particle] you should have a uri escape, too
17:58 masak yes.
18:00 moritz_ rakudo: sub f ($x) { $x(2) }; say f({$_ * 2 });
18:00 p6eval rakudo 30596: RESULT[4␤1]
18:00 masak rakudo++
18:00 moritz_ Higher Order Rakudo ;-)
18:00 masak aye :)
18:01 moritz_ YaY
18:02 masak much of that today :)
18:02 pasteling "moritz_" at 89.13.242.53 pasted "Higher Order HTML escape" (29 lines, 681B) at http://sial.org/pbot/32016
18:03 pmurias_ joined #perl6
18:03 pmurias_ ruoso: hi
18:03 moritz_ should & in URLs be translated to &amp; or to %56, in HTML::Escape?
18:03 masak moritz_: make the book deal with MJD right away :)
18:04 moritz_ heh ;)
18:06 masak the baby has grabbed my right hand! I have to program single-handedly!
18:06 Myoma left #PERL6
18:06 moritz_ whose baby is it?
18:07 masak viklund's
18:07 masak and viklund.wife()'s
18:07 moritz_ ;)
18:08 moritz_ how do you run november's tests?
18:08 masak in my branch, perl6 t/html-template.t
18:08 moritz_ so have you installed perl6 somewhere?
18:08 masak no, just an alias
18:11 * moritz_ passes all tests
18:11 masak really? number 13 too?
18:11 moritz_ no, not quite
18:12 moritz_ but that doesn't count
18:12 masak thought so :)
18:13 moritz_ except that remove a debugging statement ruins it all
18:13 masak how so?
18:13 moritz_ say $chunk<directive><insertion><attributes><escape>.perl;
18:13 moritz_ $value = escape($value,
18:13 moritz_ ~$chunk<directive><insertion><attributes><escape>);
18:13 moritz_ works
18:14 moritz_ when I remove the line with say
18:14 moritz_ it passes 1 instead of the escape value to escape()
18:14 masak strange.
18:14 masak usually, when we remove insignificant lines, Parrot crashes :)
18:15 moritz_ but I can s/say/my $dummy = / ;-)
18:15 masak sure!
18:19 moritz_ git-diff doesn't report git-add'ed files
18:19 moritz_ how can I change that?
18:19 masak moritz_: git diff --cached
18:19 masak (says viklund)
18:20 moritz_ uhm, I accidentially added a superflous file
18:20 moritz_ what's the git-delete equivalent? ;-)
18:20 masak hm, maybe there's a switch to git rm...
18:21 masak ...so that it doesn't actually nuke the file in the wc
18:21 moritz_ ah, git-rm
18:22 masak dang, I've forgotten <TMPL_ELSE>...
18:23 * masak goes back to the drawing board
18:23 pmurias joined #perl6
18:23 moritz_ [PATCH] sent
18:24 masak moritz_++
18:25 masak will look at it as soon as the baby stops being so adorable as to grab all the attention
18:25 moritz_ hehe ;)
18:43 masak http://tinyurl.com/5a6pu2 # the baby
18:43 lambdabot Title: Incompatible Browser | Facebook
18:43 masak lambdabot++ # being incompatible with Facebook
18:43 moritz_ ;)
18:44 masak you can spot #perl6 in the upper left corner
18:44 moritz_ ;)
18:44 masak actually, at the far left is a terminal window with november programming
19:16 * masak calls it a night
19:16 masak moritz_, [particle]: thanks for a fun session!
19:16 moritz_ ;)
19:31 IRSeekBot joined #perl6
19:32 rakudo_svn r30598 | pmichaud++ | [rakudo]: spectest-progress.csv update: 127 files, 2278 passing tests
19:34 jferrero joined #perl6
19:40 lambdabot joined #perl6
19:42 BinGOs_ joined #perl6
19:43 pasteling "#rurban" at 212.183.85.199 pasted "bf also" (31 lines, 941B) at http://sial.org/pbot/32022
19:46 moritz_ rakudo_svn: it seems that parts of this patch is already applied, which is why the patch fails
19:47 moritz_ erm, I meant rurban ;)
19:48 pjcj_ joined #perl6
20:20 pmurias joined #perl6
20:35 Alias_ joined #perl6
21:25 cognominal joined #perl6
21:34 BinGOs joined #perl6
21:36 wknight8111 joined #perl6
21:52 jfredett joined #perl6
21:56 japhb joined #perl6
23:11 ruoso joined #perl6
23:14 ruoso Hello
23:28 Lichtkind ruoso: hello
23:28 Lichtkind ruoso: sorry missed your talk at yapc
23:28 ruoso Lichtkind, me too ;)
23:28 ruoso Lichtkind, pmurias gave it in my place ;)
23:28 ruoso the slides are in the wiki
23:29 Lichtkind ruoso: you werent in kopenhagen?
23:29 ruoso no... I've recently moved back to brazil... So I couldn't get there...
23:32 Lichtkind ruoso: i first thought you said you missed my talk too :)
23:32 ruoso but... I did miss it ;)
23:33 Lichtkind ruoso: does smop develope well?
23:33 ruoso yes... we're very close of getting the first stage compiler ready...
23:34 ruoso I mean... the runtime that this first stage compiler requires is almost ready...
23:34 ruoso not the compiler itself
23:34 Lichtkind understand
23:34 hercynium joined #perl6
23:35 funktio joined #perl6
23:39 Lichtkind ruoso: great i make also progress with kephra
23:41 ruoso cool
23:42 Lichtkind ruoso: you heard from that?
23:42 * ruoso reading the site atm
23:42 Lichtkind ruoso: i currently work on a output panel so i can ran perl scripts inside the editor
23:43 Lichtkind there are some issues
23:43 Lichtkind but i want to make a bigger release soon
23:45 Lichtkind to grep some atention
23:45 ruoso Lichtkind, the one thing that really holds me to emacs is the code indenter (tab-always-indent)
23:46 ruoso I would definitively try kephra if it supports tab-always-indent...
23:46 Lichtkind ruoso: explain please
23:46 cognominal joined #perl6
23:47 ruoso when I press "tab" it re-indents the current line (according to the code)... instead of adding a "tab" character
23:47 ruoso the indent mechanism is pretty smart...
23:47 ruoso and usually I trust it to the point that if it's doing something weird, it's because my code is wrong...
23:50 Lichtkind i never tried that, sounds interesting but i can do that in next phase when PPI is plugged into the system
23:51 Lichtkind its already compilation wise but there are many issues
23:51 Lichtkind thanks for that hint interesting feature
23:52 ruoso I see... I would love to switch to an editor that I can actually understand the source code...
23:52 Lichtkind :)
23:52 ruoso emacs lisp is just something I can't get...
23:52 Lichtkind its not only that
23:53 ruoso about features... having "emacs-style" keybindings is also a "must-have" ;)
23:53 Lichtkind thats on todo but currently low
23:53 Lichtkind its not even that i want turn CPAN into IDE
23:54 Lichtkind its about really editor in perl style easy but sophisticated
23:54 ruoso I've already considered writing an editor myself..
23:55 ruoso I would even call it pmacs ;)
23:55 Lichtkind because editor is always something personal and every programmer wnats to tweak its enviroment a little
23:55 ruoso but then I got other stuff to do and never actually started it
23:55 Lichtkind in cpan is already a vip :)
23:56 Lichtkind yes writing an editor is a whole life job :)
23:56 ruoso but one thing I think today is that an editor is basically two things:
23:56 ruoso 1) a good buffer model
23:56 Lichtkind but someone has to do it :)
23:56 ruoso 2) a good event model
23:57 Lichtkind 2) is building up but 1) is encapsulated in component
23:57 ruoso if the two items above are well implemented, the rest comes naturally
23:57 Lichtkind i using same es Komodo
23:57 Lichtkind or i never woul get usable results
23:57 ruoso I would suggest using the component as a view of that model
23:58 Lichtkind maybe later
23:58 Lichtkind theory comes later :)
23:58 ruoso :P
23:58 Lichtkind i refactures it several times
23:59 Lichtkind it now gets some decent api for commands and events and extentions
23:59 ruoso but consider prioritizing the buffer model...
23:59 ruoso it will make your extension api much richer

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

Perl 6 | Reference Documentation | Rakudo