Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-11-28

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:10 _smg joined #perl6
00:13 bacek joined #perl6
00:21 pcbuetow joined #perl6
00:36 IRSeekBot joined #perl6
00:46 [particle] joined #perl6
00:50 hercynium joined #perl6
01:02 dalek joined #perl6
01:07 ZuLuuuuuu joined #perl6
01:45 smallfish joined #perl6
02:14 meppl good night
02:56 dhoskin joined #perl6
02:56 dhoskin left #perl6
03:19 ZuLuuuuuu left #perl6
03:25 Psyche^ joined #perl6
03:34 wayland joined #perl6
04:00 vijay4114 joined #perl6
04:02 vijay4114 left #perl6
04:04 vijay4114 joined #perl6
04:04 vijay4114 left #perl6
04:24 alester joined #perl6
05:08 kisu joined #perl6
05:19 apeiron joined #perl6
05:23 slavik joined #perl6
05:25 kanru joined #perl6
05:39 justatheory joined #perl6
05:40 rangzy1 joined #perl6
05:45 rangzy1 left #perl6
05:48 xinming_ joined #perl6
05:56 iblechbot joined #perl6
06:38 smallfish joined #perl6
07:07 xinming joined #perl6
07:14 DemoFreak joined #perl6
07:18 Bzek joined #perl6
07:30 simcop2387 joined #perl6
07:49 elmex joined #perl6
07:52 schmalbe joined #perl6
08:40 mtrimpe joined #perl6
08:43 mbtrimpe joined #perl6
08:45 iblechbot joined #perl6
08:47 slavik rakudo: say "hello"
08:47 p6eval rakudo 33300: OUTPUT[hello␤]
08:49 slavik pugs: say 2**65
08:49 p6eval pugs: No output (you need to produce output to STDOUT)
08:49 slavik pugs: print 2**65;
08:49 p6eval pugs: No output (you need to produce output to STDOUT)
08:49 slavik perl6: say 2**65
08:49 p6eval elf 24098, rakudo 33300: OUTPUT[3.68934881474191e+19␤]
08:49 p6eval ..pugs: No output (you need to produce output to STDOUT)
08:49 moritz_ slavik: pugs is broken on p6eval :(
08:49 slavik oh
08:50 slavik moritz_: is there a better article on classes than the spec?
08:50 slavik it's confusing ...
08:50 slavik there needs to be a quick run down, like here's how you make vars private/public/etc, here's how to make a constructor
08:50 slavik and such other
08:51 slavik although @objects.method() is pretty cool
08:51 moritz_ private: ! twigil (has $!foo)
08:51 moritz_ public: . twiigl (has $.foo)
08:51 mbtrimpe joined #perl6
08:51 slavik right
08:52 slavik does rakudo know that?
08:52 moritz_ constructor: default is provided, you can override new or BUILDALL which is called by new
08:52 moritz_ the twigil stuff: yes
08:52 slavik and the constructor stuff?
08:52 moritz_ the default new() is implemented
08:53 slavik according to spec, I have to be able to do: my $x = myClass.new($var => 10, $var2 => 11)
08:54 moritz_ not quite
08:54 slavik hmm
08:55 moritz_ rakudo: class A { has $.a; has $.b; }; my $a = A.new(a => 4, b => 2); say $a.b
08:55 slavik did rakudo keel over?
08:55 p6eval rakudo 33300: OUTPUT[2␤]
08:55 slavik oh
08:55 slavik heh
08:56 slavik what if I wanted to override that new?
08:56 moritz_ no, there was just a very expensive job running in parallel
08:56 slavik oh
08:57 slavik also, your grammar for URL does not work
08:57 moritz_ I know
08:58 moritz_ not yet, that is :-)
08:58 slavik and exceptions are supposed to be ?()
08:58 moritz_ exceptions?
08:58 slavik assertions
08:58 slavik sorry, my mistake
08:58 slavik rakudo: say ?(0 == 1)
08:59 slavik rakudo: say (0 == 1)
08:59 slavik I wonder
08:59 moritz_ ?(...) is just for boolean context
08:59 lambdabot Unknown command, try @list
08:59 p6eval rakudo 33300: OUTPUT[0␤]
08:59 slavik hmm, so that's not an assertion :(
08:59 p6eval rakudo 33300: OUTPUT[0␤]
09:00 moritz_ no
09:00 slavik ?{} is though
09:00 lambdabot Maybe you meant: . ? @ bf ft id pl rc v wn
09:00 slavik and it doesn't work, right?
09:00 moritz_ in grammars, right
09:00 slavik err?
09:01 moritz_ in normal code there's no ?{...}, afaict
09:01 slavik makes sense
09:01 slavik also, can zip be made to work on a list of matchers?
09:01 moritz_ but in regexes, <?{ ... }> are code assertions
09:01 moritz_ zip? matchers? what do you mean?
09:02 slavik like a grammar that matches two lists of things and then you want to do: %hash = $/<blah> Z $/<glah>
09:02 slavik rakudo: say 1..5 | 6..10
09:03 moritz_ well, zip works on any lists, also on those returned from match objects.
09:03 slavik works as in already works or as in will work?
09:04 moritz_ dunno
09:04 p6eval rakudo 33300: OUTPUT[Multiple Dispatch: No suitable candidate found for 'cmp', with signature 'PP->I'␤current instr.: 'parrot;Range;!to_test' pc 6008 (src/gen_builtins.pir:3772)␤]
09:04 moritz_ rakudo: say (<a b c> Z 1..10).perl
09:04 slavik I have a URL grammar that works now if you want to see it
09:05 moritz_ you posted that yesterday or the day before, i think
09:05 p6eval rakudo 33300: OUTPUT[elements() not implemented in class 'Range'␤current instr.: 'infix:Z' pc 4039 (src/gen_builtins.pir:2555)␤]
09:05 slavik oh, ok
09:05 moritz_ rakudo: say (<a b c> Z list(1..10)).perl
09:05 p6eval rakudo 33300: OUTPUT[["a", 1, "b", 2, "c", 3]␤]
09:05 slavik hmm
09:06 * moritz_ sends bug report...
09:07 slavik works fine for a pointy block though
09:07 slavik { %get{~$^a} = ~$^b } for $/<resource>[0]<getstr>[0][0] Z $/<resource>[0]<getstr>[0][1];
09:07 slavik that works
09:07 slavik by %get = $/<resource>[0]<getstr>[0][0] Z $/<resource>[0]<getstr>[0][1];
09:07 slavik that does not
09:09 moritz_ waht's the error message?
09:09 slavik no error message
09:10 slavik just an empty hash
09:10 pasteling "slavik" at 67.100.227.140 pasted "zip and match object list" (44 lines, 1.6K) at http://sial.org/pbot/33402
09:11 slavik also, $/.perl does not give complete info ...
09:11 moritz_ I think that your for-loop is questionable, I don't know if a block is allowed in front of a statement modifying `for'
09:12 bacek joined #perl6
09:12 slavik huh?
09:12 moritz_ anyway, please file a bug report for this one
09:12 slavik where do I mail?
09:12 moritz_ $a = $b for ... instead of { $a = $b } for ...
09:12 moritz_ rakudobug@perl.org
09:13 slavik hmm
09:13 slavik if I remove braces, it breaks
09:14 moritz_ because you use placeholder vars, I see
09:14 slavik :P
09:15 moritz_ my @r = $/<resource>[0]<getstr>[0]; for @r[0] Z @r[1] -> $a, $b { %get{$a} = $b } # does this work?
09:16 moritz_ (I can only access rakudo through a laggy ssh connection here :-/ )
09:17 slavik hmm
09:17 slavik I'll try
09:19 slavik err, wait
09:20 slavik how is it different from what I am already doing?
09:20 slavik zip works fine when in a pointy block ... not fine when assigning to hash
09:20 moritz_ it uses an explicit point block instead of a block with placeholders
09:20 moritz_ yes, but { ... } for @stuff shouldn't actually execute the block
09:21 moritz_ so your program relies on a rakudo bug (unless I'm very much mistaken)
09:21 slavik moritz_: someone told me here to do it this way
09:21 slavik maybe pmichaud
09:21 slavik or jnthn
09:21 moritz_ slavik: with the block *before* the for? 100% sure?
09:22 slavik moritz_: yes
09:22 * moritz_ finds that very weird
09:22 slavik moritz_: otherwise, I had the two things assigned to lists and zipped those in a pointy block proper
09:23 ejs1 joined #perl6
09:27 km2 joined #perl6
09:58 kst joined #perl6
10:20 rakudo_svn r33305 | bernhard++ | [codingstd] remove trailing space
10:27 justatheory joined #perl6
11:57 bacek joined #perl6
12:06 DJ-DONGDOT joined #perl6
12:07 xinming_ joined #perl6
12:20 masak joined #perl6
12:21 bacek_ joined #perl6
12:28 vixey joined #Perl6
12:29 iblechbot joined #perl6
12:43 masak I'm trying to wrap my head around the expression @a[+*] -- what actually happens there?
12:44 masak seems to me that either something magical happens (i.e. not ordinary numification, but something else) or the +* expression is somehow given 'inside knowledge' about its surroundings.
12:47 masak ...which is also magical, in a way.
12:47 masak so either something magical happens or something magical happens.
12:47 moritz_ where did you see that?
12:47 masak moritz_: I'm just speculating on my own.
12:48 moritz_ and did you try if STD.pm parses it as one or as two tokens?
12:48 masak moritz_: actually, no.
12:48 masak std: my @a; say @a[+*]
12:48 moritz_ I think it doesn't really make sense
12:48 masak moritz_: oh! it's from S09.
12:48 p6eval std 24098: RESULT[Use of uninitialized value in hash element at Cursor.pm line 804.␤Use of uninitialized value in concatenation (.) or string at Cursor.pm line 864.␤00:05 90m␤]
12:48 masak moritz_: and no, at first glance it doesn't really make sense.
12:48 moritz_ that won't tell you if it's one or two tokens
12:49 masak moritz_: I don't have Perl 5.10.
12:49 masak I think it's two tokens.
12:49 moritz_ do you have a feather account?
12:49 masak ...but that the semantics are very different
12:49 masak moritz_: aye.
12:49 masak didn't think of that, thanks.
12:51 masak so, should I check out Pugs in my home dir, or is there a globally check-out dir somewhere on feather?
12:53 moritz_ dunno, but for STD.pm it's enought to check out src/perl6/
12:53 masak right.
12:54 moritz_ (there's some collaboration for svk, but I don't know if that's binary compatible to svn stuff)
12:54 masak it should be.
12:57 rindolf joined #perl6
12:58 masak ok, now that I've run make, what am I gonna do... with it?
12:59 moritz_ last time I tried STD5_dump_match (or similar) gave the most readable output
13:01 masak ugh, STD5_dump_match seems to need some love
13:02 moritz_ sorry, gotta go now, maybe I have a more minutes later...
13:02 masak np
13:04 masak http://gist.github.com/29977
13:04 lambdabot Title: gist: 29977 — GitHub
13:04 masak so, two tokens.
13:18 hercynium joined #perl6
13:23 alech joined #perl6
13:45 kst joined #perl6
14:05 mj41 joined #perl6
14:17 aindilis joined #perl6
14:19 ChrisDavaz joined #perl6
14:25 smg joined #perl6
14:29 cognominal joined #perl6
14:42 meppl joined #perl6
15:06 araujo joined #perl6
15:06 spx2 joined #perl6
15:07 kst joined #perl6
15:13 justatheory joined #perl6
15:17 alester joined #perl6
15:19 adc_penner joined #perl6
15:37 iblechbot joined #perl6
15:43 rdice joined #perl6
15:46 alech_ joined #perl6
16:00 [particle]1 joined #perl6
16:02 alester joined #perl6
16:12 kst joined #perl6
16:30 jan_ joined #perl6
16:38 sri_kraih joined #perl6
16:46 ruoso joined #perl6
16:47 DemoFreak joined #perl6
16:50 ruoso Hello!
17:01 * ruoso wonders why he doesn't receive perl6-language messages.... :(
17:04 pmurias_ joined #perl6
17:05 pmurias joined #perl6
17:05 pmurias ruoso: hi
17:05 ruoso hi pmurias
17:07 pmurias ruoso: how portable is the PCL
17:07 pmurias ?
17:08 ruoso pmurias, I haven't used it myself, but I saw some comments that there are some things that are not really really portable...
17:08 ruoso but it seems it would run in any major OS
17:08 ruoso read: POSIX-like and Win32
17:08 pmichaud (zip and hashes):   zip works fine when assiging to a hash
17:08 pmichaud rakudo:   my %h = 1..3 Z <a b c>; say %h.perl;
17:08 p6eval rakudo 33314: OUTPUT[elements() not implemented in class 'Range'␤current instr.: 'infix:Z' pc 4028 (src/gen_builtins.pir:2551)␤]
17:09 pmichaud rakudo:   my %h = <1 2 3> Z <a b c>; say %h.perl;
17:09 p6eval rakudo 33314: OUTPUT[{"1" => "a", "2" => "b", "3" => "c"}␤]
17:09 pmurias ruoso: that should be enough
17:09 ruoso pmurias, yeah... I think so...
17:14 pmurias i'm unsure if a custom interpreter should do the coroutine saving or the code which calls a C function
17:18 [particle] joined #perl6
17:18 ruoso pmurias, why?
17:21 [particle]2 joined #perl6
17:34 szbalint joined #perl6
17:38 rhr joined #perl6
17:50 pugs_svn r24099 | putter++ | [elf_h] In support of STD_blue, accept foofix:sym<bar> as an (incorrect) alias for foofix:<bar>.
17:53 pugs_svn r24100 | putter++ | [STD_blue] Self-compilation of a tweaked elf achieved.  Utf8 fix.
17:58 pmurias ruoso: i misunderstood the coroutine interpreter idea
18:00 kst joined #perl6
18:00 ruoso pmurias, but you do understand now?
18:03 pmurias i think so, but one can never be sure
18:04 ruoso heh
18:04 pugs_svn r24101 | ruoso++ | [mildew] Map.pm shows how the map operator would work, respecting S07
18:07 pmurias ruoso: the idea is to have C coroutine frames right?
18:07 ruoso tight
18:07 ruoso right
18:08 ruoso http://svn.pugscode.org/pugs/v6/mildew/Map.pm
18:08 Limbic_Region joined #perl6
18:08 mncharity joined #perl6
18:12 pmurias mncharity: hi
18:14 mncharity TimToady: perhaps a regression in STD?   Vs yesterday I think.  With head, I'm seeing "Unknown routines: sub called at...".  I'll track down exactly what is prompting it later today (I think).
18:14 mncharity hi pmurias :)
18:14 mncharity gotta go.  bbl &
18:18 pmurias ruoso: why do the iterators use .^!clone?
18:18 ruoso because they are knowhows
18:18 ruoso not classes
18:18 ruoso they are pure prototypes
18:19 ruoso but they could call .^clone() indeee
18:20 apeiron joined #perl6
18:22 pugs_svn r24102 | ruoso++ | [mildew] no need to use .^!clone, we can use .^clone # pmurias++
18:24 bacek_ joined #perl6
18:26 REPLeffect joined #perl6
18:28 * ruoso wonders if failures will support "rethrow"
18:30 Aisling joined #perl6
18:30 pugs_svn r24103 | ruoso++ | [mildew] map consumes as many items as needed by the code signature...
18:34 pmurias ruoso: we should have something like SMOP_CALL() which does a SMOP_DISPATCH and co_resume
18:35 smg joined #perl6
18:35 ruoso pmurias, I think it's not simply SMOP_CALL,
18:35 ruoso but a SMOP_CALLBACK
18:36 slavik pmichaud: you got my bug report?
18:36 ruoso because it's specific for a callback from c
18:36 ruoso it doesn't interfere in regular SMOP_DISPATCH calls
18:36 pmurias s/intefere/work/ right?
18:37 ruoso I mean that regular SMOP_DISPATCH calls in regular SMOP code don't need to call co_resume
18:37 ruoso only the callback from C
18:37 mtrimpe joined #perl6
18:37 slavik does pir allow default values?
18:38 slavik like if I want to call a C function that takes 4 args, but I want to be able to pass only 2 from Perl
18:38 pugs_svn r24104 | ruoso++ | [spec] anything that behaves like a list might implement .Iterator(). And the name is really .Iterator(), not .iterator();
18:39 pmichaud slavik: which bug report?
18:39 pmichaud yes, PIR allows optional parameters.
18:39 slavik about zip and hashes and match object lists
18:40 pmichaud I just rewrote infix:<Z> a little bit ago -- tracking down a spectest failure.
18:40 slavik pmichaud: is it in svn already?
18:40 pmichaud not yet -- gotta find the spectest failure first.
18:41 slavik k
18:41 pmichaud I see the bug report about zip and ranges
18:41 slavik pmichaud: I have code that fails ;)
18:41 pmichaud (that's the one I fixed)
18:41 pmichaud I don't see any about zip and hash and match object lists
18:41 slavik ahh, that's nice too
18:42 slavik "zip does not work on lists of objects"
18:42 slavik that was the subject
18:42 slavik I sent it in like 12 hours ago
18:42 slavik to rakudobug, not sure who gets those
18:42 pmichaud it goes to the perl.org server, which automatically forwards them.
18:42 pmichaud sometimes it's a bit slow.
18:43 pmichaud you could send me a copy directly (pmichaud@pobox.com) and I can work on it.
18:43 slavik would you like me to?
18:43 pmichaud sure
18:43 pmichaud I'm curious if my fix to infix:<Z> resolves your bug also.  It very well might.
18:43 slavik pmichaud: I think it has to do with context
18:44 slavik { %get{~$^a} = ~$^b } for $/<resource>[0]<getstr>[0][0] Z $/<resource>[0]<getstr>[0][1];
18:44 slavik that works fine
18:44 slavik my %get2 = $/<resource>[0]<getstr>[0][0] Z $/<resource>[0]<getstr>[0][1];
18:44 slavik that doesn't
18:44 pmichaud about to commit my fix
18:45 slavik k
18:45 slavik making realclean now :)
18:46 pmichaud committed, r33317
18:46 slavik ty
18:46 slavik also, can I bother you about assertions and <code> for grammars? :P
18:49 slavik pmichaud: does this make sense? token keywork { qw(blah, glah, etc) } token word { (\w+) <!{$0 ~~ /<keyword>/}> }
18:50 rakudo_svn r33317 | svnsync++ | [rakudo]:  Rewrite infix:<Z> to be lazy, work on all types (resolves RT #60898)
18:50 slavik hmm, nope :(
18:51 slavik 33317 doesn't fix it :(
18:51 slavik I was reading about classes and Class @objarr; @objarr.method() is really neat
18:58 pmichaud assertions aren't necessarily easy to handle just yet.  They require that the regular expression engine be able to parse Perl 6 code.
18:58 slavik I see
18:58 slavik ok
18:59 pmichaud slavik: what do you get with:   say ($<resource>[0]<getstr>[0][0] Z $<resource>[0]<getstr>[0][1]).perl;
19:00 pmichaud (probably will need to nopaste it)
19:00 slavik 1 sec
19:00 slavik oh, I just noticed something
19:01 slavik hmm
19:02 slavik [{}, {}, {}, {}, {}, {}, {}, {}]
19:02 slavik say ($<resource>[0]<getstr>[0][0] Z $<resource>[0]<getstr>[0][1]), outputs all the words though
19:02 slavik maybe I should do qw() or something?
19:02 pmichaud that's because Match objects don't do .perl yet
19:02 slavik oh, ok
19:04 jferrero joined #perl6
19:07 pmurias ruoso: maybe SMOP_RESUME
19:12 ruoso pmurias, I'm not sure you need to call SMOP_RESUME
19:12 ruoso the C code will want to do a callback on some object
19:12 ruoso this callback will do the "save and resume" thingy
19:12 ruoso but from the pov of the c code,
19:12 ruoso it's not a RESUME
19:12 ruoso it's a CALLBACK
19:15 pmurias ok, SMOP_RESUME was a pretty bad idea callback is an noun not a verb
19:17 ruoso "callback" may be a noun, but "call back" is an imperative ;)
19:20 rakudo_svn r33318 | pmichaud++ | [rakudo]:  Partial spectest-progress.csv update (through 2008-11-25).
19:21 pmurias ruoso: how should the framy thingy be called?
19:21 pmurias maybe SMOP_CALL_BACK
19:23 ruoso pmurias, "C Coroutine Frame"?
19:24 ruoso or do you want an artistic name?
19:24 ruoso ;)
19:25 pmurias SMOP__S1P__CCoroutineFrame
19:25 pmurias ?
19:25 ruoso maybe just CCoro
19:26 ruoso or more specific to the implementation you're using
19:26 ruoso PCLCoro
19:30 pmurias shorter, better
19:38 pugs_svn r24105 | ruoso++ | [mildew] one last knowhow to the Map.pm implementation
19:38 pugs_svn r24106 | ruoso++ | [mildew] Iterator should return a capture
19:39 masak joined #perl6
19:42 pmurias ruoso: is there a way with PCL to determin if a given coroutine ended?
19:42 pmurias * determine
19:43 ruoso pmurias, hmm... I don't know
19:43 pmurias wrapping the given function should work
19:43 pmurias but seems a bit inefficient
19:44 ruoso I don't think one element in the stack is a big performance hit
19:51 pugs_svn r24107 | ruoso++ | [mildew] calling elems on a lazy list results in eager evaluation...
19:52 pugs_svn r24108 | ruoso++ | [mildew] small typo fix
19:53 ruoso TimToady, when you have some time, could you please take a look at http://svn.pugscode.org/pugs/v6/mildew/Map.pm ? that is a overview of what we've sketched in S07
20:13 masak rakudo: say &?BLOCK
20:13 p6eval rakudo 33318: OUTPUT[Lexical '?BLOCK' not found␤current instr.: '_block11' pc 11 (EVAL_13:13)␤]
20:13 masak I thought we had &?BLOCK.
20:13 masak maybe that was Pugs.
20:13 slavik pugs: say "hello"
20:14 p6eval pugs: OUTPUT[hello␤]
20:14 slavik yay, pugs works again
20:14 slavik pugs: say @*INC;
20:14 p6eval pugs: OUTPUT[␤]
20:14 slavik rakudo: say @*INC;
20:14 p6eval rakudo 33318: OUTPUT[.␤]
20:14 slavik elf: say @*INC;
20:14 p6eval elf 24108: OUTPUT[.␤]
20:18 Ehtyar joined #perl6
20:31 masak can Perl 6's macros be described as hygienic? which programming languages besides those in the Lisp family, have hygienic macros?
20:33 vixey masak, since Prolog doesn't have any binding operators you can pretend Prolog macros are hygienic
20:33 masak not sure if that counts :)
20:34 masak shouldn't 'hygienic' refer to the fact that some problems with binding were solved, not that they weren't introduced into the language in the first place? :)
20:40 apeiron joined #perl6
20:54 pmichaud rakudo doesn't have $?BLOCK as a runtime variable yet.
20:56 slavik pmichaud: what is that for?
20:56 pmichaud sorry, I meant &?BLOCK
20:56 pmichaud it refers to the current block.
20:56 slavik I see
20:57 slavik so ... { say &?BLOCK.perl } would print the block?
20:57 slavik perl6: { say &?BLOCK.perl }
20:57 p6eval elf 24108: OUTPUT[/home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.rb:141:in `block in to_dump0': undefined method `to_dump0' for true:TrueClass (NoMethodError)␤     from /home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.rb:140:in `each'␤       from
20:57 p6eval ../home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.r...
20:57 p6eval ..pugs: OUTPUT[\:(@_) "$_" := "Scalar" #<Scalar:0xb71df615>␤      "@_" := "Array" #<Array:0xb71de055>␤      "&?ROUTINE" := "Sub" #<Sub:0xb7184961>␤      "&?BLOCK" := "Sub" #<Sub:0xb7184961> {}{Syn "block" {Syn "sub" {:() {"$_" := "Scalar" #<Scalar:0xb71df615>␤                                   ...
20:57 p6eval ..rakudo 33318: OUTPUT[Lexical '?BLOCK' not found␤current instr.: '_block17' pc 102 (EVAL_13:48)␤]
20:57 slavik err
20:58 slavik perl6: for 1 -> $x { say &?BLOCK.perl }
20:58 p6eval rakudo 33318: OUTPUT[Lexical '?BLOCK' not found␤current instr.: '_block24' pc 174 (EVAL_14:72)␤]
20:58 p6eval ..elf 24108: OUTPUT[/home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.rb:141:in `block in to_dump0': undefined method `to_dump0' for true:TrueClass (NoMethodError)␤     from /home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.rb:140:in `each'␤       from
20:58 p6eval ../home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.r...
20:58 p6eval ..pugs: OUTPUT[\->:($x) "$x" := "Scalar" #<Scalar:0xb71cb2dd>␤        "&?BLOCK" := "Sub" #<Sub:0xb7184961> {"$_" := "Scalar" #<Scalar:0xb7a6f8d9>␤                                              "@_" := "Array" #<Array:0xb7a6ff1d>␤                                              "&?ROUTINE" := "Sub" ...
21:01 slavik hmm, did I break it?
21:05 masak slavik: no, it looks that way.
21:05 slavik oh, ok
21:05 slavik masak: is it going to be changed?
21:06 masak slavik: yes :)
21:06 slavik to what?
21:06 masak (for various values of "it")
21:06 slavik to display the actual code of the block?
21:06 masak slavik: not &?BLOCK in itself, no
21:06 slavik it would be neat to get the piece of code instead of a stack trace when shit breaks :)
21:06 masak &?BLOCK.perl, perhaps.
21:07 justatheory joined #perl6
21:08 slavik masak: look above ;)
21:08 slavik that's what I tried
21:08 masak ah. sorry.
21:08 masak yes, that will IIUC return a string containing equivalent code. as far as that's possible, at least.
21:09 kst joined #perl6
21:09 slavik nice
21:10 masak Perl 6 tends to be nice. :)
21:10 rakudo_svn r33319 | pmichaud++ | [rakudo]: spectest-progress.csv update: 227 files, 4634 passing, 89 failing
21:13 slavik yea
21:14 slavik masak: I have decided to use wordpress :)
21:14 masak slavik: for doing what?
21:15 * ruoso later &
21:15 slavik for my own blog that will house Perl6 examples that work now. :)
21:15 slavik as opposed to what will work ;)
21:15 masak slavik++
21:15 slavik ^^
21:15 masak we need stuff like that.
21:15 slavik masak: I am going from moritz_'s stuff
21:15 masak ok.
21:16 slavik I already have a grammar example that I have shown everyone like a billion times ...
21:16 slavik and a few others
21:16 masak I'd also recommend taking a look at some of the things in November for inspiration. we do real-world coding, things that Need To Be Done Somehow.
21:16 slavik ???
21:16 masak that calls for some exciting solutions somethimes.
21:17 masak slavik: ¿¿¿
21:17 slavik (04:16:35 PM) masak: I'd also recommend taking a look at some of the things in November for inspiration. we do real-world coding, things that Need To Be Done Somehow.
21:17 slavik I don't get that ...
21:17 masak slavik: which part.
21:17 slavik what things in november?
21:17 masak the Perl 6 code in November, the wiki engine.
21:18 slavik wait ... november is not a month?
21:18 masak yes, that too
21:18 masak :)
21:18 masak http://github.com/viklund/november/
21:18 lambdabot Title: viklund's november at master — GitHub
21:18 slavik http://bcacm.org/~slavik/
21:18 lambdabot Title: 42 lines of Perl
21:19 slavik ^^
21:19 masak :)
21:19 masak slavik: be sure to take a look at http://yapc.tv/2008/ye/lt/lt2-01-masak-vilkund-november/
21:19 lambdabot Title: Carl Mäsak and Johan Viklund. November @ YAPC::TV
21:22 slavik lol, nice one
21:22 masak thank you.
21:23 slavik november is really close ... not there yet, but close
21:23 masak well, Christmas is
21:23 masak November is actually here already :)
21:23 slavik err .. in both senses of the pphrase?
21:23 slavik phrase*
21:23 masak aye
21:24 masak the wiki engine works, today.
21:24 slavik nice
21:24 masak that's what I mean when I say you should check it out if you want to write about working code.
21:24 masak it's basically the largest existing app in working-today Perl 6 code out there.
21:24 slavik well, I am aiming at giving practical pieces of code
21:25 masak what's that supposed to mean?
21:25 pugs_svn r24109 | pmichaud++ | [t/spec]:  Refactor overflow tests from increment.t into overflow.t .
21:25 slavik like: here's what a class looks like
21:25 slavik here's what a grammar looks like
21:25 slavik like a tutorial type thing
21:26 slavik like what moritz_ has but simpler
21:26 masak so, by 'practical', you mean 'made up' :)
21:26 slavik no
21:26 slavik practical, I mean ... it works with rakudo now
21:26 vixey slavik don't see any perl on that site :?
21:26 masak well, November works with Rakudo now.
21:26 slavik right
21:27 slavik vixey: what moritz_ has is the theoretical Perl6 as it will work eventually
21:32 masak rakudo: say min(1..10)
21:32 p6eval rakudo 33319: OUTPUT[1␤]
21:40 slavik masak: I got an idea ... that is really useful ...
21:40 slavik a programming text editor in perl6 :)
21:40 masak slavik: yes, someone's proposed that before, I think.
21:40 masak it's a good idea, not least because of grammars.
21:41 slavik ^^
21:41 slavik and then you just keep a mapping of token -> color/style and you're done
21:41 slavik invented your language? just define the grammar for it ...
21:41 masak I'm not sure Rakudo will get you that far with implementing it today, though
21:41 masak as far as I know, Rakudo doesn't read individual keystrokes, for example.
21:42 masak nor is there a curses library
21:42 slavik masak: what about GTK?
21:42 slavik can't we use that?
21:42 masak I think someone was working on that...
21:42 masak haven't heard about any real progress, though.
21:42 masak you should search the logs for more info on that, methinks
21:43 slavik I do see an ncurses.pir ;)
21:43 masak well, I might be wrong :)
21:44 slavik the big problem I have is that make reallyinstall doesn't set up a proper library directory
21:45 pmichaud rurban++ has been working on that, I don't know the current status.
21:45 slavik k
21:46 masak pmichaud: we from the November team just want to say that we really like the new lexicals :)
21:48 pmichaud masak: thank you.  that makes the struggles I went through much more worth it.  :)
21:48 masak pmichaud++
21:48 pmichaud so, next on the list would be.... list assignment or better parameter passing?
21:49 masak what does the latter mean, more exactly?
21:49 pmichaud right now rakudo has trouble passing values to anything but scalars.
21:49 pmichaud and some things that should be "readonly" aren't.
21:50 masak oh, that's workaroundable.
21:50 masak list assignment, however, would be really nice.
21:50 pmichaud I'm thinking list slices and list assignment should be soon, since those are key Perl features.
21:50 masak aye.
21:50 masak agree.
21:50 pmichaud I think I have it pretty well fixed in my head how they should work.
21:50 pmichaud we might still cheat a bit on the parsing, but for the most part it can work.
21:51 pmichaud oh, list interpolation might be high on the list also.
21:51 masak pmichaud: btw, what's blocking .subst( $regex, $str, :g ) ?
21:51 pmichaud I think there's a patch for it that I need to review.
21:51 pmichaud if not then I could probably write that one pretty quickly.
21:52 masak having :g would help some code.
21:52 pmichaud yes, there have been a few times I've wanted that also.
21:52 masak we're writing while loops right now...
21:52 pmichaud although it might not support having $0, $1  etc. inside of $str yet.
21:52 masak no matter.
21:52 masak that's not that common anyway.
21:53 masak ...and can be faked using closures, no?
21:53 pmichaud no, because it would tie the lexicals to the wrong match object.
21:53 pmichaud the whole .match handling has to be reworked based on TimToady++'s latest changes.
21:53 masak oh, never mind then.
21:53 masak pmichaud: thing is, I'm looking at a case where I solve it with a closure :)
21:53 masak shall I paste the code?
21:53 pmichaud ah.
21:54 pmichaud sure
21:54 pmichaud (actually, it _might_ work with a closure-- I need to review the spec)
21:54 masak http://gist.github.com/30106
21:54 lambdabot Title: gist: 30106 — GitHub
21:55 pmichaud right, in this case the $0 is being tied to $/ that was produced by the ~~
21:55 pmichaud but with   subst( $link_regex, { $link_maker($0) }, :g )    we'll want the $0 to tie to the $/ that was produced by $link_regex
21:55 masak ah, so :g would un-solve that solution.
21:56 masak aye.
21:56 pmichaud at least, I _think_ that was the answer TimToady came up with when this came up a few weeks ago.
21:56 masak it aligns well with my intuitions, at least
21:57 masak you'd want the $0 et al to refer to the regex in the .subst call
21:57 slavik my $string = "testing234234"; token chars { [a..z]+ }; token nums { \d+ }; say $/ if ($string ~~ /<chars> <nums>/);
21:57 slavik should that work?
21:57 pmichaud essentially it means that .subst and .match have to modify their caller's $/ the way that ~~ does now.
21:58 pmichaud token chars { <[a..z]>+ }
21:58 masak pmichaud: yes, I guess.
21:58 pmichaud [a..z]+  is the same as perl 5's   (?:a..z)+
21:59 masak pmichaud: but it feels less obvious that that $/ should be visible outside of the parameter list
21:59 pmichaud slavik: still better might be:    token chars { <alpha>+ }
21:59 pmichaud or    token chars { <.alpha>+ }
22:00 pmichaud masak: yes, I agree, that does feel a little weird.
22:00 slavik so if(... ~~ ...) {say $/;} ???
22:01 pmichaud slavik: are you asking if the regex should work or the 'if' ?
22:01 slavik the if
22:01 pmichaud token chars { [a..z]+ }   won't match the "testing234234"
22:01 pmichaud the 'if' should work fine as either a modifier or a statement
22:02 slavik but /<chars> <nums>/ should, right?
22:02 pmichaud slavik: not with 'chars' written as given here
22:02 pmichaud [a..z]  does not mean "any letter from 'a' to 'z'"
22:02 pmichaud it means 'a', followed by two chars, followed by 'z'
22:02 slavik oh
22:02 masak does S05 talk about negative lookahead? I can't find it.
22:02 slavik then how do I do a range
22:02 pmichaud masak: <!before ... >
22:03 slavik I thought that was the way to do a-z
22:03 pmichaud slavik:  <[a..z]>
22:03 pmichaud (note angles)
22:03 slavik I see
22:03 masak pmichaud: yes, thanks. I just can't find it in S05.
22:03 masak ah, found it.
22:03 slavik <[a..z]>+ ???
22:03 pmichaud slavik:  yes.  Although the correct unicode way to specify that is   <alpha>+
22:03 pmichaud or <.alpha>+
22:03 slavik yes, I know
22:04 slavik the rest is OK?
22:04 pmichaud also note that in Perl 6 the 'if' has to be followed by a space
22:04 pmichaud if(... ~ ...)   # wrong
22:04 pmichaud if (... ~ ...)  # correct
22:04 slavik but if ($str ~~ /<chars><nums>/), that should work?
22:04 slavik k
22:04 pmichaud if ... ~ ...    # also correct
22:07 masak rakudo: say "OH HAI" ~~ / "'" /
22:07 p6eval rakudo 33319: OUTPUT[Statement not terminated properly at line 1, near "'\" /"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤]
22:08 masak pmichaud: are only ' treated as quotes?
22:08 pmichaud masak: so far, yes.
22:08 masak ah.
22:08 pmichaud we'll do "..." when we can do the string interpolations.
22:08 pmichaud (that's one of those places where PGE has to be tied into the Perl 6 parser
22:08 slavik rakudo: token n { \d+ }; say $/ if ("123234" ~~ /<n>+/);
22:08 p6eval rakudo 33319: OUTPUT[123234␤]
22:09 slavik rakudo: token n { \d+ }; say $/ if ("123 234" ~~ /<n>+\s<n>+/);
22:09 p6eval rakudo 33319: OUTPUT[123 234␤]
22:09 * masak is doing MediaWiki markup parsing -- lots of literal ' chars :)
22:09 slavik hmm
22:09 slavik rakudo: token n { \d+ }; say $/ if ("123 234" ~~ /<n>+ <n>+/);
22:09 p6eval rakudo 33319: RESULT[{}]
22:09 slavik rakudo: token n { \d+ }; say $/ if ("123 234" ~~ /<n> <n>/);
22:09 p6eval rakudo 33319: RESULT[{}]
22:09 pmichaud masak: I could probably enable double quotes w/o interpolation.
22:09 masak pmichaud: as of now I just backwhack,
22:10 masak that works too
22:10 pmichaud that works also.
22:10 slavik rakudo: token n { \d+ }; token a { <alpha>+ }; say $/ if ("asdasd234" ~~ /<a> <n>/);
22:10 p6eval rakudo 33319: OUTPUT[asdasd234␤]
22:10 slavik hmm
22:10 slavik rakudo: token n { \d+ }; token a { <[a..z]>+ }; say $/ if ("asdasd234" ~~ /<a> <n>/);
22:10 p6eval rakudo 33319: OUTPUT[asdasd234␤]
22:12 slavik WTF?!
22:12 slavik it doesn't like the name chars and nums for tokens?
22:13 masak slavik: why shouldn't it?
22:15 masak s/sh/w/
22:15 pmichaud slavik: everything you've entered makes sense to me.
22:15 pmichaud slavik: I don't understand what you're expecting to be different.
22:16 * masak neither
22:16 Lunchy joined #perl6
22:17 pmichaud however, .chars _might_ be a problem at the moment, yes.
22:17 pmichaud because Match objects have a .chars method.
22:18 kst joined #perl6
22:29 slavik does inheritance work on grammars?
22:33 masak rakudo: grammar A {}; grammar B is A {}
22:33 p6eval rakudo 33319: RESULT[{ ... }]
22:33 masak slavik: at least trivially, it does. :)
22:34 slavik I mean URL::HTTPS is URL type thing
22:34 slavik also, seems like !~ does not work
22:34 slavik !(~~) does though
22:35 masak um.
22:35 masak it does?
22:35 slavik !(blah ~~ glah)
22:35 slavik I mean that
22:35 masak ah.
22:35 * masak exhales
22:35 slavik sorry for the confusion
22:36 masak no harm in being precise :)
22:36 slavik that is the same as (blah !~ glah), but !~ does not work, causes statement not terminated properly error
22:37 slavik url::https is url gives an error about strings
22:37 slavik get_string() not implemented in class 'ResizableStringArray'
22:39 apeiron joined #perl6
22:39 masak slavik: !~ is Perl 5, not Perl 6
22:39 masak slavik: I don't think grammars can start with a lowercase letter
22:43 slavik masak: fine: URL::HTTPS is URL does not work
22:44 slavik and what is the negative match in Perl6?
22:44 slavik !~~ ?
22:44 masak slavik: would you mind nopating your code?
22:44 masak slavik: yes.
22:44 slavik sure
22:44 slavik with the correct usage or with the error one?
22:44 masak slavik: the one with the error, please.
22:45 slavik k
22:46 pasteling "slavik" at 67.100.227.140 pasted "!~~ not working" (56 lines, 2K) at http://sial.org/pbot/33418
22:47 masak slavik: that looks like a rakudobug to me.
22:47 slavik masak: I also see that a semi-colon is required after defining a grammar, but I don't think it should be required.
22:47 masak slavik: care to report it in?
22:47 slavik ok
22:48 masak slavik: no, it shouldn't be required. not if you have a newline after the ending curly
22:48 slavik another bug?
22:48 slavik pmichaud:
22:48 masak slavik: if removing the semicolon makes Rakudo complain, then yes, another bug.
22:48 slavik k
22:49 slavik masak: it's a more weird one
22:50 slavik it requires it after the last grammar definition
22:50 masak slavik: that sounds like a new thing to me. we don't experience that in November. OTOH, I don't think we have two grammar definitions one after the other anywhere.
22:51 slavik even if it's the only 1
22:52 masak slavik: will try to duplicate that.
22:53 masak slavik: works here. http://gist.github.com/30123
22:54 lambdabot Title: gist: 30123 — GitHub
22:54 slavik masak: same grammar that I pastebinned, but remove the semi-colon after the second grammar definition.
22:54 masak slavik: will try. hold on.
22:55 slavik I am using revision 33317 if that matters
22:56 masak slavik: indeed, removing that semicolon makes things not work.
22:56 masak I'll try to reduce the problem to its bare minimum.
22:57 slavik k
22:57 slavik maybe it has to do with inheritance.
22:57 masak nope.
22:57 slavik k
22:58 masak it's `grammar A {}\nif 1{}`
22:58 masak i.e. a grammar followed by an if statement.
22:58 slavik I see
22:58 masak slavik: feel free to report that one too :)
22:58 slavik should be simple, right?
22:58 masak if you don't, I will.
22:58 slavik I did, along with the other one
22:58 slavik in 1 post
22:59 slavik or should I mail another one?
22:59 masak slavik: you could follow up on the same bug with the simple case.
22:59 slavik k
22:59 masak you should have gotten an automatic mail back to which you can reply.
22:59 masak slavik++
22:59 slavik don't think I've gotten them at all
23:03 bacek_ joined #perl6
23:04 slavik hmm, got a reply to that one
23:04 slavik masak: first post is ready :D
23:04 masak excellent :)
23:05 slavik http://bcacm.org/~slavik/
23:05 lambdabot Title: 42 lines of Perl
23:05 slavik hehe
23:05 slavik I couldn't come up with a better title
23:11 masak I like that title.
23:11 slavik heh
23:11 slavik I like the caption more ;)
23:17 pmichaud #60908 is a duplicate of #57876 .
23:17 pmichaud (at least they're the same problem)
23:18 pmichaud and #57876 is a duplicate of #56228 :-)
23:19 masak ditto #56228
23:19 masak oh, you said that. :)
23:19 dukeleto joined #perl6
23:20 slavik where's the official Perl6 docs?
23:20 slavik http://feather.perl6.nl/syn/ ???
23:20 lambdabot Title: Official Perl 6 Documentation
23:20 pmichaud http://svn.pugscode.org/pugs/docs/Perl6/Spec/
23:20 lambdabot Title: pugs - Revision 24109: /docs/Perl6/Spec
23:21 pmichaud (at the moment.)
23:26 TimToady rehi from Sydney
23:26 lambdabot TimToady: You have 1 new message. '/msg lambdabot @messages' to read it.
23:31 masak hi, Sydney :)
23:49 kst joined #perl6
23:56 mbtrimpe joined #perl6
23:58 mberends joined #perl6

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

Perl 6 | Reference Documentation | Rakudo