Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2010-09-25

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:02 tadzik joined #perl6
00:02 tadzik 'evening
00:03 TimToady like y's
00:04 patspam left #perl6
00:06 Italian_Plumber left #perl6
00:10 TimToady does rakudo HEAD use gc_massacre now?
00:10 tadzik I think so
00:10 tadzik btw, where is recent Rakudo on feather?
00:11 * TimToady professes complete ignorance
00:18 eternaleye left #perl6
00:18 eternaleye joined #perl6
00:20 TimToady ooh, my hofstadter-conway $10000 sequence got further than it's ever gotten before, so it looks like the old GC limit is gone
00:20 TimToady maybe I'll be able to take the caveat out of RC
00:21 Italian_Plumber joined #perl6
00:24 lue ohai o/
00:24 risou joined #perl6
00:26 lue How would I get a website that can run Perl 6? .oO[ Please don't say home server, please don't say home server... :) ]
00:26 TimToady define "get"
00:27 sorear google VPS
00:27 ash____ joined #perl6
00:28 TimToady for instance, http://try.rakudo.org/ is a website that can run Perl 6...
00:28 ash____ rakudo master has the gc_massacure in it
00:28 ash____ is now known as ash_gti
00:29 flussence left #perl6
00:29 lue [rephrase] What would the best way be to have a website running Perl 6 code? [I tried coding a website again, and I can't help but notice how much better Perl 6 would be over JS :)]
00:29 ash_gti you'd need to have some way of interfacing with your http requests
00:29 ash_gti like CGI
00:29 ash_gti or FCGI
00:29 ash_gti or a standard gateway of interacting with the request like wsgi
00:30 ash_gti and a server that can hand off the request to your code
00:30 ash_gti most web server's allow cgi (if not all)
00:30 ash_gti you just need to have a host that allows you to compile code
00:31 ash_gti http://tools.ietf.org/html/rfc3875 is a detailed description of the CGI interface
00:32 ash_gti i don't think anyone has written a perl6 based library for it yet
00:32 ash_gti well actually masak had something called Web.pm that might do it
00:32 tadzik website running Perl code, you mean a website written in Perl?
00:34 lue I want to use Perl 6 over JavaScript, that's what I'm getting at. I know full well it can't be *exactly* like JS, considering browsers don't come with P6 implementations :)
00:34 ash_gti it might be worth asking masak++ aobut web.pm
00:35 ash_gti oh, you want it in the browser?
00:35 ash_gti not on the server side?
00:35 tadzik please define: Perl6 over JavaScript
00:35 perlygatekeeper left #perl6
00:36 lue ash_gti: I know it won't be browser side. I just want to use it for the same stuff you tend to use Javascript for.
00:37 lue tadzik: I would much rather code in Perl 6 than JavaScript :)
00:37 tadzik well, you usually use JS for the browsers' side, won't you?
00:37 tadzik s/wo/do/
00:37 jnthn c7808c3...wtf. *sigh*
00:38 jnthn TimToady: Dislike. Suggestion: make the default :local.
00:40 jnthn Everytime we add something like this, we add an extra expectation on anyone implementing their own meta-objects (or at least, those that implement the HOW API).
00:40 jnthn Plus from my experience so far, I often *want* :local
00:40 jnthn (by default)
00:41 tadzik http://en.wikipedia.org/wiki/Diamond_problem # I see a nice room for Perl 6
00:42 lue *cough*  I would like to use Perl 6 for coding various things on my site that one normally uses Javacript for (such as navigation, easy updating of stuff that appears on every page, etc.). I do not care if it's client-side or server-side [I actually expect it to be server-side].
00:44 QinGW joined #perl6
00:49 raiph joined #perl6
00:50 eternaleye_ joined #perl6
00:50 eternaleye left #perl6
00:55 TimToady jnthn: local doesn't make much sense in the presence of mix-ins
00:58 jnthn Hmm, true.
00:58 jnthn Excluding Any/Cool/Mu just feels like a hack though.
00:59 TimToady there are good linguistic reasons
00:59 jnthn If you want it, please introduce a general "hidden from introspection" trait or something that can be looked at rather than hardcoding type names.
00:59 jnthn Fine, but the current technical solution is sub-optimal.
01:00 jnthn If I'm reading correctly, we have Mu/Any/Cool just being magically excluded.
01:00 TimToady I know, we'll name the hidden classes with a '.' on the front  :)
01:00 jnthn ...I was hoping for something better. ;-)
01:00 jnthn :-)
01:00 TimToady we can certainly have a bit somewhere
01:01 jnthn I can go with the linguistic arguments, I just have a knee-jerk "oh noes" against "these types are magical".
01:02 jnthn OK, if we can make exclusion boil down to a property on the meta-object, I'm OK with it.
01:02 jnthn I just don't want all meta-objects to have to start hard-coding type names.
01:07 plobsing left #perl6
01:09 plobsing joined #perl6
01:10 jferrero left #perl6
01:15 * jnthn tries to catch up on sleep a bit
01:15 patspam joined #perl6
01:18 raiph . o O ( \o/ )
01:19 plobsing_ joined #perl6
01:20 plobsing left #perl6
01:24 Italian_Plumber left #perl6
01:28 patspam left #perl6
01:45 molaf_ joined #perl6
01:46 cdarroch left #perl6
01:47 envi^home joined #perl6
01:48 molaf_ left #perl6
01:48 LaVolta joined #perl6
01:49 molaf left #perl6
01:51 molaf joined #perl6
01:53 mikehh left #perl6
01:57 mikehh joined #perl6
02:04 nymacro joined #perl6
02:16 agentzh joined #perl6
02:20 redicaps joined #perl6
02:25 nymacro_ joined #perl6
02:27 rrgau_`` joined #perl6
02:28 nymacro left #perl6
02:28 nymacro_ is now known as nymacro
02:30 rrgau_` left #perl6
02:34 meppl left #perl6
02:37 proller_ left #perl6
02:40 proller joined #perl6
02:41 jaldhar joined #perl6
02:41 jaldhar left #perl6
02:42 jaldhar joined #perl6
02:54 nymacro left #perl6
02:58 nymacro joined #perl6
03:02 molaf left #perl6
03:09 redicaps left #perl6
03:14 rrgau_`` left #perl6
03:18 * araujo tests new code for his language
03:20 kid51 left #perl6
03:32 eternaleye_ is now known as eternaleye
03:32 LionMadeOfLions joined #perl6
03:33 PZt left #perl6
03:38 LaVolta wait...what?! REPL now accept directly input of unicode chars!
03:39 PZt joined #perl6
03:40 LaVolta i ❤ you guys :D
03:41 nymacro xoxo
03:41 nymacro call me
03:48 araujo fact -> { :n if <= n 1 { 1 } { * n fact - n 1 } }
03:48 araujo :)
03:49 leprevost joined #perl6
03:55 DemoFreak left #perl6
04:01 DemoFreak joined #perl6
04:01 DemoFreak left #perl6
04:02 DemoFreak joined #perl6
04:13 ash_gti left #perl6
04:14 smosher joined #perl6
04:26 justatheory left #perl6
04:54 mfollett joined #perl6
05:10 jaldhar left #perl6
05:12 jaldhar joined #perl6
05:15 risou left #perl6
05:15 risou joined #perl6
05:20 risou left #perl6
05:30 risou joined #perl6
05:33 risou left #perl6
05:33 risou joined #perl6
05:38 risou left #perl6
05:44 araujo http://ideone.com/ZLLHx
06:01 mfollett left #perl6
06:01 mfollett joined #perl6
06:04 Guest23195 joined #perl6
06:04 raiph left #perl6
06:07 nymacro left #perl6
06:11 satyavvd joined #perl6
06:19 satyavvd left #perl6
06:32 molaf joined #perl6
06:48 plobsing_ left #perl6
06:49 icwiener joined #perl6
06:51 sorear I'm a little confused by how the type system interacts with binding.
06:52 sorear I'm thinking about "sub foo(Int $x is rw) { $x = 1 }"
06:52 sorear what can I call foo on?
06:52 sorear my Int $k; obviously
06:52 sorear what about my $k; ?
06:52 sorear what about my $k = 5; ?
06:53 sorear what about subtype Even of Int where * !%% 2; my Even $z; ?
06:53 sorear or class SubclassOfInt is Int { }; my SubclassOfInt $z; ?
06:54 sorear How much of this changes if 'is rw' is removed?
06:54 sorear Does Perl 6 have anything like an InvalidArrayStoreException?
06:56 mfollett left #perl6
07:06 nymacro joined #perl6
07:06 Ross joined #perl6
07:06 Ross left #perl6
07:06 Ross joined #perl6
07:06 nymacro left #perl6
08:08 schpey joined #perl6
08:09 moritz_ good morning
08:11 nymacro joined #perl6
08:12 nymacro left #perl6
08:18 xinming left #perl6
08:19 xinming joined #perl6
08:36 Trashlord left #perl6
08:39 Trashlord joined #perl6
08:45 sorear hello moritz_
08:45 dual left #perl6
08:54 molaf left #perl6
09:13 cosimo hi everyone
09:15 moritz_ o/
09:16 Grrrr joined #perl6
09:30 tadzik good morning
09:30 cosimo rakudo: my $x = Mu; my $y = 42; my $z = $x // $y; say $z;
09:30 p6eval rakudo 13c8a2: OUTPUT«42␤»
09:35 icwiener left #perl6
09:35 icwiener joined #perl6
09:36 icwiener left #perl6
09:42 clintongormley joined #perl6
09:43 clintongormley Hi all - anybody have any idea what has happened to Adriano Ferreira?
09:43 clintongormley I see that none of his many CPAN modules has received any loving in the last year or so
09:43 clintongormley i haven't tried emailing him yet, but anybody seen him recently?
09:47 moritz_ clintongormley: do you happen to remember his nick?
09:47 clintongormley hi moritz_ - no, no idea i'm afraid
09:47 clintongormley on cpan he is just 'ferreira'
09:48 sorear You might have better luck asking on #toolchain or #p5p or #perl (all MAGnet)
09:48 moritz_ clintongormley: and here too... last activity in Dec 2007: http://irclog.perlgeek.de/search.pl?channel=perl6&amp;nick=ferreira&amp;q=
09:49 clintongormley hmm, wonder if he is ok
09:49 clintongormley sorear: yes?
09:49 clintongormley actually, i'll just email him and see if i get a response
09:49 clintongormley thanks all
09:49 moritz_ http://blog.rafaelferreira.net/ # last blog post from June 08
09:50 kjeldahl joined #perl6
09:50 sorear clintongormley: FERREIRA/Compress-unLZMA-0.04 uploaded 17 July
09:50 sorear (2010)
09:50 clintongormley ah interesting! so he is alive and releasing
09:50 clintongormley good to know
09:56 moritz_ http://www.perlmonks.org/?node_id=861938 any Perl 6 solutions?
09:58 sorear for @array.natatime(3) { .say }
09:58 moritz_ is that specced?
09:59 cosimo rakudo: my $x = False; say $x.perl;
09:59 p6eval rakudo 13c8a2: OUTPUT«Bool::False␤»
10:01 icwiener joined #perl6
10:01 sorear not explicitly, but I was under the impression all of List::'More'?Utils was going to be brought into core as methods
10:02 * araujo adds support for nested lists
10:04 QinGW left #perl6
10:06 tadzik where is the newest Rakudo on feather?
10:06 moritz_ rakudo: say (0, 3 ...^ 10)
10:06 moritz_ tadzik: problably nowhere
10:06 p6eval rakudo 13c8a2:
10:06 p6eval ..OUTPUT«(timeout)821242730333639424548515457606366697275788184879093969910210510811111411712012312612913213513814114414715015315615916216516817117417718018318618919219519820120420721021321621922222522823123423724024324624925225525826126426727027327627928228528829129429730030330630931231531…
10:07 tadzik hm
10:07 tadzik mind if I build some?
10:07 moritz_ no
10:10 sorear What is Rakudo build memory usage like these days?
10:10 * moritz_ hasn't monitored it after The Big GC Merge
10:11 * sorear top(1)s feather1 looking for tadzik
10:12 tadzik there's htop, don't be so spartan
10:12 sorear hmm, tadzik not in who
10:12 tadzik :)
10:12 tadzik NYLI
10:15 somebody joined #perl6
10:19 LaVolta left #perl6
10:23 moritz_ rakudo: my @l = <a bb c d e f g h>; sub chunky(@l, $len) { (@l Z  (' ' xx $len - 1, "\n") xx *).join.substr(0, -1) ~ "\n";
10:23 p6eval rakudo 13c8a2: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
10:23 moritz_ rakudo: my @l = <a bb c d e f g h>; sub chunky(@l, $len) { (@l Z  (' ' xx $len - 1, "\n") xx *).join.substr(0, -1) ~ "\n"; }; print chunky(@l, 3)
10:23 p6eval rakudo 13c8a2: OUTPUT«a bb c␤d e f␤g h␤»
10:24 araujo http://ideone.com/iLZ1V
10:24 agentzh left #perl6
10:24 araujo I guess [ ] is sane enough :P
10:27 sorear niecza: say "@@L1" # Oops.
10:27 p6eval niecza eb45fca: OUTPUT«[31m===[0mSORRY![31m===[0m␤Invalid hard reference syntax at /tmp/P10UPdLYXL line 1:␤------> [32msay "@[33m⏏[31m@L1" # Oops.[0m␤    expecting any of:␤     desigilname␤      twigil␤Parse failed␤»
10:27 sorear niecza: say '@@L1' # Oops.
10:27 p6eval niecza eb45fca: OUTPUT«Use of uninitialized value in substitution iterator at /home/p6eval/niecza/src/CodeGen.pm line 850.␤Use of uninitialized value in substitution iterator at /home/p6eval/niecza/src/CodeGen.pm line 850.␤␤»
10:29 somebody left #perl6
10:30 tadzik Parrot VM: PANIC: Out of mem!
10:30 moritz_ tadzik: please file a parrot bug
10:32 tadzik crap, I have to register?
10:32 sorear tadzik: trac sucks
10:32 tadzik :F
10:32 sorear the alternative is getting ~10 spam bugs /hr
10:33 tadzik well, on github you have to register too
10:33 plobsing joined #perl6
10:34 sorear ok, rakudo on gc_massacre is still using an egregious amount of memory
10:34 sorear I killed src/Perl6/Grammar.pm at 350mb
10:34 sorear (parrot-nqp even, not rakudo)
10:38 clintongormley left #perl6
10:44 sorear tadzik: sure that's a bug?
10:44 tadzik moritz_ | tadzik: please file a parrot bug
10:45 sorear also, why is Parrot allocating memory in chunks of 4096 bytes
10:46 moritz_ why shouldn't it?
10:47 sorear because quite a few mallocs like to allocate memory in round numbers of bytes
10:48 sorear since free(p) needs to know how many bytes to free, malloc(4096) needs to allocate the nearest round number above 4100 bytes
10:49 moritz_ where does that magic number come from?
10:49 sorear which one?
10:49 sorear 4096 or 4?
10:50 moritz_ 4
10:51 sorear 4 is sizeof(int) and thus the minimum possible malloc overhead on a system that can run Parrot
10:51 sorear *minimum sizeof(int)
10:52 sorear in practice malloc overhead is almost always sizeof(double) due to alignment concerns; 16 bytes is the traditional amount to leave before 2^n
10:53 sorear (or you just include your own allocator, like perl5 does)
10:54 plobsing sorear: I must have a magical malloc then, because perl6 -e '' seems to be running brk at increments of 4K
10:56 rgrau_ joined #perl6
10:58 sorear plobsing: what libc do you have?  I should run a proper survey some time instead of sharing conventional wisdom
10:59 plobsing glibc 2.12.1-1
11:03 schpey left #perl6
11:14 sorear I have libc 2.11.2-2
11:15 sorear allocating 2 bytes 1M times -> 15708kb
11:17 colomon sorear: been a long time since I thought about it, but a smart memory allocator theoretically doesn't need more than one bit overhead per allocation, does it?  though that doesn't deal with alignment issues.
11:18 sorear colomon: if I could go back in time and change one thing... free(void*, int) wouldn't be #1 but it would be high up there
11:19 dalek book: a6b8fdd | moritz++ | src/grammars.pod:
11:19 dalek book: [grammars] try to simplify an explanation
11:19 dalek book: review: http://github.com/perl6/book/commit/a6b8fdd2982d33a7f9605934bc4a3ed961d8a8e5
11:19 sorear testing locally allocations of 4093 through 4100 bytes use the same amount of real memory
11:19 sorear glibc 2.11.2-2 appears to round up allocations to 8n+4
11:19 sorear (i386)
11:21 sorear setting the chunk size to 4096 increases brk 4k at a time (plobsing), although it's using 4104 bytes; my libc isn't magic but it's smarter than I gave it credit for
11:21 satyavvd joined #perl6
11:23 sorear actually it seems to be 8n+12; 4 and 5 bytes are same allocation
11:23 sorear a little weird
11:24 colomon 32-bit or 64-bit?
11:25 sorear 32
11:26 colomon huh.  maybe some sort of buffer at the end to provide primitive overrun protection?
11:28 * sorear out
11:35 araujo left #perl6
11:38 zulon joined #perl6
11:46 colomon Did Rakudo release on Thursday?  My impression from github is yes, but I haven't seen a release announcement anywhere yet...
11:46 moritz_ yes; announcement went to p6c
11:46 plobsing I'm eager to see the r* benchmark graph after this release.
11:49 tadzik R* is today?
11:50 moritz_ colomon: the new policy is to not send the Rakudo compiler announcement to too many places, to avoid confusion with the R* releases
11:50 colomon ah
11:55 * colomon remembers he hasn't checked one of his e-mail addresses in a full week now...
11:58 * moritz_ just explained the second solution in http://www.perlmonks.org/?node_id=861941 to my wife
11:58 moritz_ (in detail, and with detours to named arguments)
11:59 mberends wife++
12:00 mberends and maybe, moritz_++ ;)
12:00 moritz_ :-)
12:01 meppl joined #perl6
12:03 plobsing karma wife
12:03 aloha wife has karma of 1.
12:07 rgrau_` joined #perl6
12:09 moritz_ and now we're producing SVG graphs, and because she wants a happy face I need to relearn SVG paths :-)
12:09 rgrau_ left #perl6
12:11 moritz_ http://moritz.faui2k3.org/tmp/happy-face.svg is the result
12:15 tadzik :)
12:17 plobsing contented H2O?
12:18 Ross left #perl6
12:19 moritz_ modern "art" :-)
12:20 Ross joined #perl6
12:22 zulon left #perl6
12:23 schpey joined #perl6
12:36 nymacro joined #perl6
12:51 araujo joined #perl6
13:11 satyavvd left #perl6
13:12 jnthn good afternoon, #perl6
13:12 tadzik good afternoon jnthn
13:15 zulon joined #perl6
13:17 Patterner left #perl6
13:18 jest joined #perl6
13:19 moritz_ rakudo: my $x = 5; enum A b => $x; say b
13:19 p6eval rakudo 13c8a2: OUTPUT«Could not find sub &A␤  in main program body at line 22:/tmp/bVfK2UBm2y␤»
13:19 moritz_ rakudo: my $x = 5; enum A (b => $x); say b
13:19 p6eval rakudo 13c8a2: OUTPUT«===SORRY!===␤Symbol '$x' not predeclared in <anonymous> (/tmp/sUkVnkYaiT:22)␤»
13:19 moritz_ it's so easy to find LTA error messages while reading through Actions.pm :/
13:27 jest hi
13:27 jest considering bug http://github.com/perl6/book/issues/issue/20, here is a fix: http://pastie.org/1180989
13:28 jest but I'm not sure if it should go to the book repo, or rather to Pod::PseudoPod::LaTeX
13:29 Psyche^ joined #perl6
13:29 Psyche^ is now known as Patterner
13:31 sasha joined #perl6
13:33 * moritz_ tries it in the book repo first
13:34 moritz_ jest: pushed to the fix_index branch of the book... I need to start another PC to check if it works (can't build the book on my laptop, the latex there is too old)
13:36 jest moritz_: ok; I just checked the change on my comp, the only diefference in TeX input is '!' replaced to '"!', and '!' appears in the index correctly (it wasn't previously)
13:36 sasha left #perl6
13:39 moritz_ indeed, works on my second machine too
13:39 moritz_ jest++
13:39 moritz_ jest++
13:39 moritz_ jest++
13:41 dalek book: e76fe15 | moritz++ | lib/Perl6BookLatex.pm:
13:41 dalek book: fix index; patch courtesy by jest++
13:41 dalek book: review: http://github.com/perl6/book/commit/e76fe158341bb0a747e975774096fce19da7c123
13:41 sasha joined #perl6
13:41 sasha left #perl6
13:43 sasha joined #perl6
13:43 tadzik left #perl6
13:46 sasha left #perl6
13:51 moritz_ http://www.perlmonks.org/?node_id=861950
13:54 jnthn moritz_++ # it's nice to be able to tick things off lists like that :-)
13:54 moritz_ if I were a user of logging frameworks, I'd now be tempted to write one
13:55 moritz_ I guess I'll rather work on my Sudoku solver instead :-)
13:55 jest left #perl6
13:56 tadzik joined #perl6
13:58 rgrau_` left #perl6
14:02 miso_soup joined #perl6
14:08 tadzik what do you think about including a module manager with Star this month?
14:10 moritz_ +1, if we have one :-)
14:11 TimToady http://www.perlmonks.org/?node_id=861959
14:12 tadzik well, I can say we have once someone tests neutro on windows
14:12 moritz_ tadzik: even linux-only would be great start
14:13 tadzik moritz_: it works on linux since the first commit ;P)
14:13 tadzik :)
14:13 tadzik what an ugly face I made
14:13 tadzik TimToady: I'm amazed
14:14 tadzik btw, is there a way to, uhm, reset .munch?
14:14 tadzik ah, create a new array
14:17 colomon TimToady++
14:21 flussence joined #perl6
14:22 TimToady btw, if someone wants to work on my current favorite LTA message, it's "Use of uninitialized value in numeric context" with nary a mention of location.
14:24 moritz_ rakudo: say Any + 3
14:24 p6eval rakudo 13c8a2: OUTPUT«Use of uninitialized value in numeric context␤3␤»
14:28 TimToady that gets more irritating as your program gets larger
14:29 Chillance joined #perl6
14:29 TimToady and as your data becomes less toylike and random
14:29 dual joined #perl6
14:29 moritz_ $ ./perl6 -e 'say Any +3 '
14:29 moritz_ Use of uninitialized value in numeric context at line 1372:CORE.setting
14:29 moritz_ 3
14:29 moritz_ fail :-)
14:30 moritz_ and inspecting the calling location would point to the definition of infix:<+>
14:32 mfollett joined #perl6
14:37 TimToady rakudo: say callframe(2).line
14:37 p6eval rakudo 13c8a2: OUTPUT«1␤»
14:38 moritz_ but how do we know how many callframes to walk?
14:38 TimToady it's supposed to be able to do pattern matching
14:38 wamba joined #perl6
14:38 jnthn Walk until not in CORE.setting?
14:39 moritz_ jnthn: that's a good idea, I think
14:41 moritz_ rakudo: my %h = a => 1, b => 2; say "a"trans(["a", "b"] => ["A", "B"])
14:41 p6eval rakudo 13c8a2: OUTPUT«===SORRY!===␤Confused at line 22, near "say \"a\"tra"␤»
14:41 moritz_ rakudo: my %h = a => 1, b => 2; say %a.keys[0].trans(["a", "b"] => ["A", "B"])
14:41 p6eval rakudo 13c8a2: OUTPUT«===SORRY!===␤Symbol '%a' not predeclared in <anonymous> (/tmp/fLta1M1iUA:22)␤»
14:41 moritz_ rakudo: my %h = a => 1, b => 2; say %h.keys[0].trans(["a", "b"] => ["A", "B"])
14:41 p6eval rakudo 13c8a2: OUTPUT«too few positional arguments: 2 passed, 3 (or more) expected␤  in main program body at line 22:/tmp/uBDci8MhTZ␤»
14:44 colomon not again....
14:45 moritz_ indeed not agian
14:45 moritz_ I'm adding a few prefix:<~> to EnumMap.pm
14:46 * TimToady will be offline for most of today
14:46 TimToady &
14:47 Raynes You will be missed.
14:47 TimToady sorear: I think in-out parameters have to match type exactly in most language because of co-contravariant considerations; if we violate that, we have to do some kind of coercion somewhere.
14:47 TimToady really &
14:52 kid51 joined #perl6
14:53 kid51 In Perl 6, what is the equivalent to Perl 5's 'perl -c somefile'?
14:53 flussence perl6 -c somefile
14:53 flussence it was broken and only fixed recently
14:54 flussence try rakudo 2010.09
14:54 kid51 But I get (in August Rakudo Star release):
14:54 kid51 $ perl6 -c multi.pl
14:54 kid51 ===SORRY!===
14:54 kid51 Unable to open filehandle from path '-c'
14:54 flussence yeah, it's been fixed since then
14:54 flussence a few days ago IIRC
14:54 kid51 Well, I'm in a study group which specifically focuses on Rakudo Star releases, so I can't use that yet.
14:55 xabbu42_ left #perl6
14:55 xabbu42 joined #perl6
14:55 literal left #perl6
14:59 nymacro they have Rakudo* study groups?
15:01 pmichaud -c was only added a few days ago... it'll show up in the next Star release (on Tuesday)
15:07 zulon left #perl6
15:07 kid51 NYC Rakudo Star group:  http://tech.groups.yahoo.com/group/perlsemny/message/1016
15:07 * kid51 has to get ready to go to that now
15:08 icwiener_ joined #perl6
15:09 icwiener left #perl6
15:09 risou joined #perl6
15:09 jnthn kid51: Looks like fun event :-)
15:09 jnthn Enjoy
15:10 flussence of course you could always use parsefile() as a workaround until then...
15:18 risou_ joined #perl6
15:20 risou left #perl6
15:20 jimk joined #perl6
15:22 kid51 left #perl6
15:22 nymacro now if only I could find some awesome groups in Brisbane, Australia ;)
15:23 icwiener_ left #perl6
15:23 tadzik you don't have a PM group there?
15:24 nymacro not to my knowledge
15:25 nymacro actually, maybe there is
15:25 nymacro wait. No. Past meetings: 2005
15:26 tadzik start one :)
15:26 dalek rakudo: 2632afb | moritz++ | src/core/EnumMap.pm:
15:26 dalek rakudo: fix EnumMap.keys and .kv to return proper Perl 6 strings
15:26 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/2632afb7e582be6fbdf236a6ef13e8a5e6f5e433
15:27 jimk nymacro:  Find a pub with wireless access.  Convene meeting.
15:27 jimk Simple
15:28 moritz_ one step missing
15:28 moritz_ find others interesting in the same topic
15:28 tadzik wireless access? We usually seek for pubs with beer access
15:28 nymacro ^ this ;)
15:28 jimk 'beer' is the 'interesting topic'
15:28 tadzik Rakudo Star meeting shows that a pub with beer access is not so obvious
15:28 moritz_ there are pubs without beer access?
15:29 jimk We have one ozzie coming to group today
15:29 justatheory joined #perl6
15:29 nymacro crikey!
15:29 tadzik moritz_: when we came, there was a note "out of beer". We bought everything they had, and we were lucky it was enough
15:30 ash_ joined #perl6
15:31 nymacro I might look into the viability of running such a group in Brisbane; if there is enough interested parties and I can find some mutually acceptable interests/topic areas it will be on ;)
15:31 jimk is now known as kid51
15:31 pmichaud even small groups (3-5 people) can be very worthwhile :)
15:32 kid51 nymacro: 10 years ago, we started Perl Seminar NY in a very simple manner:  I called the meeting.  I presented the very first Perl 5 program I had ever put into production.
15:32 kid51 My ambition:  To live long enough to translate *that* program into P6.
15:33 PacoLinux left #perl6
15:33 nymacro well said :)
15:33 kid51 pmichaud attends a Perl 6-focused group in DFW
15:33 moritz_ kid51: what did it do?
15:34 PacoLinux joined #perl6
15:34 kid51 It was when I was working in state psych hospital and had to refer patients to other hospitals.
15:35 kid51 It translated patient's (extensive) medication history from downloaded-from-mainframe format to one requested by MDs at other hospital.
15:35 kid51 Used Perl 5 formats!
15:36 pmichaud mmmmm, formats.  I haven't used formats since.... Perl 4.  :-P
15:49 icwiener joined #perl6
15:53 kid51 left #perl6
16:05 patspam joined #perl6
16:07 masonkramer joined #perl6
16:10 patspam left #perl6
16:16 engine joined #perl6
16:18 xabbu42 left #perl6
16:19 risou joined #perl6
16:20 engine left #perl6
16:20 engine joined #perl6
16:21 risou_ left #perl6
16:22 whoever joined #perl6
16:22 whoever is now known as Guest3416
16:23 hillu left #perl6
16:25 engine left #perl6
16:40 moritz_ nqp: loop (my $x := 0; $x < 10; $x++) { if $x > 1 { last }; say $x }
16:40 p6eval nqp: OUTPUT«PackFile_unpack: This Parrot cannot read bytecode files with version 8.3.␤␤PackFile header failed during unpack␤»
16:46 tadzik (:
16:50 zulon joined #perl6
16:57 sjn left #perl6
17:00 sjn joined #perl6
17:12 nymacro left #perl6
17:15 aloha left #perl6
17:19 tadzik left #perl6
17:24 aloha joined #perl6
17:26 literal joined #perl6
17:27 ruoso left #perl6
17:32 zulon left #perl6
17:37 mfollett left #perl6
17:41 ruoso joined #perl6
17:48 patspam joined #perl6
17:49 dalek 6model: a301155 | mberends++ | java/runtime/ (2 files):
17:49 dalek 6model: [java] add SignatureBinder
17:49 dalek 6model: review: http://github.com/jnthn/6model/commit/a30115588e5893a62b5329ba8a6d9f8f07fcf365
17:49 dalek 6model: 84b214c | mberends++ | / (4 files):
17:49 dalek 6model: [java] incomplete ports of PAST2JSTCompiler.pm and JST2Java.pm
17:49 dalek 6model: review: http://github.com/jnthn/6model/commit/84b214c3661708aeb48f6437d67df3b1478b90cd
17:53 uniejo joined #perl6
17:59 kjeldahl left #perl6
17:59 hillu joined #perl6
18:00 Ross left #perl6
18:03 masonkramer Instant and Duration are builtin types, but Weight, Currency, Temperature aren't, right?
18:04 masonkramer I'm trying to do the last chapter of Higher Order Perl in Perl6, and I thought maybe it deserves some polish and to be made available on CPAN6
18:05 flussence rakudo: say Instant.WHAT; say Duration.WHAT; say Temperature.WHAT;
18:05 p6eval rakudo 2632af: OUTPUT«Instant()␤Duration()␤Could not find sub &Temperature␤  in main program body at line 22:/tmp/ptzgC6tXrQ␤»
18:07 masonkramer I thought we weren't going back to the implementation for a definitive answer about the language anymore :p
18:07 kjeldahl joined #perl6
18:09 M_o_C joined #perl6
18:09 flussence Google says they don't exist in the spec as builtins ;)
18:10 kid51 joined #perl6
18:10 dha joined #perl6
18:10 sorear good * #perl6
18:11 kid51 patspam: file questions about PDF at http://github.com/perl6/book/issues/
18:11 patspam ta
18:11 patspam what git tag should I checkout to build the latest Rakudo Star release?
18:11 heins57 joined #perl6
18:12 TheFox21 joined #perl6
18:14 colomon masonkramer++
18:17 sorear kid51++ # love for people like me with ancient boxes
18:17 Front_slash joined #perl6
18:18 * sorear makes the same change and tests Rakudo build again
18:18 sorear (it did not work AT ALL previously - ludicrous memory usage during the parrot-nqp stage)
18:21 Front_slash left #perl6
18:21 aindilis left #perl6
18:22 risou left #perl6
18:22 aindilis joined #perl6
18:26 kid51 sorear:  Ah, now I see what you're saying.
18:26 kid51 I'll have to try building Rakudo on this box again.
18:29 aindilis left #perl6
18:30 aindilis joined #perl6
18:34 patspam star: sub x(Bool){}
18:34 p6eval star 2010.07:  ( no output )
18:34 patspam that that valid?
18:35 patspam s/sub/multi/
18:35 patspam star: multi x(Bool $x){}; multi x(Bool){}; x(True)
18:35 p6eval star 2010.07: OUTPUT«Ambiguous dispatch to multi 'x'. Ambiguous candidates had signatures:␤:(Bool $x)␤:(Bool )␤␤  in main program body at line 22:/tmp/k64hJX__5u␤»
18:36 colomon star: multi x(Bool){ say "indeed" }; x(True)
18:36 p6eval star 2010.07: OUTPUT«indeed␤»
18:36 jnthn patspam: It's valid, but the dispatcher is correct to point out that they're ambiguous if you write both.
18:36 patspam hey jnthn!
18:36 jnthn o/ patspam
18:36 patspam so you'd never be able to call either?
18:37 sorear kid51: after 11 minutes cpu, setting build is now thrashing
18:37 sorear 360mb virt
18:37 sorear 'pir' stage
18:39 dha Out of curiosity, is the p6eval bot actually running rakudo* 2010.07, as it seems to be saying?
18:40 schpey left #perl6
18:40 aindilis left #perl6
18:41 patspam star: sub x(){ shift }; x()
18:41 p6eval star 2010.07: OUTPUT«Not enough positional parameters passed; got 0 but expected 1␤  in 'shift' at line 2846:CORE.setting␤  in 'x' at line 22:/tmp/AYG_6nuYF5␤  in main program body at line 22:/tmp/AYG_6nuYF5␤»
18:41 patspam sub x(){ shift }; x(1)
18:43 patspam star: sub x(){ shift }; x(1)
18:43 p6eval star 2010.07: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤  in 'x' at line 22:/tmp/jZAnUlSiVA␤  in main program body at line 22:/tmp/jZAnUlSiVA␤»
18:43 patspam damned if I do, damned if I don't
18:45 masonkramer Say I have two class files in my @*INC: Wire.pm and Node.pm.  Nodes have Wire attributes, and Wires have Node attributes.  How do I declare the Node type in Wire.pm and vice versa?  use Node;/user Wire; is infinitely recursive
18:46 patspam shift: sub x($x){ shift }; x(1)
18:46 patspam star: sub x($x){ shift }; x(1)
18:46 p6eval star 2010.07: OUTPUT«Not enough positional parameters passed; got 0 but expected 1␤  in 'shift' at line 2846:CORE.setting␤  in 'x' at line 22:/tmp/Ufp2hUnnE2␤  in main program body at line 22:/tmp/Ufp2hUnnE2␤»
18:47 patspam is there a way to define the sub so that I can still use shift a la Perl5?
18:47 plobsing star: sub x { .shift }; x(1)
18:47 p6eval star 2010.07: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤  in 'x' at line 22:/tmp/qz_V4icVSS␤  in main program body at line 22:/tmp/qz_V4icVSS␤»
18:47 flussence sub x(*@a) maybe
18:48 patspam star: sub x(*@a) { shift }; x(1)
18:48 p6eval star 2010.07: OUTPUT«Not enough positional parameters passed; got 0 but expected 1␤  in 'shift' at line 2846:CORE.setting␤  in 'x' at line 22:/tmp/0ec9VED1xc␤  in main program body at line 22:/tmp/0ec9VED1xc␤»
18:48 plobsing start: sub x { shift @_ }; x(1)
18:49 patspam that works
18:49 patspam so what is shift doing when you don't give it @_ as an argument?
18:49 plobsing implicit use of @_ (and to a lesser extent $_) are changed/gone
18:50 colomon star: sub x { .shift }; x(1)
18:50 plobsing patspam: shift without @_ is simply that: shift(). No arguments.
18:50 p6eval star 2010.07: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤  in 'x' at line 22:/tmp/GNnnBKqT3j␤  in main program body at line 22:/tmp/GNnnBKqT3j␤»
18:50 masonkramer perhaps you could point me to a synopsis on this?
18:50 masonkramer I can't find much in the way of multi-file examples
18:51 patspam shift without arguments seems to be confusing signature checking
18:53 flussence rakudo: sub x(*@_) { @_.shift }; x(1);
18:53 jnthn patspam: There isn't a shift multi-candidate that takes no arguments.
18:53 p6eval rakudo 2632af:  ( no output )
18:53 flussence the error without that "@_." isn't very friendly though
18:53 flussence rakudo: sub x(*@_) { shift }; x(1);
18:54 p6eval rakudo 2632af: OUTPUT«(timeout)Not enough positional parameters passed; got 0 but expected 1␤  in 'shift' at line 2964:CORE.setting␤  in 'x' at line 22:/tmp/0QphK_aKeB␤  in main program body at line 22:/tmp/0QphK_aKeB␤»
18:54 flussence eh
18:54 flussence it only gives me the first error line locally
18:57 plobsing masonkramer: class A {...}; class B { has A $.a }; class A { has B $.b }
18:58 masonkramer that works because those classes are in the same lexical scope
18:58 masonkramer My classes are in their own files
18:59 masonkramer if I have class Wire; need Node; # Wire.pm
18:59 masonkramer class Node; need Wire;# Node.pm
18:59 masonkramer I get all sorts of errors
19:00 masonkramer eg ./perl6 usr/lib/Wire.pm
19:00 masonkramer ===SORRY!===
19:00 masonkramer Illegal redeclaration of symbol 'Wire'
19:00 envi^home left #perl6
19:02 mberends left #perl6
19:03 Ross joined #perl6
19:03 Ross left #perl6
19:03 Ross joined #perl6
19:03 plobsing masonkramer: A.pm - 'use B; class A { has B $.b }'
19:03 colomon masonkramer: why do you think you need to do that?
19:04 plobsing B.pm 'class A {...}; class B { has A $.a }; use A;'
19:04 patspam star: multi x(Bool $){}; multi x(Bool){}; x(True)
19:04 plobsing main.pm 'use A; use B'
19:04 p6eval star 2010.07: OUTPUT«Ambiguous dispatch to multi 'x'. Ambiguous candidates had signatures:␤:(Bool )␤:(Bool )␤␤  in main program body at line 22:/tmp/exX1ngaDvV␤»
19:04 plobsing works fine for me
19:05 masonkramer ( working through replies... )
19:06 colomon (plobsing's approach is would be my first thought as well.)
19:08 masonkramer colomon: wtr to why: Wires have Nodes and Nodes have Wires
19:08 masonkramer so class A { ... }; is serving as the declaration of A here?
19:09 colomon yes
19:09 plobsing predeclaration, yes
19:09 masak joined #perl6
19:09 masak ahoj!
19:09 colomon o/
19:11 masonkramer where is the illegal redeclaration of symbol 'Wire' coming from?
19:11 colomon when you load Wire, it loads Node, which loads Wire.
19:12 masonkramer This is a symmetrical dependency
19:12 masonkramer so having one class predeclare the other -
19:13 masonkramer but second predeclare the first
19:13 masonkramer how can I chose which one does it? heh
19:14 masak rakudo: class A { ... }; class B { has A $.a }; class A { has B $.b }; say "alive! \o/"
19:14 p6eval rakudo 2632af: OUTPUT«===SORRY!===␤Unrecognized backslash sequence: '\o' at line 22, near "/\""␤»
19:14 masak :P
19:14 masak rakudo: class A { ... }; class B { has A $.a }; class A { has B $.b }; say "alive! \\o/"
19:14 p6eval rakudo 2632af: OUTPUT«alive! \o/␤»
19:15 colomon masonkramer: you could just as easily have both classes predeclare the other...
19:16 jnthn masak: :P
19:18 plobsing rakudo: 30.can('to-radians').signature.perl.say
19:18 p6eval rakudo 2632af: OUTPUT«:(Numeric $x: Any $base;; *%_)␤»
19:18 plobsing what is Any $base?
19:19 masak enum TrigBase is export <Radians Degrees Gradians Circles>;
19:20 masak plobsing: it's a value of that enum type, according to S32/Numeric
19:20 masak I don't find it extremely intuitive that that parameter be a required positional.
19:20 plobsing oic. My thought process was: "base... hmmm... well I want my answers in base 10..."
19:20 masonkramer predeclare each class in the other is giving me an illegal redeclaration error
19:20 masonkramer http://nopaste.snit.ch/23637
19:21 patspam is there a practical difference between multi x(Int){} and multi x(Int $){}?
19:21 colomon ah, right.
19:21 patspam maybe I'm not up to that part of the book yet
19:23 kid51 Do we have any pastebots here?
19:23 colomon masonkramer: forgot about that annoying bit.
19:24 masak patspam: no, no practical difference.
19:25 masonkramer I can't get plobsing's original suggestion to compile either
19:25 kid51 http://nopaste.snit.ch/23640
19:25 wallberg joined #perl6
19:26 plobsing I like it, so long as I get to be player 1.
19:26 patspam thanks masak
19:27 patspam we're working through the Using Perl 6 book atm, hence the barrage of questions
19:27 miso_soup left #perl6
19:27 masak patspam++
19:28 masak others++
19:28 patspam kid51++ mostly
19:32 lichtkind joined #perl6
19:32 masonkramer if main.pl6 only uses Wire *or* Node, then it basically works
19:33 mberends joined #perl6
19:33 cosimo I have a class. I didn't write any new() method. what if I need to do something to initialize the class? can i write a new(), or? is there something like Moose BUILD() method? how does that work?
19:34 jnthn Yes, yes.
19:34 lichtkind moritz_: did you install any chatbots here?
19:34 phenny lichtkind: 20 Sep 12:49Z <[Coke]> tell lichtkind - please give me the exact URL including the tag for your feed.
19:34 phenny lichtkind: 20 Sep 12:49Z <[Coke]> tell lichtkind to email me at will@coleda.com for that.
19:34 lichtkind ah thanks phenny
19:35 jnthn cosimo: http://perlgeek.de/blog-en/perl-6/object-construction-and-initialization.html
19:35 jnthn cosimo: That's a good article.
19:36 cosimo thanks jnthn
19:37 cosimo submethod BUILD. awesome.
19:37 pmurias joined #perl6
19:38 sorear kid51: rakudo build finished; real time 70 minutes, max vsize 420MB; down from a best of 7min/350 (~July); but still better than the overnight run from March
19:39 kid51 sorear:  I'll try to build at home tonight:  Were you using Rakudo Star or pulling from git?
19:43 masak nothingmuch++ # http://blog.woobling.org/2010/09/moose-has-won.html
19:44 heins57 left #perl6
19:44 sorear kid51: got
19:44 sorear git
19:45 sorear hmm, nothingmuch still hasn't relurked since the fake audrey incident
19:48 ruoso left #perl6
19:49 lichtkind jnthn: cheers
19:49 jnthn lichtkind: Na zdravie!
19:49 szabgab joined #perl6
19:49 lichtkind jnthn: skoll :)
19:50 lichtkind jnthn: i think now i officially to work on my grant :)
19:51 jnthn \o/
19:51 kid51 alright, let's go to the movies
19:51 jnthn lichtkind++
19:51 dha left #perl6
19:51 patspam is there an equivalent to perldoc in Perl6?
19:51 lichtkind patspam: not yet
19:52 lichtkind patspam: there is a book some people here write
19:52 patspam heh yeah, that's what I'm working through :)
19:52 lichtkind patspam: and there are the tablets i write
19:52 patspam but say when I want to learn about "shift" in Perl6
19:52 kid51 left #perl6
19:52 patspam what's my spec/doc source?
19:52 lichtkind specs are synopses
19:53 lichtkind http://www.perlfoundation.org/perl6/index.cgi?synopses
19:53 lichtkind but maybe your better served with my index A
19:53 patspam url?
19:54 lichtkind http://www.perlfoundation.org/perl6/index.cgi?perl_6_index_tablet
19:54 patspam thanks
19:54 patspam we're wrapping up here, till next time!
19:54 colomon lichtkind++
19:54 patspam left #perl6
19:55 lichtkind colomon: thanks for what?
19:55 colomon "i officially to work on my grant"  # not thanks so much as applause and encourage
19:56 colomon *ment
19:57 flussence lichtkind++ for that index; I was looking for something like that
19:57 lichtkind thanks its also included in grok
20:00 lichtkind colomon: it was more info because i had to delay that a bit and planet6 for me is broken since i get noone to redirect to my new blog
20:01 sorear Argh
20:01 sorear I spent over an hour building this Rakudo, and it won't even start
20:01 sorear stefan@stefans:/tmp$ perl6
20:01 sorear PackFile_unpack: This Parrot cannot read bytecode files with version 8.4.
20:02 sorear both parrot & rakudo were completely clean before the build
20:02 masak moritz_: working on a Sudoku solver?
20:03 flussence does "ldd perl6" point to the right libparrot?
20:04 sorear flussence: No.  Why not?
20:04 sorear Who broke pbc2exe?
20:04 masak rakudo: my @l = <a bb c d e f g h>; while @l.munch(3) -> $_ { .say }
20:04 ruoso joined #perl6
20:04 p6eval rakudo 2632af: OUTPUT«a bb c␤d e f␤g h␤»
20:04 sorear Why is it linking stuff against Parrot 2.5?
20:05 masonkramer I want to use the default new and do some stuff afterwards...can I use .wrap for this and yet access private attributes?
20:05 flussence sorear: what commands did you use to build?
20:05 masonkramer http://nopaste.snit.ch/23642
20:06 sorear flussence: make
20:07 masonkramer submethod BUILD, alright
20:08 flussence on my system I'm using "rm parrot*/; make realclean; perl Configure.pl --gen-parrot; make all install"... you might need to re-run Configure.pl
20:09 sorear goddamn Makefile wants to rebuild everything now that I've rebuilt Parrot
20:10 * sorear deletes all the dependencies from Makefile
20:12 M_o_C left #perl6
20:12 sorear after far too much manual work, I now have a working perl6
20:13 masak "far too much manual work" seems to be the era we're in so far.
20:13 sorear sudo rm -rf /usr/local/src/parrot /usr/local/lib/parrot /usr/local/lib/libparrot*
20:14 sorear that, then reinstalling Parrot, then manually rebuilding Rakudo (the Makefile is useless), then installing, did it
20:17 mberends yes, over here it's mindlessly `rm -rf parrot parrot_install` whenever PARROT_REVISION shows up in a git pull.
20:19 masak I just 'make realclean' on both my Parrot and Rakudo every time I rebuild.
20:21 TheFox21 left #perl6
20:22 masonkramer my @wires = gather for 1..10 { take Wire.new }; # is there a better way?
20:24 flussence my @wires = Wire.new xx 10; ?
20:24 masak nope
20:24 masak that'll give you the same object ten times.
20:25 masak my @wires = map { Wire.new }, ^10;
20:26 masonkramer I always forget about ^
20:26 masak my @wires = do for ^10 { Wire.new };
20:26 masonkramer thanks masak
20:26 masonkramer is do for lazy?
20:28 jnthn It's lazy but list assignment is not.
20:29 masak masonkramer: 'for' is lazy. 'do' is just making an expression out of what's normally a statement.
20:30 masonkramer do for ^10 is exactly what I want, i'm not really transforming an integer into a Wire, so I don't want to say map
20:30 plobsing rakudo: (do for ^3 { .say }).munch(1)
20:30 p6eval rakudo 2632af: OUTPUT«0␤1␤2␤»
20:30 plobsing not lazy ATM
20:31 masak masonkramer: I think you read too much into the difference, but that's all right. :) use whatever you're comfortable with.
20:32 sorear masak: make realclean wasn't enough
20:32 sorear I had to blow away the install too
20:33 masak sorear: you're probably using --gen-parrot. I'm not.
20:33 sorear I thought I was the only one who wasn't, actually
20:33 sorear the install to blow away was in /usr/local
20:33 masak ok.
20:34 masak I haven't tried rebuilding today, but it's always worked so far.
20:34 sorear anyways I now have a working perl6 again; I think I won't touch parrot or rakudo for a couple months
20:34 flussence rakudo: our multi sub infix:<**>(Block $thing, Int $count) { do for ^$count { $thing.() } }; say ~( { rand } ** 5 );
20:35 p6eval rakudo 2632af: OUTPUT«0.378775026739703 0.40071641471344 0.964106152156951 0.42610601255463 0.0209936362079901␤»
20:37 Grimnir_ joined #perl6
20:40 * mberends forgot that nqp-rx (for 6model) is also blown away while rebuilding Parrot
20:44 lichtkind mberends: hai martin
20:45 wamba left #perl6
20:47 moritz_ nqp: loop (my $x := 0; $x < 10; $x++) { if $x > 1 { last }; say $x }
20:47 p6eval nqp: OUTPUT«Confused at line 1, near "loop (my $"␤current instr.: 'parrot;HLL;Grammar;panic' pc 654 (src/cheats/hll-compiler.pir:206)␤»
20:53 masak moritz_: [backlog] writing on a Sudoku solver?
20:54 moritz_ masak: yes
20:54 masak moritz_: have you found (1) Peter Norvig's very nice solution, (2) Donald Knuth's inspiring solution?
20:54 moritz_ yes and yes
20:54 masak good. and good.
20:54 moritz_ :-)
20:54 masak just checking :)
20:55 moritz_ maybe I should really do dancing links
20:55 wallberg left #perl6
20:55 masak I don't know. maybe fsvo 'really'.
20:55 moritz_ I've been wanting to do that for ages, but somehow the complexity deterred me
20:55 moritz_ and in C++, simple deduction + backtracking was good enough
20:55 masak it doesn't seem as obvious in Perl as in, say C.
20:56 florz moritz_: in perl6?
20:56 colomon wait, there's a Knuth solution?!
20:56 Grimnir_ I have some problems with an example from an perl advent from december. either when I use the normal rakudo or the alpha branch, I get errors. the program is: http://pastie.org/1181554
20:56 moritz_ florz: sure
20:56 Grimnir_ the alpha branch says: No applicable candidates found to dispatch to for 'prefix:='
20:57 Grimnir_ the normal branch starts with the error message: Missing block at line 25, near ";\n    my $"
20:57 moritz_ masak: where "good enough" = "can solve more sudokus in the Rakudo startup time than I can solve in a month" :-)
20:57 masak colomon: http://news.ycombinator.com/item?id=1160781
20:57 masak moritz_: aye.
20:57 florz moritz_: I gave up when rakudo didn't want to construct cartesian products for me ;-)
20:57 sorear ... There is no line 25
20:58 masak florz: what about X?
20:58 Grimnir_ sorry, 2 secs...
20:58 masak rakudo: .say for <1 2 3> X <a b c>
20:58 colomon masak++
20:58 Grimnir_ Missing block at line 2, near ";\n    my $"
20:58 p6eval rakudo 2632af: OUTPUT«1␤a␤1␤b␤1␤c␤2␤a␤2␤b␤2␤c␤3␤a␤3␤b␤3␤c␤»
20:58 moritz_ rakudo: say (<a b> X <c d>).perl
20:58 p6eval rakudo 2632af: OUTPUT«(("a", "c"), ("a", "d"), ("b", "c"), ("b", "d"))␤»
20:58 Grimnir_ I had some commented stuff in the beginning, but not in the pastie
20:59 florz masak: yeah, and then add another list ;-)
20:59 moritz_ $ /perl6 foo.pl abc 2
20:59 moritz_ "abc" rotated 2 characters gives "cde".
20:59 moritz_ with today's Rakudo
20:59 Grimnir_ oh... strange
20:59 masak florz: ah. aye, known deficiency.
20:59 Grimnir_ I'll try to get it again then
20:59 masak florz: I recommend you write your own custom sub for now.
20:59 masak florz: do you want me to try and write it for you?
21:00 florz masak: well, yeah, wasn't sufficiently important - and after all the point was to write a succint perl6 solver, not to write a sudoku solver ;-)
21:00 dalek nqp-rx/nom: 51b35b7 | jnthn++ | / (5 files):
21:00 dalek nqp-rx/nom: Implement P6int/P6num/P6str reprs so far as they are in the .Net version of 6model and add them to the build.
21:00 dalek nqp-rx/nom: review: http://github.com/perl6/nqp-rx/commit/51b35b70d67f6333910be462cdac9b9316d36e59
21:02 moritz_ http://github.com/moritz/perl6-Sudokubtw
21:02 moritz_ http://github.com/moritz/perl6-Sudoku btw
21:02 moritz_ the initializer is still fixed on 9x9, but the rest is completely generic
21:03 moritz_ and the approach with using contraints means it's very easy to change the rules, or add constraints (like for the diagonals)
21:04 moritz_ http://blog.woobling.org/2010/09/moose-has-won.html might be of interest
21:04 * masak pasted that a while ago :)
21:04 * moritz_ hasn't backlogged yet
21:04 moritz_ ye know, #perl6 is a write-only channel :-)
21:04 * sorear ponders a perl 6 minimax demo
21:06 Camille_B joined #perl6
21:06 * plobsing would like to see an LP and QP package in nqp - lpnqp (lp-nqp and lp n' qp)
21:07 moritz_ where LP = Long Playing phonograph record?
21:07 plobsing linear programming
21:08 moritz_ ah
21:08 bobkare joined #perl6
21:08 plobsing although having perl 6 play outdated media would be cool too
21:09 moritz_ and QP = quadratic programming?
21:10 plobsing yes.
21:10 jnthn Can't we just have a generic PP? :-)
21:12 plobsing sure, but it would ruin my pun and probably run slow as hell (IIRC, general QP is NP-hard)
21:12 masak Quarter Pounder is NP-hard?
21:13 moritz_ "Royale with Cheese"!
21:13 plobsing http://en.wikipedia.org/wiki/Quadratic_programming#Complexity
21:13 masak it better have quadratic complexity, or I'll be much disappointed :P
21:14 * moritz_ ponders programming with fractional dimenionality
21:21 Camille_B left #perl6
21:23 lue ohai o/
21:23 masak \o
21:24 flussence lue: [backlog] perl6 for browser scripting sounds insane. might be doable though
21:25 flussence I mean, it's all DOM manipulation in the end, so all you'd need is something that converts the p6 code into JS DOM API calls
21:26 masak converting arbitrary p6 code into js is no easy task.
21:26 lue I tried coding in Javascript, but I think it was a combination of having to constantly look up stuff and liking P6 too much that made me not like it :)
21:27 flussence yeah, JS really could use inline documentation :|
21:27 masak lue: learning to like JavaScript is a good investment for the future.
21:27 moritz_ lue: after you learned Perl 6, you'll have to accept that almost any other language is a major hassle :-)
21:28 moritz_ that shouldn't stop you from learning other languages though
21:28 lue I have used it quite enjoyably in the past. But that was before P6, and I had a place to put the results :P
21:30 flussence apparently I'm not the first person to think of this: https://wiki.mozilla.org/Labs/Bespin/DesignDocs/Inline_Documentation
21:33 lue Ah well, looks like I'll resign to JS. [ until the W3C says it's OK to put P6 in <script> tags :) ]
21:34 flussence (or someone implements P6 in JS...)
21:34 masak lue: doesn't matter much what the w3c says in this case, as long as there's no client-side support for p6 in browsers.
21:39 Chillance left #perl6
21:41 * lue attempts to switch gears before he continues displaying his !knowledge about the finer points of the web
21:41 * lue also can't wait for the IETF to finalize HTML5
21:43 * moritz_ dislikes the word "finalize"
21:44 gottreu left #perl6
21:44 Guest23195 left #perl6
21:46 moritz_ would you like to use a finalized human language?
21:47 masak the requirements on computer standards aren't the same as on spoken languages for humans.
21:47 mberends final*ze should be a banned word in #perl6
21:47 Italian_Plumber joined #perl6
21:47 lue does that mean P6.1 would never happen?
21:48 moritz_ masak: and that's the problem
21:48 jnthn .oO( I thought we called finalize "DESTROY" in Perl 6... )
21:48 masak moritz_: wait, what? no.
21:48 masak moritz_: stability has its place.
21:49 mberends lue: sure it will. But we have plenty of time before P6.0 is final*zed.
21:49 moritz_ masak: and change too
21:49 masak of course.
21:50 masak but I wouldn't consider the places in the computer industry where people have produced stable standards a "problem".
21:52 masak to some extent, I understand p5p's adherence to backwards compatibility over almost all else.
21:53 masak there are some definite advantages to not changing. Perl 6 just happens to be taking the other route, which has a number of advantages, too.
21:54 Italian_Plumber left #perl6
21:56 gabiruh_ left #perl6
21:56 lue In my mind, P6 is not a progression of Perl, but a 'fork' of sorts.
21:56 gabiruh joined #perl6
21:56 Ross left #perl6
21:57 moritz_ right; it's way ahead in some areas, and way behind in others
21:57 masak lue: it's a "new Perl".
21:57 mberends lue: true. P6 does not threaten P5, it offers an alternative Perl.
21:57 masak meme courtesy of jnthn++
21:58 jnthn Surely I wasn't the first person to put it that way? :-)
21:58 masak think so.
22:00 lue .oO(What would the next major step from P5 be called? P5v6?)
22:00 masak lue: 5.14, 5.16, 5.18 ...
22:01 masonkramer when I try to run rakudo*'s perl6 interpreter using an absolute path to it, I get an unknown file error
22:01 masonkramer if I cd to the directory containing perl6 and try again, it works
22:01 masonkramer http://pastie.org/1181654
22:01 masonkramer known issue?
22:01 masak masonkramer: 'make install'
22:02 flussence ...what masak said :)
22:02 masonkramer heh
22:02 * flussence is slow typist
22:02 masonkramer thanks :)
22:02 masak we should probably have a better error message there.
22:03 flussence I dunno, that one's pretty descriptive compared to the generic "Segmentation fault" I got
22:03 masak :P
22:04 moritz_ uhm, didn't we have a better error message for that?
22:04 moritz_ I mean, back in the days?
22:04 masak not that I recall.
22:04 jnthn Yes, alpha did.
22:05 moritz_ and I thought I had ported it to master at some point
22:05 jnthn The code is copy-pasteable to latest, if anyone wants to do os.
22:05 masak wuhwait. "Divide by zero"?
22:05 masak how does a non-installed Rakudo lead to a division by zero? o.O
22:06 masak that's wrong on at least one level.
22:07 plobsing well division is denoted by /. which also is used in paths. so it makes sense ;-)
22:08 lue .oO( maybe the end of the line (...../perl6), not finding perl6 was interpreted as ....../0 ? )
22:08 moritz_ src/Perl6/Compiler.pir lines 37-43
22:08 moritz_ masonkramer: which version of rakudo are you using?
22:08 masak plobsing++ # disturbing rationalization :)
22:09 masonkramer moritz_: how can I tell?  It's one of the * distributions (maybe the only one?)
22:09 masonkramer ./perl6 --version
22:09 masonkramer This compiler is built with the Parrot Compiler Toolkit, parrot revision 47310.
22:09 moritz_ masonkramer: must be the first R* release
22:09 uniejo left #perl6
22:09 moritz_ the second reported it version probably
22:09 moritz_ *its
22:10 moritz_ better error message added on Wed Jun 30 12:34:38 2010 +0200
22:10 masonkramer ok, pulling the latest
22:11 moritz_ there'll be another release next Tuesday
22:11 masonkramer I'll pull then too :)~
22:12 masonkramer there it is right in the readme
22:13 moritz_ you'd be the first to read it :/
22:14 cbk joined #perl6
22:15 masonkramer is there a way to really dump an object? I want more than .perl is giving me
22:15 Nosnam joined #perl6
22:15 Nosnam left #perl6
22:16 masak masonkramer: could you be a bit more specific?
22:16 masonkramer I would try to cook up a little example, but I have to wait for perl6 to build :)
22:17 flussence rakudo: say DateTime.now.perl; # not good enough?
22:17 p6eval rakudo 2632af: OUTPUT«DateTime.new(year => 2010, month => 9, day => 25, hour => 21, minute => 54, second => 26.6693475246429, timezone => 0, formatter => { ... })␤»
22:17 masonkramer Oh, does it do that?
22:17 masonkramer Then I guess the problem is that my objects have no data somehow
22:17 kjeldahl left #perl6
22:17 masak ".perl: does more than you'd think" :)
22:17 moritz_ or maybe your rakudo is too old :-)
22:18 moritz_ rakudo: class A { has $.x = 5 }; say A.new(x => 17).perl
22:18 p6eval rakudo 2632af: OUTPUT«A.new(x => 17)␤»
22:18 ^Mike\b joined #perl6
22:18 ^Mike\b Perl 5 docs say that -w not being mandatory is a bug. Will the equivalent be mandatory in perl 6?
22:19 mfollett joined #perl6
22:19 masak ^Mike\b: yes. it is.
22:19 ^Mike\b cool - what about strict?
22:19 moritz_ not mandatory, but default
22:19 moritz_ (both warnings and strict)
22:19 masak nod.
22:19 masak and right now, there's no way to turn them off.
22:20 ^Mike\b \o/
22:20 masonkramer class A { has @.things }; say A.new(things => <1 2 3>).perl
22:20 masak (and I suspect at least implementing turning off 'strict' will be difficult)
22:20 moritz_ rakudo: class A { has @.things }; say A.new(things => <1 2 3>).perl
22:20 p6eval rakudo 2632af: OUTPUT«A.new(things => ["1", "2", "3"])␤»
22:20 moritz_ masak: I don't think so, once we have enough compile time information
22:21 masak I hope you're right.
22:21 masonkramer is there any difference between things => <1 2 3> and :things(<1 2 3>) ?
22:21 lue any reason you *wouldn't* want warnings and strict, besides being lazy about your programming?
22:21 masak masonkramer: I wouldn't say there is.
22:21 flussence the ()s make precedence a bit more obvious
22:22 masak lue: yes, I've been unable to do some -n and -p one-liners with strict at times.
22:22 moritz_ you can even write it as :things<1 2 3>
22:22 masonkramer That's it?  Both create Parcels?
22:22 masonkramer or Pairs?
22:22 masonkramer what's the difference?
22:22 moritz_ Pairs
22:22 ^Mike\b left #perl6
22:22 masak lue: and selectively turning off warnings is what one wants in some cases.
22:29 sorear jnthn: I don't like DESTROY, fwiw
22:30 jnthn sorear: Well, it's essentially guaranteeeless.
22:30 jnthn (as to when it'll get run)
22:30 jnthn Wo as implementors we can do it however works.
22:30 jnthn (as in, works well for the implementation)
22:30 sorear I mean, having finalizers as object methods feels very wrong
22:31 masonkramer rakudo: class F { has @.things; has $.foo; submethod BUILD { ... }  }; say F.new(:things<1 2 3>, :foo<1>).perl
22:31 p6eval rakudo 2632af: OUTPUT«F.new(things => [], foo => Any)␤»
22:31 masak sorear: why?
22:31 sorear the resurrection problem is a major symptom of the underlying wrongness
22:31 jnthn sorear: What would you want them to be?
22:31 jnthn Resurrection isn't a problem as such.
22:32 moritz_ masonkramer: it's a known bug that BUILD interacts badly with the defualt constructor :(
22:32 jnthn It *is* a pain that it may happen.
22:32 sorear jnthn: The least insane finalizers I've seen were in GHC Haskell, which basically has Mu.attach-finalizer($sub)
22:32 sorear (actually it's integrated with the weak reference system)
22:32 masak when would resurrection happen in DESTROY?
22:32 sorear in particular, $sub does *not* receive a reference to self
22:33 masonkramer moritz_: Yay! This one's not my fault
22:33 sorear which means that objects with finalizers can be collected immediately
22:33 sorear only the data that the finalizer actually closes over needs to be retained
22:33 jnthn sorear: That is quite a nice design.
22:34 jnthn masak: When you for example make another reference to self exist.
22:34 masonkramer moritz_: so if I want to do some more initialization, I currently need to do my own new()?
22:34 masak ah. submethod DESTROY { $global = self } ?
22:36 sorear yes
22:36 plobsing S06 specifies that positional placeholder vars are arranged in "Unicode order". What does that mean? Graphemes? Codepoints?
22:36 masak sorear: I smell a spec patch coming up.
22:37 masak many of the ingredients are there; no-one particularly likes DESTROY/DESTROYALL, there's no implementation of them, and there are known problems with the spec as-is.
22:38 masak I didn't know about the resurrection problem until today. sorear++ for pointing that out.
22:38 jnthn masak: The scariest thing is code that depends on it. ;-)
22:38 masak :(
22:39 jnthn oh gah...once again I have to go chasing a Parrot change rather than doing useful stuff.
22:39 masak why would DESTROY want to be a (sub)method in the first place? because of bottom-up destruction, it would have no attribute objects that one'd want to access anyway.
22:40 masak jnthn: one almost wishes they'd finalize Parrot once and for all. :P
22:43 plobsing a finalized parrot would be a dead parrot. would still have lovely plumage though.
22:43 Italian_Plumber joined #perl6
22:43 lue .oO(And all of the internet would laugh from behind the fourth wall)
22:44 masak "it's not finalized, it's pinin'"
22:45 mberends "it's joined the Choir Eternal" # stability is overrated
22:45 lue Now I feel the need to write the Parrot/P6 version of the dead parrot sketch...
22:46 plobsing look mate, this VM wouldn't voom if you put a million volts through it!
22:46 mberends lue: you absoluetely should
22:47 lue "It's a pun" A pun? "No, one of those things that are backwards and forwards" Endianness? ...
22:48 masonkramer rakudo: class A { sub new { say "hi" } }; A.new.perl
22:48 p6eval rakudo 2632af:  ( no output )
22:48 masak lue: my golly, I think your wit is getting sharper...
22:48 masonkramer class A { sub new { say "hi" } }; say A.new.perl
22:49 masonkramer raaah
22:49 masak :P
22:49 masonkramer rakudo: class A { sub new { say "hi" } }; say A.new.perl
22:49 p6eval rakudo 2632af: OUTPUT«A.new()␤»
22:49 masak rakudo: say "RAAAH!"
22:49 p6eval rakudo 2632af: OUTPUT«RAAAH!␤»
22:50 * lue thinks it would be quite serendipitous if #parrot went down to 0 nicks and disappeared when this topic came up
22:51 dalek nqp-rx/nom: c295c00 | jnthn++ | build/Makefile.in:
22:51 dalek nqp-rx/nom: Need to put building the dynops/dynpmcs pretty early.
22:51 dalek nqp-rx/nom: review: http://github.com/perl6/nqp-rx/commit/c295c009e4bc3a4b7b73ac400979580825fdd233
22:51 dalek nqp-rx/nom: afeebf6 | jnthn++ | src/ops/nqp.ops:
22:51 dalek nqp-rx/nom: Make sure we don't double-init the meta-model / dynops.
22:51 dalek nqp-rx/nom: review: http://github.com/perl6/nqp-rx/commit/afeebf681f807ad2ea976bd7ce9c248b48bfc0c0
22:51 dalek nqp-rx/nom: d84b3db | jnthn++ | / (2 files):
22:51 dalek nqp-rx/nom: Bump to latest Parrot to get .loadlib on PAST blocks, and chase a Parrot NCI PMC API change.
22:51 dalek nqp-rx/nom: review: http://github.com/perl6/nqp-rx/commit/d84b3dbd832ff295f0effdeb0e2476e86daeb4fa
22:51 masonkramer is that supposed to happen?
22:51 Italian_Plumber left #perl6
22:51 masak masonkramer: I think you think that defining a sub 'new' overrides the method '.new' from Mu.
22:52 masonkramer if there's a method new and a sub new, how do I get the sub new?
22:52 masak rakudo: class A { method foo { bar() }; sub bar { say "OH HAI" } }; A.new.foo
22:52 p6eval rakudo 2632af: OUTPUT«OH HAI␤»
22:53 masak does that answer your question?
22:53 masak .foo and &bar have different names here, but it'd work if they had the same name too.
22:53 masak because the calling mechanisms are different.
22:54 masonkramer yes
22:54 masonkramer sorry.  I'm still in perl5 land
22:54 sorear interesting mini-survey of finalization: ftp://ftp.inf.puc-rio.br/pub/docs/techreports/04_30_leal.ps
22:55 masak masonkramer: you're not the first to be confused about this issue.
22:55 masak sorear: thanks for that reference.
22:57 masak I'm more and more convinced that we should emulate GHC in this regard.
23:00 jnthn It'd have my +1
23:01 plobsing how does not giving finalizers an explicit reference to main solve the underlying issue? can't the same problems occur with cyclic datastructures?
23:01 plobsing s/main/self/
23:02 masak plobsing: at first blush, it sounds like you're conflating two different problems with that question.
23:02 masak cyclic datastructures are a problem in e.g. refcounting GCs.
23:02 icwiener left #perl6
23:03 masak which would preventing such a GC from ever calling DESTROY in the first place.
23:04 masak whereas resurrection occurs when a DESTROY submethod is called and creates a new surviving reference to self.
23:04 plobsing we prevent 'submethod DESTROY { $global = self }'. but what's to stop a user from 'submethod DESTROY { global = $^self-ref }'?
23:05 plobsing oops. submethod DESTROY { global = $!self-ref }
23:05 sorear ah. *this* is what I was looking for
23:05 sorear http://research.microsoft.com/en-us/um/people/simonpj/Papers/weak.ps.gz
23:05 sorear plobsing: $!self-ref doesn't work without self.
23:05 masak plobsing: the solution is not letting it be a (sub)method.
23:06 masak ah, good ol' simonpj
23:07 plobsing ok, sure it's not a submethod. but it still needs access to attributes somehow. and self can occur within the object graph of an attribute.
23:08 masak plobsing: if it needs access to attributes, then the GHC solution (as I understand it) is out of the question.
23:08 masak but I must confess to having very little experience with destructors.
23:08 masak does it actually need to access the attributes.
23:08 masak s/\./?/
23:08 masak and if it does, how can it reliably do that? haven't they already been GC'd?
23:09 plobsing how do you destroy a filehandle without having access to the underlying fd?
23:09 masak good question.
23:09 masak that's certainly a use case we must factor in.
23:10 masonkramer so is there no way to use the default new constructor with BUILD?
23:10 masak sure there is.
23:11 masak rakudo: class A { has $.x }; say A.new(x => 42).x
23:11 p6eval rakudo 2632af: OUTPUT«42␤»
23:11 masak rakudo: class A { has $.x; submethod BUILD(:$x) { $!x = 5 } }; say A.new(x => 42).x
23:11 p6eval rakudo 2632af: OUTPUT«5␤»
23:12 masak hugme: hug p6eval
23:12 * hugme hugs p6eval
23:12 cbk masak, how would you do that if x is a hash?
23:13 masak hm.
23:13 cbk A.new( %x = "key", "value")
23:13 cbk just guessen' here
23:13 cbk I need something like this.
23:13 cbk nothing I try works.
23:14 masak rakudo: class A { has %.h }; say A.new(:h<1 a 2 b>).h.perl
23:14 p6eval rakudo 2632af: OUTPUT«{"1" => "a", "2" => "b"}␤»
23:14 cbk now I just have a silly make() method
23:14 masak there are other ways, to be sure. but that one works.
23:15 cbk ok
23:15 jnthn rakudo: say (:h{ a => 1, b => 2}).perl
23:15 cbk I was putting ,'s in there.
23:15 p6eval rakudo 2632af: OUTPUT«"h" => {"a" => 1, "b" => 2}␤»
23:15 masak rakudo: class A { has %.h }; say A.new(:h(a => 1, b => 2).h.perl
23:15 p6eval rakudo 2632af: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤»
23:15 masak rakudo: class A { has %.h }; say A.new(:h(a => 1, b => 2)).h.perl
23:15 p6eval rakudo 2632af: OUTPUT«{"a" => 1, "b" => 2}␤»
23:16 masak rakudo: class A { has %.h }; say A.new(:h{a => 1, b => 2}).h.perl
23:16 p6eval rakudo 2632af: OUTPUT«{"a" => 1, "b" => 2}␤»
23:16 masak \o/
23:16 cbk what is the : in front of the h mean?
23:17 masonkramer rakudo: class F { has @.things; has $.foo; submethod BUILD { self }  }; say F.new(:things<1 2 3>).perl
23:17 p6eval rakudo 2632af: OUTPUT«F.new(things => [], foo => Any)␤»
23:17 masak cbk: 'this parameter is a named parameter'
23:17 masonkramer : is way of setting up a Pair here cbk
23:17 masak or what masonkramer said.
23:17 masak rakudo: say (:h).WHAT
23:17 p6eval rakudo 2632af: OUTPUT«Pair()␤»
23:17 masonkramer masak: what am I doing wrong? things should have <1 2 3>
23:18 cbk I got the array to work but was having problems with the hash.
23:18 masak masonkramer: you're misunderstanding BUILD.
23:18 masak masonkramer: S12 is your reading task for tomorrow :)
23:20 masak #perl6, I bid you good night.
23:20 masak o/
23:20 masak left #perl6
23:20 masonkramer nite
23:21 masonkramer All I want to do is use the default new() method and then call a method on the object after it's created
23:21 masonkramer *headdesk*.  *headdesk*.  *headdesk*.
23:22 masonkramer around new { my ($orig, @args);  my $obj = $orig->(@args);  $obj.id(++$count) }
23:22 masonkramer is there nothing like that?
23:24 jnthn rakudo: class Foo { method BUILD() { self.lol }; method lol() { say "oh lol" } }; Foo.new
23:24 p6eval rakudo 2632af: OUTPUT«oh lol␤»
23:24 jnthn Like that?
23:24 jnthn or
23:25 jnthn rakudo: class Foo { method new() { my $obj = self.bless(*, *%_); $obj.lol; $obj }; method lol() { say "oh lol" } }; Foo.new
23:25 p6eval rakudo 2632af: OUTPUT«oh lol␤»
23:25 dalek nqp-rx/nom: 6addc8f | jnthn++ | src/NQP/Actions.pm:
23:25 dalek nqp-rx/nom: Load nqp_group and nqp_ops and initialize them at the start of an NQP program.
23:25 dalek nqp-rx/nom: review: http://github.com/perl6/nqp-rx/commit/6addc8f3081eb0b7e7fc819a0df91afde724ed81
23:25 dalek nqp-rx/nom: ae7a992 | jnthn++ | src/NQP/Actions.pm:
23:25 dalek nqp-rx/nom: Don't have nqpop support yet, so use pirop for now.
23:25 dalek nqp-rx/nom: review: http://github.com/perl6/nqp-rx/commit/ae7a9925aebf5ba0198c522b5e49b58e5d5cbadd
23:25 dalek nqp-rx/nom: 5a6ffa4 | jnthn++ | src/metamodel/knowhow_bootstrapper.c:
23:25 dalek nqp-rx/nom: Oops, last attempt to modify things to work on latest Parrot missed something. This works.
23:25 dalek nqp-rx/nom: review: http://github.com/perl6/nqp-rx/commit/5a6ffa4d273b3781fbbbc711b4ed6107da2ee733
23:25 dalek nqp-rx/nom: 9937ece | jnthn++ | src/NQP/ (2 files):
23:25 dalek nqp-rx/nom: knowhow declarations using the new meta-model now work.
23:25 dalek nqp-rx/nom: review: http://github.com/perl6/nqp-rx/commit/9937ece4c688ea6924d0bc0dc926282aba46d437
23:26 masonkramer jnthn: ( working through that ... )
23:30 masonkramer First way is not what I'm looking for.  I want to use Mu.new() - that is, I want attributes to be set via Pairs.  Then, I have another attribute that should be set automatically by a method - an autoincrementing ID.  I don't want to rewrite Mu.new()'s behavior in order to extend Mu.new() with something else
23:30 masonkramer second way is also rewriting Mu.new(), I think
23:31 masonkramer not really sure what's going on there
23:34 masonkramer does that make sense?  Is that possible?
23:34 pmurias left #perl6
23:35 jnthn masonkramer: Sounds like what you want is the use case for BUILD
23:35 jnthn BUILD is designed for when you want to do some extra initialization per new instance.
23:35 jnthn Though if you just want unique IDs...
23:36 jnthn rakudo: class Foo { my $cur_id = 0; has $.id = $cur_id++; }; say Foo.new.id for 1..5;
23:36 p6eval rakudo 2632af: OUTPUT«0␤1␤2␤3␤4␤»
23:38 masonkramer rakudo: class F { has @.things; has @.build_things; submethod BUILD { @!build_things = <A B C> }  }; say F.new(:things<1 2 3>).perl
23:38 p6eval rakudo 2632af: OUTPUT«F.new(things => [], build_things => ["A", "B", "C"])␤»
23:38 masonkramer things should have [1, 2, 3], afaict
23:38 jnthn Oh!
23:38 jnthn Damm...that's a Rakudo bug. :/
23:39 masonkramer alright :)
23:39 masonkramer glad I'm on the same page now
23:45 masonkramer so this ability is specced but not quite there yet.  A workaround would be to actually implement the behavior of the default Mu.new
23:45 jnthn masonkramer: Yes, it's not quite working as it should in Rakudo.
23:45 jnthn The spec has it as you expect, so far as I recall.
23:46 masonkramer how do I slurp up all the pairs that are passed to new?  I'm having some trouble figuring that out.  new (@args) { } sets up positional parameters
23:46 masonkramer *%_?
23:47 jnthn They're already slurped into *%_ for you
23:47 masonkramer the interesting that is that, even while working around rakudobugs, my code is still nicer than perl 5's built in OO stuff
23:47 jnthn But you can delcare that explicitly
23:47 jnthn Or give it a nice name
23:47 jnthn *%attrs
23:47 jnthn Or whatever you like :-)
23:48 flussence ...does *%_ work even if I stick non-pairs in between the pairs?
23:48 dalek nqp-rx/nom: 771e2ba | jnthn++ | src/metamodel/how/NQPClassHOW.pm:
23:48 dalek nqp-rx/nom: Start to sketch out an NQP ClassHOW.
23:48 dalek nqp-rx/nom: review: http://github.com/perl6/nqp-rx/commit/771e2ba6bff846d6e757890ebed7c95632c5821f
23:50 jnthn flussence: Well, it slurps up all the named arguments in the capture, which are stored separately to any positionals.
23:51 Patterner left #perl6
23:51 Psyche^ joined #perl6
23:51 Psyche^ is now known as Patterner
23:54 Guest3416 left #perl6

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

Perl 6 | Reference Documentation | Rakudo