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