»ö« 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! | Rakudo Star Released!
Set by diakopter on 6 September 2010.
00:36 Chillance joined 00:39 patspam joined 00:55 Limbic_Region joined
Limbic_Region can anyone tell me where the synopses live these days? They used to be linked on dev.perl.org but not so anymore 00:57
at least I couldn't find em
nevermind - found them
had to go to www.perl6.org/ and then to perlcabal.org/syn/ 00:58
\xF0 :D
that's the first google result for me 00:59
diakopter .g me 01:02
phenny diakopter: www.me.com/
\xF0 diakopter: by "me" I mean my legal name, of course, "Perl 6. Synopses" 01:04
ash_ try.rakudo.org/ is useful if you want to try out rakudo 01:05
diakopter heh
01:06 Limbic_Region left 01:07 mjk joined
diakopter ... 01:10
Stub code executed
in main program body at line 1
Rakudo REPL has closed... restarting
ash_: ^^
(is that intended?) 01:11
ash_ what input did you put in?
diakopter ...
ash_ if you kill rakudo for some reason, it automattically restarts
oh, ya, that was a fail
diakopter fail
ash_ rakudo: sub a { ... }; my $a = eval 'a'; say $a.WHAT; 01:12
p6eval rakudo 8156be: OUTPUT«Failure()␤»
ash_ Failure in the repl closes it
diakopter oh
ash_ so it caused the repl to exit, so it got restarted as a result
diakopter cool
ash_ rakudo: ... 01:13
p6eval rakudo 8156be: ( no output )
diakopter star: ... 01:14
p6eval star 2010.07: ( no output )
ash_ my guess is that closed too, but i am not sure
diakopter std: ...
p6eval std : OUTPUT«ok 00:01 114m␤»
ash_ rakudo: die 'foo'
diakopter std: ... ...
p6eval rakudo 8156be: OUTPUT«foo␤ in main program body at line 22:/tmp/mSlYdPD3Qm␤»
std : OUTPUT«ok 00:02 115m␤»
diakopter std: ... ... ...
p6eval std : OUTPUT«ok 00:02 115m␤»
[hudnix] hmm, so how do a get a method into a variable to call later? $meth = &.whatever isn't doing it. 01:20
01:24 synth left
ash_ rakudo: sub foo { 'foo' }; my $a = &foo; say $a(); 01:24
p6eval rakudo 8156be: OUTPUT«foo␤»
diakopter yeah but that's not a method 01:25
ash_ it should work the same with methods
TimToady use .can
ash_ std: class A { method a { 'a' }; method b { return self.^can('a'); }; }; say A.new.b 01:30
p6eval std : OUTPUT«ok 00:03 116m␤»
ash_ rakudo: class A { method a { 'a' }; method b { return self.^can('a'); }; }; say A.new.b
p6eval rakudo 8156be: ( no output )
ash_ locally: get_string() not implemented in class 'P6Invocation'
rakudo: class A { method a { 'a' } }; say A.^can('a'); 01:31
p6eval rakudo 8156be: ( no output ) 01:32
01:32 Chillance left 01:33 thowe joined
[hudnix] rakudo: class A {method a {'a'}; method b {my $meth = &.a; say self.$meth}} say A.new.b # my best shot at it 01:34
p6eval rakudo 8156be: OUTPUT«===SORRY!===␤Confused at line 22, near "class A {m"␤»
[hudnix] rakudo: class A {method a {'a'}; method b {my $meth = &.a; say self.$meth}}; say A.new.b 01:37
p6eval rakudo 8156be: OUTPUT«invoke() not implemented in class 'Perl6Str'␤ in 'A::b' at line 22:/tmp/IutXhfVZr4␤ in main program body at line 22:/tmp/IutXhfVZr4␤»
ash_ rakudo: class A { method a { 'a' }; method b { -> { self.a } }; }; say A.new.b.(); 01:38
p6eval rakudo 8156be: OUTPUT«a␤»
[hudnix] sure, but that's just aliasing one method to another 01:39
TimToady rakudo: class A { method a { 'a' } }; say A.^can('a')(A)
p6eval rakudo 8156be: OUTPUT«a␤» 01:40
01:40 leprevost left
ash_ ah, i guess thats what i was doing wrong 01:40
TimToady well, it was returning something weird and parroty that only works by calling it, I guess 01:41
ash_ ah
diakopter rakudo: class A { method a { 'a' } }; say A.^can('a').PARROT 01:42
p6eval rakudo 8156be: OUTPUT«Method 'PARROT' not found for invocant of class 'P6Invocation'␤ in main program body at line 22:/tmp/l0q0Mxo9Ub␤»
[hudnix] rakudo: class A { method a { 'a' } method b {my $meth = self.^can('a'); say self.$meth}}; say A.new.b 01:43
p6eval rakudo 8156be: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤» 01:44
diakopter need ;
[hudnix] rakudo: class A { method a { 'a' }; method b {my $meth = self.^can('a'); say self.$meth}}; say A.new.b
p6eval rakudo 8156be: OUTPUT«a␤1␤»
[hudnix] rakudo: class A { method a { 'a' }; method b {my $meth = self.^can('a'); say self.$meth}}; A.new.b 01:45
p6eval rakudo 8156be: OUTPUT«a␤»
[hudnix] ok
01:51 molaf left
ash_ rakudo: class A { method a { 12 }; method b { return self.^can('a').assuming(self) }; }; my $a = A.new.b 01:52
p6eval rakudo 8156be: OUTPUT«Method 'assuming' not found for invocant of class 'P6Invocation'␤ in 'A::b' at line 22:/tmp/8K_MOysCY4␤ in main program body at line 22:/tmp/8K_MOysCY4␤»
ash_ that seems kinda leaky 01:53
[hudnix] is is there going to be a more robust way to do that sort of thing? a run-time lookup of a stringified method name isn't very appealing. 01:54
ash_ std: class A { method b { 'b' } }; my $a = A.new; my $b = &A::b.assuming($a); say $b(); 01:56
p6eval std : OUTPUT«ok 00:03 123m␤»
ash_ rakudo: class A { method b { 'b' } }; my $a = A.new; my $b = &A::b.assuming($a); say $b(); 01:57
p6eval rakudo 8156be: OUTPUT«Null PMC access in invoke()␤ in main program body at line 1␤»
01:57 ascent_ left
ash_ something like that might work one day 01:57
i am not sure where the Null PMC access is coming from
rakudo: class A { method b { 'b' } }; my $a = A.new; my $b = &A::b.assuming($a); say $b.WHAT
p6eval rakudo 8156be: OUTPUT«Code()␤»
TimToady rakudo: class A { method b { 'b' } }; my $a = A.new; my $b = &A::b.assuming($a); say $b() 01:59
p6eval rakudo 8156be: OUTPUT«Null PMC access in invoke()␤ in main program body at line 1␤»
TimToady &A::b doesn't name method b
not unless you intentionally poke its name into the package namespace
rakudo: class A { our method b { 'b' } }; my $a = A.new; my $b = &A::b.assuming($a); say $b()
p6eval rakudo 8156be: OUTPUT«b␤»
TimToady like that
ash_ ah 02:00
hmm
TimToady but that's considered smelly
ash_ well, i tried :P i duno any way to make that 'prettier'
TimToady use .can, it's the way that knows about inheritance 02:01
ash_ rakudo: say "foo".^methods<split>
p6eval rakudo 8156be: ( no output )
ash_ is there a reason to return an array of methods instead of a hash of methods? 02:02
02:03 ruoso joined
ash_ rakudo: "foo".^methods.grep(* eq 'split').say 02:03
02:03 molaf joined
p6eval rakudo 8156be: OUTPUT«split␤» 02:03
TimToady a hash might make more sense; I could argue it either way 02:04
ash_ its not that much work to find what i am looking for with an array 02:05
but a hash seems to make sense, to me anyway 02:06
02:10 synth joined, leprevost joined 02:12 mjk left 02:20 ggoebel joined 02:27 meppl left, ggoebel left
ash_ i think i fixed the leaky method? maybe... i am testing it 02:39
nope 02:54
this is weird, it doesn't complain about some methods, like ones on core objects
rakudo: say "foo".can("split");
p6eval rakudo 8156be: OUTPUT«split␤»
ash_ rakudo: class A { method a { 1 }}; say A.can("a");
p6eval rakudo 8156be: ( no output )
ash_ returns: get_string() not implemented in class 'P6Invocation' locally 02:55
03:08 ash_ left 03:18 cdarroch left, ash_ joined 03:20 ash__ joined 03:21 ash_ left, ash__ is now known as ash_ 03:25 envi^home joined
ash_ rakudo: class A { multi method a { 1 } }; say A.can('a'); 03:26
p6eval rakudo 8156be: ( no output ) 03:27
03:52 DemoFreak left 03:58 patspam left 04:03 DemoFreak joined 04:13 qw3rty joined
qw3rty hi all 04:13
i was browsing a message board and saw this code....
for 1..60 -> $n { say "n=$n"; for 1..$n { $n %% $^a ?? say "\t$a/" ~ $n/$a !! 0 } } 04:14
ash_ rakudo: for 1..60 -> $n { say "n=$n"; for 1..$n { $n %% $^a ?? say "\t$a/" ~ $n/$a !! 0 } }
p6eval rakudo 8156be: OUTPUT«(timeout)n=2␤ 1/2␤ 2/1␤n=3␤ 1/3␤ 3/1␤n=4␤ 1/4␤ 2/2␤ 4/1␤n=5␤ 1/5␤ 5/1␤n=6␤ 1/6␤ 2/3␤ 3/2␤ 6/1␤n=7␤ 1/7␤ 7/1␤n=8␤ 1/8␤ 2/4␤ 4/2␤ 8/1␤n=9␤ 1/9␤ 3/3␤ 9/1␤n=10␤ 1/10␤ 2/5␤ 5/2␤ 10/1␤n=11␤
..1/11␤ 11/1␤n=12␤ 1/12␤ 2/6␤ 3/4␤ 4/3␤ 6/2␤ 12/1␤n=13␤ 1/13␤ 13/1␤n=14␤ 1/14␤ 2/7␤ 7/2␤ 14/1␤n=15␤ …
qw3rty i understand most of it except the $^a part...
ash_ thats a placeholder variable
qw3rty what is $â
like $_ ?
ash_ um... 04:15
-> $a, $b { } # takes 2 params, a and b right?
qw3rty right
ash_ { $^a + $^b } # also takes 2 params
04:16 eternaleye joined
ash_ in this case they are called $^a and $^b 04:16
or, depending on how fancy you want to be, you can just use *
and say: * + *
rakudo: my &a = * + *; say a(1, 2);
qw3rty so that part could have been written for 1..$n -> $a { ... ??
p6eval rakudo 8156be: OUTPUT«3␤»
ash_ ya 04:17
qw3rty ahh i see...
rakudo: for 1..60 -> $n { say "n=$n"; for 1..$n -> $a { $n %% $a ?? say "\t$a/" ~ $n/$a !! 0 } } 04:18
p6eval rakudo 8156be: OUTPUT«(timeout)n=2␤ 1/2␤ 2/1␤n=3␤ 1/3␤ 3/1␤n=4␤ 1/4␤ 2/2␤ 4/1␤n=5␤ 1/5␤ 5/1␤n=6␤ 1/6␤ 2/3␤ 3/2␤ 6/1␤n=7␤ 1/7␤ 7/1␤n=8␤ 1/8␤ 2/4␤ 4/2␤ 8/1␤n=9␤ 1/9␤ 3/3␤ 9/1␤n=10␤ 1/10␤ 2/5␤ 5/2␤ 10/1␤n=11␤
..1/11␤ 11/1␤n=12␤ 1/12␤ 2/6␤ 3/4␤ 4/3␤ 6/2␤ 12/1␤n=13␤ 1/13␤ 13/1␤n=14␤ 1/14␤ 2/7␤ 7/2␤ 14/1␤n=15␤ …
qw3rty thanks :)
ash_ perlcabal.org/syn/S06.html#Placeholder_variables 04:19
has more details, if you don't mind reading technical stuff
plobsing wonders if locale-based collation order can change how placeholders are arranged
04:20 mantovani joined
ash_ rakudo: my $a = { my $b = $^b + $^c; say "b: $b ^b: $^b ^c: $^c" }; $a(1, 2); 04:20
p6eval rakudo 8156be: OUTPUT«===SORRY!===␤Multiple declarations of lexical '$b'␤␤»
ash_ :-\ 04:21
std: my $a = { my $b = $^b + $^c; say "b: $b ^b: $^b ^c: $^c" }; $a(1, 2);
p6eval std : OUTPUT«===SORRY!===␤$b has already been used as a non-placeholder in the surrounding block,␤ so you will confuse the reader if you suddenly declare $^b here at /tmp/WMcTvXD30R line 1:␤------> my $a = { my $b = $^b⏏ + $^c; say "b: $b ^b: $^b ^c: $^c" }; $…
ash_ hmm
i think some of the spec might be out of date on that... or std is from the future
rakudo: my $a = { say "$^b" }; $a(1) 04:22
p6eval rakudo 8156be: OUTPUT«1␤»
ash_ std: 'a'..'zzz' 04:23
p6eval std : OUTPUT«ok 00:02 116m␤»
plobsing the spec says placeholders are sorted in "unicode order". how does that deal with combined characters that don't have a single codepoint? 04:24
qw3rty rakudo: my $funk = { my @val = @^placeholder; say [+]@val }; $funk(<1 2 3>);
p6eval rakudo 8156be: OUTPUT«6␤»
qw3rty :D
rakudo: my $funk = { my @val = @^placeholder; say [+]@val }; $funk(1, 2, 3);
p6eval rakudo 8156be: OUTPUT«Nominal type check failed for parameter '@placeholder'; expected Positional but got Int instead␤ in <anon> at line 22:/tmp/wTSe6rZ1AE␤ in main program body at line 22:/tmp/wTSe6rZ1AE␤»
qw3rty rakudo: my $funk = { my @val = @^placeholder; say [+]@val }; $funk(1); 04:26
ash_ rakudo: my $fn = { say [+] @^v }; $funk <1 2 3>;
p6eval rakudo 8156be: OUTPUT«Nominal type check failed for parameter '@placeholder'; expected Positional but got Int instead␤ in <anon> at line 22:/tmp/EDwC0_0snc␤ in main program body at line 22:/tmp/EDwC0_0snc␤»
rakudo 8156be: OUTPUT«===SORRY!===␤Confused at line 22, near "$funk <1 2"␤»
ash_ rakudo: my $fn = { say [+] @^v }; $funk(1..3); 04:27
p6eval rakudo 8156be: OUTPUT«===SORRY!===␤Symbol '$funk' not predeclared in <anonymous> (/tmp/9WOFbigMCe:22)␤»
ash_ rakudo: my $fn = { say [+] @^v }; fn(1..3);
p6eval rakudo 8156be: OUTPUT«Could not find sub &fn␤ in main program body at line 22:/tmp/AdqC0KkwQb␤»
ash_ can't type currently o.0
plobsing rakudo: my &fn = { say [+] @^v }; fn(1..3);
p6eval rakudo 8156be: OUTPUT«6␤»
ash_ rakudo: my $fn = { say [+] @^v }; $fn(1..3);
p6eval rakudo 8156be: OUTPUT«6␤»
ash_ plobsing: i have no idea how sorting of unicode works 04:28
qw3rty rakudo: my $fn = { say [+] @^v }; $fn(1,1,3,5,8); 04:29
p6eval rakudo 8156be: OUTPUT«Nominal type check failed for parameter '@v'; expected Positional but got Int instead␤ in <anon> at line 2:/tmp/4Z7fJ3xR1Q␤ in main program body at line 22:/tmp/4Z7fJ3xR1Q␤»
qw3rty rakudo: my $fn = { say [+] @^v }; $fn(1,2,4,8..100);
p6eval rakudo 8156be: OUTPUT«Nominal type check failed for parameter '@v'; expected Positional but got Int instead␤ in <anon> at line 2:/tmp/dBbcIGGzOB␤ in main program body at line 22:/tmp/dBbcIGGzOB␤»
qw3rty rakudo: my $fn = { say [+] @^v }; $fn( (1,2,4,8..100) );
p6eval rakudo 8156be: OUTPUT«5029␤»
plobsing ash_: when dealing with humans, it is usually appropriate to sort based on a culturally-varying "collation order". But I assume "unicode order" means by asscending codepoint.
problem is, sorting by codepoint goes against the perlish notion of using glyphs by default. 04:30
ash_ rakudo: my $fn = { say [+] @^v }; $fn( 1, 1, * + * ... 21 ); # 1 to 21 in fib added together 04:31
plobsing but there is no unique sort order over glyphs.
p6eval rakudo 8156be: OUTPUT«54␤»
plobsing However, I could be completely wrong on this point.
We'd better ask someone who knows unicode better.
qw3rty rakudo: my $fn = { say [+] @^ñ }; $fn(1..3);
p6eval rakudo 8156be: OUTPUT«6␤» 04:32
plobsing or the spec better. preferably both.
ash_ rakudo: say å..∫
p6eval rakudo 8156be: OUTPUT«===SORRY!===␤Confused at line 22, near "say \x{e5}..\u222b"␤»
ash_ ya, that could get confusing if you use unicode heavily in your block 04:33
plobsing rakudo: my $fn = { say ^ñ - ^n }; $fn(1, 2); 04:34
p6eval rakudo 8156be: OUTPUT«Too many positional parameters passed; got 2 but expected between 0 and 1␤ in <anon> at line 2:/tmp/meuRCm5lBL␤ in main program body at line 22:/tmp/meuRCm5lBL␤»
04:34 xinming joined
plobsing rakudo: my $fn = { say $^ñ - $^n }; $fn(1, 2); 04:34
p6eval rakudo 8156be: OUTPUT«1␤» 04:35
qw3rty here's the original problem for the line i posted "Create an ordered list of fractions which product of the numerator and denominator equals a specific integer n. 04:41
ex: n=60
1/60, 2/30, 3/20, 4/15, 5/12, etc....
then do it with a list of integers."
04:49 jaldhar left 04:52 ash_ left 04:54 jaldhar joined 05:00 justatheory left 05:01 qw3rty left 05:07 leprevost left 05:08 leprevost joined
avuserow rakudo: sub foo {say "$^b $^a"}; foo(1, 2); 05:29
p6eval rakudo 8156be: OUTPUT«2 1␤»
avuserow rakudo: sub foo {say "$^b $^a $^b"}; foo(1, 2); 05:31
p6eval rakudo 8156be: OUTPUT«2 1 2␤»
05:31 nymacro left 05:45 Guest23195 joined 05:52 leprevost left
sorear good * #perl6 06:03
araujo hi sorear 06:04
:)
sorear std: say $^á 06:05
p6eval std : OUTPUT«===SORRY!===␤Placeholder variable $^á may not be used outside of a block at /tmp/oDi_Y0lUFU line 1:␤------> say $^á⏏<EOL>␤Check failed␤FAILED 00:01 116m␤»
06:07 wtw joined 06:26 Su-Shee joined
Su-Shee good morning. 06:26
06:31 araujo left
moritz_ good morning 06:33
06:47 nymacro joined, plobsing left 06:50 mberends joined
dalek odel: 50c3af1 | mberends++ | java/runtime/Rakudo/Init.java:
[Init.java] tidying the source code
07:01
07:11 Ross joined, Ross left, Ross joined 07:17 Ross left 07:21 Ross joined, Ross left, Ross joined 07:23 qwebirc81609 joined 07:31 Ross left 07:48 qwebirc81609 left 07:49 qwebirc21296 joined 07:58 thowe left 08:21 araujo joined 08:29 ascent_ joined 08:34 dakkar joined 08:36 nymacro left 08:44 nymacro joined 08:48 wamba joined, wamba left 08:49 envi_home joined 08:50 envi^home left 08:51 wamba joined 09:18 tadzik joined
tadzik good morning 09:18
trac.parrot.org/parrot/changeset/49269 -- wow, makes me feel like bumping PARROT_REVISION 09:25
09:32 svetlins joined
betterworld How can I have two modules use one another and avoid endless recursion? 09:37
if I create A.pm with the contents "use B; module A;" and B.pm similar, then rakudo dies of "maximum recursion depth exceeded" 09:42
if I swap "use" and "module", it dies of "Illegal redeclaration of symbol 'A'"
tadzik duh, it's up to 33% faster with the latest Parrot revision 09:46
10:00 Guest23195 left
moritz_ tadzik: wait a day until after release 10:02
tadzik so we're going for 2.8.0 for the release?
moritz_ sure 10:03
we're always targeting parrot releases
we still need a release name... suggestions?
tadzik the hardest part
10:08 ggoebel joined, masak joined
masak hello, 6ers. 10:09
10:09 svetlins left
moritz_ oh hai masak 10:09
tadzik hello masak 10:10
masak rakudo: enum A::B <a b c>; say b 10:11
p6eval rakudo 8156be: ( no output )
masak :(
thought I could close rt.perl.org/rt3/Ticket/Display.html?id=71460
moritz_ rakudo: enum A::B <a b c>; say b.WHAT 10:12
p6eval rakudo 8156be: OUTPUT«Failure()␤»
moritz_ std: 123b 10:13
p6eval std : OUTPUT«===SORRY!===␤Whitespace is required between alphanumeric tokens at /tmp/8Zk7lTSUX1 line 1:␤------> 123⏏b␤Two terms in a row at /tmp/8Zk7lTSUX1 line 1:␤------> 123⏏b␤ expecting any of:␤ POST␤ bracketed infix␤ infix or
..meta-i…
moritz_ std: a::123b
p6eval std : OUTPUT«===SORRY!===␤Two terms in a row at /tmp/BTVYOetk6z line 1:␤------> a::⏏123b␤ expecting any of:␤ POST␤ argument list␤ bracketed infix␤ infix or meta-infix␤ postfix␤ postfix_prefix_meta_operator␤ statement modifier
..loop␤Undeclared routine:␤ 'a:…
moritz_ in perl 5 that was allowed 10:14
10:14 sftp joined
moritz_ www.perlmonks.org/?node_id=861457 # my continued perlmonks trolling :-) 10:16
tadzik that may make people say "Perl 5" when they mean Perl 5 10:17
"Dear Perlmonks, how do I bla bla bla **IN PERL 5**" 10:18
moritz_ right; if they ask for perl 5, I won't give Perl 6 answers (unless somebody else asks for other inspiration)
tadzik moritz_: Math-Rungekutta has failing tests 10:20
moritz_ :( 10:21
tadzik: thanks for the notification... did you clean out all .pir files before trying? 10:22
tadzik moritz_: let me check
masak ooh, NPW in Reykjavik in November! events.linkedin.com/Nordic-Perl-Wor...pub/257403
tempting, very tempting...
tadzik moritz_: yep, alike on the fresh clone 10:23
Su-Shee masak: because the workshop might last 4 weeks due to volcano activity? ;)
tadzik :D 10:24
masak Su-Shee: that's only part of the allure :)
10:24 daxim joined
tadzik moritz_: I'm doing smoketesting and I was feeling bad for Math-Model not being ok :) 10:24
moritz_ right, if M::RK fails, Math::Model can't work 10:25
Su-Shee masak: hmmm.. darkness, rain and HOT BATHS... 10:26
masak Su-Shee: I hear the Icelanders are stern, yet sensual.
moritz_ tadzik: seems to be a problem in the test, not the actual module code 10:27
tadzik moritz_: yep
moritz_ wipes the sweat off his forehead
fix pushed 10:28
tadzik time is not a function?
or can't be used as such?
moritz_ nope, it's a term
tadzik huh 10:29
rakudo: say time.WHAT
p6eval rakudo 8156be: OUTPUT«Int()␤»
moritz_ which allows you to write time - 3 and have it not mean time(-3)
tadzik bah, that wasn't smart
that was changed recently, no?
masak <TimToady> :D is the P6 equivalent to Haskell's 'just' types
moritz_ right
masak reaches enlightenment
nice. 10:30
tadzik sounds nice, shame I don't know what is it about :) 10:31
10:38 Guest23195 joined 10:48 ruoso left, nymacro left
gfldex rakudo: my $a = "abc"; say $a.list[0]; 11:08
p6eval rakudo 8156be: OUTPUT«abc␤»
gfldex is that intentional? 11:09
11:10 nymacro joined 11:11 Trashlord left 11:14 Trashlord joined
tadzik and how should it be? 11:16
rakudo: my $a = "abc"; $a.list.perl.say
p6eval rakudo 8156be: OUTPUT«("abc")␤»
gfldex confused haskell folks will be confused 11:17
and not just them :)
tadzik C folks too :) 11:18
11:19 dju left, dju_ joined, dju_ left, dju_ joined 11:37 plobsing joined 11:38 meppl joined 11:46 kjeldahl joined
masak gfldex: yes; intentional. 11:55
gfldex can't we just get rid of scripts that don't do one thing after another? :-> 11:56
tadzik hm? 11:57
masak rakudo: my $a = "abc"; say $a[0];
p6eval rakudo 8156be: OUTPUT«abc␤»
gfldex my point is if the worlds would be optimised for programmers, it would be much easier to avoid bugs :)
tadzik postcircumfix<[ ]> won't be bad on Strings
gfldex you can't do that
there are languages that do fairly funcy things when written 11:58
masak tadzik: I don't think postcircumfix:<[ ]> for indexing strings is negotiable.
moritz_ gfldex: well, at least we write a programming language that's optimized for the programmer (and not for the compiler writer, as is the case with C)
masak tadzik: there's nothing to stop you from making a lexical pragma that does that, though.
tadzik why not?
or just augment Str, no?
moritz_ augmenting types is a global operation 11:59
which can break other people's code
tadzik well, yes
masak but I bet the effect of the pragma could be made local.
gfldex tadzik: what if that string is a stream that does not support rewind in any case?
tadzik but who does Str[x] anyway? :)
moritz_ tadzik: the whole concept of Perl 6 is to see scalars and one-item lists as identical 12:00
tadzik String being a Stream?
moritz_ that's why <foo bar> returns a List of Str, but <foo> a plain Str
12:00 envi_home left, envi^home joined
tadzik mhm 12:00
moritz_ so if you do <foo bar>[0], you get foo
and if you do <foo>[0], you also get foo
unless you introduce string indexing, in which case you'll get 'f' 12:01
but that only makes sense, if you distinguish one-element lists from single items
and do it throughout the whole language
masak moritz_++ # explanation 12:03
what moritz_ said.
moritz_ tadzik: as another data point: in perl 5, reverse() in list context reverses lists, in scalar context reverses strings 12:07
so
print reverse("foo"); # prints foo
in Perl 6, we had a very similar case: it did list reversing when a list was passed, and string reversion when a single string was passed 12:08
90% of the tests for reverse() were about picking those two cases apart, finding corner cases etc. 12:09
now we have flip() for string reversal, and I could delete all those edge-case-checking tests - the language got a lot simpler
masak and invert() for hash reversal. made things simpler and more expressive. 12:10
moritz_ in my view, string indexing being done by substr() instead of .[] is a similar case of language simplification: if two operations don't do the same thing (even if it looks like the same at first sight),
... give them different names.
it really makes things easier 12:11
moritz_ should turn that into a blog post 12:12
tadzik good idea
moritz_ for the "people of perl 6" interview, chromatic asked for a moment of ephiphany with Perl 6. In retrospect, the reverse -> reverse/flip/invert split was a (late) moment of epiphany 12:13
because it really carried the right ideas further than previously thought
masak I have a blog post about that. hold on. 12:15
mathw likes that split
masak strangelyconsistent.org/blog/the-ta...edy-on-irc 12:16
moritz_ I know you do. I remember a hackernews discussion about it.
masak me too. can't find that discussion right now, though. 12:17
ah -- here: news.ycombinator.com/item?id=1064622 12:18
first occasion of ddg failing and Google finding something for me.
moritz_ likes the ddg results when searching for 'perl 6' 12:19
Juerd masak: I think that in p5, localtime is a better target for explaining context
masak Juerd: I bet it is.
Juerd In efnet #perlhelp I used to explain localtime when someone asked about reverse.
masak Juerd: but localtime didn't figure in my path to learning about context. reverse did.
Juerd Just saying that if you ever need to explain it to someone, localtime is easier :) 12:20
moritz_ thinks that localtime() is another great example where it's much more intuitive to return smart objects than to be context sensitive
Juerd moritz_: Definitely.
masak Juerd: I'll remember that. I'm coaching a younger Perl student right now, so I'll have use for it. thanks.
Juerd If only Perl <5 had objects... :)
nymacro masak: Nice blog post; I can relate. Only difference is I still feel stupid ;D 12:21
masak nymacro: no difference there; I feel stupid all the time :D
Juerd Well, I feel stupider than you do!!1 12:22
tadzik oh, Juerd. How do I run PSGI apps on feather? 12:24
Juerd I don't know what PSGI is 12:25
12:25 ruoso joined
Juerd But my honest guess would be that you run it on feather exactly the same way you'd run it on any other linux box 12:26
mathw good answer!
Juerd I can't say the description on its website is very helpful: 12:27
Superglue interface between perl web application frameworks and web servers, just like Perl is the duct tape of the internet.
PSGI is an interface between Perl web applications and web servers, and Plack is a Perl module and toolkit that contains PSGI middleware, helpers and adapters to web servers.
Oh, middleware! And it's an interface, sitting in between things.
Right. But what does it DO!
masak :)
it middles in other applications' affairs.
Juerd And the "Getting started" goes no further than installing the thing 12:28
Which is interesting. Apparently you install it and then get back to work, or something.
s/Getting/Get/ 12:29
daxim you know like catalyst has adapters for apache1, apache2, fastcgi and so on? and any other framework would need to reimplement those adapters all over again?
this piece is standardised in PSGI, Plack is the name of an implementation of that standard
makes sense?
Juerd So it's an adapter adapter? 12:30
daxim no, it's a standard adapter
Juerd Which you'd then need another adapter for
Or do frameworks like Catalyst now ship without the other ones?
moritz_ no, but future frameworks can get away with only one adapter 12:31
daxim not switched over yet
moritz_ mojo and catalyst are older than Plack/PSGI
tadzik bah 12:43
Juerd: I need feather.perl6.nl/~tjs/ to be forwarded to some local deamon listetning on a port 12:44
Juerd That won't happen 12:45
However, if it's going to be a full and maintained website, I could forward or even reverse-proxy a subdomain
tadzik so the only way is CGI? 12:46
moritz_ tadzik: read again what Juerd wrote 12:47
12:49 redicaps joined, redicaps left
tadzik so what defines "full and maintained website"? 12:51
that sounds scary said after "forwarding won't happen" 12:52
Juerd In all other cases, use the port number in the URL: feather.perl6.nl:8002/ 12:53
moritz_ that = "feather.perl6.nl/~tjs/ to be forwarded", not "forwarding in general"
tadzik oh, ok 12:54
Juerd But no, no ~ thing will be forwarded in the central apache config. You could, of course, use an index.html that redirects :)
tadzik right
Juerd But apache config changes are made only for actual websites or projects, not for development and playing :)
tadzik what about both? :) 12:55
12:57 grew left
tadzik or whatever, I was afraid that ports might be blocked from the outside world 12:57
Juerd Not ot feather
12:57 grew joined
Juerd s/ot/on/ 12:58
12:58 plobsing left, plobsing joined 13:00 NordQ joined
_sri moritz_: mojolicious ships with psgi support out of the box these days, but it's unlikely we'll ever standardize entirely on it 13:02
13:03 plobsing left
_sri the web of the future will be built with persistent streams, not the request/response model 13:04
florz which is horrible, indeed 13:05
masak the request/response model isn't going away anytime soon.
_sri nope, but it will become much less important 13:06
more like a handshake (as in websockets)
masak it works very well for a large number of sites out there.
not everyone will make the switch. 13:07
florz _sri: any ideas how to stop that from happening?
_sri florz: it is already in motion
florz yeah, that's how I know it's a horrible idea
_sri just look at what the mozilla labs and apple are cooking
one thing i'm afraid of is that javascript becomes a requirement on the server side 13:08
florz in particular calling it "the web", given that it lacks all of what defines "the web" 13:09
_sri lots of experimenting with server side DOMs atm, that sync to the browser....thats really scary stuff
florz it's more of a remote GUI protocol, I'd say, not much about documents at all anymore 13:10
_sri yes, streaming dom events
javascript people keep begging for it to happen :S
it would lock out basically everything else 13:11
moritz_ masak: and with "works really well" you mean "we're so used to the workarounds and limitations that we barely notice them anymore"?
_sri websockets are awesome, because perl can support them well 13:12
masak moritz_: no; I mean, sometimes I don't need a webpage to be dynamic.
moritz_ masak: right; but those that are dynamic are often a huge pile of workarounds
florz workarounds around non-existent problems, to be exact
_sri not like ajax made the web worse
masak moritz_: oh, I don't doubt that web sockets will make things better for those power users. 13:13
moritz_ I mean, take any typical web 2.0 web app
_sri it's the next ajax wave
moritz_ and check the back button works as it should
florz _sri: missing irony indicators? =:-)
_sri florz: :)
moritz_ I know just one (gmail) where it works properly. All others are a huge FAIL in that regard
florz ... :-)
_sri btw. anyone working on javascript for parrot yet? 13:14
masak didn't always work in Gmail either. it was redesigned at some point to have it work right.
_sri being able to mix perl6 and javascript could turn out to be a killer feature in a few years
florz and it's not just the back button - it's essentially the whole navigation model of hypertext that's thrown overboard
moritz_ florz: correct
wow, somebody inventing a meta object protocol for PHP: dhotson.tumblr.com/post/1167021666/...reinvented 13:15
masak rakudo: class A { method b { 'b' } }; my $a = A.new; my $b = &A::b.assuming($a) # from backlog
p6eval rakudo 8156be: ( no output )
masak rakudo: class A { method b { 'b' } }; my $a = A.new; my $b = &A::b.assuming($a); $b() 13:16
p6eval rakudo 8156be: OUTPUT«Null PMC access in invoke()␤ in main program body at line 1␤»
moritz_ LTA error
florz instead making the browser an execution environment for completely inconsistent user interfaces - which people build in the belief of improving on what the browser does
masak rakudo: class A { method b { 'b' } }; my $a = A.new; &A::b.assuming($a)()
p6eval rakudo 8156be: OUTPUT«Null PMC access in invoke()␤ in main program body at line 1␤»
masak rakudo: class A {}; my $a = A.new; &A::b.assuming($a)()
p6eval rakudo 8156be: OUTPUT«Null PMC access in invoke()␤ in main program body at line 1␤»
_sri gotta love the acronym PHP Object Oriented Programming
masak submits rakudobug
moritz_ rakudo: class A { our method b { 'b' } }; my $a = A.new; &A::b.assuming($a)()
florz heh :-)
p6eval rakudo 8156be: ( no output )
13:17 Patterner left
moritz_ &A::b won't work for has-scoped methods 13:17
13:17 patspam joined
masak ash_++ and TimToady++ for discovering it. 13:17
13:18 Psyche^ joined, Psyche^ is now known as Patterner 13:19 tadzik left
_sri guess javascript on parrot could turn out to be a huge reality shock 13:20
considering the surreal amount of optimizations in v8 and friends 13:21
masak moritz_: right. that's by spec. I kinda like the division between my/our/has. 13:22
[Coke] _sri: in that it would be slow? No, I don't think anyone would be shocked. 13:23
<-- parrot guy.
13:24 Holy_Cow joined
_sri [Coke]: ah, so far my impression has been that parrot folks are a bit more shy about that :) 13:24
PerlJam _sri: take new impressions :)
moritz_ _sri: there are parrot guys and parrot guys. 13:25
_sri will gladly accept new ones
moritz_ _sri: typically those that work only on parrot have different opinions than those working on languages on parrot (and often on parrot itself too)
nymacro moritz_: no parrot girls? 13:28
moritz_ nymacro: I know of one parrot "girl" (woman, actually). She has yet another view. 13:29
nymacro so where are all the cute Perl 6 girls at then? 13:31
moritz_ interesting views, but sometimes it's hard for me to map them to same reality as I see
PerlJam moritz_: she's got operating systems and python on the brain :)
13:31 timbunce joined
moritz_ nymacro: all over the world, I hope 13:31
nymacro heres to hoping 13:32
moritz_ 's wife sometimes wears the camelia t-shirt, and has asked if there's a baby cloth variant of it :-)
nymacro nice catch ;)
13:34 qwebirc21296 left
PerlJam sees that chromatic was in good humor yesterday 13:35
13:37 NordQ left, NordQ joined 13:39 NordQ left
moritz_ another other deprecations for the 2010.11 release, besides Bool stringifcation? 13:43
dalek kudo: 08317ed | moritz++ | docs/announce/2010.09:
[release] mention "now" and "time" being terms; deprecation notice for Bool stringification
13:50
13:50 PacoLinux joined 13:51 LoRe joined 13:53 LoRe left 13:56 pjcj joined 13:58 wamba left 14:15 mfollett joined, rgrau_ joined 14:19 mfollett left
masak I don't think I'll ever really get used to map not having a comma after its first argument in Perl 5. 14:33
that, and the occasional sigil-invariant hash access, is what gives me the most inscrutable syntax errors.
14:35 mfollett joined
flussence it's the lack of a Z operator that gets me 14:36
masak flussence: patch perl5i to have one :P 14:37
that would actually be quite fun.
flussence having to type "my %x; @x{qw(const keys i already know)} = list_returning_sub;" drives me insane sometimes
moritz_ List::MoreUtils has a zip() function, iirc 14:38
masak flussence: why? not sure I understand.
flussence ...where list_returning_sub is usually unpack() 14:39
moritz_ www.reddit.com/r/programming/commen...einvented/ it's kinda funny to the incomprehension of many programmers there 14:41
paraphrased: "if we have meta classes, that allows us to do powerful things. That's DANGEROUS"
masak flussence: ah. it breaks DRY. I see.
moritz_ or "why would you ever want something apart from the language's standard object model?" 14:42
14:45 wtw left 14:46 masonkramer joined 14:47 masonkramer left 14:48 aloha left 14:49 tadzik joined
tadzik new test results: tjs.azalayah.net/ 14:51
soon to be moved on feather and done daily with archives and other fun stuff 14:52
moritz_ wants an 'author' column, and the ability to sort by it :-) 14:53
tadzik well said! But, you know, well done is better than well said :)
[hudnix] Should the series operator really short-circuit on non-number values? I had the idea of returning a segment of a linked list like so: return ($.right, *.right ... $last_item), but it's returning a random number of items, I gues based on whether an intermediate item has an address that's greater than $last_item.
moritz_ [hudnix]: if you have a proper infix:<cmp> operator defined for your type, it should work 14:55
or infix:<eqv>, not sure
maybe you need ... { $_ === $last_item } right now 14:56
rakudo has trouble picking up custom operators in its setting
[hudnix] moritz_: ooh, nice, I'll try those, thanks 14:57
moritz_ wait, easier 14:58
the series operator smart-matches against $last
so if it's a custom type, defining a sensible method ACCEPTS($other) { .. } should do the trick 14:59
[hudnix] { $_ === $last_item } goes on forever...
moritz_ try eqv instead of ===
[hudnix] same thing 15:00
... {Bool::true} goes forever :) 15:01
moritz_ of what type are the list items?
that's bad
rakudo: say (1, *+1, True)
p6eval rakudo 08317e: OUTPUT«1_block1251␤»
moritz_ rakudo: say ~(1, *+1 ... True) 15:02
[hudnix] My own type, basically a circular linked list
p6eval rakudo 08317e: OUTPUT«1␤»
moritz_ rakudo: say ~(1, *+1 ... {True})
p6eval rakudo 08317e: OUTPUT«1␤»
moritz_ [hudnix]: which version of Rakudo are you using?
[hudnix] last months I think :) 15:05
moritz_ update :-)
[hudnix] your last construct goes forever on my rakudo :)
moritz_ I know; there was a huge series refactor (and spec change) 15:06
there'll be another compiler release later today
[hudnix] Will do, thanks 15:07
15:12 justatheory joined 15:14 mberends left, plainhao joined, risou_ joined 15:16 risou left 15:19 IllvilJa joined 15:20 patspam left 15:22 nymacro left 15:28 nymacro joined 15:31 kjeldahl_ joined 15:34 uniejo joined 15:36 miso_soup joined 15:42 Ross joined, Ross left, Ross joined 15:43 huf left 15:44 ruoso left 15:53 huf joined, fridim joined 15:55 nymacro left 15:58 huf left, mfollett left
masak why is the operator for generating sequences of things called "the series operator", by the way? 15:59
tadzik from mathematical series maybe?
15:59 justatheory left
daxim misleading, hm. en.wikipedia.org/wiki/Series_(mathematics) en.wikipedia.org/wiki/Sequence 16:00
16:01 ruoso joined 16:03 jfried joined
masak right. in mathematics, a series is the sum of a sequence. 16:03
16:03 huf joined
masak hence, the series operator in math is ∑ 16:04
jnthn evening, 6folk :-) 16:05
tadzik evening jnthn 16:06
masak jnthn! \o/ 16:07
jnthn masak! \o/
tadzik masak, look 16:09
feather.perl6.nl:8050/
updates every 00:01, at lest I hope so
masak looks
tadzik and you can see archives, like feather.perl6.nl:8050/23-09-10
masak impressive.
tadzik++
tadzik ugly :)
patches welcome
masak where's the source code? 16:10
16:10 huf left
tadzik can push to GH or somewhere 16:10
so, there is some privacy on feather? :)_ 16:11
16:11 Eevee joined 16:15 risou joined 16:17 fridim left
Juerd tadzik: There is next to no privacy on feather. 16:18
16:18 risou_ left
Juerd I wouldn't store a private key on it. 16:19
tadzik so does masak have access to my files? 16:20
masak (mwhahaha) 16:21
tadzik: even if I do, I'd recommend putting the code up on github or similar.
tadzik masak: there's a tiny dancer app, neutro and a script generating html table 16:22
will put it on GH, why not
oh, and a cronjob
masak tadzik++ 16:23
Juerd tadzik: cat /etc/sudoers
tadzik: And I'll allow other people access to your files without your approval
So no, don't put your secrets on feather
tadzik Juerd: they may be readable to anyone, I don't mind
Juerd And writable 16:24
tadzik hrm
Juerd Feather is for community stuff
tadzik alright
Juerd And the community will behave, in general :)
16:25 fridim joined
tadzik sure thing 16:25
the only non-perl stuff I put there recently was a Train Ticket and my Girlfriend's picture :)
Juerd Go ahead, but don't blame me if people abuse that :) 16:26
tadzik that was only temporary :)
masak tries to quickly put together a joke about enjoying that train journey with tadzik's girlfriend 16:27
tadzik masak: imagemacros.files.wordpress.com/200...oh_you.jpg 16:28
masak :)
jnthn masak: At least you had the nouns in that order. :P
masak jnthn: I'm not even going to try to figure out what you're implying. :) 16:29
it was a very platonic train journey. she's taken, after all. 16:30
jnthn :-)
tadzik :)
jnthn 's train journey this evening was packed (as usual) and on time (less usual). 16:31
[Coke] wishes he could regularly take the train. one car per commuter is insane.
masak [Coke]: it'll come to a natural end soon enough.
the insanity, I mean.
tadzik masak: github.com/tadzik/emmentaler 16:32
16:32 miso_soup left
masak tadzik: danke. 16:32
tadzik++ # realizing ideas
jnthn What a cheesy project name. 16:33
16:33 justatheory joined
tadzik jnthn: it's masak's idea :) 16:33
masak: want a commit bit?
jnthn tadzik: Clearly I should blame the hole thing on him. :-)
tadzik hah, punny 16:34
hah, sergenerator.pl, I thought that's a temporary script it's a with a temporary name
ser is cheese in Polish
jnthn :-)
masak tadzik: sure, why not? don't know when I will have tuits to look at it, though.
jnthn syr po Slovensky. :-)
tadzik that's why the resulsts used to be url.com/ser.html
16:35 icwiener joined
masak "Сыр" на русском языке 16:35
jnthn masak: Сырслы? 16:36
;-)
masak 哈哈
I wish more people could read Cyrillic. that was Сырслы funny. 16:37
jnthn If you average Сыр and syr then you'll probably get the Ukrainian. :-)
masak wonders if the slavic word can be traced back to the same root as the Germanic one
tadzik masak: commit bit added 16:38
masak danke. 16:39
tadzik de nada
...is that Spanish?
jnthn Yeah
masak seems not; "cheese" comes from Latin cāseus, seemingly unrelated to "ser".
tadzik good. I have to practice, I'm starting Spanish this year at my uni
Juerd: cat: /etc/sudoers: Permission denied 16:40
Juerd Oh, I didn't know that
tadzik . o O ( tadzik talks to Juerd talks to cat talks to /etc/sudoers) 16:41
jnthn masak: What root does the the Swedish "ost" kommer from?
Juerd tadzik: Anyway, 16 usernames.
jnthn *come :-) 16:42
masak: Not the same one as cheese/käse, I guess...
masak jnthn: ultimately Sanskrit, it seems. g3.spraakdata.gu.se/saob/show.phtml...77/32.html
jnthn: Swedish has many Sanskrit loans.
jnthn Oh? 16:43
I didn't know that.
16:44 Trashlord left
daxim chmete si přičichnout k mému syru? 16:45
16:46 huf joined, Trashlord joined
tadzik biking & 16:47
16:48 szabgab left 16:54 dakkar left 16:55 huf left, masak left
dalek ecs: 1779592 | TimToady++ | S (4 files):
s/series/sequence/ to accord with math culture

To a mathematician, a series is the sum of a sequence. We don't want to confuse the poor mathematicians any more than they already are.
16:58
17:02 mberends joined 17:06 icwiener left 17:09 uniejo left 17:12 Intensity left 17:15 wamba joined 17:17 huf joined 17:19 snearch joined 17:21 Intensity joined 17:22 sjn left 17:24 bluescreen joined 17:25 sjn joined, molaf left 17:27 cdarroch joined, cdarroch left, cdarroch joined 17:31 hudnix joined, [hudnix] left 17:36 Ross left 17:39 rainerschuster joined 17:40 uniejo joined 17:41 bluescreen left 17:44 Mowah left 17:45 Mowah joined 17:48 nullkuhl joined
nullkuhl am trying to reverse a string x , then repeat each word in it N times, could it be shorter than this ? $n=<>;print"@{[map{($_)x$n}split' ',reverse<>]}" 17:49
17:50 nullkuhl left
moritz_ get.flip.words Zx get 17:50
17:51 snearch left
moritz_ sorry, Xx, not Zx 17:53
$ echo "foo bar baz" | perl6 -e 'say get.flip.words Xx 3'
zabzabzabrabrabraboofoofoof
17:54 ash_ joined
Su-Shee <doorstaysclosed> 17:54
moritz_ substitute the trailing 3 for get
17:54 fridim left
moritz_ $ echo -e "foo bar baz\n3" | perl6 -e 'say get.flip.words Xx get' 17:55
zabzabzabrabrabraboofoofoof
and it's not even really golfed, it's close to idiomatic Perl 6
17:56 bluescreen joined 17:57 envi^home left
flussence moritz_++ # wow 17:57
ash_ flussence: last night i made some changes to the timeout handling for try.rakudo.org if you want to test any of them out, now there are 3 different levels of timeouts, the repl server can time out waiting on the perl6 instance, if it does it kills the perl6 instance and restarts it, the server can timeout waiting on the repl server, and the client can timeout waiting on the web server 17:58
17:59 nullkuhl joined
flussence ash_: will do. 17:59
ash_ apparently in IO::Socket::INET the timeout code is commented out for some reason, even though the docs say that it accepts a timeout and has a timeout function to set the timeout, but it doesn't actually ever timeout 18:00
flussence that's... weird 18:01
18:01 astrojp joined
flussence I've used it in other stuff and I'm pretty sure timeouts worked before, maybe something changed in the meantime 18:01
nullkuhl moritz_: get.flip.words Xx get , are you sure that this takes the number of repetitions before the string itself ? 18:02
moritz_: the input would be "3\nHello world"
moritz_ nullkuhl: oh, I thought it would be the other way round 18:03
as my example input shows
ash_ flussence: cpansearch.perl.org/src/GBARR/IO-1....et/INET.pm toward the bottom, someone pointed that out in a forum so i double checked it, i am not sure why its commented out :-\
nullkuhl moritz_: nop, does that make it longer ? :)
PerlJam nullkuhl: one char longer. 18:04
ash_ i was wondering why i never saw timeouts in it before, then i finally realized the timeouts weren't happening at all
18:04 fod joined
nullkuhl PerlJam: hmm am listening :) 18:05
PerlJam (assuming I know what I'm talking about ;)
let my perl6 finish compiling on this box so I can test it for sure
flussence wow, the ->new(Timeout => ...) option seems completely ignored...
moritz_ nullkuhl: with the R meta operator you can reverse the arguments
so: get RXx get.flip.words 18:06
PerlJam meta-ops++
moritz_ however you need get()RXx instead
nullkuhl moritz_: hmm why ? get() instead of get
moritz_ because after 'get', a term is expected, not an operator
nullkuhl aha
moritz_ $ echo -e "3\nfoo bar baz" | perl6 -e 'say get()RXx get.flip.words' 18:07
zabzabzabrabrabraboofoofoof
nullkuhl moritz_: well there is a small issue though 18:08
flussence on closer inspection... it seems my IO::Socket::INET-using code should never have worked, that timeout stuff is commented out in every version on CPAN...
nullkuhl it seems that it takes alot of time at execution
:(
flussence unless it's doing weird things at a distance
moritz_ nullkuhl: well, rakudo has a high startup time 18:09
we're working on it.
PerlJam is it my imagination or does rakudo compilation take longer than it used to?
(I don't recall ever waiting this long for a compile on this box)
TimToady revised rosettacode.org/wiki/Equilibrium_index#Perl_6 and also added a cute "pure FP" version
nullkuhl PerlJam: rakudo is this RXx ? 18:10
ash_ flussence: beats me, i use an alarm now, with a interrupt handler
nullkuhl oh wait
flussence ah well, whatever works.
nullkuhl moritz_: it seems it doesnt print the output
moritz_ nullkuhl: it does here
nullkuhl ideone.com/cwqqG
18:11 silug left
moritz_ nullkuhl: I can't reproduce that on a local rakudo 18:11
flussence PerlJam: what timespan are you talking about for compilation times? It seems more or less the same for me 18:12
nullkuhl moritz_: is there a print call or so that can be added ??
flussence admittedly the only data points I've got are the cronjob I've been running for 5 days...
PerlJam flussence: like several minutes longer
moritz_ nullkuhl: my example included a 'say' :-) 18:13
PerlJam flussence: I don't have any hard timespans, just feel. It's always been "just a few minutes", but now it seems like "several minutes"
nullkuhl moritz_: where ? 18:14
PerlJam maybe because I'm watching it.
moritz_ PerlJam: are you on parrot HEAD? or on the recommended revision?
nullkuhl: at the beginning
flussence PerlJam: you'd be surprised how much CPU a terminal's text rendering can eat sometimes... 18:15
PerlJam moritz_: what's in build/PARROT_REVISION
nullkuhl moritz_: so it would be say(get()RXx get.flip.words) ?
moritz_ nullkuhl: the outer parens aren't necessary. Just take the code I pasted.
flussence (my slow-ass work machine regularly eats up 50% CPU to output bitmap fonts)
18:15 timbunce left
PerlJam ah, there's some stuff currently running in the background. 18:16
flussence oh well, at least you're not in my situation :)
18:20 mfollett joined
dalek kudo: 74a156f | moritz++ | / (3 files):
[release] name is Milan. Bump VERSION
18:20
moritz_ not quite released yet
18:22 timbunce joined
nullkuhl moritz_: it works but it exceeds the time limit :( i think IO is the issue, is there a faster way to deal with IO ?, or perhaps different calls for reversing or repeating? ) 18:23
moritz_ nullkuhl: either golf or optimize :-) 18:24
nullkuhl: but it's not very slow here... are you sure that IO works on that server?
moritz.faui2k3.org/tmp/rakudo-2010.09.tar.gz # preview of the current release - please test!
nullkuhl moritz_: it worked with classic perl
moritz_ nullkuhl: since they need to have customized scriped for each language, that's not very convincing 18:25
18:26 daxim left
nullkuhl moritz_: www.spoj.pl/problems/REVINPUT/ 18:26
18:27 Mowah left
nullkuhl if you check best solutions, ull find about 20 languages or more 18:27
18:28 Mowah joined
TimToady it's tempting to define [+/] to mean reverse [\+] reverse 18:28
18:29 Mowah left
ash_ moritz_: do you know anyone that would like to help write tutorials for try.rakudo? 18:32
tadzik oh, SPOJ 18:33
18:33 Mowah joined
tadzik haha, my pal from Warsaw.pm is one the first place. He likes Perl 6 exactly for some golfing capabilities 18:34
18:34 justatheory left, Mowah left 18:38 Mowah joined
TimToady rakudo: say (<a b c d e> Zxx 0,1,0,1,0) 18:44
rakudo: say (<a b c d e> Zxx 0,1,0,1,0).Str
p6eval rakudo 08317e: OUTPUT«bd␤»
rakudo 08317e: OUTPUT«e e␤»
TimToady ran into this bug with my latest risottocode 18:45
tadzik where are those ZX operators documented? 18:46
TimToady S03:4612
tadzik thanks TimToady 18:47
„Summary of Perl 6 Operators”, I could have guessed :)
moritz_: did you forget to tag the release on GH? 19:02
rakudo: say (<a b c d e> Zxx 0,1,0,1,0).perl.eval.Str 19:04
p6eval rakudo 74a156: OUTPUT«b d␤»
19:06 s1n joined
moritz_ tadzik: not forgot, just haven't done it yet 19:07
tadzik: wanted to test first
tadzik oh, sure 19:08
19:08 rschuster joined 19:09 rainerschuster left, rschuster is now known as rainerschuster 19:10 ggoebel left 19:13 plobsing joined
moritz_ uploading tarball now. Tags pushed. 19:14
dalek kudo: c50ac91 | moritz++ | build/Makefile.in:
[build] release should not rely on dead pugs svn. Quick and ugly Unix-only hack.
19:15
19:16 ggoebel joined, wamba left 19:18 rschuster joined 19:19 risou left, rainerschuster left, rschuster is now known as rainerschuster
dalek kudo: 0d3c66e | moritz++ | docs/release_guide.pod:
[docs] update release guide

   * VERSION bumping
   * remove section on spectest numbers
   * update description of t/spec handling to git usage
19:21
19:22 nullkuhl left 19:27 plainhao left 19:29 robinsmidsrod joined 19:30 rainerschuster left 19:39 colomon joined 19:40 cbk left 19:41 uniejo left 19:45 colomon left, justatheory joined
moritz_ rakudo release finished. Everybody, feel free to commit again 19:45
frettled \o/ 19:46
TimToady rakudo: say (<a b c d e> Zxx 0,1,0,1,0).perl 19:47
p6eval rakudo 74a156: OUTPUT«((), ("b"), (), ("d"), ())␤»
TimToady very odd how that turns into e e 19:48
moritz_ says "bug" 19:49
TimToady rakudo: say (<a b c d e> Zxx 0,1,0,1,0).flat.perl
p6eval rakudo 74a156: OUTPUT«("b", "d")␤»
TimToady rakudo: say (<a b c d e> Zxx 0,1,0,1,0).flat.Str
p6eval rakudo 74a156: OUTPUT«e e␤»
tadzik (<a b c d e> Zxx 0,1,0,1,0).Str
TimToady sure, "bug", but not an obvious one
tadzik rakudo: (<a b c d e> Zxx 0,1,0,1,0).Str
pff
p6eval rakudo 74a156: ( no output )
tadzik rakudo: (<a b c d e> Zxx 0,1,0,1,0).Str.say 19:50
p6eval rakudo 74a156: OUTPUT«e e␤»
tadzik and still not what I wanted
rakudo: ((), ("b"), (), ("d"), ()).Str.say
p6eval rakudo 74a156: OUTPUT«b d␤»
flussence rakudo: (<e> Zxx 0,1,0,1,0).Str.say # ? 19:51
p6eval rakudo 74a156: OUTPUT«␤»
TimToady rakudo: say (eager(<a b c d e>) Zxx 0,1,0,1,0).Str 19:52
p6eval rakudo 74a156: OUTPUT«e e␤»
TimToady rakudo: say ((<a b c d e>[*] Zxx 0,1,0,1,0).Str
p6eval rakudo 74a156: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤» 19:53
flussence rakudo: (<one two three four five> Zxx 0,1,2,1,0).Str.say
TimToady rakudo: say ((\<a b c d e>[*] Zxx 0,1,0,1,0).Str
p6eval rakudo 74a156: OUTPUT«five five five five␤»
rakudo 74a156: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤»
TimToady rakudo: say (<a b c d e>[*] Zxx 0,1,0,1,0).Str
p6eval rakudo 74a156: OUTPUT«e e␤»
19:53 kjeldahl left
TimToady rakudo: say (<a b c d e>».clone Zxx 0,1,0,1,0).Str 19:53
p6eval rakudo 74a156: OUTPUT«e e␤» 19:54
jnthn o_O
19:54 timbunce left
jnthn oh, maybe it's that pesky take bug 19:54
TimToady rakudo: say (<a b c d e> Zx 0,1,0,1,0).Str
19:54 Ross^ joined, Ross^ left, Ross^ joined
p6eval rakudo 74a156: OUTPUT« b d ␤» 19:54
flussence rakudo: (0,1,{$^a,$^b}..*)[^5].perl.say
p6eval rakudo 74a156: OUTPUT«Method 'succ' not found for invocant of class 'Block'␤ in 'RangeIter::reify' at line 4723:CORE.setting␤ in 'List::at_pos' at line 1␤ in 'Any::postcircumfix:<[ ]>' at line 1688:CORE.setting␤ in 'Parcel::at_pos' at line 1␤ in 'Any::postcircumfix:<[ ]>' at line
..1688:CORE.setting␤…
flussence d'oh 19:55
jnthn flussence: Did you want ... ?
TimToady: I guess xx may be implemented using gather/take
Oh
But that still doesn't explain e very well
oh, maybe it does.
flussence jnthn: after testing it locally, seems my whole line was wrong...
jnthn If it's at the end of the string...
19:56 colomon joined 19:57 jferrero joined
flussence argh. repl without readline support is really nasty, but with it utf8 input breaks... 19:58
TimToady someone should kick gnu screaming and kicking out of the 1990s 19:59
tadzik why, they have good lawyers
TimToady s:1st/kick/drag/
ash_ flussence: NotFound in the #parrot channel things that its a bug in the way they handle readline input
20:00 mfollett left, Eevee left, bartolin left, TimToady left, TimToady joined, dukeleto joined, larsen joined, bartolin joined 20:01 Eevee joined, Khisanth joined, LionMadeOfLions joined, timbunce joined 20:03 patspam joined
ash_ flussence: trac.parrot.org/parrot/changeset/49252 is something that will help, the only problem is telling the interp which encoding to use 20:03
that alone doesn't fix the problem, somehow you still need to set the interp's encoding to utf8
but that ensures that readline is using the same encoding as the interp, we as before it didn't set the encoding so it defaulted to ascii 20:04
s/we/were
/
flussence I find it bizarre that anything would pick bare ascii as a default these days... maybe it's a posix thing. 20:06
20:06 Khisanth left 20:08 rainerschuster joined
ash_ well, now with the most recent trunk it takes the encoding from the interp and uses that, but i don't know how to set the interp's encoding to utf8 20:08
20:08 ruoso left
flussence LC_ALL doesn't work? 20:08
ash_ whats LC_ALL? 20:10
flussence env var
LC_ALL=en_US.UTF-8 or whatever's on the system ought to do something 20:11
ash_ hmm, on OS X its LANG=en_US.UTF-8 (on my computer anyway) 20:12
flussence the `locale` command prints out the current settings of stuff
LC_ALL sets all the related vars at once
sjohnson TimToady: please elaborate on the gnu stuff
20:12 Khisanth joined
ash_ NotFound was saying that he couldn't think of a safe 'default' and we kinda left it at that, i am going to email the parrot mailing list about it though 20:13
locale still leaves LC_ALL blank, sets a bunch of other things though
maybe OS X is configured differently than linux (assuming your on linux)
flussence I think LC_ALL might be a "magic" variable
fwiw, I've seen perl5 scream loudly if the vars are left at whatever the default is 20:15
ash_ ah that could be true, i don't know much about locales, i hardly speak english well enough so anything else is way beyond me 20:16
flussence heh, I'm using en_GB which might as well be another language as far as computers are concerned :) 20:17
ash_ if is still spelled if, right? 20:18
:P
20:20 stkowski joined
flussence it gets annoying writing CSS sometimes... (why'd they use "color" instead of "foreground", to go with "background"?) 20:21
(if anything it should really be huffman-coded as "hue", but whatever)
20:23 silug joined
ash_ it is odd looking at some code, like ruby code thats written in japanese, but still has english keywords like do, end, while, true, etc. 20:25
moritz_ flussence: "hue" only describes a limited aspect of color 20:26
jnthn flussence: At least they didn't choose the proper^WEnglish^WBritish spelling of colour. ;-) 20:27
20:28 ruoso joined
tadzik ash_: how is Ruby written in Japanese? 20:30
20:30 justatheory left
flussence tadzik: I assume that means it's got decent unicode support 20:32
ash_ ruby lets you use japanese for variables names and sub names
moritz_ Perl too
tadzik yup
20:32 LoRe joined 20:34 rainerschuster left
flussence php lets you use utf8 chars in some places too, but only because it's too dumb to complain 20:36
(it'll happily take unicode whitespace as variable names, whereas perl5 seems to explode :( ) 20:38
sorear good * #perl6
flussence hi 20:39
ash_ unicode whitespace as a var name seems scary
moritz_ perl only allows \w characters for names
ash_ for a given definition of \w though, which thankfully is pretty comprehensive 20:40
flussence perl5's error for "my $\x{2002}" seems a bit wrong...
Can't use global $^ÿ¿¿¿¿¿¿¿¿¾¢ in "my" at f.pl line 1, near "my $â"
moritz_ .u U+2002 20:41
phenny moritz_: Sorry, no results
flussence U+2002 EN SPACE 20:42
moritz_ std: so()
p6eval std : OUTPUT«ok 00:01 114m␤»
sorear flussence: $ has weak quoting behavior, basically any char except ' ' and '\n' is forced to be part of the variable name if immediately after $
ash_ rakudo: my $å = 3;
sorear flussence: also, $<unprintable> is treated as a global
p6eval rakudo 74a156: ( no output )
sorear flussence: so you can't my it
$^X is shorthand for $(U+0018) 20:43
moritz_ is (so($b) + 1), ((so $b) + 1), 'so($b) is (so $b)';
where $b = 0
is this test correct?
20:43 justatheory joined
flussence moritz_: (if I'm understanding it correctly...) it looks right to me 20:45
ash_ is there a character for 'end of current functions params'? 20:46
kinda how comma (,) is for next param
moritz_ notreally
ash_ i suppose ( ) around the params helps
moritz_ right
ash_ but it would be kinda nice to have: say foo 123<char> + bar 123; and it not get confused 20:47
sorear moritz_: that test seems... tautological 20:49
so($b)+1 and (so $b)+1 generate exactly the same parse tree in niecza and rakudo
moritz_ sorear: nevertheless rakudo fails it, if I fix Bool stringification 20:50
20:50 alester left
sorear What. 20:50
moritz_ thought that 'so' was a low precedence prefix op, not a function 20:51
or is it both?
sorear so( with no whitespace is a function call
flussence so($b).WHAT returns 0 for me, which makes no sense 20:52
20:52 mberends left
moritz_ rakudo: say (so($b)).WHAT 20:53
p6eval rakudo 74a156: OUTPUT«===SORRY!===␤Symbol '$b' not predeclared in <anonymous> (/tmp/o8O4yQUPbv:22)␤»
moritz_ rakudo: say (so(0)).WHAT
p6eval rakudo 74a156: OUTPUT«Bool()␤»
moritz_ rakudo: say so(0).WHAT
p6eval rakudo 74a156: OUTPUT«0␤»
moritz_ rakudo: say so (0).WHAT
p6eval rakudo 74a156: OUTPUT«0␤» 20:54
flussence oh, precedence
moritz_ thinks it's a parsing bug in rakudo
dalek ast: 29b04a9 | moritz++ | S0 (4 files):
fix tests for Bool stringification
20:55
20:55 M_o_C joined 20:56 M_o_C left 20:57 kingn0thing joined 21:00 dual joined
dalek kudo: 40d0d49 | moritz++ | src/builtins/Bool.pir:
make True and False stringify as Bool::{True,False} as per spec
21:01
kudo: a820a44 | moritz++ | src/builtins/Bool.pir:
Merge branch 'bool-str'
ash_ rakudo: class A { method b { 1 } }; say A.can('b');
p6eval rakudo 74a156: ( no output )
ash_ moritz_: do you have any idea whats up with that? you might need to try it locally to see the error message
moritz_ rakudo: say (method () { }).WHAT 21:02
p6eval rakudo 74a156: OUTPUT«Method()␤»
moritz_ ash_: a low-level type leaking through 21:03
ash_ rakudo: say "string".can("split");
p6eval rakudo 74a156: OUTPUT«split␤»
ash_ it doesn't happen with all methods though
^^ worked with Str.split but my A.b fails
21:03 Su-Shee left
moritz_ rakudo: class A { multi method b { 1 } }; say A.can('b'); 21:04
ash_ i tried tracking down that one but i didn't have any luck
jnthn ash_: .can doesn't return the method itself but rathre something that is meant to be able to serve as an iterator through the methods, but if invoked it'll invoke the method itself.
p6eval rakudo 74a156: ( no output )
ash_ hehe tried that too
jnthn I think it's horribly behind with the current ideas of iterators though.
21:04 orafu joined 21:06 stkowski left
sjohnson what is the p6 way of taking a string and making a list of chars? 21:07
is it still split //?
tadzik comb?
ash_ anyway, i filed a bug on it, just wanted to see if anyone else know about it
tadzik rakudo: "asd".comb.perl.say 21:08
p6eval rakudo 0d3c66: OUTPUT«("a", "s", "d")␤»
ash_ rakudo: say ~"comb".comb
p6eval rakudo 0d3c66: OUTPUT«c o m b␤»
tadzik I always think it's 'chop', like you're chopping a potato
sjohnson rakudo: "confusing\nstring\0chars".comb.perl.say
p6eval rakudo 0d3c66: OUTPUT«("c", "o", "n", "f", "u", "s", "i", "n", "g", "\n", "s", "t", "r", "i", "n", "g", "\x[0]", "c", "h", "a", "r", "s")␤»
sjohnson ... works for me! 21:09
sjohnson kisses perl6
tadzik so why is it comb, like a thing for brushing hair instead of chop, like chopping a potato?
flussence rakudo: "waffle".comb(/../).perl.say
p6eval rakudo 0d3c66: OUTPUT«("wa", "ff", "le")␤» 21:10
flussence yay
rakudo: "waffle".comb(/ <[^f]>+ /).perl.say
p6eval rakudo 0d3c66: OUTPUT«("ff")␤» 21:11
21:11 kingn0thing left
flussence (is ^ correct there?) 21:11
jnthn <-[f]> iirc
flussence ah
jnthn It's not ^ any more, I'm farily sure of that. 21:12
flussence rakudo: "waffle".comb(/ <-[f]>+ /).perl.say
p6eval rakudo 0d3c66: OUTPUT«("wa", "le")␤»
jnthn ah, there you go :-)
21:13 alester joined 21:15 bluescreen left 21:16 Mowah left 21:19 ruoso left
ash_ rakudo: say "Julián".chars; 21:24
p6eval rakudo 0d3c66: OUTPUT«6␤»
21:25 svetlins joined
sorear rakudo: say "七".chars 21:25
p6eval rakudo 0d3c66: OUTPUT«1␤»
ash_ tryrakudo returns 7 21:27
flussence → say "七".chars 21:28
1
21:28 kjeldahl_ left
flussence works locally 21:28
ash_ really?
flussence tryrakudo returns 3 for me...
ash_ hmmm wonder why the server is doing it wrong then
sorear ash_: tryrakudo returns 7 for 七!?
not 3 or 4?
ash_ no, for say "Julián".chars;
sorear ah
ash_ say "Julián".chars; => 7 on try.rakudo.org 21:29
21:29 Raynes left
flussence oh, I see 21:29
they both return correct numbers locally, maybe the server needs a kick
ash_ hehe 21:30
locally, if i do perl6 p6safe.pl
and try say "Julián".chars; it returns 7 too
even if i do perl6 --encoding=utf8 p6safe.pl
flussence :(
21:30 Raynes joined
ash_ same with the server :-( 21:30
flussence I'm using p6safe and it seems OK
ash_ hmmm 21:31
i wonder whats different
flussence can you see the log output from the frontend/backend scripts on tryrakudo?
everything in my copy looks correct
it could be the perl5 parts too... 21:32
ash_ why would perl5 change 6 to 7? 21:33
:P
say "Julián".chars is in the log properly on the perl persist.pl part
21:34 Holy_Cow left 21:35 synth left
ash_ just updated rakudo to latest trunk on the try.rakudo server 21:38
flussence bbl 21:40
cosimo rakudo: my $x = "perl6" ; $x ~= " "; $x ~= "rocks" ; say $x 21:41
p6eval rakudo 0d3c66: OUTPUT«perl6 rocks␤»
21:41 synth joined 21:42 Guest23195 left 21:43 jfried left
cosimo rakudo: my $x = "123"; $x.chop; $x.chop; say $x 21:43
p6eval rakudo 0d3c66: OUTPUT«123␤»
jnthn Use .= for inplace cho
cosimo rakudo: my $x = "123"; $x .= chop; say $x
p6eval rakudo 0d3c66: OUTPUT«12␤»
cosimo jnthn: thanks :)
jnthn: and to chop twice? 21:44
tadzik rakudo: my $x = "123"; $x .= chop.chop; say $x # hi hi
p6eval rakudo 0d3c66: OUTPUT«===SORRY!===␤Confused at line 22, near "$x .= chop"␤»
tadzik and it looked so funny :(
cosimo rakudo: my $x = "abc" ; $x .= chop**2; say $x
p6eval rakudo 0d3c66: OUTPUT«===SORRY!===␤ResizablePMCArray: Can't shift from an empty array!␤» 21:45
cosimo cool
21:45 orafu left
cosimo rakudo: my $x = "abc" ; $x .= chop .= chop; say $x 21:45
p6eval rakudo 0d3c66: OUTPUT«===SORRY!===␤ResizablePMCArray: Can't shift from an empty array!␤»
cosimo rakudo: my $x = "abc" ; $x .= chop, .= chop; say $x
p6eval rakudo 0d3c66: OUTPUT«Null PMC access in find_method('chop')␤ in main program body at line 22:/tmp/PFB8PoaV1C␤»
cosimo rakudo: my $x = "abc" ; ($x .= chop) .= chop; say $x 21:46
p6eval rakudo 0d3c66: OUTPUT«a␤»
sorear rakudo: my $x = "abc"; $x ~~ s/..$//; say $x
p6eval rakudo 0d3c66: OUTPUT«a␤»
jnthn $x .= chop for ^2 # ;-) 21:48
cosimo rakudo: my $s = "abc\r\n123\r\ndef\r\n"; my @x = map { "$_\r\n" } split ("\r\n", $s); say @x.perl;
p6eval rakudo 0d3c66: OUTPUT«===SORRY!===␤Confused at line 22, near "my @x = ma"␤»
jnthn missing , before split 21:49
cosimo rakudo: my $s = "abc\r\n123\r\ndef\r\n"; my @x = $s.split("\r\n"); say @x.perl;
p6eval rakudo 0d3c66: OUTPUT«["abc", "123", "def", ""]␤»
cosimo rakudo: my $s = "abc\r\n123\r\ndef\r\n"; my @x = $s.split("\r\n").map("$_\r\n"); say @x.perl; 21:50
p6eval rakudo 0d3c66: OUTPUT«No applicable candidates found to dispatch to for 'map'. Available candidates are:␤:(Mu : &block;; *%_)␤␤ in main program body at line 22:/tmp/cVhLjyNELR␤»
21:50 ggoebel left
jnthn rakudo: my $s = "abc\r\n123\r\ndef\r\n"; $s.split("\r\n") ==> map { "$_\r\n" } ==> my @x; say @x.perl # also cute 21:50
p6eval rakudo 0d3c66: OUTPUT«["abc\r\n", "123\r\n", "def\r\n", "\r\n"]␤»
cosimo rakudo: my $s = "abc\r\n123\r\ndef\r\n"; my @x = $s.split("\r\n").map {"$_\r\n"}; say @x.perl; 21:51
p6eval rakudo 0d3c66: OUTPUT«===SORRY!===␤Confused at line 22, near "my @x = $s"␤»
cosimo rakudo: my $s = "abc\r\n123\r\ndef\r\n"; $s.split("\r\n") ==> map {"$_\r\n"} ==> my @x; say @x.perl;
p6eval rakudo 0d3c66: OUTPUT«["abc\r\n", "123\r\n", "def\r\n", "\r\n"]␤» 21:52
cosimo cool, thanks jnthn
rakudo: my $s = "abc\r\n123\r\ndef\r\n"; say ($s.split("\r\n") ==> map {"$_\r\n"}).perl 21:53
p6eval rakudo 0d3c66: OUTPUT«("abc\r\n", "123\r\n", "def\r\n", "\r\n")␤»
21:53 dju_ left
tadzik rakudo: "thgindoog syas kizdat".flip.say 21:54
p6eval rakudo 0d3c66: OUTPUT«tadzik says goodnight␤»
cosimo rakudo: sub x($s) { return $s.split("\r\n") ==> map {"$_\r\n"} }; say x("a\r\n1\r\n2\r\n");
21:54 tadzik left
p6eval rakudo 0d3c66: OUTPUT«a12␤» 21:54
cosimo rakudo: sub x($s) { return $s.split("\r\n") ==> map {"$_\r\n"} }; say x("a\r\n1\r\n2\r\n").perl;
p6eval rakudo 0d3c66: OUTPUT«("a", "1", "2", "")␤»
cosimo rakudo: sub x($s) { my @l = $s.split("\r\n") ==> map {"$_\r\n"}; return @l }; say x("a\r\n1\r\n2\r\n").perl;
p6eval rakudo 0d3c66: OUTPUT«["a", "1", "2", ""]␤» 21:55
21:55 dju_ joined
cosimo rakudo: sub x($s) { $s.split("\r\n") ==> map {"$_\r\n"} ==> my @l; return @l }; say x("a\r\n1\r\n2\r\n").perl; 21:55
p6eval rakudo 0d3c66: OUTPUT«["a\r\n", "1\r\n", "2\r\n", "\r\n"]␤»
ash_ ==> works in rakudo now?
o.0 news to me, thats cool
21:55 lichtkind joined
cosimo rakudo: my $x = "OK\r\n"; if $x ~~ /(?:OK|END|ERROR)\r\n$/ { say "matches!" } else { say "boo" } 21:57
p6eval rakudo 0d3c66: OUTPUT«===SORRY!===␤Quantifier quantifies nothing at line 22, near "OK|END|ERR"␤»
cosimo rakudo: my $x = "OK\r\n"; if $x ~~ /(?:<OK|END|ERROR>)\r\n$/ { say "matches!" } else { say "boo" }
21:57 dju joined
p6eval rakudo 0d3c66: OUTPUT«===SORRY!===␤Quantifier quantifies nothing at line 22, near "<OK|END|ER"␤» 21:57
21:58 dju_ left
ash_ ?: isn't right in perl6 22:00
cosimo rakudo: my $x = "OK\r\n"; if $x ~~ / [ OK | END | ERROR ] \r\n$/ { say "matches!" } else { say "boo" }
p6eval rakudo 0d3c66: OUTPUT«matches!␤»
cosimo rakudo: my $x = "BLAH\r\n"; if $x ~~ / [ OK | END | ERROR ] \r\n$/ { say "matches!" } else { say "boo" }
p6eval rakudo 0d3c66: OUTPUT«boo␤»
cosimo rakudo: my $x = "END\r\n"; if $x ~~ / [ OK | END | ERROR ] \r\n$/ { say "matches!" } else { say "boo" }
p6eval rakudo 0d3c66: OUTPUT«matches!␤»
cosimo rakudo: my $x = "zorro"; if $x ~~ / [ OK | END | ERROR ] \r\n$/ { say "matches!" } else { say "boo" }
p6eval rakudo 0d3c66: OUTPUT«boo␤»
22:02 patspam left
cosimo jnthn: are labels supported in rakudo? like 'BLOCK: for @this { last BLOCK if ... }' 22:03
22:04 dju left
ash_ last i checked, no, labels weren't implemented yet 22:04
jnthn cosimo: Not yet
22:04 dju joined 22:06 dju_ joined, dju left
cosimo jnthn: not a big deal really 22:09
I'm converting Cache::Memcached to perl6...
now the code passes compilation just fine 22:10
I need to try it against a memcached now :)
sjohnson perl 6 have any built in base 32/64 stuff?
cosimo rakudo: my $x = 4096; say :64($x); 22:13
p6eval rakudo 0d3c66: OUTPUT«DON'T PANIC! The radix is out of range (2..36 only)␤ in main program body at line 1␤»
cosimo rakudo: my $x = 4096; say :16($x);
p6eval rakudo 0d3c66: OUTPUT«16534␤»
jnthn cosimo: Nice! :-)
cosimo rakudo: my $x = 4096; say :32($x); 22:14
p6eval rakudo 0d3c66: OUTPUT«131366␤»
cosimo sjohnson: not sure if you meant that though :)
rakudo: my $x = 4095; say :2($x); 22:15
jnthn: thanks
p6eval rakudo 0d3c66: OUTPUT«DON'T PANIC! Invalid character (4)! Please try again :) ␤ in main program body at line 1␤»
cosimo rakudo: my $x = '1101'; say :2($x);
p6eval rakudo 0d3c66: OUTPUT«13␤»
ash_ rakudo: 16.base(:2).perl
p6eval rakudo 0d3c66: OUTPUT«===SORRY!===␤Malformed radix number at line 22, near ").perl"␤»
ash_ rakudo: 16.base(2).perl.say
p6eval rakudo 0d3c66: OUTPUT«Method 'base' not found for invocant of class 'Int'␤ in main program body at line 22:/tmp/pxPQ__K9sm␤» 22:16
sjohnson rakudo: my $x = "something"; say :64($x);
p6eval rakudo 0d3c66: OUTPUT«DON'T PANIC! The radix is out of range (2..36 only)␤ in main program body at line 1␤»
jnthn Time for some rest
sjohnson ya, PHP won't let you go past 36 either
i am confused
ash_ :2($x) => returns base 10 value $x 22:17
22:17 patspam joined
ash_ where $x is in base 2 22:17
rakudo: 1.^methods.sort.perl.say 22:18
p6eval rakudo 0d3c66: OUTPUT«({ ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ...
..}, { …
ash_ rakudo: say ~1.^methods
p6eval rakudo 0d3c66: OUTPUT«perl pred succ WHICH Str Bridge Int Rat Num sign ACCEPTS Real Bool Complex reals isNaN abs exp ln sqrt roots floor ceiling truncate round cis unpolar rand sin asin cos acos tan atan sec asec cosec acosec cotan acotan sinh asinh cosh acosh tanh atanh sech asech cosech acosech
..cotanh…
cosimo rakudo: 1.^methods.sort.say 22:19
p6eval rakudo 0d3c66:
..OUTPUT«ACCEPTSACCEPTSBUILDBUILDALLBoolBoolBridgeCREATECaptureComplexIOIntIntNumNumNumericNumericNumericPARROTRatRatRealRealSeqStrStrWALKWHENCEWHEREWHICHWHICHabsabsacosacosacosecacosecacosechacosechacoshacoshacotanacotanacotanhacotanhallanyasecasecasechasechasinasinasinhasinhat_keyat_posat…
plobsing rakudo: say ~1.^methods(:local)
p6eval rakudo 0d3c66: OUTPUT«perl pred succ WHICH Str Bridge Int Rat Num sign ACCEPTS Real Bool Complex reals isNaN abs exp ln sqrt roots floor ceiling truncate round cis unpolar rand sin asin cos acos tan atan sec asec cosec acosec cotan acotan sinh asinh cosh acosh tanh atanh sech asech cosech acosech
..cotanh…
22:19 alester left 22:20 leprevost joined
ash_ doesn't know how to convert between bases 22:24
in perl6
rakudo: "foo".^methods.say 22:26
p6eval rakudo 0d3c66:
..OUTPUT«ACCEPTSperlpredsuccWHICHBoolStrencodeNumericRealIntRatNumabsexploglog10sqrtrootsto-radiansfrom-radiansfloorceilingroundtruncatesigncisunpolarchrrandsincostanseccoseccotansinhcoshtanhsechcosechcotanhasinacosatanatan2asecacosecacotanasinhacoshatanhasechacosechacotanhbytescapitalizech…
ash_ rakudo: say ~"foo".^methods.say
p6eval rakudo 0d3c66:
..OUTPUT«ACCEPTSperlpredsuccWHICHBoolStrencodeNumericRealIntRatNumabsexploglog10sqrtrootsto-radiansfrom-radiansfloorceilingroundtruncatesigncisunpolarchrrandsincostanseccoseccotansinhcoshtanhsechcosechcotanhasinacosatanatan2asecacosecacotanasinhacoshatanhasechacosechacotanhbytescapitalizech…
sorear Is it reasonable to require subs and methods with is rw parameters to be predeclared? 22:27
sbp ash_: 22:30
rakudo: my $x = 4096; say :16($x)
p6eval rakudo 0d3c66: OUTPUT«16534␤»
sbp can't remember the way to do non-decimal to others 22:31
rakudo: my $x = :16("4096"); say :10($x)
er
p6eval rakudo 0d3c66: OUTPUT«16534␤»
sbp well that didn't work anyway
rakudo: my $x = :16(16534); say :10($x) 22:32
p6eval rakudo 0d3c66: OUTPUT«91444␤»
sbp meh
22:32 leprevost left
ash_ :\d() doesn't work that way 22:32
sbp demonstrably 22:33
ash_ it confused me too :P
sbp :-)
22:33 leprevost joined
sbp hmm. Sep 01 22:41:38 <TimToady> however, as a short term expedient, .fmt('%32X', :base($r)) could override the 16-ness of X 22:34
sjohnson rakudo: say ~("pig".^methods) 22:46
p6eval rakudo 0d3c66: OUTPUT«ACCEPTS perl pred succ WHICH Bool Str encode Numeric Real Int Rat Num abs exp log log10 sqrt roots to-radians from-radians floor ceiling round truncate sign cis unpolar chr rand sin cos tan sec cosec cotan sinh cosh tanh sech cosech cotanh asin acos atan atan2 asec acosec
..acotan as…
sjohnson rakudo: say ~"pig".^methods
p6eval rakudo 0d3c66: OUTPUT«ACCEPTS perl pred succ WHICH Bool Str encode Numeric Real Int Rat Num abs exp log log10 sqrt roots to-radians from-radians floor ceiling round truncate sign cis unpolar chr rand sin cos tan sec cosec cotan sinh cosh tanh sech cosech cotanh asin acos atan atan2 asec acosec
..acotan as…
22:46 timbunce left 22:47 dju_ is now known as dju 22:48 dju left 22:52 dju joined 22:55 leprevost left
sorear let's get rid of cosec, cotan, cosech, cotanh, acosec, acotan, etc 22:56
22:56 dju left, dju joined
flussence maybe stick them behind a "use Trig;"? 22:57
sorear perhaps
sjohnson damn perl is handy.
sorear but nobody (well, not me) will look for cosec. cosecant, or csc 22:58
idiosyncratic abbreviations don't do anyone good
ash_ aren't they part of Cool? 22:59
sorear right
ash_ rakudo: say ~"Stuff".^methods(:local)
p6eval rakudo 0d3c66: OUTPUT«ACCEPTS perl pred succ WHICH Bool Str encode␤»
ash_ rakudo: say ~Cool.^methos(:local)
p6eval rakudo 0d3c66: OUTPUT«Method 'methos' not found for invocant of class 'ClassHOW'␤ in main program body at line 22:/tmp/63RirSifki␤»
sorear most of the Str, Num, List methods are actually in COOL
23:05 Ross^ left, Intensity left 23:12 stkowski joined 23:14 Intensity joined
TimToady I think perhaps the default scope of .^methods is wrong 23:15
by default it should not include Cool, but maybe everything up to Cool 23:16
flussence a .^methods(:grouped) would be helpful
TimToady or that
sorear TimToady: What's so special about Cool that it gets special treatment by ClassHOW? 23:18
TimToady it defines language more than it defines a particular type 23:19
23:19 jhuni joined
TimToady likewise for listy methods in Any 23:20
ingy when is teh next R*?
sorear: you going to PPW?
sorear no 23:22
ingy :(
so sad
TimToady: you?
TimToady well, if you look at who is supposedly giving the keynote... 23:23
ingy MOTHER OF PERL! sorry...
so when is teh next R*?
perigrin ingy: Father of Perl ... do we need gender identification flash cards?
ingy I got a couple mods to get in... 23:24
23:24 Limbic_Region joined
ingy perigrin: oh right, I was thinking of /me.... 23:24
MOTHERF***ER OF PERL
perigrin :)
TimToady I identify with all genders, one way or another. 23:25
ingy *gender 23:26
Limbic_Region For perl 6 implementations like Rakudo that do not also implement their own VM and rely on Parrot, is there any reason to believe that user defined data structure will perform worse than a built-in as is the case in perl 5? 23:29
TimToady that would depend on how you define "Parrot" 23:30
sorear Limbic_Region: all Rakudo data structures are user-defined from Parrot's current POV
an object is likely to perform much better than an array because you aren't paying for lazy iterator extension
Limbic_Region sorear - right, that's my point 23:31
TimToady - let me try and rephrase then
sorear (there are planned major overhauls to Parrot and Rakudo object handling)
in some senses, Rakudo does implement its own VM; it builds on top of Parrot in much the way Perl 5 builds on top of C89
although Rakudo is a considerably thinner layer 23:32
TimToady so by the current definition of "Parrot", it's a bit like P5
Limbic_Region hrm, having a hard time being clear in what I am asking
sorear In Perl 5, objects are (generally) a kind of hash 23:33
In Perl 6, Hash.isa(P6opaque)
(is it bad that I use 'local' a LOT more now?) 23:34
TimToady er, huh? 23:35
Limbic_Region ok, I recently wrote a solution to a problem of finding the top-N of a list using a heap implemented in pure perl using an array
as a counter benchmark data point, I used an array that was always in sorted order (use bin search to find insertion point and then use splice)
according to the math, the heap should have won hands down but didn't 23:36
my guess is that splice is implemented as highly optimized C using memcpy and what not
TimToady right
Limbic_Region where as the heap has to do many heapify-up and heapify-down operations that aren't
sorear p5 or p6?
TimToady p5 I presume 23:37
Limbic_Region this was in p5, but it made me wonder about perl 6
so I am thinking, splice's equivalent in perl 6 will be written in perl 6 and will be translated into PIR/PASM/flavor of the month and run on parrot
there isn't any specific optimization to make that go faster (unless someone spends time tuning it) 23:38
so, give the same scenario in perl 6, could I expect the same unexpected results or the expected expected results?
TimToady in P6, a memcopy of the pointers would look more like @array[@foo] »:=« @array[@bar]
Limbic_Region or is the answer, it depends on how naive you implement the heap in perl 6 23:39
s/ve/vely/
sorear Limbic_Region: PIR has a single instruction 'splice' which is ultimately used by the Perl 6 method
TimToady my point is that P6 has binding that is one step closer to the metal than assignment 23:40
sorear TimToady: How would the impl be expected to know that @foo and @bar are ranges?
also, my brain is currently breaking at the notion of »:=«
perigrin my eyes are tripping over it 23:41
TimToady well, okay, dispatch it on two range objects, if it makes you happier :)
and yes, hyper binding is probably not as bare metal as a memcopy 23:42
flussence am I close in guessing that means "copy-on-write all these over to the left"?
TimToady but maybe it could be
sorear wonders if it would make sense to say that my int @foo; @foo[0] := 2; is legal but ... = 2 is not
TimToady it means bind @array[$n] := @array[$m], $array[$n+1] := @array[$m+1], etcl 23:43
Limbic_Region incidently, the same exact implementation when using Heap::Simple::XS instead of pure perl heap ended up beating the splice() solution hands down
TimToady and presumably you'd want some way to manage when $m < $n as well as $m > $n
flussence doesn't understand the binding operator all that well 23:44
23:48 rjbs joined
ash_ flussence: do you know C pointers? 23:48
flussence vaguely...
ash_ its kinda similar to that
rjbs So, I'm looking for the documentation of Str and Buf. I'm not sure exactly where I'd find these. I started at perl6.org/ and then perlcabal.org/syn/ 23:49
flussence I'm looking at S03... are they like p5's tie() stuff?
ash_ str specifically is at perlcabal.org/syn/S32/Str.html
Buf is at perlcabal.org/syn/S32/Containers.html#Buf
TimToady note that Buf is only slightly implemented yet
rjbs Thanks. 23:50
TimToady though I'm currently using one in Real Code
rjbs Mostly, I want to look at them to steal for some ByteString / TextString library I am likely to end up writing for use in p5 at work.
(But I am also interested in them, in general, anyway!) 23:51
TimToady given $tty.read(10)[*]».chr.join { ... }
Limbic_Region TimToady - I haven't noticed a significant number of Synopsis commits lately. Does this mean that we are nearly converged, that you have been busy with other things, that you are "thinking" or something else entirely?
TimToady it mostly means I'm been pretending to be a user and actually programming in Perl 6 a lot
rjbs What does the [*] do there?
TimToady but hopefully we're also converging
treats the Buf as an array and returns all the chars as numbers
rjbs (I assumed the 10 means 'read 10 octets') 23:52
TimToady yes, I have the tty in raw mode, and it hands me an entire escape sequence as a single buf
23:52 saaki joined
TimToady actually using run "stty raw -echo min 1 time 1"; 23:52
rjbs Cool. So (I am only baby-literate in p6) the [*] latches on to the fact that the Buf does Array (or some Array-like role) and the * here is a Whatever-y slurpy "everything"? 23:53
TimToady currently the Buf type is happier being treated as Positional than as Stringy
correct
rjbs Neat, thanks. 23:54
TimToady hopefully we'll eventually get native bufs of various bit-nesses
then we can do heaps of ints with »=« instead of »:=« and still be efficient, hopefully 23:55
that is, with a compact native representation of ints, hyper assignment can turn into memcopy 23:56
rjbs That's kind of sick. :-) 23:57
TimToady but I need to think about overlap issues some, and whether that needs to be user-visible
memcopy hides it, after all
rjbs Seeing all the funny chars in here reminds me, you may be amused by: met.al/at1
TimToady you think that's sick, how about »+=« and such?
rjbs What "that" is it that you're considering the user-visibility of? 23:58
Oh, nevermind, I've been enlightened.
rjbs also only does baby C.
Limbic_Region rjbs - I am currently porting a red-black tree implementation from C to perl only so that I can then turn bits of it into XS 23:59
if I knew C better, I would just go C -> XS