Camelia, the Perl 6 bug

IRC log for #perl6, 2010-06-27

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs

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

All times shown according to UTC.

Time Nick Message
00:02 Kodi Defining &infix:<eqv> or &infix<cmp> on new classes simply doesn't work. Is that a reported bug? It is what causes most of the tests in series-nonnumeric.t to fail.
00:09 pugssvn r31469 | Kodi++ | [t/spec] Fixed another of my ", ..." typos.
00:14 sorear Kodi: Where is Alternating.v defined?
00:15 Kodi sorear: Whoops, you're right! That should be '.val'.
00:15 sorear Does that fix it?
00:16 sorear Oh, wait
00:16 Kodi I'll fix that, but I've tested overloading eqv and cmp in simpler cases.
00:16 Kodi Let me make sure I'm not crazy.
00:16 sorear Overloads in Perl 6 are scoped, iirc
00:16 sorear infix:<eqv>:(Alternating,Alternating) is defined only in that one block
00:17 sorear it's not defined anywhere infix:<...> could see it
00:17 sorear possibly changing to our multi would help
00:18 Kodi rakudo: class Foo {has $.v;}; multi infix:<cmp>(Foo $x, Foo $y) {$x.v cmp $y.v}; my $a = Foo.new(v => 1); my $b = Foo.new(v => 2); say $a cmp $b; say $b cmp $a;
00:18 p6eval rakudo 7102d7: OUTPUT«No applicable candidates found to dispatch to for 'infix:<cmp>'. Available candidates are:␤:(Foo $x, Foo $y)␤␤  in 'infix:<cmp>' at line 11:/tmp/0X5QgjV6Wx␤  in main program body at line 11:/tmp/0X5QgjV6Wx␤»
00:19 Kodi Huh?
00:19 sorear Kodi: in that test, you're calling cmp directly
00:20 sorear Kodi: if you call infix:<...>, the cmp overload needs to be somewhere ... can find it
00:20 sorear ah
00:20 Kodi sorear: Bear with me, now. Why won't the dispatcher use that candidate.
00:20 Kodi ?
00:21 sorear rakudo: class Foo {has $.v;}; multi infix:<cmp>(Foo $x, Foo $y) {$x.v cmp $y.v}; my $a = Foo.new(v => 1); my $b = Foo.new(v => 2); say $a cmp $b; say $b cmp $a;
00:21 p6eval rakudo 7102d7: OUTPUT«No applicable candidates found to dispatch to for 'infix:<cmp>'. Available candidates are:␤:(Foo $x, Foo $y)␤␤  in 'infix:<cmp>' at line 11:/tmp/SzObXPvJKb␤  in main program body at line 11:/tmp/SzObXPvJKb␤»
00:21 sorear rakudo: class Foo {has $.v;}; our multi infix:<cmp>(Foo $x, Foo $y) {$x.v cmp $y.v}; my $a = Foo.new(v => 1); my $b = Foo.new(v => 2); say $a cmp $b; say $b cmp $a;
00:21 p6eval rakudo 7102d7: OUTPUT«-1␤1␤»
00:21 sorear ok good I'm not just making this up
00:22 Kodi Huh.
00:22 sorear because infix:<cmp> is defined as a package-scope function, and you can't augment a package multi with a lexically scoped overload
00:22 Kodi So what's the scope of the cmp without "our"?
00:22 sorear my
00:22 sorear private, lexical
00:22 Kodi I see.
00:22 Kodi Thanks a lot.
00:23 Kodi Is it intended that you can't have lexical instances of a package multi, or is that an implementation limitation?
00:24 sorear I don't know
00:24 sorear probably intended
00:27 orafu joined #perl6
00:32 Kodi left #perl6
00:39 pugssvn r31470 | Kodi++ | [t/spec] Fixed overloading of cmp and eqv in series tests.
00:41 masonkramer_ joined #perl6
00:57 emadum joined #perl6
01:46 ash_ joined #perl6
01:49 PacoLinux joined #perl6
01:50 Trashlord joined #perl6
01:57 cuppe joined #perl6
02:05 macdaddy joined #perl6
02:11 cuppe so...I'm new, and just playing around at the moment. was trying to figure out how to do constructors in perl6 and hit this problem: http://scsys.co.uk:8002/45223
02:12 cuppe that's with the june rakudo release btw
02:12 sorear cuppe: new is just an ordinary method
02:12 sorear if you override new to be { say "constructor" }, then Player.new() will return whatever say() returns
02:13 sorear object construction happens in the default new(), but you overrode the default new(), so no construction happened
02:14 sorear any reason why you couldn't just use has @.hand = ... like you did for $.user?
02:15 ash_ cuppe: http://perlgeek.de/blog-en/perl-6/objec​t-construction-and-initialization.html does a good job of explaining how object construction works in rakudo
02:16 cuppe sorear: because I want to do more than just assignment
02:16 cuppe ash_: ty
02:16 ash_ there are multiple parts of object construction, so adding a 'new' isn't always what you want
02:17 sorear cuppe: use BUILD, then
02:18 cuppe yeah. I didn't know about it, I tried new() and other stuff
02:19 cuppe now it prints "Any()" instead of the expected "6"
02:19 ash_ the image in the middle of the post is a great visual representation of the construction process
02:22 cuppe why do I get Any()?
02:24 redicaps joined #perl6
02:24 redicaps left #perl6
02:25 ash_ rakudo: class Foo { has $.bar is rw; submethod BUILD { $.bar = 'bar is set'; } }; my $a = Foo.new; say $a.bar;
02:25 p6eval rakudo 233401: OUTPUT«bar is set␤»
02:28 cuppe rakudo: class Foo { has $.bar is rw = 6; submethod BUILD { 1; } }; my $a = Foo.new; say $a.bar;
02:28 p6eval rakudo 233401: OUTPUT«Any()␤»
02:28 cuppe rakudo: class Foo { has $.bar is rw = 6; }; my $a = Foo.new; say $a.bar;
02:28 p6eval rakudo 233401: OUTPUT«6␤»
02:30 ash_ hmm thats weird, i don't get why its setting it to any
02:30 ash_ rakudo: class Foo { has $.bar is rw = 6; submethod BUILD { $.bar = 123; } }; my $a = Foo.new; say $a.bar;
02:30 p6eval rakudo 233401: OUTPUT«123␤»
02:35 cuppe he ran away ;(
02:36 alester joined #perl6
02:45 emadum joined #perl6
02:56 sorear cuppe: Any is the default value of an uninitialized variable
02:56 sorear I guess your BUILD is overwriting whatever sets up variables, or something
02:57 sorear might play around with --target=pir to see what Rakudo's really doing; there's probably a bug report lurking in here somewhere
02:58 cuppe if BUILD works like that should that be expected behavior
02:58 ciphertext cuppe, sorear: i suspect this is a bug.  The spec (S12:827) says that "any default attribute values are implicitly copied into any attributes that haven't otherwise been initialized"
03:05 felliott joined #perl6
03:05 cuppe if that gets changed I can keep coding and find more :p
03:06 cuppe I can obviously work around whatever is happening
03:07 TiMBuS joined #perl6
03:13 sorear hmm.  sprixel needs to treat 'class' like 'sub'
03:19 redicaps joined #perl6
03:27 sorear ...yeah, Sprixel ClassHOW is going to look basically nothing like Rakudo's
03:37 Guest23195 joined #perl6
04:07 dalek csmeta: r346 | stefa...@cox.net++ | trunk/vicil/Kernel.cs:
04:07 dalek csmeta: [vicil] Mock up some compiled code so the kernel can be fleshed out
04:07 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=346
04:18 Trashlord joined #perl6
04:26 sorear Actually, TIMTOWDI
04:26 sorear I'm going to provide TWO metamodels for Sprixel
04:26 sorear one will be based on runtime class generation, and will support mixins & traits
04:26 sorear the other will generate classes at compile time and will load much faster
04:36 eternaleye joined #perl6
04:40 ajs left #perl6
04:53 envi^home joined #perl6
04:55 saaki joined #perl6
04:56 ciphertext colomon: ping
05:02 redicaps left #perl6
06:15 ciphertext phenny: tell colomon i've got series passing all (nonfudged) tests, and conforming to almost all of the spec. See http://nopaste.snit.ch/21602 for details. (especially note the section at the bottom).
06:15 phenny ciphertext: I'll pass that on when colomon is around.
06:19 ciphertext left #perl6
06:26 sorear rakudo: say ((1, -1/2, 1/4 ... 0)[5]).perl
06:26 p6eval rakudo 233401: OUTPUT«-1/32␤»
06:26 sorear rakudo: say ((1, -1/2, 1/4 ... 0)[55]).perl
06:26 p6eval rakudo 233401: OUTPUT«-2.77555756156289e-17␤»
06:27 sorear rakudo: say ((1, -1/2, 1/4 ... 0)[400]).perl
06:27 p6eval rakudo 233401: OUTPUT«3.87259191484932e-121␤»
06:27 sorear rakudo: say ((1, -1/2, 1/4 ... 0)[600]).perl
06:27 p6eval rakudo 233401:  ( no output )
06:27 sorear rakudo: say (1, -1/2, 1/4 ... 0).length
06:27 p6eval rakudo 233401: OUTPUT«Method 'length' not found for invocant of class 'List'␤  in main program body at line 11:/tmp/0PpmrIHCeK␤»
06:28 sorear rakudo: my @x = (1, -1/2, 1/4 ... 0); say @x.elems;
06:28 p6eval rakudo 233401:  ( no output )
06:28 sorear rakudo: say (1, -1/2, 1/4 ... 0).elems
06:28 p6eval rakudo 233401:  ( no output )
06:28 sorear huh.  I wonder what's going on here
06:45 dalek csmeta: r347 | stefa...@cox.net++ | trunk/vicil/notes.pod:
06:45 dalek csmeta: [vicil] Notes on the two ClassHOWs, new model of lexotics, eval in BEGIN
06:45 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=347
06:49 plobsing joined #perl6
07:03 __eric__ joined #perl6
07:07 moritz_ good morning #perl6
07:07 sorear good morning moritz_
07:08 araujo morning
07:12 radu_ joined #perl6
07:14 dalek csmeta: r348 | stefa...@cox.net++ | trunk/vicil/Kernel.cs:
07:14 dalek csmeta: [vicil] Add CLRImportObject, shorten IPerl6Object -> IP6 since I'm typing it so
07:14 dalek csmeta: much
07:14 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=348
07:15 gfx joined #perl6
07:31 sawyer_ joined #perl6
07:50 redicaps joined #perl6
07:54 dalek csmeta: r349 | stefa...@cox.net++ | trunk/vicil/Kernel.cs:
07:54 dalek csmeta: [vicil] Implement &say in the mock compiler output
07:54 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=349
08:02 pugssvn r31471 | moritz++ | fix plan in if.t
08:03 pugssvn r31472 | moritz++ | [t/spec] unfudges in undefined-types.t
08:03 pugssvn r31473 | radus++ | [t/spec] Added test for RT69314 - Null PMC access when calling 'callsame' directly from a sub in Rakudo.
08:13 exodist_ joined #perl6
08:22 radu_ std: enum SomeEnum <a b c>; say SomeEnum::.keys
08:22 p6eval std 31472: OUTPUT«ok 00:01 111m␤»
08:22 radu_ rakudo: enum SomeEnum <a b c>; say SomeEnum::.keys
08:22 p6eval rakudo 233401: OUTPUT«Could not find sub &SomeEnum␤  in main program body at line 11:/tmp/j1v9zTTjio␤»
08:23 exodist joined #perl6
08:24 Ross joined #perl6
08:31 pugssvn r31474 | radus++ | [t/spec] Added test for RT70894: Cannot do .keys on enum type stash in Rakudo.
08:31 skangas joined #perl6
08:40 M_o_C joined #perl6
08:43 redicaps left #perl6
08:48 moritz_ http://www.perlmonks.org/?vi​ewmode=public;node_id=632816 # preview of a Perlmonks meditation; feedback welcome
08:52 tadzik joined #perl6
08:54 mmcleric joined #perl6
09:01 moritz_ sorry, just had a small downtime of the IRC logs
09:01 moritz_ some a**hole started scraping all the pages with 10 parallel requests or so
09:02 moritz_ with distributed IPv6 source addresses
09:04 Guest23195 cxreg: How's your FakeDBD::Pg work going?
09:05 sorear :/ perlmonks doesn't like anons
09:05 moritz_ sorear: http://moritz.faui2k3.org/tmp/involved.html then
09:05 moritz_ sorear: the links are broken there, but should be fine on perlmonks
09:07 sorear I see
09:07 sorear drat.  vicil isn't going to be the first Perl 6 implementation to use STD
09:07 dalek csmeta: r350 | stefa...@cox.net++ | trunk/vicil/notes.pod:
09:07 dalek csmeta: [vicil] Rethink of interfaces system
09:07 dalek csmeta: review: http://code.google.com/p/c​smeta/source/detail?r=350
09:07 moritz_ please reload, just pushed some minor fixes
09:08 moritz_ sorear: don't complain, rather be happy... it means that pmurias++ already found some mis-parses and made TimToady++ fix them :-)
09:09 sorear apparently, checking the "don't abbreviate my e-mail" box on google code doesn't do anything
09:09 sorear in particular, it doesn't make dalek-- see the whole thing
09:10 * sorear out
09:13 mmcleric morning everyone
09:13 mmcleric rakudo: say(:foo)
09:13 p6eval rakudo 233401: OUTPUT«Unexpected named parameter 'foo' passed␤  in 'say' at line 4732:CORE.setting␤  in main program body at line 11:/tmp/iBFJKQMwk2␤»
09:13 mmcleric rakudo: say((:foo))
09:13 p6eval rakudo 233401: OUTPUT«foo        1␤»
09:13 mmcleric is this intentional?
09:15 moritz_ yes
09:15 moritz_ (:foo) is a list/parcel of single pair
09:15 moritz_ while :foo is a named argument in the context of a signature
09:15 mmcleric yes, i understand it
09:16 mmcleric i'm asking because jnthn's suggestion to propagate all .returns() in Actions.pm broke things
09:17 mmcleric handle_named_parameter relies on .returns() value to check node type
09:17 mmcleric and with () around it, (:foo) returns Pair too now
09:18 moritz_ so it's probably missing a :named or so
09:19 mmcleric its missing .value
09:20 mmcleric or do you mean i should check if node has :named attribute to check if its really pair and not pair in parens?
09:20 pugssvn r31475 | radus++ | [t/spec] Added test for RT 72814 - Null PMC access when typing a my-declared variable as ::a in Rakudo.
09:20 moritz_ mmcleric: I'm not sure, but that (:named) could be it
09:36 timbunce joined #perl6
09:51 pugssvn r31476 | moritz++ | [t/spec] more rakudo unfudges, pmichaud++
10:05 stef_ joined #perl6
10:08 stef_ joined #perl6
10:19 meppl joined #perl6
10:51 azert0x joined #perl6
10:56 cognominal too bad eval is not usable as a lhs, that would help me to circumvent the abscense of :=
10:57 cognominal *absence
10:58 cognominal ...without eval-uating the whole statement
10:59 tadzik joined #perl6
11:03 sftp joined #perl6
11:05 whiteknight joined #perl6
11:13 redicaps joined #perl6
11:16 mberends joined #perl6
11:19 pmichaud cognominal: I expect to be able to implement at least a simple form of := today.
11:21 moritz_ even binding to scalars would help many people
11:21 mberends that will be great. I have no current need for := but it's something that seems to block several developers here
11:21 pmichaud moritz:  "need little to know Parrot knowledge"  should be "need little to no Parrot knowledge"
11:22 pmichaud (in the meditation draft)
11:22 mberends hmm
11:23 dakkar joined #perl6
11:24 azawawi joined #perl6
11:30 mberends moritz_: could you figure out a way to refer to Rakudo * in your "getting involved"? At the BPW yesterday I also tried to emphasize that R* is intended to enable inexperienced developers to easily begin their own projects, and that we hope the list a proto.perl6.org quickly doubles in number of projects.
11:37 moritz_ mberends: I'll do
11:37 moritz_ pmichaud: thanks
11:38 mmcleric how can i do "defined" or "exists" in NQP?
11:38 pmichaud pir::defined($var)
11:39 pmichaud pir::exists($var, $index)
11:39 mmcleric thanks :)
11:48 pmurias joined #perl6
11:49 cognominal pmichaud++  # that would avoid many contorsions. I don't mind if it lacks all the necessary checking and I am not sure they are even specified...
11:50 cognominal my @a; my Int @b
11:50 cognominal @a := @b # is that legal for example (when checks implemented)
11:51 cognominal I feel that @a inherits the restrictions from @b
11:58 moritz_ right
11:58 moritz_ otoh @b := @a would be disallowed
12:00 M_o_C joined #perl6
12:00 moritz_ pmichaud: turns out that my "Parent is not a class" problem in the 'optimizations' branch is also triggered in the PAST::Pattern code
12:00 moritz_ I suspect it might be related to Rakudo being in a different HLL
12:01 moritz_ anyway, I've sent tcurtis++ an email describing the problem
12:01 moritz_ (I avoid it in my code in the branch by monkey-typing Perl6::Compiler
12:01 moritz_ )
12:05 pmichaud moritz_: yes, that could be it
12:06 pmichaud moritz_: I still haven't remembered what triggers that particular error.  I know it's something pretty simple, though.
12:12 tadzik how to open a binary file for writing in Perl 6?
12:13 mberends tadzik: wait one month, then recompile latest Rakudo ;-) (it's NYI but expected soon)
12:13 moritz_ tadzik: 1) bug masak to implement it 2) do it :-)
12:13 tadzik :) ok
12:14 moritz_ http://www.perlmonks.org/?node_id=846772 # posted my meditation
12:16 tadzik http://wklej.org/id/357014/
12:16 tadzik gives me a segfault. Bug?
12:17 pmichaud segfault is a bug, yes.
12:17 pmichaud but note that open doesn't throw a catchable error, iirc.
12:17 pmichaud it returns a failure
12:18 tadzik well, if I use say not die, CATCH works
12:18 tadzik but the program does not terminate even if I put exit in CATCH, prints some other things anyway
12:18 pmichaud ah, the segfault is because the CATCH is catching the 'die'
12:18 pmichaud I think that's a known bug.
12:18 pmichaud (at least, that's my guess)
12:19 pmichaud at any rate, I don't think open() should be throwing an exception.  Perhaps I'm mis-remembering the spec, though.
12:19 felliott joined #perl6
12:19 pmichaud (it can throw an exception if 'use fatal' is in effect)
12:22 tadzik hmm, is the author of LWP::Simple wandering around maybe?
12:23 moritz_ the perl 5 or the perl 6 one?
12:23 moritz_ iirc cosimo_ wrote the Perl 6 version
12:24 tadzik the Perl 6 one of course
12:24 tadzik cosimo_?
12:26 moritz_ hugme: tweet rakudoperl Getting involved with #perl6: http://www.perlmonks.org/?node_id=846772
12:26 * hugme hugs moritz_; tweet delivered
12:27 tadzik yay, fixed
12:28 tadzik I tried to implement getstore(), but fixed LWP::Simple instead
12:29 pmichaud LWP::Simple url?
12:29 tadzik http://github.com/cosimo/perl6-lwp-simple
12:29 pmichaud thanks
12:30 tadzik it was failing for urls with slashes actually
12:30 tadzik (for me at least)
12:31 pmichaud $path = '/' ~ @path.join('/');
12:31 pmichaud ick.
12:31 pmichaud better would be
12:32 pmichaud ($proto, $hostname, @path) = $url.split(/\/+/, 3);
12:32 pmichaud s/@path/$path
12:33 tadzik I wrote @path[0].join(), for some reason @path was like [[bla, bla, bla]]
12:33 pmichaud better would be to use the ,3 version
12:33 tadzik getstore() might work, but not for binary files (obvious reason)
12:34 tadzik it works for texts though
12:41 masonkramer joined #perl6
12:45 mmcleric joined #perl6
12:47 ilogger2 joined #perl6
12:48 redicaps joined #perl6
13:16 kfo joined #perl6
13:47 shade_ joined #perl6
13:52 rv2733 joined #perl6
13:53 radu_ rakudo: sub foo() {say $test; }; my $test = foo();
13:53 p6eval rakudo 233401: OUTPUT«Any()␤»
13:54 radu_ hm. I was expecting an undeclared variable error. Does anyone know if this is how it should work?
14:00 allbery_b I think it's like perl5: the former is in the global setting, the latter in the lexical.  It *should* warn, though.
14:02 pmichaud that should've been an error, yes.
14:02 pmichaud rakudo:  say $a;  my $a = 5;
14:02 p6eval rakudo 233401: OUTPUT«Any()␤»
14:02 pmichaud that's.... weird.
14:03 radu_ ok, i'll submit a bug report
14:10 allbery_b ...right. more lightbox time needed, maybe I'll wake up :}
14:23 jferrero joined #perl6
14:25 ciphertext joined #perl6
14:55 pmichaud S05-mass/rx.t has a lot of uses of &infix:<S&> in it.  What's it supposed to represent, or why was it chosen here?
14:59 dual joined #perl6
15:01 timbunce joined #perl6
15:01 * pmichaud gets rid of them.
15:02 cosimo_ pmichaud, tadzik, thanks, i'll fix the module
15:02 tadzik cosimo_: I sent you a complete patch to gh issues
15:03 tadzik even wrote a test for that, but I don't know how to run tests for p6 -_-
15:03 ciphertext joined #perl6
15:05 ciphertext_ joined #perl6
15:06 M_o_C joined #perl6
15:10 hercynium joined #perl6
15:22 saaki joined #perl6
15:29 mmcleric anyone care to review my patch about nested *?
15:29 mmcleric it's RT#76140
15:31 mmcleric or better, http://github.com/berekuk/rakudo/commit/​413f25c9eee82cc10abd19f499923f9077205b02, there are some per-line notes
15:31 redicaps left #perl6
15:37 dalek rakudo: 56d8874 | pmichaud++ | src/core/IO.pm:
15:37 dalek rakudo: open() should fail, not die.
15:37 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/5​6d8874b8f15173907f9d7a0c8ab31378100afe6
15:39 cosimo_ unfortunately, applying tadzik's patch to LWP::Simple, makes it fail the case where no path is supplied
15:40 pugssvn r31477 | pmichaud++ | [t/spec]:  Miscellaneous test cleanups.
15:42 frew so what's the difference between a rule and a token in a grammar?
15:42 frew rules can have actions and tokens can't?
15:42 dalek rakudo: 0a87aa7 | pmichaud++ | src/ (3 files):
15:42 dalek rakudo: Eliminate Mu::!STORE -- we no longer do "copy pmc" semantics for values.
15:42 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/0​a87aa7370e8b7fce486c393e39f31fac2d457bf
15:42 dalek rakudo: 7bcf224 | pmichaud++ | src/cheats/eval.pm:
15:42 dalek rakudo: Refactor eval() to set $! properly (first version).
15:42 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/7​bcf224170860714fd7268f96cdbd2c00c53678d
15:42 dalek rakudo: d16a2f0 | pmichaud++ | src/core/IO.pm:
15:42 dalek rakudo: Merge branch 'master' of github.com:rakudo/rakudo
15:42 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/d​16a2f0d89806d692a5bb4521de158e3cbd33f2f
15:43 cosimo_ damn, it's so nice to have method names like 'parse-url()'
15:44 cosimo_ i'm getting used to it, and suddenly 'parse_url()' looks so ugly! :)
15:44 frew cosimo_: true dat
15:48 pmichaud mmcleric: I think I need to let jnthn++ review the patch
15:49 mberends frew: a regex is your basic building block. token is regex with :ratchet (no backtracking) and rule is token with :sigspace. All can have actions.
15:50 mmcleric pmichaud: ok :) seems like he's not around today, though
15:50 pmichaud mmcleric: but I also think that any hoisting of .returns and .arity  should take place in the semilist action, not in circumfix:sym<( )>
15:50 frew huh...
15:50 frew mberends: thanks
15:52 mberends :) afk &
15:55 ash_ joined #perl6
15:57 cosimo_ if I declare a class with 'class foo:auth<COSIMO>:ver<3.14> {}' is there a way to get the 3.14?
15:57 cosimo_ for example to print it on stdout?
15:57 steffan joined #perl6
15:57 cosimo_ or, in alternative, any other "standard" way to declare a version for a module?
15:58 pmichaud I don't think we have that implemented yet.
15:59 steffan left #perl6
16:03 * TimToady is back online, but likely to be busy today helping set up the quiz meet
16:03 pmichaud TimToady: o/
16:06 jferrero joined #perl6
16:06 ingy TimQuizzy
16:07 frew is it supposed to be possible to modify a grammar at runtime?  if so, is that implemented in rakudo
16:08 TimToady sorear: it is intended that all function/macro defs be lexically scoped, and that a macro use the 'lift' statement prefix (NYI) to genericize its code into its caller's lexical scope
16:09 TimToady S04:768
16:09 TimToady I'm sure the spec still needs some work there though...
16:09 TimToady so if you ask me embarrassingly good questions about lift, I'll say "Beats me."  :)
16:10 ingy frew: I will probably need to do that today as well...
16:10 ash_ rakudo: use MONKEY_TYPING; grammar Foo { }; augment grammar Foo { };  # frew
16:10 p6eval rakudo 233401:  ( no output )
16:10 TimToady s/macro/multi/
16:10 frew very cool...
16:10 ash_ that lets you add more to it leter
16:10 ash_ later*
16:11 frew and presumably if I define a token in the second grammar that's already in the first it just blows the former token away
16:11 frew I wonder if it would be better to just make a sub grammar (isa) at runtime and override from there
16:11 frew probably.
16:12 ash_ TimToady: can you use a role on a grammar to add tokens?
16:12 TimToady ash_: STD already does that
16:12 pmichaud frew: inheritance is generally preferred to monkey patching :)
16:13 frew pmichaud: that's what I figured
16:13 ash_ cool, so you can do a role instead
16:13 frew I like it better to
16:13 frew too*
16:13 frew then you can go back
16:13 TimToady everywhere you see .tweak in STD, it's really doing a mixin of a role
16:13 ash_ or inheritance... lol so TMTOWTDI
16:14 TimToady mixins are inheritance, not monkey typing
16:14 ash_ monkey typing doesn't work on grammars?
16:15 pmichaud ash_: it *does* work, but it's not preferred :)
16:15 ash_ got ya
16:15 pmichaud mmmmm.... running spectests on amazone ec2 instances takes only ~20 mins  :)
16:15 pmichaud *amazon
16:16 ash_ cool
16:16 frew pmichaud: now you need to set it up so that it parallelizes on enough instances to run in 5s
16:16 frew pmichaud: and then set up a pre-commit-hook 8-P
16:21 pmichaud afk, errands
16:28 frew so could I use a grammar role to add | 'x' to a token?
16:31 frew and can I do something similar in a subclassed grammar?
16:31 frew for example, instead of copying the parent token and adding | 'x' myself, could I do soething like, .next::token | 'x' ?
16:31 ash_ frew: have you seen proto regex's?
16:31 pmichaud frew: protoregexes
16:32 frew ash_: no; looking for examples now
16:32 pmichaud they're explicitly for "add a new alternative" to a token or regex
16:32 frew ah, very cool
16:32 pmichaud short version:
16:33 ash_ http://perlgeek.de/en/articl​e/mutable-grammar-for-perl-6 has an example of some, but pmichaud can give you lots of good examples too
16:33 pmichaud proto token number { <...> }
16:33 frew I'm looking at nqp right now
16:33 pmichaud token number:sym<0d> { '0d' \d+ }
16:33 pmichaud token number:sym<0x> { '0x' <.xdigit>+ }
16:34 frew ok, so sym isn't like, a variable name then? It's what says this is a candidate?
16:34 pmichaud token number:sym<integer> { \d+ }
16:34 pmichaud the above causes <number> to match any of the candidates
16:34 frew right
16:34 pmichaud if you use <sym> in a regex, it corresponds to the name of the regex
16:34 pmichaud thus
16:35 pmichaud token number:sym<0x> { <sym> <.xdigit>+ }    # same as above
16:35 frew oooh
16:35 frew neat
16:35 pmichaud (it also captures to $<sym>)
16:36 pmichaud anyway, you can subclass the grammar and add new  token number:...   regexes
16:36 frew right
16:36 pmichaud so then  <number> in the grammar subclass includes the ones from the base class as well as the ones added in the subclass
16:36 frew and that sounds very clean and neat
16:36 pmichaud It is.
16:37 pmichaud as an added bonus, protoregexes do some nice lookahead based on constant strings
16:37 masak joined #perl6
16:37 pmichaud so,  when  matching <number>,  it's able to jump directly to the 0d or 0x rule if it sees that next in the match (and it doesn't bother calling those subrules if it doesn't)
16:37 masak hi, #perl6!
16:37 frew very cool
16:37 TimToady protoregexes are really a form of alternation, and full-blown P6 is supposed to write you a LTM matcher at every alternation
16:37 pmichaud correct
16:38 pmichaud NQP is able to handle rule-level alternations at the moment
16:38 pmichaud it doesn't do intra-rule LTM on alternations yet.
16:38 TimToady (which STD has a brand-new implementation of from sorear++)
16:38 pmichaud yes, I'm looking forward to stealing STD's new implementation, or adopting it altogether :)
16:38 pmichaud afk, errands
16:39 masak sorear++
16:46 bgoggin joined #perl6
17:05 nimiezko joined #perl6
17:38 timbunce joined #perl6
17:39 tedv joined #perl6
17:52 jferrero joined #perl6
18:15 ingy patch: greetings
18:26 Ross joined #perl6
18:27 ash_ joined #perl6
18:38 pugssvn r31478 | pmichaud++ | [t/spec]:  Match objects are mutable, remove test for immutability (RT #65610)
18:45 eternaleye joined #perl6
19:04 cosimo_ any base64 encoding example in perl6 ?
19:06 cono joined #perl6
19:07 buubot joined #perl6
19:20 tylercurtis joined #perl6
19:23 pmurias joined #perl6
19:23 pmurias sorear: ping
19:23 phenny pmurias: 25 Jun 18:29Z <moritz_> tell pmurias that I'm working on my yearly "Getting involved with Perl 6" post for perlmonks. Is there anything I should say about contributing to mildew, and if yes, what?
19:23 phenny pmurias: 25 Jun 18:32Z <moritz_> tell pmurias also if you want to have any links to mildew that you would like to see included, please let me know
19:32 rv2733 joined #perl6
19:32 ingy src/rakudo/parrot_install/bin/parrot  -o src/gen/perl6.pbc src/Perl6/Compiler.pir
19:33 ingy I'm building rakudo and seemingly hanging there
19:33 ingy for almost an hour
19:33 ingy any thoughts?
19:33 sorear hello #perl6
19:33 sorear pmurias: pong
19:34 pmurias sorear: i'm moving the uniprop reading from INIT to BEGIN time
19:34 pmurias so it's possible to load STD at runtime
19:35 pugssvn r31479 | pmurias++ | [STD] move uniprop loading from INIT to BEGIN time
19:37 pmurias sorear: is it ok?
19:38 pmurias sorear: what is CORE.lex and how do i optain that?
19:38 tadzik joined #perl6
19:38 pmurias s/optain/obtain/
19:39 masak joined #perl6
19:40 sorear pmurias: I had a good reason for INIT, but I've forgotten it.  If you can make BEGIN work, that's fine
19:40 sorear pmurias: CORE.lex is dead and gone, you can't obtain it
19:40 sorear pmurias: if STD asks for CORE.lex, it means you forgot to run ./std CORE.setting (are you using the Makefile...?)
19:41 pmurias http://pastie.org/1020965
19:42 sorear right
19:42 pmurias running make
19:42 lue joined #perl6
19:42 timbunce_ joined #perl6
19:43 sorear the file you actually want is "syml/CORE.syml.store"
19:43 eternaleye_ joined #perl6
19:43 sorear hello timbunce!
19:43 timbunce_ hi sorear
19:44 tadzik cosimo_: new lwp simple checks the uri scheme and connects to the appropriate port. But will the data you send be appropriate for e.g. FTP?
19:48 neo_ joined #perl6
19:48 neo_ helo
19:48 neo_ hello
19:49 tadzik helo
19:49 pugssvn r31480 | sorear++ | [Cursor] A more awesome error message when syml/CORE.lex.store isn't found (pmurias++)
19:49 neo_ i have a question about classes in p6
19:50 Tene Hi!
19:50 Tene What's your question?
19:50 neo_ what is the file extension, also the same like p5 ".pm" ?
19:51 moritz_ .pm and .pm6 work both
19:52 neo_ okay and another question (sorry) , i use now the padre ide, is sombody knows a ide that have highlighting for p6 ?
19:53 neo_ and thx @moritz
19:53 neo_ also @Tene
19:53 szabgab neo_, I think both vim and emacs have highlighers for p6
19:53 szabgab as Padre has
19:54 masak neo_: also, we kinda like it when people ask Perl 6 questions :)
19:55 moritz_ neo_: the vim hilighting is much better than the emacs one
19:55 neo_ sorry, is it right, if i write variables in the class like "$!bla;"
19:57 pugssvn r31481 | pmurias++ | [Cursor] use last instead of goto label
19:57 pmurias sorear: got rid of the goto
19:58 tadzik cosimo_: looks like it just hangs on ftp
19:58 neo_ ok, i will come back if i have more questions, now i will try to lern more about p6
19:59 neo_ see you all later
19:59 slavik left #perl6
20:00 mikwss joined #perl6
20:13 mikehh joined #perl6
20:17 pmurias sorear: VAST::infix__S_Tilde doesn't inherit from VAST::Base, what could cause that?
20:21 TimToady cool, power failure here, but the internet is still up...
20:22 lue Well, don't know how to react to that :)
20:22 lue [you must be using a laptop]
20:23 TimToady well, yes...
20:23 TimToady which I unplugged as soon as the lightning started...
20:25 masak TimToady: maybe it's the kind of internet that doesn't run on electricity.
20:25 TimToady otoh I'm sitting on a meta chair, which could be either good or bad...
20:25 TimToady *metal
20:25 sbp want to buy metachair
20:25 TimToady weatherized carrier pigeons, no doubt
20:26 lue .u chair
20:26 phenny U+2441 OCR CHAIR (⑁)
20:26 lue rakudo: say 3 R- 2; say 3 ⑁- 2;
20:26 p6eval rakudo d16a2f: OUTPUT«===SORRY!===␤Confused at line 11, near "say 3 \u2441- 2"␤»
20:26 lue .oO(darn, no metachair)
20:27 ingy patch and I are having troubles building parrot on my linux box
20:28 ingy is there a tag we can try
20:28 ingy does a given rakudo tag link to a specific parrot build?
20:29 TimToady if you do 'perl Configure.pl --gen-parrot' it's supposed to pull in the right one
20:30 ingy TimToady: what's a known good rakudo checkin?
20:30 moritz_ ingy: each rakudo release targets a parrot release
20:31 ingy we are just trying to write a perl6 module
20:31 moritz_ so rakudo tag 2010.06 targets parrot 2.5.0
20:31 ingy k
20:39 plobsing joined #perl6
20:39 dju joined #perl6
20:48 ingy where does the best perl6.vim live?
20:54 masak http://github.com/petdance/vim-perl
20:55 Guest23195 left #perl6
21:01 pmichaud aiiiigh
21:01 pmichaud colomon++ has turned all compile-time constants into runtime subroutine invocations :-(
21:03 ingy masak: installed, but doesn't seem to work
21:03 ingy what does it key on?
21:03 masak ingy: I haven't tried it myself.
21:03 ingy nod
21:04 patrickas joined #perl6
21:04 masak pmichaud: in what way does that merit a ++ ? :)
21:04 pmichaud masak: I'm not sure that it does.
21:04 felliott joined #perl6
21:04 masak sounds like a way to slow things down...
21:05 pmichaud yeah, I'm uncomfortable with this particular refactoring of things.
21:05 felliott_ joined #perl6
21:07 masak oh! open() fails now?
21:08 masak that's bound to cause a bit of an impact on the Application Cheese... :)
21:08 pmichaud that's the way I think it's supposed to work.
21:08 masak it is.
21:08 pmichaud I'm surprised it was ever 'die'
21:08 masak it's been "die" for the past 2 years.
21:08 pmichaud I'm surprised it got repeated in ng, then :)
21:08 masak :)
21:08 masak rakudo: say 3 !% 9
21:09 p6eval rakudo d16a2f: OUTPUT«0␤»
21:09 masak rakudo: say 9 !% 3
21:09 p6eval rakudo d16a2f: OUTPUT«1␤»
21:09 * masak submits rakudobug
21:10 pmichaud oh, colomon++'s patch only appear to affect the decimal numbers, not the ints
21:10 pmichaud that's much less worrisome to me.
21:10 pmichaud but I'd still prefer to see it precompile things to constants over processing strings at runtime.
21:12 pmichaud and I really don't like the global namespace being littered with the conversion routines
21:12 saaki masak: that's the output i would expect, what were you expecting?
21:12 pmichaud std:  say 9 !% 3
21:12 p6eval std 31481: OUTPUT«[31m===[0mSORRY![31m===[0m␤Can't negate % because multiplicative operators are not iffy enough at /tmp/p0fsMUqQ__ line 1:␤------> [32msay 9 !%[33m⏏[31m 3[0m␤Parse failed␤FAILED 00:01 112m␤»
21:12 masak saaki: there was a spec change the other day.
21:12 pmichaud saaki: that.  :-)
21:12 saaki ah =)
21:12 masak saaki: !% is now known as %%.
21:13 lue what the heck is iffyness?
21:13 masak saaki: congratulations, you just made it into a rakudobug report ;)
21:13 saaki doh!
21:13 masak saaki: consider it a privilege. you're contributing information.
21:13 arnsholt lue: Conditionalness
21:13 saaki i'm just operating under intuition, i'll have to read the specs i suppose
21:14 masak saaki: yes. all of them. all the time. :P
21:15 masak lue: there's "iffy", "diffy" and "fiddly", all of which describe operators.
21:16 masak I'm getting nothing done, so I'm going to take an early night. see you all tomorrow! o/
21:16 mberends o/
21:16 saaki night
21:16 pmichaud masak: quick question?
21:16 masak absolutely.
21:16 pmichaud I'm a bit curious about the signature of Buf.new()
21:16 pmichaud it says it takes an array
21:16 pmichaud not a slurpy array?
21:17 masak yes.
21:17 masak that's new.
21:17 masak I changed the spec and everything.
21:17 pmichaud why an array and not a slurpy, ooc?
21:17 masak this was after talking with jnthn, who indicated that a slurpy array would be very expensive here.
21:17 masak since we expect Bufs to be fairly long.
21:18 masak apparently making the array slurpy incurs a big speed hit.
21:18 pmichaud ....and we expect these long bufs to be created using .new ?
21:18 masak how else would you create a Buf?
21:18 pmichaud one could create an empty Buf and add things to it
21:18 ingy why would a build hang on 'src/rakudo/parrot_install/bin/parrot-nqp --target=pir --output=src/gen/perl6-actions.pir'
21:18 ingy ??
21:18 pmichaud (I'm just asking :)
21:19 ingy so frustrating...
21:19 pmichaud ingy: I'm guessing your machine might be a little short of ram?
21:19 masak pmichaud: it seemed like a good idea at the time. :) still does, I think.
21:19 pmichaud masak:  okay.  I'm not so sure that slurpies will take the huge speed hit in the future, though.
21:19 ingy is there a way to get a binary build?
21:20 pmichaud masak: and I'd hate to set an API based on Rakudo's current characteristics.
21:20 masak pmichaud: one thing I can think of which might change the decision back is if other similar constructors take slurpies, like Set.new, for example.
21:20 pmichaud afaik, Array.new and Seq.new all take slurpies
21:20 masak hm. ok.
21:20 pmichaud I don't know about Set.new
21:20 masak will discuss it with jnthn++ next time I see him.
21:20 pmichaud makes sense
21:20 masak g'night.
21:20 pmichaud but just because slurpies are slow now doesn't mean they'll always be that way :)
21:21 masak indeed.
21:21 pmichaud (and I'm not so sure they're slow now for basic arrays)
21:21 pmichaud ingy: I'm not aware of any binary builds at the moment
21:22 pmichaud (we certainly hope packagers will create some when R* comes out :-)
21:22 ingy pmichaud: Mem:    262364k total
21:23 pmichaud 256MB?  That's a little small for Rakudo build, yes.
21:23 ingy it's a slicehost image :\
21:24 pmichaud I just tried some builds on Amazon's EC2 cloud system -- worked very nicely there :-)
21:24 pmichaud even builds under the "small 32-bit image"
21:25 ingy pmichaud: what's the fast path to get set up there?
21:25 pmichaud but yes, 256MB is likely to be a bit constraining at the moment.  We'd like to get Parrot and Rakudo to use less memory, but there's a fair bit of refactoring and optimization that needs to happen for that.
21:25 pmichaud on ec2?
21:25 ingy yah
21:25 pmichaud just a sec, I'll write up the steps
21:25 ingy bless you
21:25 pmichaud I just did this for the first time myself yesterday, based on Util++'s talk at yapc::na
21:32 pmichaud the first set of instructions I'm writing will be for command-line ubuntu
21:32 pmichaud I'll then write a set for web interface
21:37 ingy nod
21:42 timbunce joined #perl6
21:42 pmichaud version 1 of instructions: http://www.pmichaud.com/san​dbox/ec2-ubuntu-cmdline.txt
21:42 pmichaud now for a web-based version
21:46 pmichaud oops, typo
21:47 pmichaud (updated)
22:01 pmichaud web-based instructions now at http://pmichaud.com/sandbox/ec2-ubuntu-web.txt  (doesn't require the ubuntu ec2 tools)
22:05 songmaster joined #perl6
22:09 dual joined #perl6
22:11 ingy pmichaud++
22:11 ingy pmichaud: trying now...
22:11 pmichaud I'm sure the instructions need some updating.
22:11 pmichaud Maybe I'll stick them on the rakudo github wiki.
22:12 ingy pmichaud: can I create multiple users on this?
22:12 pmichaud ingy: I don't know.
22:13 pmichaud basically all I know about ec2 is there in that document :-)
22:14 ingy :)
22:14 songmaster Hi, I'm just starting out with p6. What's the simplest way to initialize a hash with keys 1..9 (values don't care)?
22:14 pmichaud songmaster: my %hash = 1..9 X Any;
22:15 pmichaud rakudo:  my %hash = 1..9 X Any;  say %hash.perl;
22:15 p6eval rakudo d16a2f: OUTPUT«{"1" => Any, "2" => Any, "3" => Any, "4" => Any, "5" => Any, "6" => Any, "7" => Any, "8" => Any, "9" => Any}␤»
22:15 songmaster pmichaud: Ahh, thanks.
22:16 pmichaud rakudo:  my %hash = 1..9 X 'welcome';  say %hash.perl;
22:17 p6eval rakudo d16a2f: OUTPUT«{"1" => "welcome", "2" => "welcome", "3" => "welcome", "4" => "welcome", "5" => "welcome", "6" => "welcome", "7" => "welcome", "8" => "welcome", "9" => "welcome"}␤»
22:33 christine joined #perl6
22:53 bbkr joined #perl6
22:59 felliott joined #perl6
23:02 macdaddy joined #perl6
23:04 rgrau_ joined #perl6
23:23 * sorear wonders what the improvement in r31481 is
23:25 pmichaud std:  say <1 2 3>.>>.perl;
23:25 p6eval std 31481: OUTPUT«ok 00:01 111m␤»
23:28 jedai joined #perl6
23:37 ingy pmichaud++ # perl6 installed easily on ec2
23:37 ingy thanks!!
23:37 ingy \o/
23:45 sorear Ouch!  All parameters always being containerized calls the circularity saw when the argument in question is the invocant to FETCH
23:45 * sorear decides, grudgingly, to allow non-containerized values
23:48 diakopter heh
23:53 Psyche^ joined #perl6
23:59 rgrau_ joined #perl6

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

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs