»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
perigrin Ali_h: incase there is a transcription error or something ... can you humor us and paste the results into something like paste.scsys.co.uk/ ? 00:00
TimToady of gist.github.com 00:01
*or
Ali_h well ill take screenshot and it will show output too
perigrin harder for one of us to copy it and try it locally that way, but as you wish
TimToady has to run off in a few minutes, but is glad to see other people helping 00:02
another question, is this the first time you've install Rakudo? 00:03
or is there maybe an old copy out there somewhere?
Ali_h first time instal
paste.scsys.co.uk/103508
as I said its right from the book 00:04
PerlJam not quite
TimToady yowsers, that's ancient 00:05
PerlJam (There's some odd spacing at the very least)
TimToady illegal Perl 6 these days
Ali_h PerlJam, its how the books done it
sorear -> $line{ will never work 00:06
PerlJam Ali_h: $line{ and $r2{ won't fly too far
Ali_h so the books wrong :/ can anyone suggest anything else to learn perl6 by 00:07
PerlJam no, the book is correct (at least in source form :) 00:08
TimToady }else{ is incorrect
PerlJam did you copy/paste from the PDF or something?
TimToady put spaces around all your block braces
Ali_h >.< no so I typed wrong ok just gonna hide now :/ 00:09
TimToady you also misspelled $result/$results 00:10
TimToady and $sets needs to be %sets 00:11
Ali_h eek goes into hiding and goes to read preoperly :/
sorry guys
PerlJam Ali_h: no worries.
perigrin Ali_h: and that's why I suggested actually pasting the code ... transcription errors are a bane to us all. 00:12
TimToady has to run off now, but good luck! :) 00:12
Ali_h thanks TimToady,perljam and pergrin for your help:) 00:13
PerlJam Ali_h: that's what we're here for? 00:17
er, s/\?/./
PerlJam wonders how long the culture of friendliness can last. 00:19
dalek ecza: cbfec0f | sorear++ | lib/CLRBackend.cs:
Use nesting depth to break ties in my multi sub
00:25
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␤»
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:␤------> class foo { method bar() { -> { $.foo⏏ } } }␤ok 00:01 114m␤»
TimToady yes, I need to fix that 01:37
dalek d: 4d51d3e | larry++ | STD.pm6:
better emulation of partial/complete object scope
02:46
dalek d: e9571cb | larry++ | STD.pm6:
apply $*HAS_SELF context to self itself, duh...
02:51
TimToady std: self 02:53
p6eval std 3ba3a75: OUTPUT«ok 00:01 112m␤»
sorear std: sub infix:<>() {} 02:54
p6eval std 3ba3a75: OUTPUT«===SORRY!===␤Null operator is not allowed at /tmp/4vpa2H7lXK line 1:␤------> sub infix:<>⏏() {}␤Other potential difficulties:␤ Pair with <> really means a Nil value, not null string; use :('') to represent the null string,␤ or :() to
..represent…
sorear niecz: sub infix:<>() {}
niecza: sub infix:<>() {}
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
..@ 11)␤ at /…
sorear it looks like someone edited STD.pm6 recently with an editor that doesn't respect # vim: expandtab 03:28
dalek d: 46608ea | sorear++ | STD.pm6:
Fix tab usage
03:29
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:␤------> try { }; say $!⏏; # TimToady!!␤ok 00:01 114m␤»
sorear std: isn't fully up to date 03:39
p6eval std 3ba3a75: OUTPUT«===SORRY!===␤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␤»
sorear locally, it's a full "sorry"
TimToady std: self 03:44
p6eval std 3ba3a75: OUTPUT«ok 00:01 112m␤»
sorear TimToady: std 3ba = before $*HAS_SELF 03:45
TimToady yeah, but $! will still be rwong
std: $.
p6eval std 3ba3a75: OUTPUT«===SORRY!===␤Unsupported use of $. variable; in Perl 6 please use the filehandle's .line method at /tmp/tLZGhyiEFa line 1:␤------> $.⏏<EOL>␤Parse failed␤FAILED 00:01 112m␤» 03:46
sorear also, someone added new usages of $variable.sorry
where $variable ~~ Match
TimToady well, the intent is that $variable remember a cursor position for errors, since self might be too far down the buffer 03:54
well, that was the intent originally, but the code has mutated over time... 03:59
sorear the problem is that Match objects don't have a .sorry method 04:01
Rakudo and Niecza use $variable.CURSOR.sorry; I'm not sure what the best way is
our way feels a smidge hackish
TimToady I'm generating a $here = self.cursor($variable.from) now 04:07
testing 04:08
TimToady wonders why his vim stopped paying attention to the vim: line... 04:17
dalek d: 01c24ce | larry++ | STD.pm6:
$! not twigilled; convert $variable to cursor
04:20
TimToady somehow my modeline defaulted to 'no'... 04:22
doubtless someone decided it was a security hole
std: self 04:23
p6eval std 3ba3a75: OUTPUT«ok 00:01 112m␤»
TimToady still not updating, alas
TimToady std: self 06:01
p6eval std 01c24ce: OUTPUT«===SORRY!===␤'self' used where no object is available at /tmp/xBsEKZrE7K line 1:␤------> self⏏<EOL>␤Check failed␤FAILED 00:01 112m␤»
TimToady there we go 06:02
sorear \o/
sorear is currently making a priority of bringing niecza closer to STD
TimToady std: class Foo { method bar { -> { $.foo } } } 06:03
p6eval std 01c24ce: OUTPUT«ok 00:01 114m␤»
TimToady std: class Foo { submethod bar { -> { $.foo } } } 06:04
p6eval std 01c24ce: OUTPUT«===SORRY!===␤Virtual call $.foo may not be used on partially constructed object at /tmp/E0BTd6OSIM line 1:␤------> class Foo { submethod bar { -> { ⏏$.foo } } }␤Check failed␤FAILED 00:01 114m␤»
TimToady std: class Foo { submethod bar { -> { self.foo } } } 06:05
p6eval std 01c24ce: OUTPUT«ok 00:01 114m␤»
TimToady that's allowed though
moritz so are submethods only meant for object construction? 06:06
TimToady they're meant to be infrastructural
anyway, you can get around the $.foo restriction with self.foo, which seems reasonable to me 06:07
people think of $.foo as a variable, but not self.foo
perigrin you've trained them that $ means "scalar" 06:20
and that two punctuation symbols means "Twigil"
nobody expect "hidden invocant" 06:21
TimToady the deception is somewhat intentional 06:23
perigrin I'm not surprised :) 06:25
moritz it does confuse newcomers that $.foo isn't writable within the class
sorear twigils are always sort of invokey 06:26
moritz huh? what does $!foo invoke?
perigrin foo's really really hard.
sorear moritz: even in nom it's indirected through REPR's get_attr 06:27
otoh, having said that, I think of $?foo, which is in some ways less dynamic than $foo 06:28
moritz sorear: is there anything in Perl 6 that is not indirected in some way, at least notionally? 06:29
TimToady 42 06:30
sorear $foo has to be pretty direct because of the ways it plays with static typing
especially if it was declared with a native type
moritz sorear: it's indirected by the lexpad, no?
at least if not natively typed
TimToady everything is indirected through the grammar :) 06:31
moritz ... even the grammar :-)
sorear TimToady: is class Foo { token bar { ... } } bad form?
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"
maybe I should have grammar Cursor is Any { ... } 06:33
:)
grammar Grammar is Cursor { ... }
TimToady unless 'grammar' implies 'is Cursor'
sorear in current niecza explicit trait_mod:<is> overrides that
moritz rakudo: grammar Foo { }; say join ' ', Foo.^parents
p6eval rakudo 678ad3: OUTPUT«Grammar() Cursor() Regex::Cursor() Any() Mu()␤»
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 { }
moritz in rakudo 'grammar' implies 'is Grammar'
sorear (pretend I have a few more "my"s in there)
moritz: niecza too, except without Regex::Cursor and with Cool
moritz Regex::Cursor is an artifact 06:35
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
p6eval rakudo 678ad3: OUTPUT«Method 'parents' not found for invocant of class 'P6metaclass'␤ in main program body at line 22:/tmp/QQ3N3eBLip␤»
sorear moritz: sorry, confused myself there
Niecza's Match is Cool, its Cursor is not
moritz sorear: that makes much more sense to me :-) 06:37
dalek ecza: 7c63a3c | sorear++ | src/STD.pm6:
constant %hash works now
06:49
ecza: 2703ab0 | sorear++ | / (3 files):
Fix multimethods and implement lexical proto shadowing
mathw \o 07:11
moritz o/ 07:14
sorear /o 07:14
cxreg if 5.14 is coming out on 5/14, is 6.0 coming out on 6/0? 07:25
std: 6/0
p6eval std 01c24ce: OUTPUT«ok 00:01 113m␤»
cxreg oops 07:26
rakudo: 6/0
p6eval rakudo 678ad3: ( no output )
sorear Will 6.0 ever come out? 07:28
cxreg NaN 07:33
mathw what is 6.0? A state of mind? A tick in a box? 07:36
jdhore IMO, 6.0 is a specification 07:42
moritz an idea 08:15
tadzik 6.0 is niecza in one month, isn't it? 09:48
moritz v6, not 6.0 :-) 09:57
tadzik aw :) 10:01
moritz what you get when you write 'use v6;' :-) 10:01
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␤»
moritz /o\
moritz submits rakudobug
colomon woof 11:42
colomon wonders if that's a current record for the least characters needed to cause a Null PMC
moritz I know that 5.HOW.HOW caused a segfault 11:43
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␤»
moritz rakudo: ~pir::null__p()
p6eval rakudo 678ad3: OUTPUT«Null PMC access in get_string()␤ in main program body at line 7654:CORE.setting␤»
moritz ok, but that's cheating :-) 11:45
colomon it's also still longer than 5.HOW.HOW, no? 11:46
moritz yes 11:47
rakudo: 5.HOW.HOW; say 'alive';
p6eval rakudo 678ad3: OUTPUT«alive␤»
moritz seems it got fixed some time ago
rakudo: 5^.HOW; say 'alive';
p6eval rakudo 678ad3: OUTPUT«alive␤»
takadonet morning all 12:23
moritz good morning 12:25
sjn o7 12:26
Ali_h PerlJam, are you around? 13:58
PerlJam Ali_h: aye 14:05
Ali_h may I pm?
PerlJam Why not just speak on channel? 14:07
(It's not like you'll be interrupting the awesome conversation going on right now :-) 14:08
besides, on channel you get the benefit of others helping
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 :/
mathw But why would we help if you're here PerlJam? You can fix everything :P
PerlJam Ali_h: show the code again 14:10
mathw: were that true I would have long ago fixed the "not having a fast Perl 6 compiler" problem.
mathw :) 14:11
Ali_h pastebin.com/9kcJKiYv
moritz what's the error you get? and did you take care to remove leading whitespace from the input data?
moritz thinks we should use .words in up6 14:12
Ali_h moritz, thats the c&p one straight out the book
PerlJam moritz: aye
moritz Ali_h: does your data file have leading blanks?
PerlJam Ali_h: you're missing a } looks like.
moritz and... what error do you get? 14:13
PerlJam oh, maybe not. Just weird indentation
Ali_h the errors Non-declarative sigil is missing its name at line 1, near "$ perl6 sc" 14:14
PerlJam Oh! 14:15
Ali_h: you've copied a line that shouldn't be part of your program
moritz Ali_h: the $ indicates a shell prompt, it's not part of the program
Ali_h hmm Ill go look 14:17
thanks again :)
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(' | ')
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" ?
moritz PerlJam: yes 14:21
PerlJam moritz: works for me
Ali_h moritz, so I shouldnt use perl6.exe ? 14:22
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
so in your command prompt, write
perl6 yourscriptname.pl
Ali_h thanks 14:24
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:25
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 :/
moritz Ali_h: there will be a book that teaches total newcomers Perl 6, but it's not written yet :/
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:28
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
moritz Ali_h: not within 4 weeks 14:29
Ali_h: more like in some years
Ali_h well I guess I better get learning some aspects of perl before looking at perl 6:/ 14:31
moritz Ali_h: do you have knowledge in other programming languages? 14:32
Ali_h ruby
moritz Ali_h: ah, then you're not a total noob anymore :-)
PerlJam Perl 6 and Ruby are very similar in some respects
moritz Ali_h: and you might even fall in the target audience of the book
tadzik Ali_h: I have a feeling that you might have been trolled 14:33
I don't really know who the deamon guy is though
moritz github.com/TiMBuS/Net--IRC/ <-- good basis for an IRC bot 14:33
tadzik Ali_h: anyway, you might want to look at Net::IRC module (modules.perl6.org), and you're pretty much done 14:34
that's what moritz++ linked
Ali_h unfortunatly the basis of the bet is no modules socket or socket6
only
tadzik I see 14:35
moritz IO::Socket::INET is part of the core, fortunately
Ali_h I can use socket or socket6 but no modules
daemon you can use ::inet as its in base; by no modules I meant 'no additional'
moritz it's not a module, it's a class in core 14:36
daemon++ # challenging people to write Perl 6 code
daemon moritz, ^_^
moritz Ali_h++ # writing Perl 6 code
Ali_h moritz, hes evil :/
moritz :-)
so, what's at stake?
tadzik oh, the daemon appears :) Hello there
daemon hello tadzik
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
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! :)
that's interesting
moritz daemon: sounds like fun... how did you like her friends?
Ali_h but I will add - he did say that perl6 was nothing like perl :/
daemon moritz, oh I already knew them from a previous encounter; it was voring and unproductive -_- 14:38
s/voring/boring/ 14:39
tadzik daemon: do you have some Perl6 experience?
daemon tadzik, no I have perl 5 experiance though; I have a learning queue at the moment; Erlang->Perl6
tadzik I see
daemon It will ofc be a benefit watching over ali_h's shoulder as she hacks away at it though ;) 14:40
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
Ali_h meh
Ali_h goes back to the book 14:42
daemon heads back to erlang land
moritz Ali_h: you're welcome to ask for help here. We won't write the code for you, but we happily answer questions
Ali_h thanks moritz i have a feeling ill be in here ALOT! :D
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:43
dalek ok/first-example-more-robust: 0281365 | moritz++ | src/basics.pod:
[basics] made first example more robust wrt whitespace. Text still needs updating
14:46
ok/first-example-more-robust: 346ed6a | moritz++ | src/basics.pod:
[basics] start to updated description of the new first example
newbee rakudo: for <#comment not_a_comment #comment _not_a_coment_#_either> -> $s { say $s };
p6eval rakudo 678ad3: OUTPUT«#comment␤not_a_comment␤#comment␤_not_a_coment_#_either␤»
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␤»
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 };
p6eval rakudo 678ad3: OUTPUT«#comment␤notcomment␤» 14:48
rakudo 678ad3: OUTPUT«not_a_comment␤_not_a_coment_#_either␤»
newbee ohh.. thanks :)
moritz std: /\#/ 14:49
p6eval std 01c24ce: OUTPUT«===SORRY!===␤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:␤------> /\⏏#/␤Parse failed␤FAILED 00:01 113m␤»
moritz use '#' instead of \#
since \# introduces unspace, you can't use it as an escape sequence
it's a bug in rakudo that it allows it
colomon moritz++
masak greetings, lambdazebras, from .ru! 14:54
colomon \o 14:55
moritz o/
moritz hopes that the hackathon in .ru will be as awesome as the last one
masak the conditions appear favourable. 14:55
newbee ahother question :) 14:58
another*
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.
how are you trying to print?
moritz $IO.print
not print $IO
newbee my $CAL = open $.file or die "Can not open $.file : $!"; for $CAL -> $line { say $line; }
moritz for $CAL.lines -> $line { say $line; } 15:00
colomon for $CAL.lines -> $line
moritz you still have to *read* from the file :-)
masak newbee: you were looping over the filehandle. 15:01
newbee: ($CAL, the result of 'open', is a filehandle in Perl 6. similar to Perl 5's "open my $CAL, '<', $file"
)
newbee i see... i still think in "perl5" :) 15:02
moritz then imagine that the .lines replaces the < > around the file handle 15:02
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.
moritz masak's and mine similar lines of thoughts are kinda scary :-)
moritz still hasn't got around to backlog #rakudosketch from Tuesday - ETOOMUCHFAMILYTROUBLE 15:04
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.
moritz: but when it happens with longish p6eval oneliners, it's scarier, IMO :) 15:06
colomon the masakbot is learning.... :p
newbee rakudo: my @data = split /:/, 'a:b:c:d'; @data.perl.say;
p6eval rakudo 678ad3: OUTPUT«===SORRY!===␤Confused at line 22, near "my @data ="␤»
newbee rakudo: my @data = split ':', 'a:b:c:d'; @data.perl.say;
p6eval rakudo 678ad3: OUTPUT«["a", "b", "c", "d"]␤»
masak newbee: the rule is this:
colomon newbee: not sure what you mean by preferred over / / ?
moritz newbee: that constructs a string, not a regex
masak newbee: any non-alphanumerics that you mean literally need to be quoted or escaped. 15:06
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 /\:/
moritz std: my @data = split /:/, 'a:b:c:d'; @data.perl.say;
p6eval std 01c24ce: OUTPUT«===SORRY!===␤Unrecognized regex metacharacter (must be quoted to match literally) at /tmp/8VmhlhHrNn line 1:␤------> my @data = split /:⏏/, 'a:b:c:d'; @data.perl.say;␤Can't call method "from" on unblessed reference at STD.pm line
..54066.␤FAILED 0…
masak submits LTA rakudobug 15:08
moritz is pretty sure that's already submitted
masak possibly.
masak someone should take on the role of tending to the bug queue :) 15:08
not necessarily closing tickets, but categorizing and de-duping them. 15:09
moritz tadzik++ did, recently
newbee i'll stick to single quotes then :) thanks!
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.
ah; a certain moritz++ has submitted it already: rt.perl.org/rt3/Ticket/Display.html?id=77386 15:11
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)␤»
moritz nqp: "ab" ~~ / (a) { pir::die("foo: '$0'") } / 15:25
p6eval nqp: OUTPUT«foo: '$0'␤current instr.: '_block31' pc 972 ((file unknown):274)␤»
moritz nqp: "ab" ~~ / (a) { pir::die("foo: '" ~ $/[0] ~ "'") } /
p6eval nqp: OUTPUT«foo: 'a'␤current instr.: '_block31' pc 972 ((file unknown):274)␤»
moritz nqp: "ab" ~~ / (a) { pir::die("foo: '$/[0]'") } / 15:25
p6eval nqp: OUTPUT«foo: 'a[0]'␤current instr.: '_block31' pc 972 ((file unknown):274)␤»
TimToady std: class Foo { has $.a, $.b } 15:26
p6eval std 01c24ce: OUTPUT«===SORRY!===␤Variable $.b used where no 'self' is available at /tmp/8Eb7BSsbbV line 1:␤------> class Foo { has $.a, ⏏$.b }␤Check failed␤FAILED 00:01 115m␤»
TimToady that was my actual todo item for adding self-awareness to STD 15:27
tadzik masak: o/ 15:28
masak \o 15:29
TimToady is glad to see all the fresh faces around here
TimToady is also glad to see some of the stale faces :)
tadzik sta-sta-sta-stale face 15:29
masak .oO( TimToady and his stale mates )
TimToady winces (in)appropriately 15:30
bbkr_ std: my $x = / $x /; # hmm 15:30
p6eval std 01c24ce: OUTPUT«ok 00:01 117m␤»
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
..<anon> at …
TimToady niecza: my $x = / $x /; "" ~~ $x; # kabooom? 15:31
p6eval niecza v5-4-g2703ab0: ( no output )
moritz I guess it should just evaluate $x to Any at (non)-interpolation time
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…
moritz perl6: my $x; my $re = rx/ $x /; $x = 'a'; say 'abc' ~~ $re
bbkr_ everything looks more atractive when there is explosion in background :)
p6eval rakudo 678ad3, niecza v5-4-g2703ab0: OUTPUT«a␤» 15:32
..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…
TimToady perl6: my $x = rx/ $x /; $x = 'a'; say 'abc' ~~ $x 15:33
p6eval rakudo 678ad3, niecza v5-4-g2703ab0: OUTPUT«Bool::False␤»
..pugs: OUTPUT«␤» 15:34
masak bbkr_: feel free to report that one.
TimToady hmm
I don't understand why that one doesn't match 15:35
moritz because $x is 'a'
TimToady oh, yeah, duh
moritz perl6: say 'abc' ~~ 'a'
p6eval rakudo 678ad3, niecza v5-4-g2703ab0: OUTPUT«Bool::False␤»
..pugs: OUTPUT«␤»
TimToady goes back for a larger dose of caffiene
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:36
moritz colomon: there are lots of recursions in STD 15:37
and any other Perl 6 parser, for that matter
colomon: we just realize them with named rules
colomon most other parsers in general, come to think of it. 15:38
TimToady perl6: my $x = / "blue " (\w+ | $x)/; say $x ~~ 'blue blue blue pink' 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
..rakudo 678ad3, niecza v5-4-g2703ab0: OUTPUT«Bool::False␤»
moritz TimToady: fwiw the 'Unrecognized regex metacharacter' error message in token termish doesn't report the offending character
TimToady: the one in token nibbler does
moritz TimToady: remember that :s :-) 15:40
colomon perl6: my $x = / "blue " (\w+ | $x)/; say 'blue blue blue pink' ~~ $x
p6eval rakudo 678ad3: OUTPUT«blue blue␤»
..niecza v5-4-g2703ab0: OUTPUT«blue␤»
..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…
colomon thinks TimToady definitely needs caffeine, stat 15:41
;)
pmichaud ...why is RT#90456 considered a bug?
colomon pmichaud: I think we were just exploring that. :) 15:42
TimToady perl6: my $x = / "blue " ($x | \w+)/; say $x ~~ 'blue blue blue pink'
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…
..rakudo 678ad3, niecza v5-4-g2703ab0: OUTPUT«Bool::False␤»
moritz try Str ~~ Regex, not the other way round :-) 15:43
TimToady perl6: my $x = / "blue " ($x | \w+)/; say 'blue blue blue pink' ~~ $x
p6eval niecza v5-4-g2703ab0: OUTPUT«blue␤»
..rakudo 678ad3: OUTPUT«blue blue blue pink␤»
..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…
moritz \o/
TimToady thanks for being patient with us newbies :)
why did niecza only return "blue"? 15:44
moritz niecza: my $x = rx{a}; say 'a' ~~ /$x/
TimToady obviously it's binding $x into the regex as a value too soon, I guess
p6eval niecza v5-4-g2703ab0: OUTPUT«␤»
moritz guesses it can't interpolate regexes at all 15:45
which explains why it didn't blow up in bbkr_'s example :-)
colomon pmichaud: I agree that it #90456 shouldn't be a bug, unless it's explicitly forbidden somewhere...
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"?
in fact, how the heck did it get "blue" with no space on teh end?
moritz niecza: say 'ab' ~~ /"a b"/ 15:47
p6eval niecza v5-4-g2703ab0: OUTPUT«␤»
moritz niecza: say so 'ab' ~~ /"a b"/
p6eval niecza v5-4-g2703ab0: OUTPUT«Bool::False␤»
moritz TimToady: bug, but I don't know what kind of bug
pmichaud colomon: it's no more forbidden than the error that is obtained by: my $x = sub { $x(); }; $x();
dalek p: d846b25 | moritz++ | src/Regex/P6Regex/Grammar.pm:
more awesome error message for unrecognized meta character in regexes

not quite awesome yet, it does not report the actual offending character
15:50
d: b9c20c5 | larry++ | STD.pm6:
fix LTA unrec regex meta reported by moritz++
15:51
colomon pmichaud: then obviously it's not a bug
TimToady it might in some cases be possible to detect left recursion 15:52
moritz this particular one might be hard though 15:53
unless you special-case very hard for it
colomon but even if you did, the appropriate response would just be a nicer error message, right?
TimToady well, putting a hard recursion limit on is always going to be either too large or too small 15:54
pmichaud (rejected ticket)
PerlJam greetings
bbkr_ rakudo: / a ** / / / # parse bug here, should detect empty regexp first like STD does? 15:55
PerlJam is relaxing after moving offices at $work
p6eval rakudo 678ad3: OUTPUT«===SORRY!===␤Quantifier quantifies nothing at line 22, near " / / / # "␤»
pmichaud PerlJam: now in NRC?
bbkr_ std: / a ** / / /
p6eval std 01c24ce: OUTPUT«===SORRY!===␤Unrecognized regex metacharacter * (must be quoted to match literally) at /tmp/U3Afwf2Zsz line 1:␤------> / a *⏏* / / /␤Unable to parse regex; couldn't find final '/' at /tmp/U3Afwf2Zsz line 1:␤------> / a ** ⏏/ /
.. /…
PerlJam pmichaud: I was already in NRC, but on the 3rd floor. Now I'm on the 2nd floor
bbkr_ nvm
pmichaud PerlJam: which office?
PerlJam 2105 I think. 15:56
We reclaimed the 2100 suite
masak braves the streets of Moscow again
pmichaud the corner one?
PerlJam no, that's Rizzo's. Mine's the one next to his.
pmichaud got it
moritz can resist a Sovjet Russia joke. o/ 15:56
PerlJam pmichaud: are you planning a visit sometime? :) 15:57
pmichaud pj: not at present
TimToady niecza: my $x = / $x /; '' ~~ $x; say 'alive' 15:58
p6eval niecza v5-4-g2703ab0: OUTPUT«alive␤» 15:58
TimToady niecza doesn't blow up there
but maybe it's just a compensating bug...
moritz yes, because it doesn't handle variables which contain regexes
pmichaud we're guessing that niecza doesn't do regex interpolation
moritz niecza: my $re = rx/a/; say so 'a' ~~ /$re/ 15:59
p6eval niecza v5-4-g2703ab0: OUTPUT«Bool::False␤»
moritz rakudo: my $re = rx/a/; say so 'a' ~~ /$re/
TimToady niecza: my $x = / <$x> /; '' ~~ $x; say 'alive'
pmichaud niecza: my $x = / a /; my $y = / $x /; say "a" ~~ $y;
p6eval rakudo 678ad3: OUTPUT«Bool::True␤»
niecza v5-4-g2703ab0: OUTPUT«␤Unhandled Exception: OutOfMemoryException␤»
niecza v5-4-g2703ab0: OUTPUT«␤»
TimToady there you go :)
moritz TimToady++
TimToady nonetheless, I believe the LTM matcher should warn when it notices left recursion liek that 16:00
TimToady make that "the longest LTM matcher" :) 16:01
moritz rakudo currently has an LTA matcher :-)
pmichaud it's better than no matcher. :-)
moritz agreed, very much so
masak moritz: in Moscow Underground, the train car waits for YOU! 16:02
(they're that frequent) 16:03
TimToady in Moscow Underground, you shelter it from nuclear war
masak .oO( "Longest Token Awesome"? )
TimToady you just need to increment LTA 12 times
moritz LTA as in ... LTA :-)
masak oh! :P 16:04
nebuchadnezzar hello 16:04
masak hi, nebuchadnezzar!
nebuchadnezzar I just compile a rakudo after reading 5_to_6 and "Using perl6", synopsis in progress 16:05
PerlJam nice nick
You can't go wrong if you're named after a king :) 16:06
TimToady was named after Abraham Lincoln
nebuchadnezzar it was not the first reason in fact
masak nebuchadnezzar: cool that you're reading up on Perl 6! let us know if you have any questions along the way.
& 16:07
nebuchadnezzar but my real first name is connected to my nickname so I kept it
PerlJam nebuchadnezzar: you're name is really chad?
PerlJam picks the most obvious secondary chunking
nebuchadnezzar no, my /whois is filled AFAIK 16:08
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...
PerlJam nebuchadnezzar: note that "Str{} 16:11
pmichaud "hello world" isn't a MyStr
PerlJam nebuchadnezzar: note that "Str{}" is not the same as "Str { }" :)
TimToady std: class MyStr is Str{}
p6eval std 01c24ce: OUTPUT«===SORRY!===␤Unable to parse class definition at /tmp/1gNuLsL2dj line 1 (EOF):␤------> class MyStr is Str{}⏏<EOL>␤Parse failed␤FAILED 00:01 112m␤»
nebuchadnezzar sorry, I have the space is my code
moritz: the story of Nebuchadnezzar is written in Daniel's book
PerlJam then what pmichaud said
TimToady nebuchadnezzar: are you in your proud stage, your insane stage, or your "I got better" stage? 16:12
PerlJam heh
moritz nebuchadnezzar: there might not yet be a simple way to instantiate a subclass of a value type in rakudo :/
nebuchadnezzar: ah, thanks
moritz not well versed in bible terms
pmichaud s/rakudo/Perl 6/ # maybe?
nebuchadnezzar moritz: neither me
moritz pmichaud: probably
nebuchadnezzar well, my idea was to create a subtype of string with the Iterable role to slice strings instead of using substr ;-) 16:13
That's one of the only 3 things I prefer in python than in perl5
TimToady what are the other two? 16:14
PerlJam nebuchadnezzar: what are the other 2
?
nebuchadnezzar the list compehension syntax
TimToady I don't like the conditional after the loop 16:15
it's unnatural, even if mathematicians like it
and it relies on post-declarations
nebuchadnezzar and the 3-way comparaison 16:15
PerlJam Well, Perl 6 has that one :) 16:16
moritz rakudo: say 'yes' if 1 < 3 < 5;
nebuchadnezzar PerlJam: yes
p6eval rakudo 678ad3: OUTPUT«yes␤»
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
TimToady but yeah, you should be able to mix in slicing to strings
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
erf
moritz and it automatically desguars slices passed to .[] into .at-pos calls
PerlJam your ruby is showing ;)
TimToady also, you get one level of list comprehension for free with .foo when Mumble for @list
we tend to discourage monkey patching 16:18
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)
TimToady well, you'd really want to modify the quoting grammar too
moritz nebuchadnezzar: so introducing string slicing will likely cause havoc
PerlJam though that is one of those features "newbies" always want. 16:20
pmichaud why not a .slice method?
alester hey pmichaud
pmichaud "hello world".slice[1 2 3 4]
er
TimToady .comb[]
pmichaud "hello world".slice[1,2,3,4]
or even .comb
alester: hello 16:21
alester I'm about to post this on Perlbuzz: gist.github.com/968860
TimToady note also that a buf is defined to have slicing
alester anything I should add?
moritz rakudo: say 'hello worlds'.comb.[1, 2, 3, 4]
p6eval rakudo 678ad3: OUTPUT«ello␤»
pmichaud rakudo: say "Hello world".comb[4..8]
p6eval rakudo 678ad3: OUTPUT«o wor␤»
alester Forgive the lack of wrapping.
nebuchadnezzar ok
pmichaud rakudo: say "Hello world".comb[7, 3, 1..6]
TimToady or 4..^8 to get Python's strange semantics
p6eval rakudo 678ad3: OUTPUT«olello w␤»
pmichaud rakudo: say "Hello world".comb[*-2]
p6eval rakudo 678ad3: OUTPUT«l␤» 16:22
pmichaud rakudo: say "Hello world".comb.reverse]
p6eval rakudo 678ad3: OUTPUT«===SORRY!===␤Confused at line 22, near "]"␤»
pmichaud rakudo: say "Hello world".comb.reverse
p6eval rakudo 678ad3: OUTPUT«dlrow olleH␤» 16:22
TimToady rakudo: my $x = Buf.new("abc"); say $x[1]
p6eval rakudo 678ad3: OUTPUT«Any()␤»
TimToady I thought rakudo did Buf
moritz rakudo: say Buf ~~ Positional
p6eval rakudo 678ad3: OUTPUT«Bool::True␤»
moritz rakudo: say 'abc'.encode.[1] 16:23
p6eval rakudo 678ad3: OUTPUT«98␤»
TimToady rakudo: my $x = Buf.new(<a b c>); say $x[1]
p6eval rakudo 678ad3: OUTPUT«b␤»
TimToady rakudo: my $x = Buf.new(<a b c>); say $x
p6eval rakudo 678ad3: OUTPUT«Buf()<0x5225f60>␤»
TimToady rakudo: my $x = Buf.new(<a b c>); say ~$x
p6eval rakudo 678ad3: OUTPUT«Buf()<0x52abe90>␤»
moritz TimToady: Buf.new wants a list of ints
pmichaud rakudo: my $x = Buf.new("abc"); say $x[0];
TimToady hmm
p6eval rakudo 678ad3: OUTPUT«abc␤»
moritz TimToady: to get from strings to Buf you use .encode
TimToady it took <a b c> above
moritz ... but more by accident
TimToady right 16:24
TimToady anyway, strings have always been scalars in Perl, not lists 16:25
pmichaud alester: reading 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
pmichaud alester: looks great!
alester It's kinda boring. 16:27
pmichaud some press releases are boring, yes. :-)
TimToady newbee: actually, TimeOfDay can go to 23:59:60 :P 16:28
alester perlbuzz.com/2011/05/rakudoorg-relaunched.html
newbee brb!!!
nebuchadnezzar TimToady: ok, I was just looking for a shorter/nicer syntax for substr($string, $start, $end); 16:29
thanks guys
pmichaud $string.comb[$start..$end] 16:30
except it's a list, not a string
so put a ~ in front
(granted, not a lot shorter)
colomon the at_pos solution, if implemented, would still have the list not a string problem. 16:31
pmichaud (I entered "boring press releases" into Google, and it helpfully suggests that I intended "boeing press releases".) 16:33
PerlJam Except aren't perlbuzz articles supposed to have some "buzz"? :) 16:34
a boring press release has no buzz.
alester In this case, there's nothing more to say other than "RSS works now thank goodness" 16:36
pmichaud afk, lunch 16:44
alseter++
alester++ # oops, typo
TimToady std: /:/ 16:51
p6eval std b9c20c5: OUTPUT«===SORRY!===␤Unrecognized regex metacharacter : (must be quoted to match literally) at /tmp/tCv13YCOeC line 1:␤------> /:⏏/␤Can't call method "from" on unblessed reference at STD.pm line 54066.␤FAILED 00:01 113m␤»
diakopter std: /\:/ 16:52
p6eval std b9c20c5: OUTPUT«ok 00:01 113m␤»
diakopter std: /':'/
p6eval std b9c20c5: OUTPUT«ok 00:01 113m␤»
masak ah, Moscow. 19:56
masak std: enum nebuchadnezzar <proud insane i_got_better> 19:59
p6eval std b9c20c5: OUTPUT«ok 00:01 112m␤»
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:01
masak newbee: the Counter thing you're describing sounds more like a role than a class. 20:05
a parameterized role, at that.
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:06
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])␤»
masak I hope you can take over from there :)
newbee Thanks :D 20:12
newbee just a question.... what does "*@" means? I'm guessing that it means "put any parameters received in @maxvalues" 20:20
masak the star there is pronounced "slurpy". 20:21
it emulates the Perl 5 behaviour of reading in all (positional) arguments into one array parameter.
benabik I pronounce it "shlurpy".
masak new version. this one does incrementing. 20:23
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
p6eval rakudo 678ad3: OUTPUT«TimeOfDay.new(values => [15, 0, 0])␤»
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:24