Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-09-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 araujo joined #perl6
00:01 wayland76 donri: Yes.  There's also a way of pairing an action class with a grammar, and that may be a more useful way of doing things
00:01 donri i have yet to find information on what actions are supposed to be
00:02 donri also wondering, can grammars give you a parse tree automatically, e.g. based on which rules matched?
00:03 wayland76 Well, in this context, you have a grammar and a class, and when certain things are triggered in the grammar, it calls methods on the class
00:03 wayland76 Yes
00:03 araujo hello
00:03 wayland76 Well, kind of.  They give you a match object, which points at other match objects
00:03 wayland76 You can call that a parse tree if you want
00:03 wayland76 araujo: o/
00:04 donri depends what information match objects carry
00:04 Caliginous_ left #perl6
00:05 donri actions: ah. but i was thinking it could be useful to add methods directly that are not specifically actions for a running parse. perhaps you want to add a parse_from_foo method that gets a string from foo and calls the internal parse, etc.
00:07 japhb joined #perl6
00:07 wayland76 I'm pretty sure you can add methods to a grammar too
00:07 wayland76 If not, you can make your own custom dialect of Perl 6 where that's possible :)
00:09 araujo hi wayland76
00:09 araujo :)
00:10 donri STD.pm does it, although it's not using block syntax for the grammar, if now that matters (shouldn't, right?)
00:11 wayland76 That shouldn't matter
00:12 donri are grammars fundamentally PEGs, or is there a fundamental difference?
00:13 donri sorry for all the questions, i try to google but i find mostly basic usage syntax examples and the like
00:14 wayland76 Keep in mind that I'm no expert (with the questions you're asking, TimToady is the expert)
00:16 wayland76 Also, everything I know about PEGs comes from a skim over the Wikipedia article just then
00:16 wayland76 Basically, their description sounds about right, but I don't understand enough of the nuances to be able to answer your question :)
00:16 donri aye :)
00:24 sm` joined #perl6
00:25 brunov joined #perl6
00:44 charsbar_ joined #perl6
01:07 shinobi-cl joined #perl6
01:20 staykov joined #perl6
01:21 nihiliad joined #perl6
01:41 donri what is the motivation behind requiring <> around character classes?
01:41 bgs100 joined #perl6
01:50 sri_kraih_ joined #perl6
01:51 diakopter lambdabot had 3m-old msgs for me
01:52 TimToady donri: two reasons, mainly
01:52 TimToady first, we wanted to steal bare [...] for grouping without capturing, which I felt was more important
01:52 TimToady we have that in Perl 5, but it's really ugly:  (?:...)
01:53 TimToady that's just [...] in p6
01:53 donri aha, [] is (?:)
01:53 TimToady second
01:53 TimToady character classes are getting to be "wronger" these days
01:53 TimToady it was already wrong in the age of Latin-1 to say [a-z]
01:53 donri i use (?:) *alot* in any regex machine. and character classes less so.
01:53 TimToady now that we have unicode
01:54 TimToady you should almost always be using a named character class like <alpha>
01:54 devin joined #perl6
01:54 TimToady so it was basically a matter of huffman coding the more common feature to use [...], and discouraging character classes by demoting them to <[...]>
01:54 TimToady on the other hand
01:55 TimToady it's also a feature
01:55 TimToady because it gives us a composition notation
01:55 TimToady <+[a..z]-[aeiou]> and such
01:55 sevvie joined #perl6
01:55 TimToady so you can build up character classes with set operations inside the <>
01:56 TimToady which wouldn't work outside as well, since + means something else there
01:56 donri i don't know compositions yet
01:56 TimToady basically, lets you rough in the set of characters, and then define exceptions or extensions to the character class
01:57 TimToady so things like <+alpha-vowels> become possible
01:57 TimToady anyway, that's why it's <[ a .. z ]> now
01:57 TimToady note that ranges are now .. instead of -
01:58 TimToady since there's no reason to ever use .. it's obviously "meta"
01:58 TimToady and it's consistent with ranges elsewhere in Perl 6
01:58 TimToady also whitespace is allowed for clarity
01:59 TimToady so that's probably a longer answer than you wanted :)
01:59 TimToady but most of the design features of p6 have complicated answers like that, with multiple reasons contributing
01:59 TimToady because we almost never changed anything for a single reason
02:00 donri why is there no reason to use ..?
02:03 TimToady because a character class only needs each character listed once
02:03 TimToady if you were wanting to match . then there's no reason to add another .
02:03 TimToady so it's naturally out-of-band, as it were
02:03 TimToady unlike -, which you might actually want to match
02:04 TimToady anyway, S05 discusses a lot of this, if you're interested
02:04 TimToady decommuting &
02:05 donri oh, i thought you meant the actual range syntax
02:06 donri like, [az] would be the same as [a..z], which would surprise me
02:10 donri TimToady: is a grammar more like a class or a role, or can i use it like either, or, uh.
02:21 rhr_ joined #perl6
02:30 wayland76 He's decommuted.  That & means he's away from his keyboard
02:30 wayland76 roles can always be used as classes.
02:31 carlin joined #perl6
02:43 staykov left #perl6
02:49 jaldhar joined #perl6
02:49 carlin rakudo: class Alpha { has @!a = < beta gamma >; method postcircumfix:<[ ]>($key) { return @!a[$key]; }; }; my $a = Alpha.new; say $a[1];
02:49 p6eval rakudo 446d49: OUTPUT«No such attribute '@!a'␤in method Alpha::postcircumfix:[ ] (/tmp/7AR5tMc3Jx:2)␤called from method Alpha::postcircumfix:[ ] (/tmp/7AR5tMc3Jx:2)␤called from Main (/tmp/7AR5tMc3Jx:2)␤»
02:51 carlin rakudo: class Alpha { has @!a = < beta gamma >; method postcircumfix:<{ }>($key) { return @!a[$key]; }; }; my $a = Alpha.new; say $a{1};
02:51 p6eval rakudo 446d49: OUTPUT«gamma␤»
02:56 carlin should that first one have worked? If not, does that error make sense?
03:07 justatheory joined #perl6
03:12 synth joined #perl6
03:14 brunov joined #perl6
03:38 mepplock joined #perl6
03:52 synth joined #perl6
03:53 JimmyZ joined #perl6
03:54 JimmyZ rakudo: Str.^method();
03:54 p6eval rakudo 446d49: OUTPUT«Method 'method' not found for invocant of class 'ClassHOW'␤»
03:54 JimmyZ rakudo: Str.^methods();
03:54 p6eval rakudo 446d49:  ( no output )
03:57 JimmyZ rakudo: Str.^methods().join(', ').say;
03:58 p6eval rakudo 446d49: OUTPUT«pred, encode, succ, ACCEPTS, perl, WHICH, sprintf, Scalar, 1, map, cis, comb, 1, min, max, bytes, chop, sin, 1, 1, values, 1, end, ceiling, p5chomp, keys, kv, unpolar, floor, ord, capitalize, pick, round, 1, 1, split, 1, words, p5chop, lc, join, srand, reduce, trim, reverse,
03:58 p6eval ..isa, 1…
04:32 mrsaturn joined #perl6
04:33 mrsaturn Don't worry! I'm here. Hi everyone.
04:39 drbean_ joined #perl6
04:46 cotto joined #perl6
04:50 wayland76 What if I want to worry? :)
04:51 jaldhar joined #perl6
04:56 mrsaturn Well then it is permitted
04:59 synth joined #perl6
04:59 donri how is "temp $x" different from "my $x = $x"?
05:10 TimToady well, for one, the 2nd won't work, since $x is already redefined by the time it hits the =
05:11 wayland76 donri: Answer is in S02.  Search for "temp "
05:11 wayland76 (that's "temp" with a space after it)
05:11 TimToady and temp will change $x in whatever scope it already exists, while my $x makes a new $x in the current scope
05:11 wayland76 TimToady++ :)
05:11 TimToady (you'd have to say "my $x = OUTER::<$x>" or some such
05:12 TimToady but nobody implements temp yet, actually
05:12 donri ah. thanks for all your answers btw, people.
05:12 TimToady we've tended to move more to contextual variables from temp, because they're safer for threading
05:13 mrsaturn joined #perl6
05:13 TimToady though if you use temp on a context var, it actually declares a new var in the current scope, because that's how contextuals work
05:14 TimToady so "temp %*ENV;" for instance makes a local copy of the global environment, and anything in the current dynamic scope will see that %*ENV instead
05:15 TimToady whereas "my %*ENV;" would make a new environment with nothing in it, rather than copying in the outer environment
05:15 TimToady so "temp %*ENV" is more or less what every Unix process does
05:21 zloyrusskiy joined #perl6
05:23 mrsaturn joined #perl6
05:33 payload joined #perl6
05:41 donri oh fun; larry has the same birth day as me. :D
05:44 mrsaturn I have the same birthday as julius caesar
05:44 mrsaturn wait, no i don't
05:44 colomon Errrr.... anyone out there having trouble with t/spec/S32-io/IO-Socket-INET  ?  I did a make spectest to make sure my recent changes didn't break anything, and it's broken -- but I can't see what it has to do with trig functions....
05:45 s1n pmichaud: mini 10v with 16g ssd shipped this afternoon
05:46 s1n pmichaud: hopefully it'll be here for this month's hackathon
05:46 mrsaturn I have the same birthday as Gaius Julius Caesar Augustus Germanicus
05:54 donri Although I have taken the form of Gaius Caligula, I am all men as I am no man and therefore I am a god! *throwing around random only-obscurely relevant quotes*
05:57 donri how close are PGE to perl 6 rules, and does rakudo use them so that regexes in rakudo are compiled not merely interpreted?
06:01 pugs_svn r28221 | jimmy++ | [t/spec/S04-statements/gather.t]fix typo
06:03 wayland76 methinks Gaius Caligula needed to read Manalive by G. K. Chesterton :)
06:04 wayland76 donri: I think Perl6 uses the PGE stuff, but not sure -- ask pmichaud for a definitive answer
06:22 jhuni joined #perl6
06:40 redicaps joined #perl6
06:41 orafu joined #perl6
07:08 masak joined #perl6
07:09 masak @@summon messages
07:09 phenny masak: 11 Sep 18:04Z <TimToady> tell masak I particularly like the slide with "(this step requires ingenuity)" which is obviously the ??? before Profit!
07:09 phenny masak: 11 Sep 18:10Z <TimToady> tell masak also, we're missing the list split primitive; I wonder if two more or slurpy arrays in a binding should auto-split a list
07:09 masak I'm on a bus.
07:09 masak I won't stay online for long, because the wifi is eating too much battery.
07:10 masak I just stopped by to say hi, because I like saying hi from a bus. :)
07:10 wayland76 masak: Hi to a bus!
07:10 masak :)
07:10 masak another slogan for Perl 6:
07:10 masak "Perl 6 - bringing you the singularity since 2001"
07:11 [particle]1 joined #perl6
07:11 wayland76 s/2001/2010/ :)
07:12 masak wayland76: heh, you're just a late adopter, then. :P
07:12 wayland76 Good idea though :)
07:12 masak now, if you'll excuse me, I'll go offline to figure out how to hack continuations into Perl 6. :P
07:19 ejs joined #perl6
07:27 c9s_ joined #perl6
07:41 meppl joined #perl6
08:04 Su-Shee joined #perl6
08:04 Su-Shee good morning. :)
08:04 phenny Su-Shee: 09 Sep 20:22Z <moritz_> tell Su-Shee http://rakudo.spreadshirt.net/de/DE/Shop/Index/ Perl 6 goodies without horrible shipping costs. Sadly spreadshirt.de doesn't allow images on dark t-shirts (wtf?)
08:04 lambdabot Title: Rakudo
08:04 Su-Shee *hrhrhr* :)
08:16 Jedai joined #perl6
08:28 carlin joined #perl6
08:51 abra joined #perl6
08:54 sundar_ joined #perl6
08:59 |Jedai| joined #perl6
09:02 jauaor joined #perl6
09:05 sundar_ joined #perl6
09:25 sharada joined #perl6
09:29 JimmyZ joined #perl6
09:36 mikehh rakudo (3b63817) builds on parrot r41223 - make test PASS / make spectest (up to 28221) FAIL - Ubuntu 9,04 i386 (gcc)
09:36 mikehh rakudo - 1 direct fail - t/spec/S12-introspection/walk.rakudo - Non-zero exit status: 1 - Parse errors: Bad plan.  You planned 10 tests but ran 8.
09:37 mikehh rakudo - ./perl6 t/spec/S12-introspection/walk.rakudo - fails with (after ok 8): set_pmc() not implemented in class 'Failure'
09:37 mikehh rakudo - t/spec/S03-operators/arith.rakudo - TODO passed:   131
09:37 mikehh rakudo - t/spec/S12-attributes/class.rakudo and t/spec/S14-roles/basic.rakudo - Non-zero wait status: 11 (Segfault after passing tests)
09:40 nsh_ joined #perl6
09:45 wayland76 Su-Shee: On a dark shirt, you first have to print the whole image with white paint, then put the other on top.  On a light shirt, you just apply one batch of colour.
09:46 M_o_C joined #perl6
09:46 Su-Shee I'll make me a "rakudo starlet" shirt in april. :)
09:50 carlin I want a Perl 6 shirt, but, as much as I like Camelia, I'm not wearing one with a butterfly on it ;) Maybe the Rakudo one though
10:03 Patterner I'm man enough to wear it :)
10:04 Su-Shee *haha* :)
10:06 carlin joined #perl6
10:16 JimmyZ joined #perl6
10:18 abra joined #perl6
10:22 Whiteknight joined #perl6
10:28 Juerd carlin: What's wrong with wearing a shirt with a butterfly?
10:31 carlin Juerd: Nothing, but since other people don't realise that, it would garner funny looks
10:32 Juerd It'll give you and them something to talk about :)
10:33 |Jedai| joined #perl6
10:36 jferrero joined #perl6
10:48 Patterner It's a chick magnet for sure.
10:50 nsh- joined #perl6
10:55 carlin Indeed
10:55 carlin If only it was also wearable by males ...
10:57 icwiener joined #perl6
11:03 masak joined #perl6
11:03 masak a t-shirt with a large hen on it might also be a chick magnet...
11:05 wayland76 ...if the chick in question has imprinted on t-shirts instead of hens
11:06 JimmyZ rakudo: while (1,2,3) -> $foo { ($foo * 2).say; }
11:06 p6eval rakudo 446d49:
11:06 p6eval ..OUTPUT«6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6​␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6​␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6​␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6​␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6␤6�
11:06 Juerd JimmyZ: for, perhaps?
11:06 * masak imagines 10 chicklets following some t-shirt around wherever it goes
11:06 JimmyZ rakudo: while (1,2,3) -> $foo { ($foo.say; }
11:06 p6eval rakudo 446d49: OUTPUT«Unable to parse block; couldn't find final '}' at line 2, near "($foo.say;"␤in Main (src/gen_setting.pm:3469)␤»
11:06 JimmyZ rakudo: while (1,2,3) -> $foo { $foo.say; }
11:07 p6eval rakudo 446d49:
11:07 p6eval ..OUTPUT«123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤​123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤1​23␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤12​3␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123​␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤​123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123�
11:08 JimmyZ rakudo: sub bar { return 1,2,3 }; while bar() -> $foo { $foo.say; }
11:08 p6eval rakudo 446d49: OUTPUT«too many arguments passed (3) - at most 1 param expected␤in sub bar (/tmp/kLEpvj1H79:2)␤called from Main (/tmp/kLEpvj1H79:2)␤»
11:08 masak JimmyZ: (1) parens not needed, (2) the list will scalarify into $foo
11:08 masak um, strike 'scalarify'. it'll simply be stored in $foo. of course.
11:08 masak JimmyZ: that's 'return' complaining.
11:08 JimmyZ Juerd: I just test while;
11:08 JimmyZ rakudo: sub bar { 1,2,3 }; while bar() -> $foo { $foo.say; }
11:08 p6eval rakudo 446d49:
11:08 p6eval ..OUTPUT«123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤​123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤1​23␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤12​3␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123​␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤​123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123�
11:08 masak JimmyZ: Rakudo's version of return is multival-challenged.
11:09 JimmyZ masak: I can't understand how to use while someting() -> thing { ... }
11:10 JimmyZ rakudo: sub bar { 1,2,3 }; while bar() { $^foo.say; }
11:10 masak JimmyZ: why, like you just did.
11:10 p6eval rakudo 446d49:
11:10 p6eval ..OUTPUT«123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤​123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤1​23␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤12​3␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123​␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤​123␤123␤123␤123␤123␤123␤123␤123␤123␤123␤123�
11:10 JimmyZ rakudo: sub bar { 1,2,3 }; while bar() { $^foo.say; $^baz.say; }
11:10 masak JimmyZ: but it doesn't seem to do what you want, which is another thing.
11:10 Juerd I don't understand why you'd use while with a constant :)
11:10 p6eval rakudo 446d49: OUTPUT«too few arguments passed (1) - 2 params expected␤in Main (/tmp/HS4jUTj9Vc:2)␤»
11:10 JimmyZ masak: yes.
11:11 masak JimmyZ: 'while' works just like the English word 'while'. it continues looping while some condition is true.
11:11 JimmyZ Juerd: That is from S04.
11:11 masak JimmyZ: the condition in your case is the list 1,2,3. as such, it is a constant, like Juerd said.
11:11 avar Odd. I hadn't noticed those semantics in the English word "while" :)
11:11 masak JimmyZ: and that constant is always true.
11:12 JimmyZ masak: how to use while someting() -> thing { ... } correctly?
11:12 avar rakudo: sub bar { 1,2,3 }; for bar() { .say; }
11:12 p6eval rakudo 446d49: OUTPUT«1␤2␤3␤»
11:12 masak avar: 'make the beds while I do the dishes' means 'as long as I keep doing the dishes, keep making the beds'. roughly. :)
11:12 avar perhaps you want this?
11:12 JimmyZ avar: not, I think.
11:12 masak JimmyZ: your question is strange, because you're obviously creating compiling code already.
11:13 masak JimmyZ: thus, for any definition of 'correctly' that I can think of, you're already doing it.
11:13 masak JimmyZ: could you not just explaing what it is you want to do instead?
11:13 masak s/ng/n/
11:13 Juerd masak: It gets interesting if you add "While you're at it, do the laundry"
11:14 JimmyZ masak: that is, It didn't work as I expected.
11:14 masak rakudo: my ($you, $it, $laundry); while ($you.at($it)) { $laundry.do };
11:14 p6eval rakudo 446d49: OUTPUT«Method 'at' not found for invocant of class 'Failure'␤»
11:14 masak JimmyZ: it worked as I expected.
11:15 Juerd Keep making the beds, and doing the laundry, in parallel, as long as I'm doing the dishes. Weird!
11:15 masak JimmyZ: what were your expectations?
11:15 JimmyZ masak: or I don't know what is the meaning about "while something() -> $thing { .... }"
11:15 masak JimmyZ: no, I don't think you do.
11:15 masak JimmyZ: the crucial question is what ends up in $thing, right?
11:15 masak JimmyZ: now what ends up in $thing is the value of something().
11:16 masak JimmyZ: in your case, the list 1,2,3.
11:16 masak JimmyZ: every... single... time. :)
11:16 JimmyZ yes
11:16 Juerd Confused by Perl 5's weird while-readline?
11:16 masak JimmyZ: why wasn't that what you expected?
11:16 masak Juerd: ah! that might be it! :)
11:16 masak a war veteran.
11:17 JimmyZ masak: because the output   has no meaning.
11:17 jferrero joined #perl6
11:17 Juerd I've never liked iterators.
11:17 Juerd Except for :)
11:18 JimmyZ masak: Is there a meanging example for use it?
11:18 masak JimmyZ: that's the same as saying it's not what you expected.
11:18 masak JimmyZ: by the way, you still haven't spelled out what it was you expected from your program.
11:19 JimmyZ masak: I expected a meaningful example.
11:20 JimmyZ masak: not just my program.
11:21 masak rakudo: my $a = 0; while $a < 10 { say $a++ }; say "presto!"
11:21 p6eval rakudo 446d49: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤presto!␤»
11:21 masak JimmyZ: that's how 'while' works.
11:21 JimmyZ rakudo: my $a = 0; while $a < 10 { say $a++; $^foo.say };
11:22 p6eval rakudo 446d49: OUTPUT«0␤1␤1␤1␤2␤1␤3␤1␤4␤1␤5␤1␤6␤1␤7␤1␤8␤1␤9␤1␤»
11:22 JimmyZ rakudo: my $a = 8; while $a < 10 { say $a++; $^foo.say };
11:22 masak JimmyZ: now, the clue to what each '1' means there...
11:22 p6eval rakudo 446d49: OUTPUT«8␤1␤9␤1␤»
11:22 Chillance joined #perl6
11:22 masak JimmyZ: ...is realizing that the value of '$a < 10' is True (or 1) as long as the loop runs.
11:23 JimmyZ masak: It bind the result to any $^foo var.
11:23 masak JimmyZ: 对
11:23 masak does that make sense to you?
11:23 JimmyZ masak: just like while ( $result = func() ) { $result.say; }
11:23 masak right.
11:24 masak no need for the parens.
11:25 JimmyZ rakudo: my $a =8; while my $b = $a < 10 { $b.say; }
11:25 p6eval rakudo 446d49:
11:25 p6eval ..OUTPUT«1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1​␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1​␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1​␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1​␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1�
11:25 JimmyZ rakudo: my $a =8; while my $b = $a++ < 10 { $b.say; }
11:25 p6eval rakudo 446d49: OUTPUT«1␤1␤»
11:26 JimmyZ masak: thanks ;)
11:26 masak any time. :)
11:26 JimmyZ rakudo: my $a =8; while $a++ < 10 { $^_.say; }
11:26 p6eval rakudo 446d49: OUTPUT«1␤1␤»
11:27 agentzh joined #perl6
11:29 l3thal joined #perl6
11:30 l3thal left #perl6
11:35 masak rakudo: sub han-numeral-to-digit($h) { '一二三四五六七八九'.index($h) }; say han-numeral-to-digit('七')
11:35 p6eval rakudo 446d49: OUTPUT«6␤»
11:35 masak oops. off-by-one.
11:36 masak rakudo: sub han-numeral-to-digit($h) { '〇一二三四五六七八九'.index($h) }; say han-numeral-to-digit('七')
11:36 p6eval rakudo 446d49: OUTPUT«7␤»
11:36 masak :)
11:40 carlin bah, putty + screen + irssi = utf-8 fail
11:41 Chillance joined #perl6
11:45 icwiener_ joined #perl6
11:46 masak` joined #perl6
11:53 masak`` joined #perl6
12:09 Chillance_ joined #perl6
12:10 Zloyrusskiy joined #perl6
12:14 masak``` joined #perl6
12:37 jnthn oh hai
12:42 sharada joined #perl6
12:42 abra_ joined #perl6
12:42 abra_ joined #perl6
12:43 JimmyZ joined #perl6
12:48 abra joined #perl6
12:53 pmurias joined #perl6
12:53 lisppaste3 colomon pasted "Patch that breaks t/spec/S32-io/IO-Socket-INET.t" at http://paste.lisp.org/display/86974
12:53 JimmyZ rakudo: my $a = 1; repeat while $a< 10 { $a++.say; }
12:53 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near ".say; }"␤in Main (src/gen_setting.pm:3469)␤»
12:54 jnthn std: my $a = 1; repeat while $a< 10 { $a++.say; }
12:54 p6eval std 28221: OUTPUT«[31m===[0mSORRY![31m===[0m␤(Possible runaway string from line 1)␤Unable to parse quote-words subscript; couldn't find right angle quote at /tmp/ICI0C9bqJD line 1 (EOF):␤------> [32ma = 1; repeat while $a< 10 { $a++.say; }[33m⏏[31m<EOL>[0m␤FAILED 00:03 38m␤»
12:54 JimmyZ rakudo: my $a = 1; repeat while $a< 10 { ($a++).say; }
12:54 p6eval rakudo 446d49: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤»
12:54 colomon Does anyone out there see why that patch would break IO-Socket-INET.t?
12:54 JimmyZ rakudo: my $a = 1; while $a< 10 { ($a++).say; }
12:54 p6eval rakudo 446d49: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤»
12:55 colomon Maybe there's another sec command out there somewhere?
12:55 colomon I will be afk for an hour or so.
12:55 jnthn colomon: Does it make it fail consistently? I occasionally see randm fails on that test file.
12:56 JimmyZ rakudo: my $a = 1; repeat while $a< 10 { $^a.say; }
12:56 zloyrusskiy joined #perl6
12:56 p6eval rakudo 446d49: OUTPUT«Null PMC access in find_method()␤in Main (/tmp/D6TEWetACE:2)␤»
12:56 JimmyZ rakudo: my $a = 1; while $a< 10 { $^a.say; }
12:56 p6eval rakudo 446d49: OUTPUT«1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1​␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1​␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤»
12:57 JimmyZ rakudo: my $a = 1; while $a++< 10 { $^a.defined.say; }
12:57 p6eval rakudo 446d49: OUTPUT«1␤1␤1␤1␤1␤1␤1␤1␤1␤»
12:57 zloyrusskiy joined #perl6
12:59 JimmyZ rakudo: my $a = 1; repeat while $a< 10 { $^a.defined.say; }
12:59 p6eval rakudo 446d49: OUTPUT«Null PMC access in find_method()␤in Main (/tmp/UO6woc3c4r:2)␤»
13:00 JimmyZ std: my $a = 1; repeat while $a< 10 { $^a.defined.say; }
13:00 p6eval std 28221: OUTPUT«[31m===[0mSORRY![31m===[0m␤(Possible runaway string from line 1)␤Unable to parse quote-words subscript; couldn't find right angle quote at /tmp/XQYRGb8Eox line 1 (EOF):␤------> [32mrepeat while $a< 10 { $^a.defined.say; }[33m⏏[31m<EOL>[0m␤FAILED 00:03 38m␤»
13:14 rdice joined #perl6
13:19 Chillance joined #perl6
13:29 pmurias joined #perl6
13:31 jaldhar joined #perl6
13:36 sm joined #perl6
13:44 M_o_C joined #perl6
13:46 masak joined #perl6
13:46 masak I smell a Null PMC access in the Force...
13:46 masak joined #perl6
13:46 masak rakudo: repeat while True {}
13:47 p6eval rakudo 446d49:  ( no output )
13:47 masak rakudo: my $a = 1; repeat while $a< 10 { $^a.defined.say;
13:47 masak oops.
13:47 masak rakudo: my $a = 1; repeat while $a< 10 { $^a.defined.say; }
13:48 p6eval rakudo 446d49: OUTPUT«Unable to parse block; couldn't find final '}' at line 2, near ""␤in Main (src/gen_setting.pm:3469)␤»
13:48 p6eval rakudo 446d49: OUTPUT«Null PMC access in find_method()␤in Main (/tmp/cBCo5MtLpF:2)␤»
13:48 * masak submits rakudobug
13:49 masak phenny: tell jnthn Please put your "Solved in Perl 6" talk slides online soon, so that those of us who weren't fortunate enough to be in Japan at the time can enjoy it, too!
13:49 phenny masak: I'll pass that on when jnthn is around.
13:49 edenc seen ruoso?
13:50 masak @seen ruoso
13:50 lambdabot I saw ruoso leaving #perl6 3m 16d 15h 37m 55s ago, and .
13:50 edenc blargh
13:51 sm` joined #perl6
13:53 patspam joined #perl6
13:56 JimmyZ masak: Do you hide yourself?
14:02 pmurias edenc: do you need any smop help/info?
14:03 edenc pmurias: not really, I'm just chasing ruoso down
14:04 edenc pmurias: actually, I do, but not right this moment :)
14:04 JimmyZ rakudo: my $a = 1; repeat while $a< 10 -> $b { $b.defined.say; }
14:04 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near "$b { $b.de"␤in Main (src/gen_setting.pm:3469)␤»
14:04 JimmyZ masak: Is it a bug?
14:05 TimToady I will be offline most of today; driving to SoCal
14:05 colomon Update on my own issue: The problem is apparently defining Any.sec as a trig function.
14:06 JimmyZ rakudo: my $a = 1; while $a< 10 -> $b { $b.defined.say; }
14:06 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near "$b { $b.de"␤in Main (src/gen_setting.pm:3469)␤»
14:07 JimmyZ rakudo: my $a = 1; while $a<10{ $^b.defined.say; }
14:07 p6eval rakudo 446d49: OUTPUT«too few arguments passed (0) - 1 param expected␤in Main (/tmp/4dbj4yEVuE:0)␤»
14:08 carlin rakudo: my $a = 1; while ($a < 10) -> $b { say $b.defined; $a++; };
14:08 p6eval rakudo 446d49: OUTPUT«1␤1␤1␤1␤1␤1␤1␤1␤1␤»
14:08 carlin JimmyZ: Is that what you wanted?
14:08 JimmyZ rakudo: my $a = 1; while $a< 10 -> $b { $b.defined.say; };
14:09 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near "$b { $b.de"␤in Main (src/gen_setting.pm:3469)␤»
14:10 zloyrusskiy joined #perl6
14:14 JimmyZ carlin: yes
14:15 JimmyZ rakudo: my $a = 1; while $a<2 { $a++ }
14:15 p6eval rakudo 446d49:  ( no output )
14:15 JimmyZ rakudo: my $a = 1; repeat while $a<2 { $a++ }
14:15 p6eval rakudo 446d49:  ( no output )
14:15 JimmyZ rakudo: my $a = 1; repeat while $a<2 -> $b { $a++ }
14:15 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near "$b { $a++ "␤in Main (src/gen_setting.pm:3469)␤»
14:15 JimmyZ rakudo: my $a = 1; repeat while $a < 2 -> $b { $a++ }
14:15 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near "-> $b { $a"␤in Main (src/gen_setting.pm:3469)␤»
14:16 JimmyZ rakudo: my $a = 1; repeat while $a < 2 -> $b { $a++ };
14:16 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near "-> $b { $a"␤in Main (src/gen_setting.pm:3469)␤»
14:16 JimmyZ rakudo: my $a = 1; repeat while $a < 2 -> $b { $a++; }
14:16 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near "-> $b { $a"␤in Main (src/gen_setting.pm:3469)␤»
14:16 JimmyZ rakudo: my $a = 1; repeat while $a < 2 -> $b { $a++; };
14:16 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near "-> $b { $a"␤in Main (src/gen_setting.pm:3469)␤»
14:16 JimmyZ rakudo: my $a = 1; repeat while ($a<2) -> $b { $a++; };
14:16 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near "$b { $a++;"␤in Main (src/gen_setting.pm:3469)␤»
14:16 JimmyZ rakudo: my $a = 1; repeat while ($a < 2) -> $b { $a++; };
14:16 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near "-> $b { $a"␤in Main (src/gen_setting.pm:3469)␤»
14:17 justatheory joined #perl6
14:25 carlin rakudo: repeat while something() -> $thing { say 'NYI?'; };
14:25 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near "-> $thing "␤in Main (src/gen_setting.pm:3469)␤»
14:25 carlin std: repeat while something() -> $thing { say 'NYI?'; };
14:25 p6eval std 28221: OUTPUT«Undeclared routine:␤   something used at 1␤ok 00:03 38m␤»
14:28 carlin ah, yes, the test is fudged in rakudo
14:31 JimmyZ a example:
14:31 JimmyZ rakudo: my $a = 1; while ($a<10) -> $b { say $b.defined; $a++; }
14:31 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near "$b { say $"␤in Main (src/gen_setting.pm:3469)␤»
14:31 JimmyZ rakudo: my $a = 1; while ($a < 10) -> $b { say $b.defined; $a++; }
14:31 p6eval rakudo 446d49: OUTPUT«1␤1␤1␤1␤1␤1␤1␤1␤1␤»
14:32 JimmyZ another:
14:32 JimmyZ rakudo: my $a = 1; while $a<10{ $^b.defined.say; };
14:32 p6eval rakudo 446d49: OUTPUT«too few arguments passed (0) - 1 param expected␤in Main (/tmp/gUZ1M5sNW3:0)␤»
14:32 JimmyZ rakudo: my $a = 1; while $a<10 { $^b.defined.say; };
14:32 jferrero joined #perl6
14:32 p6eval rakudo 446d49:
14:32 p6eval ..OUTPUT«1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1​␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1​␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1​␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1​␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1�
14:33 JimmyZ that may be a bug.
14:38 zloyrusskiy joined #perl6
14:43 JimmyZ rakudo: my $a = 1; while $a<10 -> $b { say $b.defined; $a++; }
14:43 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near "$b { say $"␤in Main (src/gen_setting.pm:3469)␤»
14:43 JimmyZ rakudo: my $a = 1; while $a < 10 -> $b { say $b.defined; $a++; }
14:43 p6eval rakudo 446d49: OUTPUT«1␤1␤1␤1␤1␤1␤1␤1␤1␤»
14:45 c9s_ joined #perl6
14:47 Psyche^ joined #perl6
14:47 osvaldo joined #perl6
15:00 __ash__ joined #perl6
15:02 fridim_ joined #perl6
15:02 nihiliad joined #perl6
15:07 wlamagna joined #perl6
15:08 Guest44537 joined #perl6
15:19 JimmyZ joined #perl6
15:25 JimmyZ rakudo: my $a = 1; repeat while $a < 10 { $a++.say; }
15:25 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near ".say; }"␤in Main (src/gen_setting.pm:3469)␤»
15:29 JimmyZ std: class Alpha { has @!a = < beta gamma >; method postcircumfix:<[ ]>($key) { return @!a[$key]; }; }; my $a = Alpha.new; say $a[1];
15:29 p6eval std 28221: OUTPUT«ok 00:03 40m␤»
15:29 JimmyZ rakudo: class Alpha { has @!a = < beta gamma >; method postcircumfix:<[ ]>($key) { return @!a[$key]; }; }; my $a = Alpha.new; say $a[1];
15:29 p6eval rakudo 446d49: OUTPUT«No such attribute '@!a'␤in method Alpha::postcircumfix:[ ] (/tmp/gxkKQ4x8zm:2)␤called from method Alpha::postcircumfix:[ ] (/tmp/gxkKQ4x8zm:2)␤called from Main (/tmp/gxkKQ4x8zm:2)␤»
15:29 JimmyZ rakudo: class Alpha { has @!a = < beta gamma >; method postcircumfix:<{ }>($key) { return @!a[$key]; }; }; my $a = Alpha.new; say $a{1};
15:29 p6eval rakudo 446d49: OUTPUT«gamma␤»
15:30 JimmyZ A bug?
15:33 JimmyZ rakudo: class Alpha { has @!a = < beta gamma >; method postcircumfix:<( )>($key) { return @!a[$key]; }; }; my $a = Alpha.new; say $a(1);
15:33 p6eval rakudo 446d49: OUTPUT«gamma␤»
15:33 JimmyZ rakudo: class Alpha { has @!a = < beta gamma >; method infix:<~>($key) { return @!a[$key]; }; }; my $a = Alpha.new; say $a~1;
15:33 p6eval rakudo 446d49: OUTPUT«Alpha()<0xb689c8c8>1␤»
15:39 abra joined #perl6
15:48 osvaldo hi everyone, i'm trying to run some examples and keep on getting this error message:
15:48 osvaldo perl6 examples/files/read_file.p6
15:48 osvaldo Method 'readline' not found for invocant of class 'IO'
15:48 osvaldo any idea what might be happening?
15:51 s1n osvaldo: doesn't look like readline is in the spec anymore
15:52 avar I think it's .get now
15:52 avar ol .getline
15:52 osvaldo ah, ok, so the examples might just be too old then? s1n?
15:52 s1n osvaldo: yes, the standard is a moving target
15:53 osvaldo s1n: thks!!
15:53 JimmyZ osvaldo: that might be not implemented .
15:54 s1n osvaldo: http://perlcabal.org/syn/S32/IO.h​tml#IO%3A%3AReadable%3A%3AEncoded
15:54 s1n looks like avar is right
15:54 lambdabot Title: S32::IO, http://tinyurl.com/oox6bm
15:55 osvaldo thks! i'll check that
16:00 silug joined #perl6
16:05 zamolxes joined #perl6
16:09 cmv joined #perl6
16:13 mberends joined #perl6
16:21 carlin joined #perl6
16:21 PacoLinux joined #perl6
16:24 synth^2 joined #perl6
16:35 diakopter joined #perl6
16:38 diakopter joined #perl6
16:38 frew_ joined #perl6
16:42 diakopter joined #perl6
16:44 diakopter joined #perl6
16:46 diakopter joined #perl6
17:00 wtgee joined #perl6
17:13 snearch joined #perl6
17:15 sevvie joined #perl6
17:19 Whiteknight joined #perl6
17:24 explorer__ joined #perl6
17:28 mikehh joined #perl6
17:45 synth joined #perl6
17:47 zamolxes joined #perl6
17:47 Zloy_russkiy joined #perl6
17:55 yath joined #perl6
17:55 yath heya
17:55 mberends hi yath
17:56 yath hi mberends
17:57 frew_ joined #perl6
17:58 diakopter joined #perl6
17:59 diakopter rakudo: say "\"
17:59 p6eval rakudo 446d49: OUTPUT«say requires an argument at line 2, near " \"\\\""␤in Main (src/gen_setting.pm:2565)␤»
17:59 colomon You, doing big compiles in a Windows virtual machine while running Rakudo spectests in another window really eats the laptop's battery...
18:00 diakopter std: say "\"
18:00 colomon s/You/You know/  # apparently losing ability to type
18:00 p6eval std 28221:  ( no output )
18:02 colomon rakudo: say "\""
18:02 p6eval rakudo 446d49: OUTPUT«"␤»
18:02 diakopter rakudo: say ""
18:03 p6eval rakudo 446d49: OUTPUT«␤»
18:03 diakopter "\"
18:03 diakopter rakudo: "\"
18:03 p6eval rakudo 446d49: OUTPUT«Syntax error at line 2, near "\"\\\""␤in Main (src/gen_setting.pm:3469)␤»
18:04 mberends heh, say "\\" segfaults here after printing a \
18:04 diakopter I wonder what it parsed "\" as
18:04 colomon It's an incomplete parse, right?
18:04 diakopter rakudo: say "\\"
18:04 p6eval rakudo 446d49: OUTPUT«\␤»
18:04 mberends probably escaped the second " and then had a runaway string
18:05 diakopter it got to "say requires an argument at line 2" with an incomplete parse?
18:05 mberends yeah
18:06 colomon Runaway string, as mberends says... maybe Rakudo just throws it away?
18:06 colomon Certainly should be a better error message.
18:06 mberends like an EOF while trying to finish the string for the say
18:06 diakopter rakudo: say "
18:06 p6eval rakudo 446d49: OUTPUT«say requires an argument at line 2, near " \""␤in Main (src/gen_setting.pm:2565)␤»
18:06 diakopter rakudo: say "\
18:06 p6eval rakudo 446d49: OUTPUT«say requires an argument at line 2, near " \"\\"␤in Main (src/gen_setting.pm:2565)␤»
18:06 diakopter rakudo: say("\)
18:07 p6eval rakudo 446d49: OUTPUT«say requires an argument at line 2, near "(\"\\)"␤in Main (src/gen_setting.pm:2565)␤»
18:07 mberends diakopter you are becoming evil
18:08 diakopter ok...
18:09 diakopter rakudo: say(
18:09 p6eval rakudo 446d49: OUTPUT«say requires an argument at line 2, near "("␤in Main (src/gen_setting.pm:2565)␤»
18:09 diakopter rakudo: say()
18:09 p6eval rakudo 446d49: OUTPUT«say requires an argument at line 2, near ""␤in Main (src/gen_setting.pm:2582)␤»
18:10 diakopter rakudo: say(())
18:10 p6eval rakudo 446d49: OUTPUT«␤»
18:10 mberends hah!
18:10 diakopter rakudo: say(().perl)
18:10 p6eval rakudo 446d49: OUTPUT«undef␤»
18:15 mikehh rakudo (3b63817) builds on parrot r41237 - make test PASS / make spectest (up to 28221) FAIL - Ubuntu 9,04 amd64 (g++)
18:15 mikehh rakudo - 1 direct fail - t/spec/S12-introspection/walk.rakudo - Non-zero exit status: 1 - Parse errors: Bad plan.  You planned 10 tests but ran 8.
18:15 mikehh rakudo - ./perl6 t/spec/S12-introspection/walk.rakudo - fails with (after ok 8): set_pmc() not implemented in class 'Failure'
18:15 mikehh rakudo - t/spec/S03-operators/arith.rakudo - TODO passed:   120, 131-132
18:16 payload joined #perl6
18:17 mikehh also note no segfaults for me on amd64 and also on i386 - t/spec/S03-operators/arith.rakudo - TODO passed:   131
18:18 colomon hey, sweet, I just passed the spectest for the first time in days.  Today's git pull cleared up the lingering errors...
18:20 donri why isn't "my" the default in perl6? it must be the most common scope?
18:20 pugs_svn r28222 | colomon++ | [t/spec] Unfudge now-working tests, overhauled tests for sec and cosec.
18:21 dalek rakudo: 0f1edeb | (Solomon Foster)++ | src/setting/ (3 files):
18:21 dalek rakudo: Remove Any.sec because of conflicts with S32-io/IO-Socket-INET.t, and add Rat.sec and Int.sec to replace it.
18:21 dalek rakudo: I'm not sure why Any.sec fails, but this patch keeps the spectests happy until we can figure out a better approach.
18:21 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/0​f1edeb0959e62338bed60e9e87b5bed65488cc7
18:21 dalek rakudo: 3a48086 | (Solomon Foster)++ | src/setting/Any-num.pm:
18:21 lambdabot Title: Commit 0f1edeb0959e62338bed60e9e87b5bed65488cc7 to rakudo's rakudo - GitHub, http://tinyurl.com/oaq2l4
18:21 dalek rakudo: Implement Any versions of the basic forward trig functions.
18:21 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/3​a480865f6df73ec9e17edd52773aff9fbf0e059
18:21 dalek rakudo: 186cf24 | (Solomon Foster)++ | src/setting/Num.pm:
18:21 lambdabot Title: Commit 3a480865f6df73ec9e17edd52773aff9fbf0e059 to rakudo's rakudo - GitHub, http://tinyurl.com/p2kqht
18:21 dalek rakudo: Add Num.Num method which simply returns self.
18:21 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/1​86cf24ba3a32d0e9f75eceb89ce76a1a2b945b4
18:21 lambdabot Title: Commit 186cf24ba3a32d0e9f75eceb89ce76a1a2b945b4 to rakudo's rakudo - GitHub, http://tinyurl.com/r2ywl4
18:21 diakopter hrm
18:22 colomon donri: Not sure what you mean?  How would you default my?
18:22 colomon (Geez, I think perhaps I need to learn how to compress commits into one before pushing....)
18:22 donri "$x = foo" is automatically "my $x = foo"
18:23 colomon donri: But then how do you know whether $x was intended to be a new variable or an existing one?
18:23 donri didn't know that was relevant :P
18:24 donri wait, undeclare "$x = foo" is not meaningful in perl6? iirc in perl5 it is a global declaration?
18:25 donri vaguely recalling global in perl6 needs a * twigil
18:25 mberends donri: Perl 6 defaults to Perl 5's 'use strict', although in future the immediate execution mode will get a 'no strict'
18:25 colomon If you say "$x = foo" in Perl 5 it declares a global, yes.  Though that is *highly* frowned upon today -- the widely used "use strict" forbids it.
18:26 colomon But you couldn't default "$x = foo" to be a my declaration.   It would make all sorts of common things ambiguous or just plain wrong.
18:27 donri immediate execution mode, is that -e?
18:27 mberends yes, and Rakudo has that
18:28 donri aye, sounds all good then. :)
18:29 sevvie joined #perl6
18:34 abra joined #perl6
18:35 patspam joined #perl6
18:38 wlamagna1 joined #perl6
18:39 wlamagna1 left #perl6
18:40 c9s_ joined #perl6
18:45 tak11 joined #perl6
18:58 wlamagna1 joined #perl6
18:59 wlamagna1 left #perl6
19:11 jferrero joined #perl6
19:11 rhr joined #perl6
19:12 synth joined #perl6
19:23 frew_ joined #perl6
19:26 jaldhar joined #perl6
19:33 dolmen joined #perl6
19:34 synth^2 joined #perl6
19:35 DakeDesu joined #perl6
19:43 jaldhar joined #perl6
20:00 osvaldo left #perl6
20:11 donri joined #perl6
20:24 bgs100 joined #perl6
20:36 rdice joined #perl6
21:06 jaldhar joined #perl6
21:12 zloyrusskiy joined #perl6
21:14 colomon @karma
21:14 lambdabot You have a karma of 1
21:14 colomon @karma all
21:14 lambdabot all has a karma of 0
21:14 frettled colomon++
21:15 colomon :)
21:17 Su-Shee left #perl6
21:17 __ash__ @karma
21:17 lambdabot You have a karma of 0
21:17 __ash__ lol
21:17 frettled @karma moritz_
21:17 lambdabot moritz_ has a karma of 69
21:17 frettled @karma moritz
21:17 lambdabot moritz has a karma of 655
21:17 frettled Just a little bit more work needed to get there.  ;)
21:19 __ash__ hmmmm
21:19 diakopter link on http://rakudo.org/how-to-get-rakudo broken
21:19 lambdabot Title: How to get Rakudo Perl 6 | Rakudo.org
21:19 diakopter url is http://github.com/rakudo/downloads
21:20 diakopter should be http://github.com/rakudo/rakudo/downloads
21:20 lambdabot Title: Downloads for rakudo's rakudo - GitHub
21:22 frew_ joined #perl6
21:23 __ash__ rakudo: role A { method a { say 'hi'; } }; class B does A is also { }; my $b = B.new; $b.B::a; $b.A::a;
21:23 p6eval rakudo 446d49: OUTPUT«Cannot use 'is also' on non-existent class B at line 2, near "; my $b = "␤in Main (src/gen_setting.pm:1654)␤»
21:24 __ash__ akudo: role A { method a { say 'hi'; } }; class B does A { }; my $b = B.new; $b.B::a; $b.A::a;
21:25 __ash__ helps when you spell rakudo right...
21:25 __ash__ rakudo: role A { method a { say 'hi'; } }; class B does A { }; my $b = B.new; $b.B::a; $b.A::a;
21:25 p6eval rakudo 446d49: OUTPUT«hi␤Method '!select' not found for invocant of class 'B'␤»
21:26 __ash__ does anyone here know much about how rakudo pun's stuff internally? roles that is
21:27 alester joined #perl6
21:31 SmokeMachine joined #perl6
21:31 diakopter alester: broken link on /how-to-get-rakudo  (first github url has too few rakudo/)
21:32 alester ok
21:33 * donri just installed rakudo and parrot for the first time. :)
21:34 alester which link?
21:34 alester oh, i see
21:35 alester fixed
21:39 mberends rakudo: class A { method a { say "hi A"; } }; class B is A { method a { say "hi B"; } }; my $b = B.new; $b.a; $b.A::a; # __ash__: works with class, not with role
21:39 p6eval rakudo 446d49: OUTPUT«hi B␤hi A␤»
21:43 donri why does rakudo freeze on "my @L = 0..Inf", is it not supposed to be lazy?
21:44 donri or is it because i'm in the interpreted shell where it wants to print the list or something
21:44 mberends donri: laziness is Not Yet Implemented
21:44 donri aha
21:45 __ash__ mberends i know it works with a class, but it _should_ work with roles too, but there is a problem with how it pun's the role into an object, or thats what I have been lead to believe
21:47 mberends __ash__, you're probably right. this is the sort of thing jnthn++ usually takes care of
21:48 __ash__ he's the one that told me it was a problem with how its punned
21:50 mberends rakudo: my $L = 0..Inf; $L.WHAT.say; # donri: not quite the same thing, but may be useful to you
21:50 p6eval rakudo 446d49: OUTPUT«Range()␤»
21:51 donri thanks, though i'm just playing
21:51 mberends oh hai frettled
21:51 mikehh rakudo (0f1edeb) builds on parrot r41241 - make test PASS / make spectest (up to 28222) FAIL - Ubuntu 9.04 amd64
21:51 mikehh rakudo - t/spec/S12-introspection/walk.rakudo FAILS and t/spec/S03-operators/arith.rakudo - TODO passed:   120, 131-132
21:51 frettled good evening, mberends :D
21:53 * mberends is hacking a (broken) installed-modules branch of proto
21:54 * frettled is doing nothing useful, just browsing websites for possible euroshopping of bicycle and/or parts -- I'll be visiting Abigail in a week.
21:55 markmont joined #perl6
21:55 donri is perl6 intended to have open classes?
21:56 frettled Open classes -- as in everything being public by default?  If so, no.
21:56 frettled You have to specify whether something is public.
21:56 donri i mean, you can reopen an existing class to add methods and whatnot to it
21:57 mberends the 'augments' keyword allows you to add more to a class definition. The old syntax was 'is also' and has not been replaced in Rakudo afaik
21:57 donri rakudo: class Test {} class Test { method foo() { return "ok!" } } Test.new.foo
21:58 p6eval rakudo 446d49: OUTPUT«Confused at line 2, near "class Test"␤in Main (src/gen_setting.pm:3469)␤»
21:58 mberends Less Than Awesome error message :/
21:58 donri how do you use augments(is also?
21:58 donri s/(/\//
22:00 mberends rakudo: class Test {}; class Test is also { method foo() { return "ok!" } }; Test.new.foo.say
22:00 p6eval rakudo 446d49:  ( no output )
22:01 mberends try it locally with perl6 -e, it was ok here
22:02 donri can you add your own "instructions" for class bodies, like class Foo is InheritingSomething { do_this_thing args...; }
22:04 mberends that would behave as if InheritingSomething is another class or role
22:04 mberends donri: you may want http://www.perlcabal.org/syn/S14.html
22:04 lambdabot Title: S14
22:04 donri the idea is that InheritingSomething defines do_this_thing as a class method and class bodies are executable so in the context of Foo it knows do_this_thing
22:05 donri (ruby does this alot. i'm looking for arguments to convince ruby folk of perl6 awesomeness. :))
22:06 mberends donri: fine examples http://www.jnthn.net/papers/2​009-yapc-eu-roles-slides.pdf
22:07 lambdabot Title: Microsoft PowerPoint - 2009-yapc-eu-roles
22:08 mberends all of jnthn++'s talks: http://www.jnthn.net/articles.shtml
22:08 lambdabot Title: Jonathan Worthington :: Articles And Papers
22:23 M_o_C joined #perl6
22:23 tak11 joined #perl6
22:43 frew_ joined #perl6
23:24 tak11 joined #perl6
23:37 donri something neat in ruby is File.open{} ensures the handle is closed after the block, will perl6 have something like that?
23:40 donri something neat in haskell is getContents which corresponds to slurp is lazy so you can use it on a big file and it only reads what you request, will slurp do that?
23:44 TimToady you can close a handle with a 'will leave' trait on the declaration
23:44 TimToady does getContents break into lines?
23:44 donri huh, how does that work
23:45 donri no (though maybe there is something for that too)
23:45 TimToady okay, but it's a string represented as a list, right?
23:46 TimToady we don't have lazy strings in Perl 5, but if you want to read a file char by char, that could be done lazily
23:46 donri well, strings in haskell are lists of Char
23:46 TimToady lines() is lazy
23:46 TimToady and I think .comb on a filehandle should be lazy eventually
23:46 TimToady though I doubt rakudo does that
23:47 donri how does 'will leave' work?
23:48 TimToady my $fh will leave {.close} = open $file;
23:48 TimToady is equiv to
23:48 TimToady my $fh = open $file;
23:48 TimToady LEAVE { $fh.close }
23:48 donri and, sorry, what is LEAVE{}?
23:48 TimToady S04 is where these are discussed
23:49 donri aye
23:49 TimToady always executes on leaving the current block
23:49 TimToady there are many variants
23:49 TimToady see the section labelled "Closure traits"
23:49 donri so you could simply scope it with {} attach to nothing in particular
23:49 donri and it would correspond to the ruby way?
23:50 donri though abit verbose for that
23:53 TimToady if you don't do anything with a filehandle, and don't care exactly when it closes, it we close when the filehandle is garbage collected
23:53 TimToady you only have to close it explicitly if you care about the exact timing
23:53 donri but it's good practice to make sure it's closed when you don't need it right?
23:54 dukeleto joined #perl6
23:54 donri or i don't really know why that would be important
23:54 donri an open handle isn't really blocking is it?
23:54 TimToady well, you might have race conditions if you want to reopen the file

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

Perl 6 | Reference Documentation | Rakudo