Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2011-05-12

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:00 perigrin Ali_h: incase there is a transcription error or something ... can you humor us and paste the results into something like http://paste.scsys.co.uk/ ?
00:01 TimToady of gist.github.com
00:01 TimToady *or
00:01 Ali_h well ill take screenshot and it will show output too
00:01 perigrin harder for one of us to copy it and try it locally that way, but as you wish
00:02 * TimToady has to run off in a few minutes, but is glad to see other people helping
00:03 TimToady another question, is this the first time you've install Rakudo?
00:03 TimToady or is there maybe an old copy out there somewhere?
00:03 Ali_h first time instal
00:03 Ali_h http://paste.scsys.co.uk/103508
00:04 Ali_h as I said its right from the book
00:04 PerlJam not quite
00:05 TimToady yowsers, that's ancient
00:05 PerlJam (There's some odd spacing at the very least)
00:05 TimToady illegal Perl 6 these days
00:05 Ali_h PerlJam, its how the books done it
00:06 sorear -> $line{ will never work
00:06 PerlJam Ali_h: $line{ and $r2{ won't fly too far
00:07 Ali_h so the books wrong :/ can anyone suggest anything else to learn perl6 by
00:08 PerlJam no, the book is correct (at least in source form  :)
00:08 TimToady }else{ is incorrect
00:08 PerlJam did you copy/paste from the PDF or something?
00:08 TimToady put spaces around all your block braces
00:09 Ali_h >.< no so I typed wrong ok just gonna hide now :/
00:10 TimToady you also misspelled $result/$results
00:10 justatheory left #perl6
00:10 justatheory joined #perl6
00:11 TimToady and $sets needs to be %sets
00:11 Ali_h eek goes into hiding and goes to read preoperly :/
00:11 Ali_h sorry guys
00:11 PerlJam Ali_h: no worries.
00:12 perigrin Ali_h: and that's why I suggested actually pasting the code ... transcription errors are a bane to us all.
00:12 justatheory left #perl6
00:12 * TimToady has to run off now, but good luck!  :)
00:13 Ali_h thanks TimToady,perljam and pergrin  for your help:)
00:14 whiteknight left #perl6
00:17 PerlJam Ali_h: that's what we're here for?
00:17 PerlJam er, s/\?/./
00:17 spinclad joined #perl6
00:18 whiteknight joined #perl6
00:19 * PerlJam wonders how long the culture of friendliness can last.
00:25 dalek niecza: cbfec0f | sorear++ | lib/CLRBackend.cs:
00:25 dalek niecza: Use nesting depth to break ties in my multi sub
00:25 dalek niecza: review: https://github.com/sorear/niecza/commit/cbfec0ff62
00:26 sorear niecza: class A { multi method foo(:$x) { say 1 } }; class B is A { multi method foo(:$x) { say 2 } }; A.foo(:x); B.foo(:x)
00:26 p6eval niecza v5-1-gfd940af: OUTPUT«1␤2␤»
00:26 keeth left #perl6
00:28 dual left #perl6
00:30 sorear std: class foo { method bar() { -> { $.foo } } }
00:30 p6eval std 3ba3a75: OUTPUT«Potential difficulties:␤  Variable $.foo used outside of method declaration at /tmp/PGyVKiR6pw line 1:␤------> [32mclass foo { method bar() { -> { $.foo[33m⏏[31m } } }[0m␤ok 00:01 114m␤»
00:30 dual joined #perl6
00:35 keeth joined #perl6
00:35 araujo joined #perl6
00:37 xinming left #perl6
00:39 xinming joined #perl6
00:39 [Coke] left #perl6
00:41 [Coke] joined #perl6
01:02 f00li5h left #perl6
01:04 f00li5h joined #perl6
01:13 woosley joined #perl6
01:14 cotto joined #perl6
01:16 am0c left #perl6
01:25 jaldhar joined #perl6
01:26 ymasory_ joined #perl6
01:29 alc joined #perl6
01:34 alc left #perl6
01:34 daxim left #perl6
01:36 keeth left #perl6
01:37 TimToady yes, I need to fix that
01:44 whiteknight left #perl6
01:46 daxim joined #perl6
01:53 daxim left #perl6
01:56 daxim joined #perl6
01:58 frodwith left #perl6
02:01 frodwith joined #perl6
02:01 [1]imamelia joined #perl6
02:01 mtk left #perl6
02:04 imamelia left #perl6
02:04 [1]imamelia is now known as imamelia
02:09 alester joined #perl6
02:11 mtk joined #perl6
02:12 alc joined #perl6
02:19 ggoebel left #perl6
02:20 alc left #perl6
02:20 beek left #perl6
02:24 ggoebel joined #perl6
02:44 [1]imamelia joined #perl6
02:46 imamelia left #perl6
02:46 dalek std: 4d51d3e | larry++ | STD.pm6:
02:46 dalek std: better emulation of partial/complete object scope
02:46 dalek std: review: https://github.com/perl6/std/commit/4d51d3ec36
02:47 imamelia joined #perl6
02:49 [1]imamelia left #perl6
02:49 am0c joined #perl6
02:51 dalek std: e9571cb | larry++ | STD.pm6:
02:51 dalek std: apply $*HAS_SELF context to self itself, duh...
02:51 dalek std: review: https://github.com/perl6/std/commit/e9571cb072
02:53 TimToady std: self
02:53 p6eval std 3ba3a75: OUTPUT«ok 00:01 112m␤»
02:54 sorear std: sub infix:<>() {}
02:54 p6eval std 3ba3a75: OUTPUT«[31m===[0mSORRY![31m===[0m␤Null operator is not allowed at /tmp/4vpa2H7lXK line 1:␤------> [32msub infix:<>[33m⏏[31m() {}[0m␤Other potential difficulties:␤  Pair with <> really means a Nil value, not null string; use :('') to represent the null string,␤  or :() to
02:54 p6eval ..represent…
02:54 sorear niecz: sub infix:<>() {}
02:54 sorear niecza: sub infix:<>() {}
02:54 p6eval niecza v5-2-gcbfec0f: OUTPUT«Unhandled exception: Unable to resolve method ast in class Any␤  at /home/p6eval/niecza/src/NieczaActions.pm6 line 1413 (NieczaActions NieczaActions.coloncircumfix @ 3)␤  at  line 0 (ExitRunloop @ 0)␤  at /home/p6eval/niecza/src/STD.pm6 line 2049 (STD P6.coloncircumfix
02:54 p6eval ..@ 11)␤  at /…
03:00 imamelia left #perl6
03:00 imamelia joined #perl6
03:12 benabik joined #perl6
03:15 satyavvd joined #perl6
03:16 hudnix left #perl6
03:21 wamba joined #perl6
03:23 Su-Shee joined #perl6
03:26 Su-Shee_ left #perl6
03:28 sorear it looks like someone edited STD.pm6 recently with an editor that doesn't respect # vim: expandtab
03:29 dalek std: 46608ea | sorear++ | STD.pm6:
03:29 dalek std: Fix tab usage
03:29 dalek std: review: https://github.com/perl6/std/commit/46608eaf9c
03:31 satyavvd_ joined #perl6
03:34 satyavvd left #perl6
03:36 hatseflats left #perl6
03:37 pmichaud left #perl6
03:37 pmichaud joined #perl6
03:37 hatseflats joined #perl6
03:37 sorear std: try { }; say $!; # TimToady!!
03:37 p6eval std 3ba3a75: OUTPUT«Potential difficulties:␤  Variable $! used outside of method/submethod declaration at /tmp/otSmINFALB line 1:␤------> [32mtry { }; say $![33m⏏[31m; # TimToady!![0m␤ok 00:01 114m␤»
03:38 ymasory_ left #perl6
03:39 sorear std: isn't fully up to date
03:39 p6eval std 3ba3a75: OUTPUT«[31m===[0mSORRY![31m===[0m␤Undeclared routines:␤        'date' used at line 1␤  'fully' used at line 1␤ 'isn't' used at line 1␤ 'to' used at line 1␤    'up' used at line 1␤Check failed␤FAILED 00:01 112m␤»
03:39 sorear locally, it's a full "sorry"
03:44 TimToady std: self
03:44 p6eval std 3ba3a75: OUTPUT«ok 00:01 112m␤»
03:45 sorear TimToady: std 3ba = before $*HAS_SELF
03:45 TimToady yeah, but $! will still be rwong
03:45 TimToady std: $.
03:45 p6eval std 3ba3a75: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unsupported use of $. variable; in Perl 6 please use the filehandle's .line method at /tmp/tLZGhyiEFa line 1:␤------> [32m$.[33m⏏[31m<EOL>[0m␤Parse failed␤FAILED 00:01 112m␤»
03:46 sorear also, someone added new usages of $variable.sorry
03:46 sorear where $variable ~~ Match
03:47 wamba left #perl6
03:54 TimToady well, the intent is that $variable remember a cursor position for errors, since self might be too far down the buffer
03:59 TimToady well, that was the intent originally, but the code has mutated over time...
04:01 sorear the problem is that Match objects don't have a .sorry method
04:01 sorear Rakudo and Niecza use $variable.CURSOR.sorry; I'm not sure what the best way is
04:01 sorear our way feels a smidge hackish
04:03 tadzik left #perl6
04:03 PerlJam left #perl6
04:03 Juerd left #perl6
04:04 Juerd joined #perl6
04:04 PerlJam joined #perl6
04:05 tadzik joined #perl6
04:06 PerlJam left #perl6
04:07 TimToady I'm generating a $here = self.cursor($variable.from) now
04:08 TimToady testing
04:12 colomon left #perl6
04:14 benabik left #perl6
04:15 PerlJam joined #perl6
04:15 wamba joined #perl6
04:17 * TimToady wonders why his vim stopped paying attention to the vim: line...
04:20 dalek std: 01c24ce | larry++ | STD.pm6:
04:20 dalek std: $! not twigilled; convert $variable to cursor
04:20 dalek std: review: https://github.com/perl6/std/commit/01c24ce380
04:22 TimToady somehow my modeline defaulted to 'no'...
04:22 TimToady doubtless someone decided it was a security hole
04:23 TimToady std: self
04:23 p6eval std 3ba3a75: OUTPUT«ok 00:01 112m␤»
04:23 TimToady still not updating, alas
04:29 colomon joined #perl6
04:33 imamelia left #perl6
04:36 wamba left #perl6
04:36 wamba joined #perl6
04:41 imamelia joined #perl6
04:44 imamelia left #perl6
04:49 imamelia joined #perl6
04:51 nymacro joined #perl6
04:51 wamba left #perl6
05:01 pjcj joined #perl6
05:02 imamelia left #perl6
05:08 alester left #perl6
05:11 sftp left #perl6
05:15 SHODAN joined #perl6
05:18 molaf joined #perl6
05:20 birdwindupbird joined #perl6
05:26 molaf left #perl6
05:48 Mowah joined #perl6
06:01 TimToady std: self
06:01 p6eval std 01c24ce: OUTPUT«[31m===[0mSORRY![31m===[0m␤'self' used where no object is available at /tmp/xBsEKZrE7K line 1:␤------> [32mself[33m⏏[31m<EOL>[0m␤Check failed␤FAILED 00:01 112m␤»
06:02 TimToady there we go
06:02 sorear \o/
06:02 * sorear is currently making a priority of bringing niecza closer to STD
06:03 SHODAN left #perl6
06:03 TimToady std: class Foo { method bar { -> { $.foo } } }
06:03 p6eval std 01c24ce: OUTPUT«ok 00:01 114m␤»
06:04 TimToady std: class Foo { submethod bar { -> { $.foo } } }
06:04 p6eval std 01c24ce: OUTPUT«[31m===[0mSORRY![31m===[0m␤Virtual call $.foo may not be used on partially constructed object at /tmp/E0BTd6OSIM line 1:␤------> [32mclass Foo { submethod bar { -> { [33m⏏[31m$.foo } } }[0m␤Check failed␤FAILED 00:01 114m␤»
06:05 TimToady std: class Foo { submethod bar { -> { self.foo } } }
06:05 p6eval std 01c24ce: OUTPUT«ok 00:01 114m␤»
06:05 TimToady that's allowed though
06:06 moritz so are submethods only meant for object construction?
06:06 TimToady they're meant to be infrastructural
06:07 TimToady anyway, you can get around the $.foo restriction with self.foo, which seems reasonable to me
06:07 TimToady people think of $.foo as a variable, but not self.foo
06:10 wamba joined #perl6
06:11 donri joined #perl6
06:11 wtw joined #perl6
06:12 miso2217_ joined #perl6
06:12 miso2217 left #perl6
06:20 perigrin you've trained them that $ means "scalar"
06:20 perigrin and that two punctuation symbols means "Twigil"
06:21 perigrin nobody expect "hidden invocant"
06:23 TimToady the deception is somewhat intentional
06:25 perigrin I'm not surprised :)
06:25 moritz it does confuse newcomers that $.foo isn't writable within the class
06:26 SHODAN joined #perl6
06:26 sorear twigils are always sort of invokey
06:26 moritz huh? what does $!foo invoke?
06:26 perigrin foo's really really hard.
06:27 sorear moritz: even in nom it's indirected through REPR's get_attr
06:28 sorear otoh, having said that, I think of $?foo, which is in some ways less dynamic than $foo
06:28 wamba left #perl6
06:29 moritz sorear: is there anything in Perl 6 that is not indirected in some way, at least notionally?
06:30 TimToady 42
06:30 sorear $foo has to be pretty direct because of the ways it plays with static typing
06:30 sorear especially if it was declared with a native type
06:30 moritz sorear: it's indirected by the lexpad, no?
06:30 moritz at least if not natively typed
06:31 TimToady everything is indirected through the grammar :)
06:31 moritz ... even the grammar :-)
06:31 sorear TimToady: is class Foo { token bar { ... } } bad form?
06:32 TimToady well, it won't have the grammatical methods to process the regex unless Foo derives from a grammar somewhere
06:32 sorear in the case I'm looking at, "Foo" = "Cursor"
06:33 sorear maybe I should have grammar Cursor is Any { ... }
06:33 sorear :)
06:33 sorear grammar Grammar is Cursor { ... }
06:33 TimToady unless 'grammar' implies 'is Cursor'
06:33 sorear in current niecza explicit trait_mod:<is> overrides that
06:33 moritz rakudo: grammar Foo { }; say join ' ', Foo.^parents
06:33 p6eval rakudo 678ad3: OUTPUT«Grammar() Cursor() Regex::Cursor() Any() Mu()␤»
06:34 * perigrin wonders off now thinking grammar Kelsy is Actor { ... }
06:34 sorear that's probably needed if you're going to define class Junction is Mu { }
06:34 moritz in rakudo 'grammar' implies 'is Grammar'
06:34 sorear (pretend I have a few more "my"s in there)
06:34 sorear moritz: niecza too, except without Regex::Cursor and with Cool
06:35 moritz Regex::Cursor is an artifact
06:36 moritz sorear: I'm a bit surprised you consider Grammar Cool - does it support the usual operations like conversion to Str, Int, and so on?
06:36 sorear rakudo: say join ' ', Regex::Cursor.^parents
06:36 p6eval rakudo 678ad3: OUTPUT«Method 'parents' not found for invocant of class 'P6metaclass'␤  in main program body at line 22:/tmp/QQ3N3eBLip␤»
06:36 sorear moritz: sorry, confused myself there
06:36 sorear Niecza's Match is Cool, its Cursor is not
06:37 moritz sorear: that makes much more sense to me :-)
06:49 dalek niecza: 7c63a3c | sorear++ | src/STD.pm6:
06:49 dalek niecza: constant %hash works now
06:49 dalek niecza: review: https://github.com/sorear/niecza/commit/7c63a3cb27
06:49 dalek niecza: 2703ab0 | sorear++ | / (3 files):
06:49 dalek niecza: Fix multimethods and implement lexical proto shadowing
06:49 dalek niecza: review: https://github.com/sorear/niecza/commit/2703ab0b64
06:56 agentzh joined #perl6
07:00 fhelmberger joined #perl6
07:01 kst left #perl6
07:11 mathw \o
07:14 moritz o/
07:14 mj41 joined #perl6
07:14 sorear /o
07:25 cxreg if 5.14 is coming out on 5/14, is 6.0 coming out on 6/0?
07:25 cxreg std: 6/0
07:25 p6eval std 01c24ce: OUTPUT«ok 00:01 113m␤»
07:26 cxreg oops
07:26 cxreg rakudo: 6/0
07:26 p6eval rakudo 678ad3:  ( no output )
07:28 sorear Will 6.0 ever come out?
07:33 cxreg NaN
07:36 mathw what is 6.0? A state of mind? A tick in a box?
07:42 jdhore IMO, 6.0 is a specification
07:43 Shozan joined #perl6
07:46 satyavvd_ left #perl6
07:53 alc joined #perl6
07:53 alc left #perl6
08:04 satyavvd joined #perl6
08:04 awoodland joined #perl6
08:15 tzhs joined #perl6
08:15 moritz an idea
08:17 awoodland left #perl6
08:26 dakkar joined #perl6
08:28 mikemol left #perl6
08:28 mikemol joined #perl6
08:57 domidumont joined #perl6
09:21 tzhs left #perl6
09:39 am0c left #perl6
09:40 am0c^ joined #perl6
09:48 tadzik 6.0 is niecza in one month, isn't it?
09:50 mtk left #perl6
09:52 am0c^2 joined #perl6
09:54 am0c^ left #perl6
09:57 moritz v6, not 6.0 :-)
09:58 am0c^2 left #perl6
09:58 mtk joined #perl6
10:01 tadzik aw :)
10:01 pernatiy left #perl6
10:01 moritz what you get when you write 'use v6;' :-)
10:08 am0c^ joined #perl6
10:08 am0c^ left #perl6
10:09 am0c^ joined #perl6
10:17 jerome left #perl6
10:18 jerome joined #perl6
10:33 Tedd1 left #perl6
10:50 woosley left #perl6
10:52 pernatiy joined #perl6
11:00 tzhs joined #perl6
11:05 Patterner left #perl6
11:07 Psyche^ joined #perl6
11:07 Psyche^ is now known as Patterner
11:26 silent_h joined #perl6
11:28 jerome left #perl6
11:29 am0c^ left #perl6
11:32 miso_soup joined #perl6
11:32 miso_soup left #perl6
11:32 miso_soup joined #perl6
11:34 plainhao joined #perl6
11:34 pernatiy_ joined #perl6
11:34 pernatiy left #perl6
11:38 moritz rakudo: { use Test; }; ok 1
11:38 p6eval rakudo 678ad3: OUTPUT«Null PMC access in setprop()␤  in main program body at line 22:/tmp/oNBTJT7gCJ␤»
11:38 moritz /o\
11:38 * moritz submits rakudobug
11:42 colomon woof
11:42 * colomon wonders if that's a current record for the least characters needed to cause a Null PMC
11:43 moritz I know that 5.HOW.HOW caused a segfault
11:44 moritz rakudo: ~pir::null()
11:44 p6eval rakudo 678ad3: OUTPUT«error:imcc:syntax error, unexpected '\n'␤ in file '(file unknown)' line 150␤error:imcc:syntax error ... somewhere␤        in file '(file unknown)' line 313␤===SORRY!===␤syntax error ... somewhere␤»
11:44 moritz rakudo: ~pir::null__p()
11:44 p6eval rakudo 678ad3: OUTPUT«Null PMC access in get_string()␤  in main program body at line 7654:CORE.setting␤»
11:45 moritz ok, but that's cheating :-)
11:46 colomon it's also still longer than 5.HOW.HOW, no?
11:47 moritz yes
11:47 moritz rakudo: 5.HOW.HOW; say 'alive';
11:47 p6eval rakudo 678ad3: OUTPUT«alive␤»
11:47 moritz seems it got fixed some time ago
11:47 moritz rakudo: 5^.HOW; say 'alive';
11:47 p6eval rakudo 678ad3: OUTPUT«alive␤»
12:06 satyavvd left #perl6
12:11 takadonet joined #perl6
12:15 takadonet left #perl6
12:19 bluescreen10 joined #perl6
12:19 agentzh left #perl6
12:22 yegor joined #perl6
12:23 takadonet joined #perl6
12:23 takadonet morning all
12:25 moritz good morning
12:25 PacoLinux_ joined #perl6
12:26 sjn o7
12:28 MayDaniel joined #perl6
12:28 ruoso left #perl6
12:28 meteorjay left #perl6
12:29 hudnix joined #perl6
12:34 MayDaniel left #perl6
12:36 ruoso joined #perl6
12:38 miso_soup left #perl6
12:42 woosley joined #perl6
12:43 jerome joined #perl6
12:52 daxim left #perl6
12:53 daxim joined #perl6
12:53 PacoLinux_ left #perl6
12:56 PacoLinux_ joined #perl6
13:00 wknight8111 joined #perl6
13:01 Holy_Cow joined #perl6
13:02 tzhs left #perl6
13:12 molaf joined #perl6
13:17 Trashlord left #perl6
13:28 satyavvd joined #perl6
13:32 domidumont left #perl6
13:34 domidumont joined #perl6
13:43 ggoebel left #perl6
13:48 ggoebel joined #perl6
13:53 JimmyZ_ joined #perl6
13:58 Ali_h PerlJam, are you around?
13:58 envi joined #perl6
14:05 PerlJam Ali_h: aye
14:05 Ali_h may I pm?
14:06 JimmyZ_ left #perl6
14:07 PerlJam Why not just speak on channel?
14:08 PerlJam (It's not like you'll be interrupting the awesome conversation going on right now  :-)
14:08 PerlJam besides, on channel you get the benefit of others helping
14:08 Ali_h kinda emabarrasing - Im still getting the same error I fixed the code that I copied wrong and even copied and pased the code and still the same :/
14:08 mathw But why would we help if you're here PerlJam? You can fix everything :P
14:10 PerlJam Ali_h: show the code again
14:10 PerlJam mathw: were that true I would have long ago fixed the "not having a fast Perl 6 compiler" problem.
14:11 mathw :)
14:11 Ali_h http://pastebin.com/9kcJKiYv
14:11 moritz what's the error you get? and did you take care to remove leading whitespace from the input data?
14:12 * moritz thinks we should use .words in up6
14:12 Ali_h moritz, thats the c&p one straight out the book
14:12 PerlJam moritz: aye
14:12 moritz Ali_h: does your data file have leading blanks?
14:12 PerlJam Ali_h: you're missing a } looks like.
14:13 moritz and... what error do you get?
14:13 PerlJam oh, maybe not.  Just weird indentation
14:14 JimmyZ_ joined #perl6
14:14 Ali_h the errors Non-declarative sigil is missing its name at line 1, near "$ perl6 sc"
14:15 PerlJam Oh!
14:15 PerlJam Ali_h: you've copied a line that shouldn't be part of your program
14:15 moritz Ali_h: the $ indicates a shell prompt, it's not part of the program
14:17 Ali_h hmm Ill go look
14:17 Ali_h thanks again :)
14:17 JimmyZ_ left #perl6
14:19 Ali_h I dont have $ perl6 sc in the code - $ perl6 scores.pl is what I entered into the perl6 cmd the only time it was entered :/
14:19 moritz PerlJam: do you think it would make sense to omit the 'vs ' from the 'scores' file, and use .words to obtain the names, rather than .split(' | ')
14:19 Holy_Cow left #perl6
14:20 moritz Ali_h: you should enter it in your command prompt, not in perl6
14:20 PerlJam moritz: so, the lines would look like  "Ana Dave 3:0"  ?
14:21 moritz PerlJam: yes
14:21 PerlJam moritz: works for me
14:22 wtw left #perl6
14:22 Ali_h moritz, so I shouldnt use perl6.exe ?
14:23 Ali_h I apologise im a total noob to any form of perl :/
14:23 moritz Ali_h: you should *call* perl6.exe, with the script file name as the argument
14:23 moritz so in your command prompt, write
14:23 moritz perl6 yourscriptname.pl
14:24 Ali_h thanks
14:25 PerlJam Ali_h: See?  I would have been totally unresponsive in PM since I had to walk down the hall at my office for a few minutes.  It's a good thing you spoke on channel  :-)
14:27 moritz Ali_h: I don't want to discourage you, but total noobs are not the intended audience of "Using Perl 6". You might find lots of things hard to understand. We are happy about your feedback anyway.
14:27 Ali_h tell that to deamon its his fault im learning it :/
14:27 moritz Ali_h: there will be a book that teaches total newcomers Perl 6, but it's not written yet :/
14:28 moritz PerlJam: locally I've fixed the code examples and the input format, but it'll take more time to adapt the explanations in the book
14:29 Ali_h when will that be - any idea - little bit of background deamon challanged me to write an irc bot in perl 6 (I like ruby better ) hes givin me 4 weeks :/
14:29 woosley left #perl6
14:29 moritz Ali_h: not within 4 weeks
14:29 moritz Ali_h: more like in some years
14:29 ymasory left #perl6
14:31 Ali_h well I guess I better get learning some aspects of perl before looking at perl 6:/
14:32 moritz Ali_h: do you have knowledge in other programming languages?
14:32 Ali_h ruby
14:32 moritz Ali_h: ah, then you're not a total noob anymore :-)
14:32 PerlJam Perl 6 and Ruby are very similar in some respects
14:32 moritz Ali_h: and you might even fall in the target audience of the book
14:33 tadzik Ali_h: I have a feeling that you might have been trolled
14:33 tadzik I don't really know who the deamon guy is though
14:33 woosley1 joined #perl6
14:33 woosley1 left #perl6
14:33 moritz https://github.com/TiMBuS/Net--IRC/ <-- good basis for an IRC bot
14:34 tadzik Ali_h: anyway, you might want to look at Net::IRC module (modules.perl6.org), and you're pretty much done
14:34 tadzik that's what moritz++ linked
14:34 Ali_h unfortunatly the basis of the bet is no modules socket or socket6
14:34 Ali_h only
14:35 ab5tract joined #perl6
14:35 tadzik I see
14:35 moritz IO::Socket::INET is part of the core, fortunately
14:35 Ali_h I can use socket or socket6 but no modules
14:35 daemon you can use ::inet as its in base; by no modules I meant 'no additional'
14:36 moritz it's not a module, it's a class in core
14:36 moritz daemon++ # challenging people to write Perl 6 code
14:36 daemon moritz, ^_^
14:36 moritz Ali_h++ # writing Perl 6 code
14:36 Ali_h moritz, hes evil :/
14:36 moritz :-)
14:36 moritz so, what's at stake?
14:36 tadzik oh, the daemon appears :) Hello there
14:36 daemon hello tadzik
14:37 tadzik I see some good intentions :)
14:37 daemon tadzik, moritz; well you see me and ali_h actually live together; ali is my girlfriend.. I got forced into meeting some friends of hers against every fibre of my being; in return ali_h agreed that she would complete a Simple IRC BOT in perl6 within one month
14:38 daemon all that is at stake really is Ali_h's honour; if she fails on something she absolute SWORE she would do.
14:38 tadzik aha! :)
14:38 tadzik that's interesting
14:38 moritz daemon: sounds like fun... how did you like her friends?
14:38 Ali_h but I will add - he did say that perl6 was nothing like perl :/
14:38 simcop2387 left #perl6
14:38 daemon moritz, oh I already knew them from a previous encounter; it was voring and unproductive -_-
14:39 daemon s/voring/boring/
14:39 tadzik daemon: do you have some Perl6 experience?
14:39 daemon tadzik, no I have perl 5 experiance though; I have a learning queue at the moment; Erlang->Perl6
14:39 tadzik I see
14:39 PacoLinux_ left #perl6
14:40 daemon It will ofc be a benefit watching over ali_h's shoulder as she hacks away at it though ;)
14:40 newbee joined #perl6
14:41 Ali_h dont know about the benefit - I might not have a pc left at the end of the month :)
14:41 daemon Ali_h, just remember that a person is as only strong as their word :D
14:41 Ali_h meh
14:42 * Ali_h goes back to the book
14:42 * daemon heads back to erlang land
14:42 moritz Ali_h: you're welcome to ask for help here. We won't write the code for you, but we happily answer questions
14:42 Ali_h thanks moritz i have a feeling ill be in here ALOT! :D
14:43 daemon Ali_h, I will give you access to one of the linux or freebsd servers if you would preffer not doing it on windows ^_^
14:46 dalek book/first-example-more-robust: 0281365 | moritz++ | src/basics.pod:
14:46 dalek book/first-example-more-robust: [basics] made first example more robust wrt whitespace. Text still needs updating
14:46 dalek book/first-example-more-robust: review: https://github.com/perl6/book/commit/0281365b94
14:46 dalek book/first-example-more-robust: 346ed6a | moritz++ | src/basics.pod:
14:46 dalek book/first-example-more-robust: [basics] start to updated description of the new first example
14:46 dalek book/first-example-more-robust: review: https://github.com/perl6/book/commit/346ed6a170
14:46 newbee rakudo: for <#comment not_a_comment #comment _not_a_coment_#_either> -> $s { say $s };
14:46 p6eval rakudo 678ad3: OUTPUT«#comment␤not_a_comment␤#comment␤_not_a_coment_#_either␤»
14:47 newbee rakudo: for <#comment not_a_comment #comment _not_a_coment_#_either> -> $s { next if $s ~~ /^#/; say $s };
14:47 p6eval rakudo 678ad3: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
14:47 Shozan left #perl6
14:47 moritz rakudo: for <<#comment␤notcomment>> { .say }
14:47 colomon rakudo: for <#comment not_a_comment #comment _not_a_coment_#_either> -> $s { next if $s ~~ /^\#/; say $s };
14:48 p6eval rakudo 678ad3: OUTPUT«#comment␤notcomment␤»
14:48 p6eval rakudo 678ad3: OUTPUT«not_a_comment␤_not_a_coment_#_either␤»
14:48 newbee ohh.. thanks :)
14:49 moritz std: /\#/
14:49 p6eval std 01c24ce: OUTPUT«[31m===[0mSORRY![31m===[0m␤No unspace allowed in regex; if you meant to match the literal character, please enclose in single quotes ('#') or use a backslashed form like \x23 at /tmp/pVvjAqDCO8 line 1:␤------> [32m/\[33m⏏[31m#/[0m␤Parse failed␤FAILED 00:01 113m␤»
14:49 moritz use '#' instead of \#
14:49 moritz since \# introduces unspace, you can't use it as an escape sequence
14:49 moritz it's a bug in rakudo that it allows it
14:49 colomon moritz++
14:54 masak joined #perl6
14:54 masak greetings, lambdazebras, from .ru!
14:55 colomon \o
14:55 moritz o/
14:55 * moritz hopes that the hackathon in .ru will be as awesome as the last one
14:55 SHODAN left #perl6
14:55 masak the conditions appear favourable.
14:58 newbee ahother question :)
14:58 newbee another*
14:59 newbee if i try to print a line on a file, i got this: IO()<0x96245b4>
14:59 colomon that looks like you are actually printing the IO object.
14:59 colomon how are you trying to print?
14:59 moritz $IO.print
14:59 moritz not print $IO
14:59 newbee my $CAL = open $.file or die "Can not open $.file : $!"; for $CAL -> $line { say $line; }
15:00 moritz for $CAL.lines -> $line { say $line; }
15:00 colomon for $CAL.lines -> $line
15:00 moritz you still have to *read* from the file :-)
15:00 satyavvd_ joined #perl6
15:01 masak newbee: you were looping over the filehandle.
15:01 masak newbee: ($CAL, the result of 'open', is a filehandle in Perl 6. similar to Perl 5's "open my $CAL, '<', $file"
15:01 masak )
15:02 orafu joined #perl6
15:02 newbee i see... i still think in "perl5" :)
15:02 satyavvd left #perl6
15:02 moritz then imagine that the .lines replaces the < > around the file handle
15:03 moritz in perl 5 you can't do while ($filehandle) either, you need <$filehandle>
15:03 masak newbee: even in Perl 5, it's <$CAL>, not $CAL, to read from the filehandle.
15:03 moritz masak's and mine similar lines of thoughts are kinda scary :-)
15:04 * moritz still hasn't got around to backlog #rakudosketch from Tuesday - ETOOMUCHFAMILYTROUBLE
15:05 newbee another question.... single quotes are preferred over / / in regexps now?
15:05 masak moritz: similar lines seems to happen often nowadays. not just you and me, but me and jnthn, too.
15:06 masak moritz: but when it happens with longish p6eval oneliners, it's scarier, IMO :)
15:06 colomon the masakbot is learning....  :p
15:06 newbee rakudo: my @data = split /:/, 'a:b:c:d'; @data.perl.say;
15:06 p6eval rakudo 678ad3: OUTPUT«===SORRY!===␤Confused at line 22, near "my @data ="␤»
15:06 newbee rakudo: my @data = split ':', 'a:b:c:d'; @data.perl.say;
15:06 p6eval rakudo 678ad3: OUTPUT«["a", "b", "c", "d"]␤»
15:06 masak newbee: the rule is this:
15:06 colomon newbee: not sure what you mean by preferred over /  /  ?
15:06 moritz newbee: that constructs a string, not a regex
15:06 ymasory joined #perl6
15:06 masak newbee: any non-alphanumerics that you mean literally need to be quoted or escaped.
15:07 moritz newbee: the difference is that split accepts a string in Perl 6, whereas it always coerced to regex in Perl 6.
15:07 masak newbee: so /foo/ is fine, but you need to quote /':'/ or escape /\:/
15:07 moritz std: my @data = split /:/, 'a:b:c:d'; @data.perl.say;
15:07 p6eval std 01c24ce: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unrecognized regex metacharacter (must be quoted to match literally) at /tmp/8VmhlhHrNn line 1:␤------> [32mmy @data = split /:[33m⏏[31m/, 'a:b:c:d'; @data.perl.say;[0m␤Can't call method "from" on unblessed reference at STD.pm line
15:07 p6eval ..54066.␤FAILED 0…
15:07 SHODAN joined #perl6
15:08 * masak submits LTA rakudobug
15:08 * moritz is pretty sure that's already submitted
15:08 masak possibly.
15:08 yegor left #perl6
15:08 masak someone should take on the role of tending to the bug queue :)
15:09 masak not necessarily closing tickets, but categorizing and de-duping them.
15:09 moritz tadzik++ did, recently
15:09 newbee i'll stick to single quotes then :) thanks!
15:09 kaare_ joined #perl6
15:09 moritz somebody should *fix* bug reports :-)
15:09 masak I'll make a quick search for it, and submit if I don't find anything.
15:11 masak ah; a certain moritz++ has submitted it already: http://rt.perl.org/rt3/Ticket/Display.html?id=77386
15:19 VXZ left #perl6
15:24 moritz nqp: "ab" ~~ / (a) { pir::die("foo: '$0') } /
15:24 p6eval nqp: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 1␤current instr.: 'nqp;Regex;Cursor;FAILGOAL' pc 3863 (src/Regex/Cursor.pir:239)␤»
15:25 moritz nqp: "ab" ~~ / (a) { pir::die("foo: '$0'") } /
15:25 p6eval nqp: OUTPUT«foo: '$0'␤current instr.: '_block31' pc 972 ((file unknown):274)␤»
15:25 moritz nqp: "ab" ~~ / (a) { pir::die("foo: '" ~ $/[0] ~ "'") } /
15:25 p6eval nqp: OUTPUT«foo: 'a'␤current instr.: '_block31' pc 972 ((file unknown):274)␤»
15:25 silent_h left #perl6
15:25 moritz nqp: "ab" ~~ / (a) { pir::die("foo: '$/[0]'") } /
15:25 p6eval nqp: OUTPUT«foo: 'a[0]'␤current instr.: '_block31' pc 972 ((file unknown):274)␤»
15:26 TimToady std: class Foo { has $.a, $.b }
15:26 p6eval std 01c24ce: OUTPUT«[31m===[0mSORRY![31m===[0m␤Variable $.b used where no 'self' is available at /tmp/8Eb7BSsbbV line 1:␤------> [32mclass Foo { has $.a, [33m⏏[31m$.b }[0m␤Check failed␤FAILED 00:01 115m␤»
15:27 PacoLinux_ joined #perl6
15:27 TimToady that was my actual todo item for adding self-awareness to STD
15:28 tadzik masak: o/
15:29 masak \o
15:29 * TimToady is glad to see all the fresh faces around here
15:29 * TimToady is also glad to see some of the stale faces :)
15:29 PacoLinux_ left #perl6
15:29 tadzik sta-sta-sta-stale face
15:29 * masak .oO( TimToady and his stale mates )
15:30 * TimToady winces (in)appropriately
15:30 PacoLinux_ joined #perl6
15:30 bbkr_ std: my $x = / $x /; # hmm
15:30 p6eval std 01c24ce: OUTPUT«ok 00:01 117m␤»
15:31 bbkr_ rakudo: my $x = / $x /; "" ~~ $x; # kabooom?
15:31 p6eval rakudo 678ad3: OUTPUT«maximum recursion depth exceeded␤  in <anon> at line 22:/tmp/JEnOOsfLdh␤  in <anon> at line 22:/tmp/JEnOOsfLdh␤  in <anon> at line 22:/tmp/JEnOOsfLdh␤  in <anon> at line 22:/tmp/JEnOOsfLdh␤  in <anon> at line 22:/tmp/JEnOOsfLdh␤  in <anon> at line 22:/tmp/JEnOOsfLdh␤  in
15:31 p6eval ..<anon> at …
15:31 SHODAN left #perl6
15:31 TimToady niecza: my $x = / $x /; "" ~~ $x; # kabooom?
15:31 p6eval niecza v5-4-g2703ab0:  ( no output )
15:31 moritz I guess it should just evaluate $x to Any at (non)-interpolation time
15:32 TimToady pugs: my $x = / $x /; "" ~~ $x; # kabooom?
15:32 p6eval pugs: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤    unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.13.16/blib6/pugs/perl5/lib';␤    eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** '<HANDLE>' trapped by operat…
15:32 moritz perl6: my $x; my $re = rx/ $x /; $x = 'a'; say 'abc' ~~ $re
15:32 bbkr_ everything looks more atractive when there is explosion in background :)
15:32 SHODAN joined #perl6
15:32 p6eval rakudo 678ad3, niecza v5-4-g2703ab0: OUTPUT«a␤»
15:32 p6eval ..pugs: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤    unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.13.16/blib6/pugs/perl5/lib';␤    eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** '<HANDLE>' trapped by operat…
15:33 nymacro left #perl6
15:33 TimToady perl6: my $x = rx/ $x /; $x = 'a'; say 'abc' ~~ $x
15:33 p6eval rakudo 678ad3, niecza v5-4-g2703ab0: OUTPUT«Bool::False␤»
15:33 p6eval ..pugs: OUTPUT«␤»
15:34 masak bbkr_: feel free to report that one.
15:34 TimToady hmm
15:35 TimToady I don't understand why that one doesn't match
15:35 moritz because $x is 'a'
15:35 TimToady oh, yeah, duh
15:35 moritz perl6: say 'abc' ~~ 'a'
15:35 p6eval rakudo 678ad3, niecza v5-4-g2703ab0: OUTPUT«Bool::False␤»
15:35 p6eval ..pugs: OUTPUT«␤»
15:35 * TimToady goes back for a larger dose of caffiene
15:36 krunen left #perl6
15:36 colomon is there an actual quasi-sane usage for a recursive pattern?  I mean, $x = / $x / is clearly nuts, but what about something like $x = / "blue " (\w+ | $x)/  ?
15:37 moritz colomon: there are lots of recursions in STD
15:37 moritz and any other Perl 6 parser, for that matter
15:37 moritz colomon: we just realize them with named rules
15:38 colomon most other parsers in general, come to think of it.
15:39 TimToady perl6: my $x = / "blue " (\w+ | $x)/; say $x ~~ 'blue blue blue pink'
15:39 krunen joined #perl6
15:39 p6eval pugs: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤    unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.13.16/blib6/pugs/perl5/lib';␤    eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** '<HANDLE>' trapped by operat…
15:39 p6eval ..rakudo 678ad3, niecza v5-4-g2703ab0: OUTPUT«Bool::False␤»
15:39 moritz TimToady: fwiw the 'Unrecognized regex metacharacter' error message in token termish doesn't report the offending character
15:39 moritz TimToady: the one in token nibbler does
15:39 SHODAN left #perl6
15:40 moritz TimToady: remember that :s :-)
15:40 colomon perl6: my $x = / "blue " (\w+ | $x)/; say 'blue blue blue pink' ~~ $x
15:40 p6eval rakudo 678ad3: OUTPUT«blue blue␤»
15:40 p6eval ..niecza v5-4-g2703ab0: OUTPUT«blue␤»
15:40 p6eval ..pugs: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤    unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.13.16/blib6/pugs/perl5/lib';␤    eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** '<HANDLE>' trapped by operat…
15:41 * colomon thinks TimToady definitely needs caffeine, stat
15:41 colomon ;)
15:41 pmichaud ...why is RT#90456 considered a bug?
15:42 colomon pmichaud: I think we were just exploring that.  :)
15:42 TimToady perl6: my $x = / "blue " ($x | \w+)/; say $x ~~ 'blue blue blue pink'
15:42 p6eval pugs: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤    unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.13.16/blib6/pugs/perl5/lib';␤    eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** '<HANDLE>' trapped by operat…
15:42 p6eval ..rakudo 678ad3, niecza v5-4-g2703ab0: OUTPUT«Bool::False␤»
15:42 moritz try Str ~~ Regex, not the other way round :-)
15:43 TimToady perl6: my $x = / "blue " ($x | \w+)/; say 'blue blue blue pink' ~~ $x
15:43 p6eval niecza v5-4-g2703ab0: OUTPUT«blue␤»
15:43 p6eval ..rakudo 678ad3: OUTPUT«blue blue blue pink␤»
15:43 p6eval ..pugs: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤    unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.13.16/blib6/pugs/perl5/lib';␤    eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** '<HANDLE>' trapped by operat…
15:43 moritz \o/
15:43 TimToady thanks for being patient with us newbies :)
15:44 TimToady why did niecza only return "blue"?
15:44 moritz niecza: my $x = rx{a}; say 'a' ~~ /$x/
15:44 TimToady obviously it's binding $x into the regex as a value too soon, I guess
15:44 p6eval niecza v5-4-g2703ab0: OUTPUT«␤»
15:45 * moritz guesses it can't interpolate regexes at all
15:45 moritz which explains why it didn't blow up in bbkr_'s example :-)
15:45 colomon pmichaud: I agree that it #90456 shouldn't be a bug, unless it's explicitly forbidden somewhere...
15:46 moritz or maybe it falls into the same category as quantified zero-width matches
15:46 TimToady why didn't it get "blue " or "blue blue"?
15:46 TimToady in fact, how the heck did it get "blue" with no space on teh end?
15:47 moritz niecza: say 'ab' ~~ /"a b"/
15:47 p6eval niecza v5-4-g2703ab0: OUTPUT«␤»
15:47 moritz niecza: say so 'ab' ~~ /"a b"/
15:47 p6eval niecza v5-4-g2703ab0: OUTPUT«Bool::False␤»
15:47 moritz TimToady: bug, but I don't know what kind of bug
15:47 pmichaud colomon:  it's no more forbidden than the error that is obtained by:    my $x = sub { $x(); };   $x();
15:50 dalek nqp: d846b25 | moritz++ | src/Regex/P6Regex/Grammar.pm:
15:50 dalek nqp: more awesome error message for unrecognized meta character in regexes
15:50 dalek nqp:
15:50 dalek nqp: not quite awesome yet, it does not report the actual offending character
15:50 dalek nqp: review: https://github.com/perl6/nqp/commit/d846b25a3d
15:51 dalek std: b9c20c5 | larry++ | STD.pm6:
15:51 dalek std: fix LTA unrec regex meta reported by moritz++
15:51 dalek std: review: https://github.com/perl6/std/commit/b9c20c55a9
15:51 colomon pmichaud: then obviously it's not a bug
15:52 TimToady it might in some cases be possible to detect left recursion
15:53 moritz this particular one might be hard though
15:53 moritz unless you special-case very hard for it
15:53 colomon but even if you did, the appropriate response would just be a nicer error message, right?
15:54 TimToady well, putting a hard recursion limit on is always going to be either too large or too small
15:54 pmichaud (rejected ticket)
15:54 PerlJam greetings
15:55 bbkr_ rakudo: / a ** / /  / # parse bug here, should detect empty regexp first like STD does?
15:55 * PerlJam is relaxing after moving offices at $work
15:55 p6eval rakudo 678ad3: OUTPUT«===SORRY!===␤Quantifier quantifies nothing at line 22, near " / /  / # "␤»
15:55 pmichaud PerlJam: now in NRC?
15:55 bbkr_ std: / a ** / /  /
15:55 p6eval std 01c24ce: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unrecognized regex metacharacter * (must be quoted to match literally) at /tmp/U3Afwf2Zsz line 1:␤------> [32m/ a *[33m⏏[31m* / /  /[0m␤Unable to parse regex; couldn't find final '/' at /tmp/U3Afwf2Zsz line 1:␤------> [32m/ a ** [33m⏏[31m/ /
15:55 p6eval .. /…
15:55 PerlJam pmichaud: I was already in NRC, but on the 3rd floor.   Now I'm on the 2nd floor
15:55 bbkr_ nvm
15:55 pmichaud PerlJam: which office?
15:56 PerlJam 2105 I think.
15:56 PerlJam We reclaimed the 2100 suite
15:56 * masak braves the streets of Moscow again
15:56 pmichaud the corner one?
15:56 PerlJam no, that's Rizzo's.  Mine's the one next to his.
15:56 pmichaud got it
15:56 benabik joined #perl6
15:56 * moritz can resist a Sovjet Russia joke. o/
15:57 PerlJam pmichaud: are you planning a visit sometime?  :)
15:57 pmichaud pj:  not at present
15:58 TimToady niecza: my $x = / $x /; '' ~~ $x; say 'alive'
15:58 dual left #perl6
15:58 p6eval niecza v5-4-g2703ab0: OUTPUT«alive␤»
15:58 TimToady niecza doesn't blow up there
15:58 TimToady but maybe it's just a compensating bug...
15:58 moritz yes, because it doesn't handle variables which contain regexes
15:58 pmichaud we're guessing that niecza doesn't do regex interpolation
15:59 moritz niecza: my $re = rx/a/; say so 'a' ~~ /$re/
15:59 p6eval niecza v5-4-g2703ab0: OUTPUT«Bool::False␤»
15:59 moritz rakudo: my $re = rx/a/; say so 'a' ~~ /$re/
15:59 TimToady niecza: my $x = / <$x> /; '' ~~ $x; say 'alive'
15:59 pmichaud niecza:  my $x = / a /;   my $y = / $x /;   say "a" ~~ $y;
15:59 p6eval rakudo 678ad3: OUTPUT«Bool::True␤»
15:59 p6eval niecza v5-4-g2703ab0: OUTPUT«␤Unhandled Exception: OutOfMemoryException␤»
15:59 p6eval niecza v5-4-g2703ab0: OUTPUT«␤»
15:59 TimToady there you go :)
15:59 moritz TimToady++
16:00 TimToady nonetheless, I believe the LTM matcher should warn when it notices left recursion liek that
16:00 ab5tract left #perl6
16:01 TimToady make that "the longest LTM matcher" :)
16:01 moritz rakudo currently has an LTA matcher :-)
16:01 pmichaud it's better than no matcher.  :-)
16:01 moritz agreed, very much so
16:02 Chillance joined #perl6
16:02 masak moritz: in Moscow Underground, the train car waits for YOU!
16:03 masak (they're that frequent)
16:03 TimToady in Moscow Underground, you shelter it from nuclear war
16:03 * masak .oO( "Longest Token Awesome"? )
16:03 TimToady you just need to increment LTA 12 times
16:03 moritz LTA as in ... LTA :-)
16:04 masak oh! :P
16:04 nebuchadnezzar joined #perl6
16:04 nebuchadnezzar hello
16:04 masak hi, nebuchadnezzar!
16:05 nebuchadnezzar I just compile a rakudo after reading 5_to_6 and "Using perl6", synopsis in progress
16:05 PerlJam nice nick
16:06 PerlJam You can't go wrong if you're named after a king  :)
16:06 * TimToady was named after Abraham Lincoln
16:06 nebuchadnezzar it was not the first reason in fact
16:06 masak nebuchadnezzar: cool that you're reading up on Perl 6! let us know if you have any questions along the way.
16:07 masak &
16:07 nebuchadnezzar but my real first name is connected to my nickname so I kept it
16:07 PerlJam nebuchadnezzar: you're name is really chad?
16:07 * PerlJam picks the most obvious secondary chunking
16:08 masak left #perl6
16:08 nebuchadnezzar no, my /whois is filled AFAIK
16:08 risou_awy is now known as risou
16:08 alester joined #perl6
16:08 dual joined #perl6
16:10 moritz it is... but the connection is not obvious to me :-)
16:10 nebuchadnezzar I have a probably stupid issue, I try to inherit from Str and thought it should be as simple as "class MyStr is Str{}; my MyStr $Test = "hello world"; say $Test;", but type checking bug me...
16:11 PerlJam nebuchadnezzar: note that "Str{}
16:11 pmichaud "hello world" isn't a MyStr
16:11 PerlJam nebuchadnezzar: note that "Str{}" is not the same as "Str { }"  :)
16:11 TimToady std: class MyStr is Str{}
16:11 p6eval std 01c24ce: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unable to parse class definition at /tmp/1gNuLsL2dj line 1 (EOF):␤------> [32mclass MyStr is Str{}[33m⏏[31m<EOL>[0m␤Parse failed␤FAILED 00:01 112m␤»
16:11 nebuchadnezzar sorry, I have the space is my code
16:11 nebuchadnezzar moritz: the story of Nebuchadnezzar is written in Daniel's book
16:11 PerlJam then what pmichaud said
16:12 TimToady nebuchadnezzar: are you in your proud stage, your insane stage, or your "I got better" stage?
16:12 PerlJam heh
16:12 moritz nebuchadnezzar: there might not yet be a simple way to instantiate a subclass of a value type in rakudo :/
16:12 moritz nebuchadnezzar: ah, thanks
16:12 * moritz not well versed in bible terms
16:12 pmichaud s/rakudo/Perl 6/   # maybe?
16:12 nebuchadnezzar moritz: neither me
16:12 moritz pmichaud: probably
16:13 nebuchadnezzar well, my idea was to create a subtype of string with the Iterable role to slice strings instead of using substr ;-)
16:13 nebuchadnezzar That's one of the only 3 things I prefer in python than in perl5
16:14 TimToady what are the other two?
16:14 PerlJam nebuchadnezzar: what are the other 2
16:14 PerlJam ?
16:14 nebuchadnezzar the list compehension syntax
16:15 TimToady I don't like the conditional after the loop
16:15 TimToady it's unnatural, even if mathematicians like it
16:15 TimToady and it relies on post-declarations
16:15 mj41 left #perl6
16:15 nebuchadnezzar and the 3-way comparaison
16:16 PerlJam Well, Perl 6 has that one  :)
16:16 moritz rakudo: say 'yes' if 1 < 3 < 5;
16:16 nebuchadnezzar PerlJam: yes
16:16 p6eval rakudo 678ad3: OUTPUT«yes␤»
16:16 dual_ joined #perl6
16:16 PerlJam At the rate that Perl 5 is backporting Perl 6 features, they may well get multi-way comparisons one day soon
16:16 nebuchadnezzar that's why I want to test it
16:16 TimToady but yeah, you should be able to mix in slicing to strings
16:17 moritz note that in rakudo you only have to provide an at-pos($index) { } method
16:17 nebuchadnezzar maybe just augment Str does Iterable and Implement an at-pos
16:17 nebuchadnezzar erf
16:17 moritz and it automatically desguars slices passed to .[] into .at-pos calls
16:17 PerlJam your ruby is showing  ;)
16:17 TimToady also, you get one level of list comprehension for free with .foo when Mumble for @list
16:18 TimToady we tend to discourage monkey patching
16:18 dual left #perl6
16:18 cdarroch joined #perl6
16:18 cdarroch left #perl6
16:18 cdarroch joined #perl6
16:18 dual_ is now known as dual
16:19 colomon TimToady: is there a spec way to actually derive from Str?  I've never understood how you would initialize the string's value (for instance) from a derived class.
16:19 moritz nebuchadnezzar: note that Perl 6 treats single-item-lists and scalars the same, so code can rely on "abc"[0] eq "abc" (and probably does)
16:19 TimToady well, you'd really want to modify the quoting grammar too
16:19 moritz nebuchadnezzar: so introducing string slicing will likely cause havoc
16:20 PerlJam though that is one of those features "newbies" always want.
16:20 pmichaud why not a .slice method?
16:20 alester hey pmichaud
16:20 pmichaud "hello world".slice[1 2 3 4]
16:20 pmichaud er
16:20 TimToady .comb[]
16:20 pmichaud "hello world".slice[1,2,3,4]
16:20 pmichaud or even .comb
16:21 pmichaud alester: hello
16:21 alester I'm about to post this on Perlbuzz: https://gist.github.com/968860
16:21 TimToady note also that a buf is defined to have slicing
16:21 alester anything I should add?
16:21 moritz rakudo: say 'hello worlds'.comb.[1, 2, 3, 4]
16:21 p6eval rakudo 678ad3: OUTPUT«ello␤»
16:21 pmichaud rakudo:  say "Hello world".comb[4..8]
16:21 p6eval rakudo 678ad3: OUTPUT«o wor␤»
16:21 alester Forgive the lack of wrapping.
16:21 nebuchadnezzar ok
16:21 pmichaud rakudo:  say "Hello world".comb[7, 3, 1..6]
16:21 TimToady or 4..^8 to get Python's strange semantics
16:21 p6eval rakudo 678ad3: OUTPUT«olello w␤»
16:21 pmichaud rakudo:  say "Hello world".comb[*-2]
16:22 p6eval rakudo 678ad3: OUTPUT«l␤»
16:22 pmichaud rakudo:  say "Hello world".comb.reverse]
16:22 p6eval rakudo 678ad3: OUTPUT«===SORRY!===␤Confused at line 22, near "]"␤»
16:22 pmichaud rakudo:  say "Hello world".comb.reverse
16:22 simcop2387 joined #perl6
16:22 p6eval rakudo 678ad3: OUTPUT«dlrow olleH␤»
16:22 TimToady rakudo: my $x = Buf.new("abc"); say $x[1]
16:22 p6eval rakudo 678ad3: OUTPUT«Any()␤»
16:22 TimToady I thought rakudo did Buf
16:22 moritz rakudo: say Buf ~~ Positional
16:22 p6eval rakudo 678ad3: OUTPUT«Bool::True␤»
16:23 moritz rakudo: say 'abc'.encode.[1]
16:23 p6eval rakudo 678ad3: OUTPUT«98␤»
16:23 TimToady rakudo: my $x = Buf.new(<a b c>); say $x[1]
16:23 p6eval rakudo 678ad3: OUTPUT«b␤»
16:23 TimToady rakudo: my $x = Buf.new(<a b c>); say $x
16:23 p6eval rakudo 678ad3: OUTPUT«Buf()<0x5225f60>␤»
16:23 TimToady rakudo: my $x = Buf.new(<a b c>); say ~$x
16:23 p6eval rakudo 678ad3: OUTPUT«Buf()<0x52abe90>␤»
16:23 moritz TimToady: Buf.new wants a list of ints
16:23 pmichaud rakudo:  my $x = Buf.new("abc");  say $x[0];
16:23 TimToady hmm
16:23 p6eval rakudo 678ad3: OUTPUT«abc␤»
16:23 moritz TimToady: to get from strings to Buf you use .encode
16:23 TimToady it took <a b c> above
16:23 moritz ... but more by accident
16:24 TimToady right
16:24 PacoLinux_ left #perl6
16:25 TimToady anyway, strings have always been scalars in Perl, not lists
16:26 pmichaud alester: reading
16:26 cotto left #perl6
16:26 newbee TimeOfDay goes from 00:00:00 to 23:59:59. The thing is, surely there are other kind of "counters" that behave the same way: An hexadecimal counter: From 00:00:00:00 to FF:FF:FF:FD. I want to 'abstract' that, so TimeOfDay could inherit from that. How can i call this base class?
16:26 alester kthx
16:26 pmichaud alester: looks great!
16:27 alester It's kinda boring.
16:27 pmichaud some press releases are boring, yes.  :-)
16:28 TimToady newbee: actually, TimeOfDay can go to 23:59:60  :P
16:28 alester http://perlbuzz.com/2011/05/rakudoorg-relaunched.html
16:28 newbee brb!!!
16:29 nebuchadnezzar TimToady: ok, I was just looking for a shorter/nicer syntax for substr($string, $start, $end);
16:29 nebuchadnezzar thanks guys
16:30 pmichaud $string.comb[$start..$end]
16:30 pmichaud except it's a list, not a string
16:30 pmichaud so put a ~ in front
16:30 pmichaud (granted, not a lot shorter)
16:31 colomon the at_pos solution, if implemented, would still have the list not a string problem.
16:32 bluescreen10 left #perl6
16:33 newbee left #perl6
16:33 pmichaud (I entered "boring press releases" into Google, and it helpfully suggests that I intended "boeing press releases".)
16:34 PerlJam Except aren't perlbuzz articles supposed to have some "buzz"?  :)
16:34 PerlJam a boring press release has no buzz.
16:36 alester In this case, there's nothing more to say other than "RSS works now thank goodness"
16:38 wamba joined #perl6
16:44 pmichaud afk, lunch
16:44 pmichaud alseter++
16:44 pmichaud alester++ # oops, typo
16:47 wknight8111 left #perl6
16:47 wknight8111 joined #perl6
16:48 bluescreen10 joined #perl6
16:51 ryansb joined #perl6
16:51 TimToady std: /:/
16:51 p6eval std b9c20c5: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unrecognized regex metacharacter : (must be quoted to match literally) at /tmp/tCv13YCOeC line 1:␤------> [32m/:[33m⏏[31m/[0m␤Can't call method "from" on unblessed reference at STD.pm line 54066.␤FAILED 00:01 113m␤»
16:52 diakopter std: /\:/
16:52 p6eval std b9c20c5: OUTPUT«ok 00:01 113m␤»
16:52 diakopter std: /':'/
16:52 p6eval std b9c20c5: OUTPUT«ok 00:01 113m␤»
16:56 birdwindupbird left #perl6
17:01 ryansb left #perl6
17:03 satyavvd_ left #perl6
17:03 dakkar left #perl6
17:13 ab5tract joined #perl6
17:13 newbee joined #perl6
17:18 Trashlord joined #perl6
17:30 satyavvd joined #perl6
17:31 dual left #perl6
17:32 dual joined #perl6
17:32 satyavvd_ joined #perl6
17:34 satyavvd left #perl6
17:35 dual_ joined #perl6
17:37 satyavvd_ left #perl6
17:37 dual left #perl6
17:37 dual_ is now known as dual
17:42 pernatiy_ left #perl6
17:47 jevin joined #perl6
17:58 dual_ joined #perl6
17:59 dual left #perl6
18:00 dual_ is now known as dual
18:00 Ali_h left #perl6
18:02 dual_ joined #perl6
18:02 risou is now known as risou_awy
18:03 Ali_h joined #perl6
18:04 dual left #perl6
18:05 dual joined #perl6
18:06 dual_ left #perl6
18:13 fhelmberger left #perl6
18:15 benabik left #perl6
18:27 dual left #perl6
18:36 pernatiy joined #perl6
18:37 molaf left #perl6
18:40 newbee left #perl6
18:43 Helios left #perl6
18:50 wamba left #perl6
18:55 newbee joined #perl6
18:57 Helios joined #perl6
18:58 sftp joined #perl6
19:01 wamba joined #perl6
19:08 SHODAN joined #perl6
19:13 kst joined #perl6
19:22 envi left #perl6
19:23 birdwindupbird joined #perl6
19:23 snearch joined #perl6
19:24 ymasory left #perl6
19:39 ab5tract left #perl6
19:43 ab5tract joined #perl6
19:48 wamba left #perl6
19:48 TiMBuS left #perl6
19:48 TiMBuS joined #perl6
19:52 snearch left #perl6
19:56 masak joined #perl6
19:56 masak ah, Moscow.
19:57 Helios left #perl6
19:59 masak std: enum nebuchadnezzar <proud insane i_got_better>
19:59 p6eval std b9c20c5: OUTPUT«ok 00:01 112m␤»
20:00 Helios joined #perl6
20:01 masak PerlJam: backporting chained comparison ops into Perl 5 goes against the trend of backwards compatibility in the Perl 5 lineage. it would change the semantics of (probably highly questionable, but still) code out there.
20:04 benabik joined #perl6
20:05 masak newbee: the Counter thing you're describing sounds more like a role than a class.
20:05 masak a parameterized role, at that.
20:06 newbee mmmm yes, it does. The parameters are the "dimensions" (h m and s for TimeOfDay) and the "ranges" for each dimension (00-23 for hour, etc...)
20:10 masak rakudo: role Counter[*@maxvalues] { has @.values; method new(*@values) { die "wrong number of args" unless @maxvalues == @values; die "out of range" unless 0 <= all(@values) && @values Z<= @maxvalues; self.bless(*, :@values) } }; class TimeOfDay does Counter[23,59,59] {}; my $t = TimeOfDay.new(14,59,59); say $t.perl
20:10 p6eval rakudo 678ad3: OUTPUT«TimeOfDay.new(values => [14, 59, 59])␤»
20:10 masak I hope you can take over from there :)
20:12 newbee Thanks :D
20:15 benabik left #perl6
20:19 benabik joined #perl6
20:20 newbee just a question.... what does "*@" means? I'm guessing that it means "put any parameters received in @maxvalues"
20:21 masak the star there is pronounced "slurpy".
20:21 masak it emulates the Perl 5 behaviour of reading in all (positional) arguments into one array parameter.
20:21 benabik I pronounce it "shlurpy".
20:21 ab5tract left #perl6
20:22 tinhead joined #perl6
20:23 masak new version. this one does incrementing.
20:23 masak rakudo: role Counter[*@bases] { has @.values; submethod BUILD(@!values) { die "wrong number of args" unless @bases == @!values; die "out of range" unless 0 <= all(@!values) && @!values Z< @bases }; method succ { my @v = @!values; for reverse 0..@v.end -> $i { ++@v[$i]; last if @v[$i] %= @bases[$i] }; self.new(:values(@v.list)) } }; class TimeOfDay does Counter[24,60,60] {}; my $t = TimeOfDay.new(:values(14,59,59)); $t++; say $t.perl
20:23 p6eval rakudo 678ad3: OUTPUT«TimeOfDay.new(values => [15, 0, 0])␤»
20:24 masak` joined #perl6
20:24 newbee nice :) That's exactly the idea ... now i just have to implement an "offset" in case the ++ goes beyond the "scale". I have that in my TimeOfDay class but this role thing is much cooler
20:26 mr joined #perl6
20:26 mr is now known as Guest16407
20:27 masak left #perl6
20:27 Guest16407 left #perl6
20:28 dual joined #perl6
20:28 wknight8111 left #perl6
20:29 [particle] left #perl6
20:29 noganex_ joined #perl6
20:29 masak` left #perl6
20:30 noganex left #perl6
20:34 [particle] joined #perl6
20:38 yunga joined #perl6
20:42 yunga left #perl6
20:45 tinhead left #perl6
20:53 birdwindupbird left #perl6
20:58 y3llow_ joined #perl6
20:59 [Coke] left #perl6
21:00 y3llow left #perl6
21:00 y3llow_ is now known as y3llow
21:00 [Coke] joined #perl6
21:00 orafu left #perl6
21:01 orafu joined #perl6
21:02 ab5tract joined #perl6
21:07 SHODAN left #perl6
21:12 plainhao left #perl6
21:19 donri left #perl6
21:20 dual_ joined #perl6
21:21 dual_ left #perl6
21:22 dual left #perl6
21:28 cdarroch left #perl6
21:42 Mowah left #perl6
21:43 kaare_ left #perl6
21:56 bluescreen10 left #perl6
22:00 sftp left #perl6
22:09 bluescreen10 joined #perl6
22:12 newbee left #perl6
22:15 bluescreen100 joined #perl6
22:25 alester left #perl6
22:29 alester joined #perl6
22:30 ymasory joined #perl6
22:40 jevin left #perl6
22:40 Trashlord left #perl6
22:40 Chillance left #perl6
22:40 Pathin left #perl6
22:40 dsouza left #perl6
22:40 ashleydev left #perl6
22:40 pyrimidine left #perl6
22:40 Bucciarati left #perl6
22:40 sivoais left #perl6
22:42 jevin joined #perl6
22:42 Trashlord joined #perl6
22:42 Chillance joined #perl6
22:42 dsouza joined #perl6
22:42 ashleydev joined #perl6
22:42 pyrimidine joined #perl6
22:42 Bucciarati joined #perl6
22:42 sivoais joined #perl6
22:46 Pathin joined #perl6
22:46 Pathin left #perl6
22:47 Pathin_ joined #perl6
22:53 ab5tract left #perl6
23:03 dju left #perl6
23:03 benabik left #perl6
23:07 miso_soup joined #perl6
23:07 miso_soup left #perl6
23:20 whiteknight joined #perl6
23:21 Khisanth left #perl6
23:26 araujo left #perl6
23:36 keeth joined #perl6
23:40 Khisanth joined #perl6
23:45 Helios left #perl6
23:48 Helios joined #perl6
23:48 hudnix left #perl6
23:52 Chillance left #perl6

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

Perl 6 | Reference Documentation | Rakudo