Camelia, the Perl 6 bug

IRC log for #perl6, 2010-10-15

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:11 jferrero left #perl6
00:20 Limbic_Region joined #perl6
00:23 dalek niecza/master: dc83727 | sorear++ | src/ (2 files):
00:23 dalek niecza/master: Regexes capture returns
00:23 dalek niecza/master: review: http://github.com/sorear/niecza/commit/d​c83727a9efca12731d4a8cb252264148b669d67
00:23 dalek niecza/master: 8c6552e | sorear++ | v6/STD.pm6:
00:23 dalek niecza/master: [STD] Depend less on Nil semantics
00:23 dalek niecza/master: review: http://github.com/sorear/niecza/commit/8​c6552e2085b3305696ad7ed53b2d9777e0c1913
00:23 dalek niecza/master: 0644834 | sorear++ | / (4 files):
00:23 dalek niecza/master: Allow list-valued constants
00:23 dalek niecza/master: review: http://github.com/sorear/niecza/commit/0​644834cbb301619ea8ab91b2cf2a4de1433cb4b
00:28 dalek niecza/master: 6d9e43e | sorear++ | / (4 files):
00:28 dalek niecza/master: () is now Nil, a constant
00:28 dalek niecza/master: review: http://github.com/sorear/niecza/commit/6​d9e43e53cd1bb48cf8e5fa636d88ed93a224a9c
00:37 Italian_Plumber joined #perl6
00:55 prettyrobots joined #perl6
00:55 prettyrobots perl6: say 3
00:55 p6eval pugs, rakudo 46b2c5: OUTPUT«3␤»
01:05 dukeleto left #perl6
01:08 dukeleto joined #perl6
01:20 Eevee_ is now known as Eevee
01:22 silug joined #perl6
01:27 Schwern joined #perl6
01:31 QinGW joined #perl6
01:31 QinGW left #perl6
01:36 QinGW joined #perl6
01:50 hudnix left #perl6
01:52 silug left #perl6
01:54 envi left #perl6
01:57 colomon_ joined #perl6
01:57 colomon left #perl6
01:57 colomon_ is now known as colomon
01:58 justatheory joined #perl6
02:06 nymacro joined #perl6
02:10 risou joined #perl6
02:10 Italian_Plumber left #perl6
02:18 lue joined #perl6
02:20 risou left #perl6
02:30 lichtkind left #perl6
02:36 Schwern left #perl6
02:42 Schwern joined #perl6
03:03 agentzh joined #perl6
03:09 ironcamel joined #perl6
03:10 ironcamel is this right? my @list = 0,2,4 ... *;
03:12 ironcamel i am trying the examples on slide 80 http://www.slideshare.net/mfollett/perl-6-talk
03:13 ironcamel oops, i needed := instead of =
03:14 Tene Unfortunately.
03:18 TimToady eventually = will notice the * and give up
03:18 phenny TimToady: 10 Oct 15:59Z <diakopter> tell TimToady  sorear> hmm, there's a STD bug which causes role Foo[$x] { ... }; Foo[2] to be misparsed
03:18 phenny TimToady: 10 Oct 16:00Z <diakopter> tell TimToady sorear> ::Foo[2] is handled as a syntactic special case but Foo[2] winds up an ordinary postcircumfix call
03:18 TimToady done with my talk, so might get my brane back soon
03:23 Limbic_Region left #perl6
03:33 meppl left #perl6
03:38 sftp left #perl6
03:52 satyavvd joined #perl6
03:55 nymacro left #perl6
03:59 nymacro joined #perl6
04:00 silug joined #perl6
04:00 TimToady left #perl6
04:12 alester left #perl6
04:15 meppl joined #perl6
04:44 justatheory left #perl6
04:53 _kaare joined #perl6
05:19 nymacro left #perl6
05:23 nymacro joined #perl6
05:26 tinhead joined #perl6
05:27 cotto left #perl6
05:27 cotto joined #perl6
05:34 tinhead left #perl6
05:40 araujo joined #perl6
05:40 sorear good * #perl6
05:45 sorear heey TimToady pinged out :/
05:53 araujo left #perl6
05:58 orafu left #perl6
05:59 pythonian4000 is now known as pythonian4000afk
06:04 PZt left #perl6
06:06 _twitch joined #perl6
06:09 PZt joined #perl6
06:19 moritz_ good morning
06:19 envi joined #perl6
06:19 sorear good morning moritz_
06:20 moritz_ sorear: (backlog) () shouldn't be Nil
06:20 moritz_ rakudo: say ().defined, Nil,defined
06:20 p6eval rakudo 46b2c5: OUTPUT«===SORRY!===␤Confused at line 22, near "say ().def"␤»
06:20 moritz_ rakudo: say ().defined, Nil.defined
06:20 p6eval rakudo 46b2c5: OUTPUT«Bool::TrueBool::False␤»
06:21 sorear niecza still follows the old standard, Nil is the unique empty parcel
06:23 moritz_ just thought I'd mention it, in case you missed the change
06:23 mavrc joined #perl6
06:23 sorear so what does () do now?
06:23 sorear same as &infix:<,>() ?
06:23 moritz_ just an empty Parcel
06:24 sorear that feels wrong
06:24 sorear rakudo: sub foo { }; say foo.defined
06:24 p6eval rakudo 46b2c5: OUTPUT«Bool::False␤»
06:24 sorear rakudo: say (().defined)
06:24 p6eval rakudo 46b2c5: OUTPUT«Bool::True␤»
06:24 sorear () is simply an empty list of statements
06:24 moritz_ rakudo: sub foo { ()  }; say foo.defined
06:24 sorear rakudo: say ({ }.().defined)
06:25 p6eval rakudo 46b2c5: OUTPUT«Bool::True␤»
06:25 p6eval rakudo 46b2c5: OUTPUT«invoke() not implemented in class ''␤  in main program body at line 22:/tmp/8AacyDUxec␤»
06:25 sorear () should return Nil because the empty list of statements returns Nil
06:35 kjeldahl joined #perl6
06:54 kjeldahl left #perl6
07:01 mavrc left #perl6
07:06 baux joined #perl6
07:08 mavrc joined #perl6
07:20 dalek rakudo: 79f754a | moritz++ | / (2 files):
07:20 dalek rakudo: use parrot's String.reverse for Str.flip
07:20 dalek rakudo:
07:20 dalek rakudo: also bumps PARROT_REVISION
07:20 dalek rakudo:
07:20 dalek rakudo: This speeds up a small benchmark (which reverse a 1200 char 10 times) from 14s
07:20 dalek rakudo: to 0.7s (close to startup time). cotto++ cotto++ cotto++
07:20 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/7​9f754aa9fd45afa517649226a12e968bdef7a0c
07:44 Mowah joined #perl6
07:44 envi_ joined #perl6
07:48 envi left #perl6
08:02 nymacro left #perl6
08:08 christine left #perl6
08:08 christine joined #perl6
08:15 sorear std: sub foo($*) {}
08:15 p6eval std 263c207: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unable to parse signature at /tmp/5Kp6x0wo41 line 1:␤------> [32msub foo[33m⏏[31m($*) {}[0m␤Couldn't find final ')'; gave up at /tmp/5Kp6x0wo41 line 1:␤------> [32msub foo($[33m⏏[31m*) {}[0m␤    expecting any of:␤       constraint␤
08:15 p6eval ..param_sep␤        parame…
08:16 sorear (oops)
08:28 Mowah left #perl6
08:29 Mowah joined #perl6
08:32 dakkar joined #perl6
08:38 cjk101011 joined #perl6
08:43 nymacro joined #perl6
08:57 zby_home_ joined #perl6
09:13 sorear What does [1, 2; 3, 4] do?
09:13 [Sec] rakudo: my $x="foo"x 99;$x.substr(70)="";$x.say
09:13 p6eval rakudo 79f754: OUTPUT«Cannot modify readonly value␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/v3YBt3EnwC␤»
09:14 sorear rakudo: say [1,2;3,4].perl
09:14 p6eval rakudo 79f754: OUTPUT«[3, 4]␤»
09:14 [Sec] Hm. how can I elegantly trucate a string in perl6?
09:14 timbunce joined #perl6
09:15 moritz_ rakudo: my $x = "foo" x 99; $x.=substr(0, 70); $x.say
09:15 p6eval rakudo 79f754: OUTPUT«foofoofoofoofoofoofoofoofoofoofoo​foofoofoofoofoofoofoofoofoofoofoofoof␤»
09:16 moritz_ [Sec]: (mostly unrelated) I strongly recommend the use of whitespace around infix operators
09:16 [Sec] oh. .= -- nasty %)
09:17 sorear .=substr is a postfix operator though
09:17 [Sec] thats breking my perl5 assumtions. Although i think i understand what it does now.
09:19 moritz_ it's the same as $x = $s.substr(...)
09:20 sorear the thing to realize about .= is that it really is a special case
09:20 sorear don't try to think about it as derived from a metaoperator, because it isn't
09:20 sorear it's just designed to be Strangely Consistant(tm)
09:20 moritz_ right; it's a postfixish or so :-)
09:21 [Sec] moritz_: but there is no way to just use substr as a lvalue?
09:21 moritz_ and .= exists as an infix, which is weird, because there's no infix .
09:21 moritz_ [Sec]: I think it's specced, but not implemented
09:21 sorear std: my $x; $x .= foo;
09:21 p6eval std 263c207: OUTPUT«ok 00:01 117m␤»
09:22 moritz_ std: my $x; $x . foo;
09:22 p6eval std 263c207: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unsupported use of . to concatenate strings; in Perl 6 please use ~ at /tmp/BH_y6rgLr8 line 1:␤------> [32mmy $x; $x . [33m⏏[31mfoo;[0m␤Parse failed␤FAILED 00:01 117m␤»
09:24 * sorear out
09:27 BooK joined #perl6
09:34 daxim joined #perl6
09:46 kjeldahl joined #perl6
09:48 pythonian4000afk is now known as pythonian4000
09:54 mberends joined #perl6
09:55 mberends \o iz  Ljubljane :-)
09:55 moritz_ o/
09:59 * mberends is very happy to be key speaker for http://event.perlrussia.org/saintperl2/
10:00 moritz_ mberends: what will you talk about?
10:00 mberends I haz a new talk idea: The Perl 6 Book of Records
10:00 Italian_Plumber joined #perl6
10:03 jnthn mberends: Enjoy! :-)
10:03 jnthn Have (a few) vodki for me. ;-)
10:03 QinGW left #perl6
10:03 * jnthn finally may have managed to catch up on sleep
10:08 mberends thanks jnthn, although vodka is one drink I have never enjoyed, possibly due to a bad start as a newbie
10:09 jnthn Aww.
10:09 jnthn Yes, I've had one bad experience with it too.
10:09 jnthn There's good stuff and there's less good stuff. :-)
10:11 * moritz_ just noticed that the linux and windows styles of finding executables resemble the difference between sub and method scoping/dispatch
10:12 moritz_ the file associations on windows mean that if you registered a type with a certain executable, it doesn't ahve to be in scope/$PATH to be found - kinda like methods
10:13 moritz_ whereas the classical UNIX model requires all executables (like subs) to be in $PATH (like scope), unless you specify the full path
10:15 mberends moritz_: I thought I had all these ideas neatly and separately pigeon-holed, and then you mix them together and make me feel confused ;-(
10:15 cjk101012 joined #perl6
10:17 moritz_ mberends: if you fear mixing of ideas, you should avoid a 100km safety zone around #perl6 :-)
10:18 * mberends deploys a tinfoil hat
10:18 * moritz_ builds a laser evaporater for reflecting hats
10:19 cjk101011 left #perl6
10:31 muixirt joined #perl6
10:39 Italian_Plumber left #perl6
10:44 Mowah left #perl6
10:45 pythonian4000 is now known as pythonian4000afk
10:45 pythonian4000afk is now known as pythonian4000
10:46 pythonian4000 is now known as pythonian4000afk
10:48 krakan left #perl6
10:49 krakan joined #perl6
10:55 Italian_Plumber joined #perl6
11:08 daxim left #perl6
11:08 daxim joined #perl6
11:16 imarcust1is left #perl6
11:17 muixirt hi moritz_
11:20 masak joined #perl6
11:20 masak oh hai, #perl6
11:21 muixirt rakudo: my @r=[]; sub reg() { @r[@r-1] }; reg[1]=1;
11:21 p6eval rakudo 79f754:  ( no output )
11:21 muixirt hi masak
11:21 muixirt the right man at the right time
11:21 masak muixirt: need to 'say' something.
11:22 muixirt can you explain what is going on in that snippet (i looked at yapsi)
11:22 masak oh! yapsi, indeed.
11:22 masak it looks a bit taken out of context, but...
11:23 masak the runtime has registers. the registers are stored in an array.
11:23 masak but if I recall correctly, the registers also need to be stashed/restored as we climb the call stack.
11:23 muixirt it relates to @register-stack, sub reg and the reg[$register]=something constructs
11:24 masak right, the register stack corresponds to the call stack.
11:24 masak any questions so far? :)
11:25 muixirt i need a more basic explanation, what that snippet does (how it works)
11:25 masak I think I need to look at the original code. hold on.
11:27 masak ok, so here's &reg: http://github.com/masak/yapsi/blob/96ca8f0cb30c​ebbaa1ee3acd6b05188679d5049d/lib/Yapsi.pm#L480
11:27 masak it's basically a local convenience sub.
11:27 masak it says, in words, "give me the topmost layer of registers".
11:28 masak since @register-stack is an array of arrays, &reg returns an array
11:28 masak I made &reg because at any given point of the runtime, we're only ever interested in the topmost layer of registers.
11:28 masak that's the one containing registers for the block we're in.
11:30 masak muixirt: am I making sense?
11:30 muixirt ok, so why is reg[$register]=something possible (again it's my lack of the basic understanding of perl6 contructs)
11:30 masak ah.
11:30 masak it just looks funny, but nothing funny is going on.
11:30 masak recall that &reg returns an array.
11:31 masak so 'reg[$ix] = $sth' just means
11:31 masak (1) call &reg
11:31 masak (2) assign $sth to the $ix index of the result
11:31 masak and that's it.
11:32 masak you wouldn't have balked at all if 'reg' was called '@reg', but that's basically what it is.
11:32 muixirt cool, what is that called in perl6 jargon?
11:32 masak "calling a sub and then indexing the result" :)
11:32 masak fwiw, I was confused the first time I saw it too.
11:32 masak but it's really not magic at all.
11:33 flussence Does p6 still have lvalue subs, or do objects obviate the need for that now?
11:33 masak compare it to 'reg()[$ix] = $sth', which means the same thing.
11:33 jnthn I muchly prefer it with reg()[$ix]
11:33 jnthn flussence: sub foo() is rw { ... }
11:33 masak jnthn: it adds one kind of clarity and subtracts another, IMHO.
11:33 jnthn But Rakudo is a bit hand-wavey on this stuff at the moment.
11:33 muixirt masak: thanks for the explanation
11:33 masak muixirt: my pleasure.
11:33 jnthn masak: I know what you're saying, but I think that it adds needed clarity.
11:34 masak jnthn: I agree.
11:35 masak jnthn: I see it as an abstraction. using just 'reg' allows me to think of &reg more like a "thing". using 'reg()', I keep thinking of it as a call. thinking of it as a thing has its merits.
11:37 masak jnthn: by an amazing coincidence, Guy Steele is up talking about the thing about associativity and parallelism that I mentioned in the car: http://twitter.com/mfollett/status/27381191594
11:37 masak (perhaps not so amazing; I got the original idea from one of his slides)
11:38 jnthn masak: I can totally buy that argument. I just tend to worry a little over constructs that make experienced Perl 6 folks like us do a double-take. The majority of folks are quite new to Perl 6 at the moment, so a little thoughtfulness for their understanding is nice. :-)
11:39 masak jnthn: embracing thoughtfulness for newcomers' understanding is very different to dumbing down one's code.
11:40 masak my goal is clarity often enough. but not always clarity for the newcomer.
11:40 mberends left #perl6
11:42 reqamst_ left #perl6
11:43 satyavvd left #perl6
11:46 masak <sorear> () should return Nil because the empty list of statements returns Nil
11:46 masak intriguing.
11:46 masak I have no counterargument to that; I just have a feeling that it won't work.
11:49 Intensity left #perl6
11:52 moritz_ well
11:52 moritz_ if it were nil, () eqv @list.grep(False)  wouldn't hold true
11:52 moritz_ it's perl 5 think that list and statement list are the same thing, AFAICT
11:53 mberends joined #perl6
11:57 agentzh left #perl6
11:58 pythonian4000afk is now known as pythonian4000
11:58 krakan left #perl6
12:00 takadonet morning all
12:01 masak takadonet: \o
12:01 masak one of the more insightful comments on Perl 6 on Twitter: http://twitter.com/jimpick/status/27397727538
12:02 * moritz_ seriously doubts that TimToady can kill Perl 5, even if he tried
12:03 masak :)
12:04 masak speaking of TimToady; whatever he's up to in YAPC::Asia, it's leaving ripples and waves on Twitter.
12:04 muixirt the 'Kaffe' Jim Pick ?
12:04 masak TimToady++
12:04 masak muixirt: quite likely.
12:04 takadonet masak: in a good or bad way?
12:04 masak I just replied to him: http://twitter.com/carlmasak/status/27434049287
12:04 masak takadonet: I'm not putting any such value into it. just talking about quantity.
12:05 masak but most of it seems expectant and awed, as usual.
12:05 masak things like this: http://twitter.com/ironcamel/status/27406491292 :)
12:06 masak it just goes to show how some things that we take for granted here are considered magic by some outsiders.
12:06 masak one doesn't even need the 8 :P
12:06 [Sec] 1,2,4 -- i would expect the next to be 7 %)
12:07 moritz_ why?
12:07 christine left #perl6
12:07 christine joined #perl6
12:08 masak $^last + ++$n, probably :)
12:09 pythonian4000 is now known as pythonian4000afk
12:09 moritz_ when faced with the question on how to resume a sequence, I usually answer with 42
12:12 masak 42: the metasyntactic integer constant.
12:12 krakan joined #perl6
12:13 masak it wouldn't surprise me if 42 is the most commongly occuring integer in the perl6 queue in RT.
12:13 moritz_ it would surprise me
12:13 moritz_ I'd expect 0 or 1 to hold that position
12:14 moritz_ especially considering that True and False have long stringified to 1 and 0
12:14 masak I can easily find out.
12:15 moritz_ masak: do you have a text dump of the perl6 RT queue, or something similar?
12:15 masak even better. I have a YAML dump :)
12:15 moritz_ \o/
12:15 moritz_ how did you obtain it?
12:15 masak Perl 5 script. want it?
12:15 moritz_ yes please
12:15 masak gimme a minute.
12:17 MayDaniel joined #perl6
12:19 masak moritz_: http://github.com/masak/rt-statistics
12:19 masak man, I love github. :)
12:19 * moritz_ too
12:20 masak moritz_: maybe you could even help me with a problem I have with the generated tickets.yaml file...
12:20 masak the 'message' fields are garbled in that they are missing all newlines. I'd like to have the newlines, too.
12:20 pythonian4000afk is now known as pythonian4000
12:21 masak the problem is on this line: http://github.com/masak/rt-stat​istics/blob/master/collect#L20
12:21 masak I know I shouldn't do it like that, but I don't have a better idea.
12:22 * moritz_ not familiar with Web::Scraper
12:22 masak ever since I learned about it, I've been using it everywhere.
12:23 masak I'm not yet a power user of it, though. maybe I should ask miyagawa.
12:23 moritz_ speaking of miyagawa, I just had the first failure trying to install a module with cpanm
12:24 moritz_ but there's nothing he can do about it - XML::LibXML was missing the libxml2-dev package
12:24 pythonian4000 is now known as pythonian4000afk
12:26 pythonian4000afk is now known as pythonian4000
12:28 mavrc left #perl6
12:28 pythonian4000 is now known as pythonian4000afk
12:29 moritz_ huh. libxml2 comes only with a dynamic lib
12:30 masak I'm now switching my Github account plan to micro. I don't need it (yet), but I want to show them my support.
12:30 atomicstack joined #perl6
12:31 masak wow, that was easy.
12:31 masak github++
12:32 daxim left #perl6
12:34 pythonian4000afk is now known as pythonian4000
12:37 MayDaniel left #perl6
12:37 constant left #perl6
12:37 pythonian4000 is now known as pythonian4000afk
12:39 pythonian4000afk is now known as pythonian4000
12:39 constant joined #perl6
12:39 constant left #perl6
12:39 constant joined #perl6
12:41 pythonian4000 is now known as pythonian4000afk
12:44 mavrc joined #perl6
12:47 _kaare left #perl6
12:50 risou_ joined #perl6
12:51 Quadrescence Is there a proper name for the kind of regex matches where the parenthetical match is remembered
12:51 Quadrescence ?
12:51 Quadrescence s/foo(.*)/foo$1.txt/ <-- name for the whole () $1 dealio
12:52 moritz_ "capture"
12:52 Quadrescence moritz_: tell me a regex joke.
12:52 moritz_ (though in Perl 6 it's $0 and not $1)
12:52 moritz_ Quadrescence: ... now you have two problems!
12:53 jnthn Did you hear about the guy who dated a regex?
12:53 jnthn He met his Match!
12:54 Quadrescence ha ha ha ha
12:54 pythonian4000afk is now known as pythonian4000
12:54 masak jnthn: but only after a lot of backtracking.
12:55 moritz_ but was it a LT Match? :-)
12:55 masak token length is overrated :P
12:56 plainhao joined #perl6
13:02 masak moritz_: I'm programming in Java for $WORK, and finding that I'm constantly avoiding the use of protected and package-protected...
13:03 moritz_ masak: should I feel guilty? or confirmed?
13:03 masak moritz_: I'll get back to you on that. :)
13:03 masak moritz_: for what it's worth, I buy your argument.
13:03 wamba joined #perl6
13:04 masak one might call my current Java OO design style "Perl 6 infected".
13:04 moritz_ btw I there is one use case in java where it might be valid to use protected methods
13:04 masak oh?
13:04 moritz_ for methods which you have to derive in subclasses
13:04 moritz_ where you'd just pass in closure in Perl instead :-)
13:05 moritz_ (because last I looked, java didn't have any first class code objects)
13:05 masak not sure I follow. not sure I have that pattern in Java.
13:05 masak no, it doesn't.
13:05 moritz_ I guess the usual java approach is to use an Interface instead
13:05 masak right. method in anon class deriving some interface.
13:06 masak Huffman called, and he wants his excess keystrokes back. or something.
13:07 moritz_ Huffman called, and I want my excess keystrokes back :-)
13:08 masak I guess both I and Huffman want them back.
13:10 mavrc left #perl6
13:10 mavrc joined #perl6
13:20 Patterner left #perl6
13:20 tadzik joined #perl6
13:20 tadzik o/
13:21 moritz_ \\o
13:22 masak \\\\o
13:22 * masak is programming in Java
13:22 masak need to backwhack four times. :)
13:23 masak wow, I think one could do a talk just on that. how some programming languages seem to actively disregard syntax.
13:23 * moritz_ imagines it's quite a backslashing hell if you write regexes in a language that doesn't have regex literals
13:23 masak just so.
13:23 moritz_ \\\\ for a single backslash, \\w for a simple char class...
13:25 flussence It's not so bad in PHP, the single-quoted strings are more or less the same semantics as P5's.
13:25 prettyrobots left #perl6
13:25 * moritz_ says preg_match_all
13:26 flussence OTOH they have a pre-defined constant just for directory slash/backslash called "directory_separator"...
13:26 masak <linguification>"not so bad" and "PHP" in the same sentence? well I never!</linguification>
13:26 moritz_ which reminds me that I should give m:g/.../ another shot
13:26 masak ++moritz_
13:26 flussence the "not so bad" parts of PHP are where they've copied from p5 :)
13:27 masak :)
13:27 moritz_ it's something I'd neet to brainstorm with pmichaud
13:28 icwiener joined #perl6
13:29 moritz_ last time I tried, I nearly got there, but since rakudo doesn't have slice context, the return values from 'abc' ~~ m:g/(.)/  and 'abc' ~~ m/(.)+/ were identical
13:29 moritz_ which is a problem for split(), for example
13:29 sftp joined #perl6
13:29 moritz_ so, I could have a 'has $.is-flat' attribute in Match for that
13:29 moritz_ which is a cheat
13:30 moritz_ or somebody[tm] could implement slice context (which I don't see happen any time soon)
13:30 Mowah joined #perl6
13:31 moritz_ or we could turn to m:g// relly returning a list of matches, not a single match
13:31 moritz_ but what about $/ in that case?
13:31 Psyche^ joined #perl6
13:31 Psyche^ is now known as Patterner
13:32 Schwern left #perl6
13:32 orafu joined #perl6
13:33 prettyrobots_ joined #perl6
13:33 prettyrobots_ left #perl6
13:34 prettyrobots_ joined #perl6
13:34 prettyrobots_ left #perl6
13:36 masak good question.
13:36 flussence m:g returning a list does sound sensible to me, from a normal user viewpoint
13:36 masak moritz_: maybe create a Match that simply acts as an Array container for the list of matches?
13:37 moritz_ masak: then we end  up with the problem I described above
13:37 masak oh, sorry. I'm not paying full attention. :/
13:37 masak I'm busy not using protected :)
13:38 masak so... tempted...
13:38 moritz_ currently m:attribs/foo/ compiles to $/ := $_.match(:attribs, rx/foo/)
13:38 moritz_ which has the disadvantage of always returning a scalar
13:39 moritz_ so I'd have to compile it to something like
13:39 moritz_ ($/ := $_.match(...); $return_list ?? @($/) !! $/ )
13:40 moritz_ which has the disadvantage of duplicating the decision of wheter to return a list or not (once in the compiler, once in .match)
13:41 moritz_ or maybe it's  $/ ~~ List ?? $/.list !! $/
13:41 moritz_ but that sets $/ to a non-sensical value
13:41 moritz_ hm, or maybe not...
13:41 moritz_ $0 would still mean $/[0]
13:42 moritz_ but $<foo> would give LTA errors
13:42 moritz_ and half an hour later, masak++ would submit annoying bug reports :-)
13:42 masak you bet.
13:43 * moritz_ was told not to gamble :-)
13:43 masak it's just an EXPR.
13:43 tadzik s/annoying/helpful/ # cough, cough
13:44 moritz_ tadzik: the two are not mutually exclusive
13:45 mblackmer left #perl6
13:45 tadzik sure
13:47 alester joined #perl6
13:48 masak "masak: annoyingly helpful"
13:54 rindolf joined #perl6
13:54 rindolf perl6: my %h = ('one' => "two"); say "%h"
13:54 p6eval pugs, rakudo 79f754: OUTPUT«%h␤»
13:55 masak rakudo: my %h = 'one' => 'two'; say "%h{}"
13:55 p6eval rakudo 79f754: OUTPUT«two␤»
13:56 masak rindolf: @ and % and & are only interpolated if their run ends with a () or [] or {} or <>, for safety (and other) reasons.
13:56 rindolf masak: ah.
13:56 masak see S02 for the whole scoop.
13:57 PerlJam rindolf: or you can say   "...{%h}..."
13:57 rindolf PerlJam: OK.
13:58 rgrau_ joined #perl6
13:59 masak someone asking about the state of Perl 6: http://community.livejourn​al.com/ru_perl/374751.html
13:59 PerlJam masak: Texas!  ;)
14:00 masak EWRONGTYPEOFSTATE :)
14:01 flussence rakudo: say <solid liquid gas plasma>.pick(1)
14:01 p6eval rakudo 79f754: OUTPUT«gas␤»
14:01 masak you're all being very helpful.
14:01 flussence I'd say it's more of a liquid at this point.
14:02 masak not according to most trolls out there...
14:03 prettyrobots joined #perl6
14:03 flussence maybe I should go write a "big" app in it just to prove them wrong :)
14:04 moritz_ please do!
14:04 araujo joined #perl6
14:04 araujo left #perl6
14:04 araujo joined #perl6
14:04 kjeldahl left #perl6
14:05 PerlJam Perl 6 needs a "Lacuna Expanse" type thing to happen to it.  Not necessarily a game or graphical, just something biggish and completely unexpected.
14:05 _kaare joined #perl6
14:06 pythonian4000 is now known as pythonian4000afk
14:07 masak PerlJam: agreed. a "killer app".
14:07 masak something for which the first impression is "wow, this rocks!" and the second is "by the way, this is all written in Perl 6".
14:08 * moritz_ wonders if he should write a "killer's app" for April 1st
14:08 moritz_ which help a killer to track his victims, payments etc.
14:09 PerlJam we've now gone down the dark side of pun
14:10 masak Assassination Management Software. interesting.
14:11 PerlJam It's got too much ass in it.
14:15 jnthn If you remove the ass it sounds like an Apple product.
14:15 jnthn iNation
14:17 MayDaniel joined #perl6
14:18 masak I'm sure we could make it tasteful enough for the Apple Store to approve it.
14:18 PerlJam jnthn: iNation sounds like something that would be right up your alley
14:23 jnthn If I did it, it'd only support nations that start with an 'S' though. :-)
14:25 timbunce_ joined #perl6
14:27 Schwern joined #perl6
14:27 timbunce left #perl6
14:27 timbunce_ is now known as timbunce
14:35 tadzik left #perl6
14:37 cjk101012 left #perl6
14:51 tadzik joined #perl6
14:53 rindolf left #perl6
14:56 uniejo joined #perl6
15:11 uniejo left #perl6
15:15 masak rakudo: class A {}; class B { has A $.a is rw }; class C { has B $.b }; my $c = C.new; $c.b.?a = A.new
15:15 p6eval rakudo 79f754: OUTPUT«Cannot modify readonly value␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/83kx8LOfBt␤»
15:16 masak I'm not 100% sure what I'm trying to do...
15:16 masak but I also don't see what's readonly here, and why.
15:16 flussence C.b ?
15:17 masak right. $c.b is readonly. does that matter?
15:17 jnthn masak: I think it's right. (more)
15:17 flussence that's the only thing I can see in there that might be responsible...
15:17 flussence rakudo: class A {}; class B { has A $.a is rw }; class C { has B $.b is rw }; my $c = C.new; $c.b.?a = A.new
15:17 p6eval rakudo 79f754: OUTPUT«Cannot modify readonly value␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/NU_Jz6UX7D␤»
15:17 jnthn masak: $c.b gives back something that has no .a method
15:18 jnthn masak: So .? hands back Nil
15:18 flussence well scratch that...
15:18 masak jnthn: oh, ok.
15:18 jnthn Or maybe a Failure
15:18 masak yes, makes sense.
15:18 jnthn Anyway, something you cannot assign to.
15:18 jnthn if you want try
15:18 masak probably Nil, to be consistent with .*
15:18 jnthn ($c.b.?a // *) = A.new
15:19 masak rakudo: class A {}; class B { has A $.a is rw }; class C { has B $.b }; my $c = C.new; ($c.b.?a // *) = A.new
15:19 jnthn Since assigning to * throws away the value silently.
15:19 p6eval rakudo 79f754: OUTPUT«Cannot modify readonly value␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/Sm9PnTw3yz␤»
15:19 masak hm.
15:19 jnthn rakudo: * = 42;
15:19 p6eval rakudo 79f754:  ( no output )
15:19 jnthn oh
15:19 jnthn rakudo: class A {}; class B { has A $.a is rw }; class C { has B $.b }; my $c = C.new; say ($c.b).WHAT
15:19 p6eval rakudo 79f754: OUTPUT«Any()␤»
15:20 jnthn rakudo: class A {}; class B { has A $.a is rw }; class C { has B $.b }; my $c = C.new; say ($c.b.?a).WHAT
15:20 p6eval rakudo 79f754: OUTPUT«␤»
15:20 jnthn rakudo: class A {}; class B { has A $.a is rw }; class C { has B $.b }; my $c = C.new; say ($c.b.?a).defined
15:20 p6eval rakudo 79f754: OUTPUT«Bool::False␤»
15:20 masak rakudo: say Nil.WHAT
15:20 p6eval rakudo 79f754: OUTPUT«␤»
15:20 jnthn rakudo: class A {}; class B { has A $.a is rw }; class C { has B $.b }; my $c = C.new; say pir::defined($c.b.?a)
15:20 p6eval rakudo 79f754: OUTPUT«0␤»
15:20 masak it's a Nil.
15:20 jnthn Aye
15:20 jnthn I think that's current spec.
15:20 masak aye.
15:20 jnthn I'm a tad curious why the // doesn't work here.
15:21 jnthn rakudo: class A {}; class B { has A $.a is rw }; class C { has B $.b }; my $c = C.new; say ($c.b.?a // *).WHAT
15:21 p6eval rakudo 79f754: OUTPUT«WhateverCode()␤»
15:21 jnthn Oh!!
15:21 jnthn It auto-curries.
15:21 jnthn :-)
15:21 jnthn So then you end up trying to assign to a closure.
15:21 tadzik left #perl6
15:22 jnthn Rakudo. It's smarter than me.
15:24 icwiener left #perl6
15:24 icwiener joined #perl6
15:25 jnthn masak: $c.b //= A.new; # wait, isn't this what you really want?
15:25 masak no...
15:26 masak that would try to assign an A object to an attr typed with B.
15:26 masak what I was fishing for was some kind of "conditional assignment", that only assigned if the whole method call chain made it to the end.
15:27 masak //= doesn't do that. in some ways, it does the opposite; assigns only if something didn't make it.
15:28 jnthn ah, ok
15:30 rhr left #perl6
15:31 s1n left #perl6
15:31 jnthn Feels like your'e trying to do introspection without introspecting :P
15:32 masak that wasn't my intent :)
15:33 flussence .oO( "transactional assignment"? )
15:33 moritz_ "made it to the end" triggers my "use exceptions" brain cell
15:33 mdxi left #perl6
15:34 masak it's just that I kept writing Java code like 'if (a.b != null) { a.b.c = d }' and wondering if there was some shorter way in Perl 6.
15:34 jferrero joined #perl6
15:35 Schwern left #perl6
15:36 s1n joined #perl6
15:36 jnthn if $a.b -> { .c = d } # maybe?
15:36 moritz_ given a.b { $_ && .c = d }
15:37 moritz_ rakudo: if 1 -> { say "alive" }
15:37 p6eval rakudo 79f754: OUTPUT«alive␤»
15:38 masak -> {} means "don't bind value to anything"
15:38 masak jnthn: you probably meant -> $_ {}
15:39 masak or we could create a given/if hybrid, "giffen" :P
15:41 jnthn oh, yes
15:41 jnthn That's what I get for writing Perl 6 while translating Java into C#...
15:42 masak :)
15:42 tadzik joined #perl6
15:42 masak today I've written two methods that sit in different classes but produce the same result, all the while maintaining the same inter-class invariant.
15:43 moritz_ sounds curious
15:43 masak things always get so tricky once references are bidirectional.
15:44 masak I like models like Git's where all references are one way only.
15:45 Schwern joined #perl6
15:46 mdxi joined #perl6
15:55 silug left #perl6
16:00 rhebus joined #perl6
16:02 justatheory joined #perl6
16:11 atomicstack left #perl6
16:12 atomicstack joined #perl6
16:15 whiteknight joined #perl6
16:20 atomicstack left #perl6
16:23 whiteknight left #perl6
16:29 baux left #perl6
16:31 masak lol, I blogged! http://strangelyconsistent​.org/blog/a-sudden-insight
16:32 dual joined #perl6
16:36 jnthn Yes, calling and returning are a bit more symmetric in Perl 6 than in other langauges.
16:36 jnthn Well, s/ 6// I guess :-)
16:39 cdarroch joined #perl6
16:39 cdarroch left #perl6
16:39 cdarroch joined #perl6
16:42 masak nom &
16:42 masak left #perl6
16:42 rhr joined #perl6
16:51 takadonet trying to figure out what title for a reddit post would be for http://strangelyconsistent​.org/blog/a-sudden-insight . Any suggestions?
16:55 prettyrobots left #perl6
16:58 flussence ouch, I went to that wikipedia link... they have some really bad code highlighting colours.
17:01 wamba left #perl6
17:03 justatheory left #perl6
17:03 prettyrobots joined #perl6
17:07 dakkar left #perl6
17:23 kjeldahl joined #perl6
17:36 prettyrobots left #perl6
17:42 jferrero left #perl6
17:42 justatheory joined #perl6
17:47 justatheory left #perl6
17:51 timbunce left #perl6
17:53 prettyrobots joined #perl6
17:53 rhebus left #perl6
17:54 orafu left #perl6
17:54 prettyrobots left #perl6
17:54 prettyrobots joined #perl6
17:55 prettyrobots left #perl6
17:55 justatheory joined #perl6
17:55 prettyrobots joined #perl6
17:56 prettyrobots left #perl6
17:57 timbunce joined #perl6
18:01 sorear good * #perl6
18:01 tadzik hello
18:02 silug joined #perl6
18:03 sorear moritz_: it's not perl 5 think - you can't even put statements in a () list in Perl 5
18:03 moritz_ sorear: scalar (2, 3, 4) treats (2, 3, 4) as a statement list
18:04 justatheory left #perl6
18:04 justatheory joined #perl6
18:06 _twitch left #perl6
18:07 sorear buubot: scalar (2, if (1) { print "x" }) # no, expression list
18:07 buubot sorear: Couldn't match input.
18:07 sorear buubot: eval scalar (2, if (1) { print "x" }) # no, expression list
18:07 buubot sorear: ERROR: syntax error at (eval 34) line 1, near ", if"
18:22 Italian_Plumber left #perl6
18:22 colomon left #perl6
18:27 colomon joined #perl6
18:29 colomon left #perl6
18:29 s1n i keep reading the threads thread (pun intended) on the ML and i wanted to throw out my 2cents
18:30 s1n fibers, continuations, and green threads are great, but i think they miss the whole point (unless i miss understand how they work): the kernel isn't aware and thus you can't take advantage of hardware
18:31 s1n event schedulers are nice, but i think true hardware threads are desirable
18:32 Schwern left #perl6
18:32 sorear s1n: don't listen to p6l, nobody else does
18:33 sorear or at least, don't be concerned about it
18:33 PerlJam s1n: Perl is still slowing warming up to "threads".
18:33 sorear if someone there comes up with a genuinely good idea, by all means take it
18:33 s1n avoiding real threads would be an epic fail
18:34 PerlJam "real threads"?
18:34 sorear p6l is where we quarantine the dangerously disconnected from reality
18:34 s1n hardware threads
18:34 silug left #perl6
18:34 s1n 1:1
18:34 s1n sorear: hope so, but _noone_ is expressing a voice of reason there
18:34 sorear nobody ever does
18:34 PerlJam s1n: you could be the first!
18:35 s1n PerlJam: guess i'll have to be
18:35 s1n seems like a waste of time to provide something like continuations if it's still an N:1 model
18:36 PerlJam s1n: from a language perspective Perl 6 should paint itself into a corner that precludes hardware (or any other style) threads.   that's about it.
18:36 PerlJam s/should/shouldn't/  oops!
18:36 sorear incidentally, niecza has 1:1 threads
18:37 s1n when i write threads, i want my kernel to schedule it to take advantage of modern hardware
18:37 s1n so if i write perl6 threaded code, if it doesn't, then i wrote write threaded code in perl6
18:38 timbunce left #perl6
18:39 Schwern joined #perl6
18:42 skids s1n: True hardware threads are absolutely needed for interfacing with blocking APIs.  You could argue that could be done by the implementation for each use case, but not providing visibility into how things are coprocessed (and tuning) would kinda run in the face of Perl6's dedication to introspection/etc.
18:43 skids But we'll be in green-thread-ville for a while because parrot is stilljust green-threads and they need to overhaul a bit to start using green+hw threads.
18:43 s1n parrot is free to make all the mistakes they want
18:43 pjcj_ left #perl6
18:44 PerlJam parrot has threads?
18:44 s1n PerlJam: not really, they had a SoC to implement green threads
18:44 sorear s1n: please don't think Perl6 == Parrot
18:44 skids I don't see anyone over in parrotville questioning whether they need hw threading, just lamenting the chore.
18:44 s1n sorear: i know better
18:44 timbunce joined #perl6
18:44 skids sorear: no offence intended :-)
18:44 s1n i don't understand why people hate threading, if you think of it from the get-go, they're easy
18:45 s1n if you try to graft on afterwards, it's usually a disaster
18:45 sorear niecza: use Threads; Thread.new({ say "Hello" }).join
18:46 p6eval niecza 6d9e43e: OUTPUT«Hello␤»
18:46 skids There's two types of coders.  Those that love threads, because they actually have had to do something with time/latency sensitive interaction, and those who have never had to do that and so do not have an inkling just how essential they are to any complete language.
18:46 PerlJam skids: false.
18:46 sorear I'm in a "can't stand 'em, can't live without 'em" relationship with threads
18:47 PerlJam skids: I've had to do time sensitive interaction and I do not love threads.
18:47 skids OK, well, "love" may have been the wrong word.
18:47 [particle] left #perl6
18:47 s1n it's kinda hard to avoid threads nowadays
18:47 PerlJam I'm wary of threads.
18:47 ironcamel how do i write tests in perl6?
18:47 skids Threads can certainly be badly abused.
18:47 shortcircuit skids: Day job for me is time-sensitive interaction, and I'd much rather have a task dispatch model available.
18:47 ironcamel is there Test::More ?
18:47 PerlJam s1n: no it's not!  We keep inventing new ways of avoiding them all the  time!
18:48 sorear it's called Test now
18:48 ironcamel thanks sorear
18:48 s1n PerlJam: and all those ways suck
18:48 s1n because my hardware has threads
18:48 s1n and my kernel can schedule them well
18:48 s1n anything else, is just slow and pointless
18:48 dalek niecza/master: 9615df7 | sorear++ | / (2 files):
18:48 dalek niecza/master: Add a 'regex global state' object
18:48 dalek niecza/master: review: http://github.com/sorear/niecza/commit/9​615df7ff8741acee34ff8a6940530489e81bfb7
18:48 dalek niecza/master: 1e0987f | sorear++ | / (2 files):
18:48 dalek niecza/master: Allow $*FOO as parameters
18:48 dalek niecza/master: review: http://github.com/sorear/niecza/commit/1​e0987f556a6217124d6c749c76d32d6f091f883
18:48 dalek niecza/master: 22a529d | sorear++ | / (2 files):
18:48 dalek niecza/master: Implement [ 1, 2, 3 ] syntax
18:48 dalek niecza/master: review: http://github.com/sorear/niecza/commit/2​2a529d5ac3c095cd5aac97dde2ea14981f561ba
18:48 skids shortcircuit: reread the above with a broader definition of "threads" :-)
18:48 shortcircuit skids: So, 'concurrency'? :)
18:49 tadzik s1n: so what is your point again?
18:49 PerlJam It's partly because fork() isn't as onerous as it used to be that threads haven't made it mainstream IMHO
18:49 sorear s1n: [1, 2, 3] »+« [10, 20, 30] # this is a way of avoiding Perl threads, but it can still map to OS threads
18:49 skids shortcircuit: concurrency that uses hardware threads, to be specific, regardless of whether the api looks like a threading api.
18:49 sorear Programmers should not use threads unless they absolutely have to
18:49 s1n no, threads aren't mainstream because people have a hardtime contemplating thinking of multiple threads executing the same line of code at the same time
18:50 sorear The *runtime* should use threads whenever possible
18:50 PerlJam sorear++
18:50 s1n they're also difficult to debug
18:51 s1n too many developers rely on print statements
18:51 sorear The reason I don't like to write threads is the same reason I don't like to work with /dev/hda
18:51 sorear they're just too low level
18:51 zostay left #perl6
18:51 s1n aww
18:51 s1n i love the low level
18:51 sorear I build abstractions on top of both - data parallelism, file systems
18:51 moritz_ sorear: if you don't like low level, you shouldn't be writing a compiler *SCNR* :-)
18:51 s1n moritz_++
18:52 tadzik (that was a joke, wasn't it?)
18:52 moritz_ it was
18:52 zostay joined #perl6
18:53 sorear au contraire.  If I *actually* liked low level, why would I be writing code to hide it?
18:53 sorear :-)
18:53 skids High level abstractions above threads are great, and the less guts Perl6 users have to see to get needed concurrency the better, but no matter what high level API you put on top of it, there's still the shared data access problem.  Unless all your threads never need to do more than pass messages, and once you get into messages, you lose all the benefits of perl6's kickass OO because you have to constantly pack/unpack stuff.
18:54 shortcircuit skids: Well, yes, software should take advantage of the underlying platform's scaling capabilities.
18:54 s1n i think a good perl6 interface over pthreads is possible
18:55 [particle] joined #perl6
18:55 s1n (not perl6/pthreads, but Perl6 threads that are analogous to pthreads)
18:56 shortcircuit s1n: I'm inclined to agree; in an N:1 or N:M model, punching the kernel scheduler wtr the kernels' idea of threads is likely to have nasty consequences.
18:56 shortcircuit *wrt
18:57 s1n i just want to write perl6 code that can be threaded to each code and hardware thread automatically with a nice perl6 interface. green threads won't get me there
18:57 shortcircuit (In other words, don't call out to a C API pthreads library. Don't call out to Win32's WaitForSingleObject, etc.)
18:58 skids I think there's a very interesting thing in Perl6's hyperops which is a mostly new issue -- not all hyperops are going to need an interpreter, some will be simple math, and folks will want OpenMP and cloud stuff to tie in seamlessly (maybe even oportunistically in some cases)
18:58 skids So is that a "thread" if it's not perl6 in the "thread"?
18:59 PerlJam skids: have you used PDL?
18:59 s1n i'm not sure what you're asking, but openmp typically abstracts the pthreads call with a nice #praga
18:59 shortcircuit s1n: I'm not sure what you're saying. I think you're saying either you want to know that you have an execution sequence in Perl6 to map 1:1 to a hardware thread, or you're saying want your code to transparently scale across available hardware processing units.
18:59 shortcircuit Ah. Transparent scaling.
19:00 skids I guess not, since I'm unsure what the acronym is, unless it's "parrot (something) language" in which case, maybe, in a fit of hacking, a bot.
19:00 skids s/bot/bit/
19:00 PerlJam skids: Perl Data Language.
19:00 skids No, I'll take a gander sometime.
19:00 timbunce_ joined #perl6
19:00 PerlJam skids: They talk about threading over matrices and such.  That's the non-perl6 thread you just described.
19:00 s1n shortcircuit: well, yes, 1:1 mapping from a perl6 interface would seem to give me transparent scaling by both the perl6 interpreter and my kernel
19:01 timbunce left #perl6
19:01 timbunce_ is now known as timbunce
19:01 * shortcircuit is totally confused. Back to focusing on work.
19:01 skids PerlJam: thanks, I've been lacking a good word for that.
19:01 ironcamel hi guys, so i'm doing a timed coding exercise at work ... and my and partner chose to do it in perl 6 ... so i'm going to be asking a lot of noob questions ... and i'm very rushed so will probably spell things wrong
19:01 PerlJam skids: pdl.perl.org :)
19:02 Tene ironcamel: Sounds fun! :)
19:02 ironcamel just want to import a module
19:02 jnthn use ModuleName;
19:02 ironcamel and i'm doing it perl5 way and it's not working
19:02 ironcamel jnthn: ok, what is the first line of ModuleName.pm ?
19:02 PerlJam ironcamel: you're doing a perl5 thing in perl6?
19:02 jnthn Depends what's in it.
19:02 jnthn module ModuleName; # if it's a bunch of subs
19:02 jnthn use class if you're putting a class in there.
19:02 ironcamel PerlJam: no ... i only know perl 5 ... so i'm making noob mistakes
19:03 PerlJam okay
19:03 ironcamel jnthn:  it's going to be a bunch of classes
19:03 tadzik jnthn: s/use //
19:03 tadzik ?
19:03 moritz_ then class ModuleName { ... }
19:03 tadzik ah, no, nvm
19:03 PerlJam tadzik: the "use" there wasn't syntactic :)
19:03 tadzik PerlJam: yeah, noticed :)
19:03 ironcamel moritz_: there will be multiple classes in there
19:04 moritz_ ironcamel: that's OK
19:04 ironcamel i want to use Foo in my test file.  i want module Foo to have classes Bar and Poo
19:04 ironcamel and class Foo too maybe
19:04 ironcamel so i make a Foo.pm file right?
19:04 PerlJam classes and modules occupy the same symbol-space IIRC
19:04 moritz_ ironcamel: right
19:05 moritz_ ironcamel: and you add class Foo { ... }; class Foo::Bar { ... }; class Foo::Poo { ... }
19:05 ironcamel got it, it's working :)
19:06 ironcamel any good quick tutorials on OOP for p6?
19:06 ironcamel http://perlgeek.de/en/article/5-to-6
19:06 PerlJam ironcamel: perldoc Moose  # ;-)
19:06 ironcamel is what i'm looking at
19:06 ironcamel ok, i'm good with moose, so it shouldn't be too bad
19:06 PerlJam ironcamel: There's also some info in the perl 6 advent calendar
19:07 moritz_ ironcamel: http://github.com/downloads/per​l6/book/2010.09.a4.pdf/qr_code
19:07 PerlJam ironcamel: http://perl6advent.wordpress.com/2​009/12/01/perl-6-advent-calendar/
19:08 PerlJam ironcamel: perl6.org has all the links you'll ever need  :)
19:15 skids s1n: just for fun you might want to read this very early whack at Perl6 thread-like concurrency constructs that Austin made way back when and everyone dutifullyhttp://www.nntp.perl.org/group/perl.​perl6.language/2003/04/msg14788.html ignored:
19:16 * skids hates mouse-cursor-based pastes in terminal-like applications.
19:16 ironcamel how do i declare an attribute is an array/arrayref?
19:16 PerlJam has @array;
19:16 ironcamel i'm making a monopoly game object.  it has players
19:16 moritz_ has @!thing;
19:16 PerlJam er, what moritz_ said
19:16 ironcamel ok cool
19:17 PerlJam my sigil got lost somewhere
19:17 PerlJam er, twigil
19:17 ironcamel twigil is required right?
19:17 tadzik will Perl 7 have thrigils? :)
19:17 moritz_ actually I think you can omit it
19:17 ironcamel and how come say "hi @foo" doesn't work anymore
19:17 tadzik you mean @foo[]
19:17 PerlJam ironcamel: say "hi @foo[]"
19:17 ironcamel moritz_: it will default to public or private?
19:17 s1n tadzik: you will have to build them with sticks and stones though
19:17 moritz_ rakudo: class A { has @x = 1, 2; method foo { say @x } }; A.new.foo
19:17 flussence or "hi {@foo}"
19:17 moritz_ ironcamel: private
19:17 p6eval rakudo 79f754: OUTPUT«12␤»
19:18 tadzik s1n: what do you mean?
19:18 s1n tadzik: heard the expression "perl 7 will be fought with sticks and stones"
19:19 tadzik heh
19:20 ironcamel oh neat, so Foo.new( players => @players ) works ... so i don't have to do \@players any longer?
19:20 moritz_ right
19:20 moritz_ you can even write Foo.new(:@players)
19:20 skids By perl7, OO objects very well may be tangible enough to poke someone's eye out.
19:20 zby_home__ joined #perl6
19:21 zby_home_ left #perl6
19:21 ironcamel does @players.shuffle() should work?
19:21 moritz_ @players.pick(*)
19:21 tadzik .=?
19:21 moritz_ (that returns the shuffled array, not inplace)
19:21 tadzik ah, nvm me
19:21 ironcamel moritz_: where can i find documentation for pick()
19:22 moritz_ ironcamel: S32/Containers
19:22 jnthn Slides from my OSDC.fr talks now up at http://www.jnthn.net/articles.shtml
19:23 ironcamel moritz_: where is that?
19:23 jnthn Sorry it took a whole week. exhaustion--
19:23 moritz_ ironcamel: linked from http://perlcabal.org/syn/
19:24 [particle] left #perl6
19:25 ironcamel is there a Test::Exception equivalent?
19:25 moritz_ ironcamel: Test.pm come with lives_ok and dies_ok
19:25 ironcamel cool
19:25 moritz_ and eval_{lives,dies}_ok
19:25 ironcamel is there a way to match on the exception?
19:25 moritz_ not yet
19:26 synth left #perl6
19:29 nymacro left #perl6
19:30 ironcamel something wrong with this? is $g.players => <horse car>, 'have 2 players';
19:30 Tene ironcamel: did you declare the attribute as rw?
19:31 Tene has $.players is rw;
19:31 Tene or whatever
19:31 ironcamel @.players is rw
19:31 moritz_ ironcamel: => constructs a Pair
19:31 moritz_ ironcamel: it's not just a comma anymore
19:32 Tene Ah, yes, I misread that as just '='.
19:32 ironcamel ah
19:32 Tene Yes, moritz is right, s/ =>/,/
19:32 ironcamel but => was so nice to associate pairs of things :)
19:32 tadzik it now assosiates a Pair of things :)
19:33 tadzik Pair.new, to be more specific :)
19:33 ironcamel so length of list/array how does that work now
19:33 ironcamel scalar context is not working
19:33 sorear .elems
19:33 sorear or numeric context
19:33 moritz_ ironcamel: => is also used for named arguments
19:33 Tene @foo.elems
19:33 Tene or +@foo
19:33 sorear timtoady still hasn't pinged in :(
19:34 ironcamel .elems returns a count?
19:34 Tene yes
19:34 ironcamel what does +@foo mean?
19:34 moritz_ @foo in numeric context
19:34 moritz_ returns the same as @foo.elems
19:34 tadzik like @foo.Num?
19:34 sorear like @foo.Numeric
19:34 moritz_ tadzik: .Numeric
19:34 tadzik ok
19:35 sorear .Num generally means 64-bit float... Numeric is a lot more general
19:38 plainhao left #perl6
19:40 ironcamel what is corresponding BUILD in p6?
19:40 moritz_ BUILD
19:40 tadzik submethod BUILD
19:41 moritz_ (roughly)
19:41 tadzik but now, you have to assign the parameters on your own, iirc
19:41 ironcamel or even better, i want to assert there are between 2 to 6 players when object is constructed
19:41 xivix joined #perl6
19:41 ironcamel has @.players is rw;
19:41 ironcamel i want to die if it is not
19:41 ironcamel is BUILD right place to do that?
19:41 tadzik I think so
19:41 xivix How's the next version coming?
19:42 ironcamel no easy way to add validation to the attribute?
19:42 moritz_ submethod BUILD(:@players) { die unless 2 <= @players <= 6 }
19:42 ironcamel submethod?  why not method?
19:42 moritz_ ironcamel: there is, but it doesn't work well yet
19:42 tadzik xivix: great as always :) Are you asking about something specific?
19:42 moritz_ subset Players of Array where { 2 <= .elems <= 6 }
19:43 xivix Not really. Is the project aimed as a successor to Perl 5?
19:43 tadzik I think so
19:43 moritz_ or not, depending on whom you ask :-)
19:43 xivix I had thought so, but then I visited the website today, and it said something like, "sister language."
19:44 moritz_ xivix: in some sense it's a successor, but that doesn't mean it will obsolete Perl 5
19:44 tadzik It's not a drop-in replacement, as it's not backwards-compatibile, so it's not just another version of Perl
19:44 Tene xivix: Perl 5 is not going away, and people will still be using it for quite a long time.
19:44 moritz_ xivix: which is what many people falsly assume
19:44 xivix Is it going to have backwards-compatibility modules?
19:44 xivix use legacy;
19:44 xivix or someghing?
19:44 tadzik use v5
19:44 tadzik it's speced
19:45 ironcamel what does submethod mean?
19:45 xivix But that's as far as backwards-compatibility will go?
19:45 tadzik it doesn't get inherited
19:45 moritz_ ironcamel: it's a method that's not inherited
19:45 Tene xivix: It's specced, but not yet implemented, and Perl 5 is going to continue development.
19:45 sorear Perl 6 is being designed as a successor to Perl 5, in the sense that C++ is a successor to C
19:45 moritz_ xivix: you can also use perl 5 modules from Perl 6 (within certain limits)
19:45 xivix Why not Perl++?
19:45 tadzik we alredy evaluated that
19:45 sorear the relationship between the two languages will probably be similar to that
19:46 moritz_ xivix: because it's not an increment :-)
19:46 sorear although, the complexity differential is a lot smaller
19:46 moritz_ it's a huge step
19:46 xivix I was trying to come up with something more perl-y.
19:46 tadzik I think there are more important things than the numeration
19:46 sorear Perl 6 makes some things more complicated, but it also simplifies a great deal
19:47 xivix How can it be more complicated than anything in Perl already?
19:47 moritz_ ironcamel: http://perlgeek.de/blog-en/perl-6/objec​t-construction-and-initialization.html might interest you
19:48 ironcamel thanks moritz_ !
19:48 moritz_ xivix: a programming language can't make everything simple
19:48 xivix I kid. The language was much in need of a facelift, though.
19:48 ironcamel submethod BUILD { die unless 2 <= @.players.elems <= 6 }
19:48 ironcamel something wrong with that?
19:48 moritz_ xivix: it's like a waterbed - if you press down in some places, others will start to rise
19:48 xivix It was beginning to reach its limits.
19:48 sorear the only reason Perl 5 was ever worth using was CPAN
19:48 sorear we're trying to fix that with 6
19:49 xivix CPAN and the best regex support ever.
19:49 moritz_ ironcamel: you probably need submethod BUILD(:@!player) { ... } (for some strange reason I don't quite understand)
19:49 moritz_ xivix: well, perl 6 regexes are even more powerful :-)
19:49 ironcamel has @.players is rw;
19:49 ironcamel is my attribute
19:49 moritz_ ironcamel: I know, I know
19:49 xivix How?
19:49 moritz_ s/player/players/ in my example
19:49 tadzik xivix: as they're not regular, more like context-free
19:49 tadzik iirc
19:50 moritz_ xivix: you can name regexes, and call them by name
19:50 sorear Perl 5 regexes are wayyyy beyond regular too
19:50 xivix How is s/player/players/ special?
19:50 tadzik and iiuc
19:50 moritz_ xivix: and organize them in grammars, and inherit from them
19:50 tadzik xivix: that was for ironcamel
19:50 xivix Oh, okay.
19:50 xivix I was all, "how...is...that...different...?"
19:51 tadzik take a look at the Regexes chapter in moritz_'s Perl 5 to 6
19:51 xivix So simple regex stuff will be pretty much the same, but now you can have regex inheritence and write whole parsers and stuff?
19:52 tadzik right
19:52 moritz_ right
19:52 tadzik yet regexes themselves are also a bit different
19:52 xivix Right on.
19:52 xivix Implementation-wise?
19:52 sorear Perl 6 itself is expressed as a regex grammar
19:52 xivix Or in their use?
19:52 moritz_ both
19:52 tadzik not really. They have a different syntax, speced
19:53 moritz_ ironcamel: it's a limitation in Rakudo atm, as far as I understand
19:53 xivix Huh. So, it will be superpowerful in Perl 6 because it's pretty much the bedrock of the language?
19:53 moritz_ ironcamel: BUILD doesn't have access to attributes, unless you declare them as named arguments
19:53 xivix Or something like that.
19:54 tadzik xivix: the thing is, you can actually modify/extend the standard grammar, in your code
19:54 [particle] joined #perl6
19:54 moritz_ xivix: there's the old saying that you can't parse XML in with regexes -- that's not true anymore in Perl 6
19:54 xivix Oh, no way.
19:55 tadzik still, can you parse HTML?
19:55 xivix Yeah, I figured it might be practical with the inheritance thing.
19:55 xivix HTML is almost regular sometimes.
19:55 moritz_ http://perlgeek.de/en/article/5-to-6#post_20
19:55 tadzik I mean, to a data structure? How would it treat things like <b><i>bla</b></i>
19:55 moritz_ tadzik: badly :-)
19:55 tadzik I thought so :) So tokenizing is the only way, like HTML::Parser does this?
19:55 xivix So you could have some module ``perl-to-java'', and then write Java code after that?
19:56 tadzik That sounds possible. That also sounds wrong :)
19:56 xivix That would be dumb. But would it be possible?
19:56 moritz_ tadzik: stringly speaking, <b><i>bla</b></i> is not HTML :-)
19:56 tadzik moritz_: isn't it? It's not XHTML, but isn't stuff like this HTML-ok?
19:56 xivix Yeah, but the fact that such a thing could be internal is mind-blowing.
19:56 moritz_ xivix: if somebody implement it...
19:57 xivix Right. Who would? Probably nobody.
19:57 tadzik there's a Java to Perl6 translator
19:57 xivix Nah, somebody will do something like that.
19:57 moritz_ tadzik: SGML has its quirks, but wrongly nested tags aren't allowed in SGML and HTML either
19:57 tadzik I see
19:57 xivix "Hey look, guys! I made Perl into Scheme!"
19:57 moritz_ well, mberends is working on a Java backend for Perl 6
19:58 moritz_ for Rakudo, to be precise
19:58 tadzik Java, or JVM?
19:58 moritz_ Java atm
19:58 xivix So why was Parrot chosen?
19:58 * dukeleto mumbles about wheels within wheels
19:59 xivix And not LLVM or another VM?
19:59 moritz_ xivix: it provides lots of stuff that Perl 6 needs - like a framework for multi dispatch
19:59 tadzik Parrot is more dynamic than most of the VMs around, I think
19:59 moritz_ and it's desgined for dynamic languages
19:59 dukeleto xivix: llvm is "low-level" hence the name. Parrot will begin to use LLVM in the near future.
19:59 moritz_ whereas JVM is for statically typed languages
19:59 xivix Oh, so Pure should be using Partot.
20:00 xivix Huh.
20:00 tadzik Pure?
20:00 xivix Very much so, actually.
20:00 xivix Pure is a newish functional language, written by a German music teacher.
20:00 xivix It's based on term rewriting and has haskell-like syntax to a degree.
20:00 xivix But the fact that is' based on term rewriting, though POWERFUL, is HELLA SLOW.
20:01 moritz_ how statically typed is it
20:01 moritz_ ?
20:01 zostay left #perl6
20:01 xivix The interpreter is written for LLVM, but it would make sense for it to be Parrot, if it's higher level.
20:01 xivix It's one of LLVM's demo projects, actually.
20:02 tadzik if it's for LLVM, it's not an interpreter I think :)
20:02 zostay joined #perl6
20:02 xivix It's a compiler but it has a command line as well.
20:03 tadzik so does Rakudo
20:03 xivix Okay, so it JIT compiles the code when there's an input file.
20:03 xivix When there's not an input file.
20:04 xivix Whatever. It's slow on LLVM.
20:04 moritz_ that doesn't mean LLVM is to blame
20:04 moritz_ rakudo is also slow on parrot
20:05 xivix I didn't say LLVM was to blame.
20:05 xivix I was calling into question the choice of VM.
20:05 Tene xivix: Quite possibly.  Parrot is quite a nice platform for some languages.
20:06 Tene It's still in heavy development, and has some notable drawbacks and not-yet-implemented parts.
20:07 xivix Yeah, whereas LLVM is fairly mature.
20:07 tadzik it has less to do :)
20:07 sorear Parrot is the laughing stock of the VM community, sadly
20:07 muixirt Tene: could you please define "some languages"
20:07 xivix Like, Apple's linking cc to llvm-gcc in Xcode 4.
20:07 sorear ten years of political infighting in the steering committee have left it not significantly better off than it was in 2001
20:07 xivix So if it's good enough for Apple, it's...
20:07 jnthn Turns out Perl 6 is actually gradually typed. If I target Parrot, I gotta build the static bits I want. If I target the JVM, I gotta build the dynamic bits I want.
20:08 ironcamel say 10.rand.int ... what is the rigth way to do that
20:08 sorear there are signs that this might be improving soon, but I for one am not that patient
20:08 sorear say 10.rand
20:08 sorear .Int
20:08 Tene muixirt: Parrot seems to be pretty nice for some types of language research.  I'm quite pleased with their compiler tools, for example.
20:09 xivix So I looked up Parrot on Wikipedia just now.
20:09 xivix Turns out Parrot and LLVM both just reached 2.8.
20:09 xivix Coincedince?
20:10 sorear Parrot does monthly releases
20:10 xivix CONSPIRACY!
20:10 sorear You can't assume 2.8 is better than 2.7, because that's not the release condition
20:10 xivix Nope. Usually, "stable again as far as we know."
20:11 sorear Parrot stable releases are 0 mod 3
20:11 sorear not 2
20:11 sorear 2.9 will be the next stable release
20:11 xivix That's somewhat unusual.
20:13 xivix So what are the current projects involving Perl 6?
20:14 xivix Rakudo, ...
20:16 sorear Niecza ;)
20:16 sorear there are a couple people using perl 6 for apps
20:17 xivix Niecza?
20:17 xivix Oh, that's your compiler.
20:17 xivix For Mono?
20:18 sorear yes
20:18 xivix Perl and Windows seems to be a contradiction.
20:18 sorear well the binaries will work fine on MS .NET
20:18 jnthn xivix: Er
20:18 sorear there is also a LLVM port in the works
20:18 Mowah left #perl6
20:18 jnthn xivix: I'm one of the core Rakudo devs and I do pretty much all my development work on Windows. :-)
20:18 xivix jnthn: ?
20:18 jnthn I assure you there's no contradiction. :-)
20:19 xivix There needs to be someone to make sure it works on the lesser platforms. :P
20:19 jnthn It works just fine there.
20:19 sorear People always look at me funny when I say I target the CLR.
20:19 jnthn Not lesser by install base. ;-)
20:19 xivix Average IQ of install base?
20:19 sorear There's so much hate against everything even tangentially associated with Microsoft.  It's ridiculous.
20:19 jnthn sorear: Agree.
20:20 xivix I'm just kidding around.
20:20 jnthn :P
20:20 xivix I play my video games from time to time.
20:21 sorear the CLR was not designed at Microsoft, was not initially implemented at Microsoft, was not created to run on Windows, and the implementation I use is completely independant
20:21 Tene I personally just don't know much about MS software.  I assume by default that they must be doing *something* pretty well, as their software seems useful to quite a few people.
20:21 sorear the only thing associated with Microsoft about the CLR is the fact that Microsoft bought the company that made it
20:21 Tene I just haven't had any need or use for it.  I don't seem to be their target market, or something.
20:21 xivix They were the first to be cross-platform and dirt-cheap.
20:21 sorear and somehow this taints Mono? WTF?
20:22 xivix I didn't say anything bad about your project!
20:22 sorear 15:17 < xivix> For Mono?
20:22 sorear 15:18 < sorear> yes
20:22 sorear 15:18 < xivix> Perl and Windows seems to be a contradiction.
20:22 sorear This is a non sequiter
20:22 xivix I was joking!
20:22 xivix Sheesh.
20:22 xivix Don't be so defensive.
20:23 Tene xivix: We get a nontrivial number of trolls here, so some people are touchy about possible trolling from new nicks.
20:24 xivix Sorry, I didn't mean it, honest.
20:24 ironcamel has Int $.position is rw default 0;
20:24 Tene Joking and sarcasm often come across wrong on IRC, unfortunately. :(
20:24 ironcamel how do i do defaults?
20:24 xivix It's evident, though, that it's finally clicked for some of the folks at Microsoft that reinventing the wheel isn't the holy grail of design.
20:24 sorear ironcamel: = 0;
20:24 Tene ironcamel: = 0;
20:25 xivix With IE9, finally implementing standards, for example.
20:25 ironcamel thanks :)
20:25 xivix It's actually a REALLY NICE browser.
20:25 xivix No foolin'.
20:25 ironcamel is there an easy way to mock methods?
20:26 moritz_ define "mock"
20:26 ironcamel $foo.bar() = { say 'hi' }
20:26 xivix Yeah, "Ha ha, you suck, print()!"
20:26 ironcamel just want to replace a method with my own
20:26 moritz_ $foo but role { method bar { say 'hi' } }
20:27 ironcamel that's awesome
20:27 jnthn I think you want does there
20:27 jnthn If you want to twiddle the object in place.
20:27 moritz_ erm, yes; I always mix up those two
20:27 ironcamel when do you use but?
20:27 jnthn ironcamel: When you want to make a copy and mix in to that.
20:27 xivix Are these new or am I just that bad at Perl?
20:27 eternaleye left #perl6
20:28 jnthn ironcamel: You'd use it when mixing into literals, for example
20:28 jnthn 42 but role { method Str() { "the answer" } }
20:28 jnthn xivix: Yes, does and but are new operators in Perl 6.
20:28 xivix Whew.
20:29 eternaleye joined #perl6
20:29 sorear As are roles.
20:29 xivix Clearly.
20:29 xivix That's pretty awesome.
20:30 _2easy joined #perl6
20:30 _2easy left #perl6
20:30 masak joined #perl6
20:30 masak ahojte!
20:30 tadzik hai masak!
20:31 ironcamel has %.board_names = { 7 => 'Chance' };
20:31 ironcamel is that right?
20:31 masak no need for the {}
20:31 tadzik yay, Monopoly
20:31 moritz_ and potentially harmfull, no?
20:31 masak rakudo: class A { has %.board_names = 7 => 'Chance' }; say A.new.board_names.perl
20:32 p6eval rakudo 79f754: OUTPUT«{"7" => "Chance"}␤»
20:32 ironcamel say $g.board_names{7}; is printing Any()
20:32 masak moritz_: no, it should work, I think.
20:32 masak rakudo: class A { has %.board_names = { 7 => 'Chance' } }; say A.new.board_names.perl
20:32 p6eval rakudo 79f754: OUTPUT«{"7" => "Chance"}␤»
20:32 moritz_ rakudo: my %h = { a => 1, b => 2}; say %h.perl
20:32 p6eval rakudo 79f754: OUTPUT«{"a" => 1, "b" => 2}␤»
20:32 eternaleye left #perl6
20:32 tadzik ironcamel: you mean either <7> or {'7'}
20:32 tadzik {} is not autoquoting anymore
20:32 masak right. with arrays, however, there's a difference.
20:32 sorear Is { "foo" => "bar" } a hash constructor?
20:32 masak tadzik: say what?
20:32 tadzik masak: say .WHAT?
20:32 sorear How about { $variable-which-happens-to-hold-a-pair } ?
20:33 masak tadzik: the hash keys still autoquote, just like in Perl 5.
20:33 tadzik masak: I meant you can't do %foo{bar}
20:33 ironcamel ints cant' be keys?
20:33 ironcamel keys are only strings?
20:33 masak tadzik: oh, ah. hash indexing :)
20:33 tadzik bar being a string literal
20:33 eternaleye joined #perl6
20:33 Tene tadzik: no
20:33 masak tadzik: sorry, I thought you meant circumfix:<{ }>, not postcircumfix:<{ }>
20:34 Tene tadzik: if you want that, use explicit autoquoting, %foo<bar>
20:34 tadzik Tene: I know, I was telling that to ironcamel
20:34 tadzik ironcamel: that'll have to be string with numbers
20:34 Tene Oh, um, I reading comprehension failed.
20:34 tadzik ironcamel: or you just want an Array maybe?
20:34 masak tadzik: re <b><i>foo</b></i> and tokenizing; I once addressed that problem for November the wiki engine.
20:34 tadzik Tene: there's plenty of people shouting all over to each other
20:35 masak I said THE MUSIC IS TOO LOUD.
20:35 tadzik WHAT?
20:35 jnthn masak: oh yay, you used the plural form of the greeting! \o/
20:35 tadzik I CAN'T HEAR YOU, THE MUSIC IS TOO LOUD!
20:35 masak WHAT?
20:35 xivix DID SOMEBODY SAY SOMETHING?
20:36 masak :)
20:36 * jnthn hands masak a type object
20:36 timbunce left #perl6
20:36 dalek rakudo: 0647023 | moritz++ | docs/ChangeLog:
20:36 dalek rakudo: [docs] update ChangeLog
20:36 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/0​647023ba2e34798cbb271fd26a9031efec35ffa
20:36 xivix dalek?
20:37 tadzik dalek
20:37 xivix That's your GitHub bot's name?
20:37 Tene xivix: bot that reports commits to the repos
20:37 Tene yes
20:37 xivix Superb.
20:37 Tene EXTERMINATE BUGS
20:37 masak xivix, ironcamel: I just want to extend a "welcome" to you both. welcome. :)
20:38 xivix Thanks!
20:38 masak how did you hear about this place?
20:38 xivix I was looking through my ports system and realized Perl wasn't there, then decided to check on Perl 6 because I'd heard it was in the works.
20:39 masak and so it is! :)
20:39 xivix Indeed!
20:39 xivix Is anyone good at Irssi?
20:40 Tene many here use it
20:40 Tene what do you need?
20:40 xivix I think I finally get the commands, and it's time to move on to making a configuration file.
20:40 sorear irssi sucks
20:41 sorear I use it with hatred
20:41 tadzik everything sucks
20:41 xivix Until now, I'd been leaning on gui irc clients.
20:41 silug joined #perl6
20:41 xivix Do you recommend an alternative?
20:41 tadzik xivix: what kind of ports system does not have Perl?
20:41 moritz_ "software is hateful" -- Nicholas Clark
20:41 xivix Homebrew for Mac.
20:41 xivix Tries not to duplicate OS X builtins, and Perl 5.12 isn't enough to warrant the upgrade from 5.10.
20:41 tadzik xivix: I like weechat personally
20:41 sorear xivix: irssi doesn't use configuration files of the handmade varity; when you type /save it creates config from current settings
20:42 sorear variety
20:42 xivix do't wory aboet speling
20:43 Tene I've never bothered with learning the commands to deal with the config from in-client.  I change my channels and networks sufficiently rarely that I just edit the config in an editor and then /reload
20:43 masak rakudo: sub roman { $^n >= 10 ?? "x" ~ roman $n-10 !! $n == 9 ?? "ix" !! $n >= 5 ?? "v" ~ roman $n-5 !! <i ii iii iv>[$n-1] }; say map { .&roman }, 14, 9
20:43 p6eval rakudo 79f754: OUTPUT«xivix␤»
20:43 masak \o/
20:43 xivix That sounds like a good solution.
20:45 timbunce joined #perl6
20:45 xivix Haha, just looking at WeeChat.
20:45 xivix "We're multi-protocol! (supports IRC and Jabber)"
20:46 xivix It's more than most IRC clients, to be sure.
20:46 xivix But dual-protocol would be a better description.
20:47 moritz_ I for one welcome our new protcol droids
20:47 xivix :)
20:48 * moritz_ -> sleep
20:48 masak moritz_: night!
20:48 xivix Nighty-nite.
20:49 justatheory left #perl6
20:50 diakopter xivix: Mono released v2.8 the same day as LLVM v2.8
20:51 xivix Oh my! How conspiratory.
20:51 xivix Parrot, Mono, and LLVM. What could this mean?
20:51 xivix Also, that was a while ago. Kudos for reading the chat log.
20:52 pythonian4000afk is now known as pythonian4000
20:53 masak rakudo: sub roman { my $pre = <v x xv xx xxv xxx xxxv>[($^n-4) / 5] // ""; $n % 5 == 4 ?? $pre.substr(0, -1) ~ "i" ~ $pre.substr(-1) !! $pre ~ "i" x ($n % 5) }; say roman($_) for 1..30
20:53 p6eval rakudo 79f754: OUTPUT«(timeout)»
20:53 jferrero joined #perl6
20:53 masak p6eval: you turtle! :)
20:54 masak rakudo: sub roman { my $pre = <v x xv xx xxv xxx xxxv>[($^n-4) / 5] // ""; $n % 5 == 4 ?? $pre.substr(0, -1) ~ "i" ~ $pre.substr(-1) !! $pre ~ "i" x ($n % 5) }; say roman($_) for 1..15
20:54 diakopter heh
20:54 p6eval rakudo 79f754: OUTPUT«i␤ii␤iii␤iv␤v␤vi␤vii␤v​iii␤ix␤x␤xi␤xii␤xiii␤xiv␤xv␤»
20:54 xivix Nice. What's the double slash?
20:54 masak xivix: defined-or
20:55 masak xivix: "use the lhs if it's defined, otherwise the rhs"
20:55 xivix Right, was that a necessary change?
20:55 masak xivix: lots more details in S03: http://perlcabal.org/syn/S03.html
20:55 xivix Like you couldn't use normal or for it?
20:55 masak xivix: I could've.
20:55 masak but I like being specific. adds clarity.
20:56 xivix Is that new syntax?
20:56 masak Perl 6 introduced it. Perl 5.10 "borrowed" it.
20:56 xivix Who would have guessed that adding forward slashes to Perl would add clarity?
20:56 xivix Go figure.
20:57 masak well, you're right in that it's not necessary in this case.
20:57 masak I could have just used the normal || operator.
20:57 xivix I thought it was a side-effect of the changes in v6.
20:57 xivix Like you had to do that now.
20:57 masak not at all.
20:57 xivix Also, what are those delimeters? I don't think they're showing right in my encoding.
20:58 diakopter xivix: I think you mean the newlines
20:58 masak xivix: Unicode is your friend.
20:58 diakopter in p6eval's output
20:58 Tene xivix: I've plenty of times written: defined($foo) ? $foo : $other
20:58 xivix They're newlines. Gotcha.
20:58 Tene with //, that's just $foo // $other
20:58 masak xivix: here on #perl6, if you don't have your set calibrated for utf-8, you'r losing out.
20:58 xivix I think I'm using UTF-8.
20:58 xivix Irssi must not be.
20:59 Tene using || would alternate on defined-but-false values like 0 and the empty string.
20:59 masak Tene: the Lisp world has a name for that kind of trouble.
20:59 xivix That's some good sugar.
20:59 masak Tene: I don't recall what, though.
21:01 jferrero xivix, what is $^n ?
21:01 huf semipredicate problem?
21:01 masak huf: yup, that sounds like it. huf++
21:01 xivix jferrero: What do you mean?
21:02 masak http://en.wikipedia.org/wiki/Semipredicate_problem
21:02 jferrero sorry, xivix , Is a question for masak :*)
21:02 masak Perl 6 should be mentioned in that article.
21:02 masak jferrero: $^n -- see S06.
21:03 masak jferrero: (it's a variable that declares itself as a parameter)
21:03 xivix jferrero: I thought you were testing me.
21:03 jferrero ah, Ok...
21:04 masak xivix: at any time, there might be a test. better stay alert! :P
21:04 xivix PERL N00BS: EVACUATE THE PREMISES
21:05 xivix Yo, someone should write a PerlQuiz bot.
21:05 xivix Not it.
21:06 masak xivix: I think you and lue++ might get along fine.
21:06 xivix Who?
21:06 _kaare left #perl6
21:06 masak oh, lue is just this guy, you know. :)
21:07 xivix Yeah, I see him in your commit logs.
21:10 masak he's the one who put in this error message:
21:10 masak rakudo: :2<OH HAI>
21:10 p6eval rakudo 064702: OUTPUT«===SORRY!===␤Malformed radix number at line 22, near "<OH HAI>"␤»
21:10 masak oh, not that one.
21:10 masak rakudo: my $foo = "OH HAI"; :2($foo)
21:10 p6eval rakudo 064702: OUTPUT«DON'T PANIC! Invalid character (O)! Please try again :) ␤  in main program body at line 1␤»
21:10 masak that one.
21:11 xivix Er, what was the error?
21:12 masak xivix: :2() only accepts the characters "0" and "1".
21:12 xivix Oh, duh.
21:12 xivix My b.
21:12 masak no need to apologise :)
21:13 xivix I'd be pleasantly surprised if for a moment I forgot what binary was, though!
21:13 xivix Though maybe a little lost.
21:13 xivix And also, I discovered that my encoding is still not working.
21:14 xivix αβγδ
21:15 xivix How did that...?
21:16 sorear alpha beta gamma delta
21:16 xivix But the symbols, right?
21:17 masak the Greek letters.
21:17 sorear symbols?  no, they're lowercase letters
21:17 xivix The symbols vs. the names.
21:17 masak sorear: letters are symbols :)
21:17 xivix 'f' is a symbol in the Latin alphabet, with the name "eff".
21:18 sorear masak: if I had a penny for every time somebody expected 'λ' ~~ /\W/ ...
21:18 masak 是, however, is a symbol but not a letter. actually, it's a 字 :)
21:18 xivix What's its name!
21:18 masak xivix: depends on where you're from.
21:19 sorear the hanzi have different names in each country that uses them
21:19 masak xivix: in the Mandarin-speaking parts, its name is SHI4.
21:19 xivix Touché.
21:19 masak TouSHI4. :)
21:19 sorear even the collective name differs; the Japanese call them kanji
21:19 masak and the Korean "hanja".
21:20 xivix I knew that last thing.
21:20 xivix Because I took some Japanese once.
21:20 jnthn lol i blug: http://6guts.wordpress.com/2010/10/15/slides-a​nd-a-few-words-on-representation-polymorphism/
21:20 xivix So, those symbols all showed up just fine, but the delimiters from rakudo didn't. :\
21:20 masak jnthn++ \o/
21:21 xivix The past tense?
21:21 masak xivix: probably your font not being l33t enough, then.
21:21 xivix Maybe not.
21:21 masak xivix: jnthn likes Indo-European languages, so he's toying with... ablaut, is it?
21:22 jnthn Yes, yes, I abaught inappropriately. :-)
21:22 jnthn *ablaught
21:22 masak *laul*
21:22 sorear xivix: the delimiters from p6eval are in very very few fonts
21:23 xivix Now I'm using Courier, so maybe it'll work.
21:24 masak jnthn: “but that usually will create another problem”
21:24 masak jnthn: that's not how I heard it.
21:24 masak jnthn: I heard it as "except the problem of too many levels of indirection", which is more of a punch line.
21:25 sorear TimToady is a linguist.  It rubs off.
21:25 xivix Wait, what should the thing before "Welcome to Perl 6" look like?
21:26 sorear A butterfly.
21:26 xivix Oh, okay.
21:26 jnthn masak: http://en.wikiquote.org/wiki/Programming
21:26 jnthn masak: Was my source.
21:26 masak xivix: '>>' as one char, 'o' with two dots, '<<' as one char.
21:26 sorear Closing guillemot, o-umlaut, opening guillemot
21:26 xivix Okay, it's looked like that the whole time.
21:26 sorear aka "ISO-8859-1 Camelia"
21:26 jnthn masak: But I seem to remember it the way I have it too.
21:27 sorear our logo has an official character form
21:27 masak jnthn: here's my source: http://en.wikipedia.org/wiki/Dav​id_Wheeler_(computer_scientist)
21:27 colomon joined #perl6
21:27 masak quote just above "Publications".
21:27 jnthn Yeah
21:27 jnthn Maybe he said both. ;-)
21:28 jnthn Sadly, he's no longer around to ask. :-(
21:28 jnthn I'm pretty sure I stood in an elevator with him once though...
21:29 xivix *schoolgirl scream*
21:29 jnthn Those two comments weren't *that* related. :P
21:29 masak not a good idea to scream like a schoolgirl while in an elevator.
21:29 jnthn I didn't. I was more like "wait, is that..."
21:30 xivix masak: Apparently I need to re-evaluate my idea of what is socially appropriate.
21:32 xivix rakudo: "encoding?"
21:32 p6eval rakudo 064702:  ( no output )
21:32 masak rakudo: say $*ENC
21:32 p6eval rakudo 064702:  ( no output )
21:32 masak :(
21:33 xivix rakudo: say "huh?"
21:33 p6eval rakudo 064702: OUTPUT«huh?␤»
21:33 xivix Nope. Still broked.
21:34 xivix Er, unless it's supposed to look like N/L.
21:34 muixirt rakudo: my Buf @b=1,2,3,4; say @b[0]
21:34 xivix In which case that's just strange.
21:34 p6eval rakudo 064702: OUTPUT«maximum recursion depth exceeded␤  in 'at_pos' at line 1␤  in 'at_pos' at line 5:CORE.setting␤  in 'Any::postcircumfix:<[ ]>' at line 1697:CORE.setting␤  in 'at_pos' at line 5:CORE.setting␤  in 'at_pos' at line 5:CORE.setting␤  in 'Any::postcircumfix:<[ ]>' at line
21:34 p6eval ..1697:CORE.settin…
21:34 masak xivix: it's supposed to look like N/L.
21:35 masak xivix: think about it :)
21:35 xivix I get it.
21:35 xivix But it looked like icky quotes and a right angle at size 11.
21:35 masak muixirt: that doesn't do what you think it does.
21:35 xivix I can read the characters now at size 13.
21:36 xivix It was never broken in the first place.
21:36 * xivix feels silly
21:36 masak muixirt: when you type an array, the type refers to the array's elements.
21:36 sorear I actually think a box is more readable than N/L so I haven't bothered to fix it
21:37 xivix So, can arrays have other arrays as elements in Perl 6?
21:37 masak xivix: sure.
21:37 xivix Thank God.
21:37 masak rakudo: my @a = [1, 2, 3], [4, 5, 6]; say @a.elems; say @a.perl
21:37 p6eval rakudo 064702: OUTPUT«2␤[[1, 2, 3], [4, 5, 6]]␤»
21:38 xivix That was SO NECESSARY.
21:38 masak xivix: erm. Perl 5 does that too.
21:38 xivix Have I been using v4?
21:38 xivix Maybe using v4 docs.
21:39 pyrimidine left #perl6
21:39 xivix I thought it could only store the references.
21:39 masak that's all Perl 6 can do too.
21:39 masak no real difference.
21:39 Tene perl -E '@a = ([1,2],[3,4]); say scalar(@a)'
21:39 Tene 2
21:40 muixirt rakudo: my Buf @b=1,2,3,4; say @b.perl
21:40 p6eval rakudo 064702: OUTPUT«[1, 2, 3, 4]␤»
21:40 muixirt i don't get it
21:40 jferrero left #perl6
21:41 sorear muixirt: you just created a list of Buf objects, and stored 4 integers in it
21:41 sorear it should have crashed, saying "1 cannot be stored in an array of Buf"
21:41 mavrc left #perl6
21:41 xivix Whoah, type checking?
21:42 muixirt so how do i get a Buf and fill it with integer values?
21:42 chturne joined #perl6
21:44 Tene rakudo: my Buf $b .= new(); say $b.WHAT;
21:44 p6eval rakudo 064702: OUTPUT«Buf()␤»
21:49 masak rakudo: my Buf $b .= new(65, 66, 67). say $b.decode
21:49 p6eval rakudo 064702: OUTPUT«===SORRY!===␤Confused at line 22, near "my Buf $b "␤»
21:49 xivix Yeah, so about the array thing.
21:49 masak rakudo: my Buf $b .= new(65, 66, 67); say $b.decode
21:49 jnthn masak:  ;
21:49 p6eval rakudo 064702: OUTPUT«ABC␤»
21:49 xivix I'd been always putting in the addresses by hand.
21:50 envi_ left #perl6
21:51 muixirt and what is wrong with: my Buf $b .= new(); $b=1,2,3,4;
21:51 masak muixirt: the second assignment overwrites the first.
21:51 jnthn That's doing item assignment
21:51 jnthn It's like ($b=1),2,3,4
21:52 jnthn std: my Buf $b .= new(); $b=1,2,3,4;
21:52 Tene rakudo: my Buf $b .= new(); $b[0..4] = 120, 105, 118, 105, 120; say $b.decode;
21:52 p6eval std 263c207: OUTPUT«ok 00:01 119m␤»
21:52 p6eval rakudo 064702: OUTPUT«xivix␤»
21:52 jnthn ah, std ain't doing the useless warnings yet.
21:54 jferrero joined #perl6
21:55 timbunce left #perl6
22:02 timbunce joined #perl6
22:03 synth joined #perl6
22:03 Schwern left #perl6
22:04 icwiener left #perl6
22:04 Chillance left #perl6
22:05 dalek niecza/master: 2b2ac81 | sorear++ | / (4 files):
22:05 dalek niecza/master: Implement hash constructors
22:05 dalek niecza/master: review: http://github.com/sorear/niecza/commit/2​b2ac81b3240380dbc079835ba613a2b908f32e0
22:07 xivix Where does dalek come from?
22:08 tadzik yay, Hashes in niecza!
22:08 masak sorear++
22:09 xivix Why the ++?
22:09 masak aloha: karma sorear
22:09 aloha masak: sorear has karma of 105.
22:09 masak sorear++
22:09 masak aloha: karma sorear
22:09 aloha masak: sorear has karma of 106.
22:09 wooden left #perl6
22:10 xivix Cool, and why?
22:10 masak social expectation to do good -> get karma.
22:10 xivix Right, but, what does it mean?
22:11 masak nothing. it's just a number.
22:11 wooden joined #perl6
22:11 wooden left #perl6
22:11 wooden joined #perl6
22:11 xivix I'm a fan of meaningless fun things.
22:11 masak in other news, money are just paper and scraps of metal.
22:11 masak s/are/is/
22:12 xivix You should have p6eval edit your last message.
22:13 masak rakudo: $_ = "in other news, money are just paper and scraps of metal."; s/are/is/; .say
22:13 wooden left #perl6
22:13 p6eval rakudo 064702: OUTPUT«in other news, money is just paper and scraps of metal.␤»
22:13 masak p6eval++ rakudo++
22:13 xivix Haha.
22:13 xivix Where's the source for the p6eval bot? It'd be fun to correct typos with s//.
22:14 alester left #perl6
22:14 xivix Anyway, I find it fairly surprising that nobody registered the nick "dalek" on freenode until perl6 needed a GitHub bot.
22:15 sorear xivix: daleks are the main lawful evil race in Dr Who
22:15 xivix sorear: My favorite doctors are 1, 4, and 9.
22:16 wooden joined #perl6
22:16 wooden left #perl6
22:16 wooden joined #perl6
22:17 xivix I'd just assume that the name would be registered rather quickly on a network as large as Freenode.
22:17 tadzik sorear: btw, where did the name "niecza" come from?
22:18 sorear tadzik: I asked masak to come up with a name for a Perl 6 implementation
22:18 tadzik masak: btw, where did the name "niecza" come from?
22:18 sorear you could say "butchered Polish", but "masak's mind" is probably a more apt description
22:18 sorear czas = time, nie = no
22:19 tadzik niecza is like "nie trza", which is like "nie trzeba", which is like "isn't needed"
22:19 jnthn I think it was a polification of a misunderstanding of some Czech that was captioned as if it was Swedish.
22:19 tadzik ach, cza from czas
22:19 masak tadzik: yes, from czas.
22:19 timbunce left #perl6
22:21 jnthn o~ "...e kass..."
22:22 tadzik yapsi is like "apsik"
22:22 masak what does that mean?
22:23 masak "sneezy"?
22:23 tadzik "apsik" is an.., onomathopeia (is there an english word like this?) for... this activity you do when you get a cold
22:23 masak yes, onomatopoeia.
22:24 tadzik some people like to make their "apsik" really loud, so the whole district hears it and fells off their chairs
22:24 sorear We say "A-a-a-a-choo!!" here
22:24 tadzik yeah, that's it
22:24 tadzik "kichać
22:24 tadzik "
22:24 sorear What is your home language?
22:24 tadzik Polish
22:24 masak my office-mate only says the "CHOO!" sometimes, which tends to make me jump.
22:25 tadzik like a train
22:25 tadzik CHOO CHOO!
22:25 masak no, just once. and real loud.
22:25 xivix chugga chugga
22:25 tadzik I like saying "Achoo!" very loud, and then saying "thank you" even though no one says "bless you", being too stiffed
22:26 xivix And you then look around for who you might have responded to.
22:26 tadzik somewhat
22:28 Schwern joined #perl6
22:30 wooden left #perl6
22:33 wooden joined #perl6
22:35 justatheory joined #perl6
22:38 wooden_ joined #perl6
22:39 wooden left #perl6
22:41 tadzik sleepytime, g'night folks
22:41 masak tadzik: dobranoc!
22:42 tadzik branoc :)
22:42 tadzik left #perl6
22:42 cdarroch left #perl6
22:45 masak heh, look how p6 looked on p6l in 2003: http://www.nntp.perl.org/group/perl.​perl6.language/2003/09/msg15787.html
22:48 zby_home__ left #perl6
22:48 kjeldahl left #perl6
23:00 masak rakudo: use MONKEY_TYPING; augment grammar Perl6::Grammar { token package_declarator:sym<diagram> { <sym> :my $*PKGDECL := "diagram"; <package_def> } }; Perl6::Grammar!protoregex_generation(); eval(diagram Foo {}; say 42]);
23:00 p6eval rakudo 064702: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤»
23:00 jnthn Missed quotes in eval
23:01 masak argh.
23:01 masak rakudo: use MONKEY_TYPING; augment grammar Perl6::Grammar { token package_declarator:sym<diagram> { <sym> :my $*PKGDECL := "diagram"; <package_def> } }; Perl6::Grammar!protoregex_generation(); eval(q[diagram Foo {}; say 42]);
23:01 p6eval rakudo 064702:  ( no output )
23:01 xivix argv.
23:01 masak rakudo: use MONKEY_TYPING; augment grammar Perl6::Grammar { token package_declarator:sym<diagram> { <sym> :my $*PKGDECL := "diagram"; <package_def> } }; Perl6::Grammar!protoregex_generation(); eval(q[diagram Foo {}; say 42]); say $!
23:01 p6eval rakudo 064702: OUTPUT«No HOW declared for package declarator diagram at line 1, near "{}; say 42"␤»
23:02 masak rakudo: use MONKEY_TYPING; augment grammar Perl6::Grammar { token package_declarator:sym<diagram> { <sym> :my $*PKGDECL := "grammar"; <package_def> } }; Perl6::Grammar!protoregex_generation(); eval(q[diagram Foo {}; say 42]); say $!
23:02 p6eval rakudo 064702: OUTPUT«Null PMC access in invoke()␤»
23:02 masak I... I hesitate to rakudobug this one :)
23:02 jnthn :-)
23:02 Tene jnthn: where's the 6model stuff online?
23:03 moritz_ http://github.com/jnthn/6model
23:03 jnthn Tene: See nom branch in nqp-rx repo for the on-Parrot impl so far
23:03 jnthn And...what moritz_ said for the CLR and JVM ones.
23:04 Tene That's extremely tempting to work on.
23:04 jnthn :-)
23:05 sorear No love for me.
23:05 sorear :-)
23:05 jnthn Tene: I guess you have a commit bit for nqp-rx repo already, and let me know if you want one for 6model repo.
23:06 Tene jnthn: I'm all sorts of nonfunctional these days, so it's unlikely that I'll do anything.  Would I need to work on anything in 6model to work on the nom branch in nqp-rx?
23:06 jnthn Tene: No
23:07 Tene I'm unlikely to work on CLR or JVM.
23:07 jnthn Tene: Generally my work flow is to do the first cut of things in 6model and then port it.
23:07 jnthn But that's not the case all the time.
23:07 jnthn Basically, "whatever's easiest"
23:07 jnthn It's fine to just hack on one, there's no "they must all remain consistent all the time" requirement. :-)
23:07 Tene 'k
23:13 pwnage- joined #perl6
23:13 MayDaniel left #perl6
23:18 envi joined #perl6
23:19 Chillance joined #perl6
23:24 masak left #perl6
23:25 pwnage- left #perl6
23:35 Trashlord left #perl6
23:37 Trashlord joined #perl6
23:37 risou_ left #perl6
23:37 eternaleye left #perl6
23:38 [particle] left #perl6
23:39 eternaleye joined #perl6
23:40 [particle] joined #perl6
23:42 eternaleye left #perl6
23:43 eternaleye joined #perl6
23:46 eternaleye left #perl6
23:49 eternaleye joined #perl6

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

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs