The topic for #perl6 is: pugscode.org/ planetsix.perl.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, elf: etc.) (or perl6: for all) | irclog: irc.pugscode.org/
Set by TimToady on 25 November 2008.
00:02 araujo left
pugs_svn r24640 | mberends++ | first commit, add self to AUTHORS 00:12
00:18 araujo joined 00:21 Limbic_Region left 00:39 DemoFreak left 01:04 jhorwitz left
pugs_svn r24641 | ruoso++ | [smop] ControlExceptionReturn provides a helper method for the implicit CONTROL bblock of routines. 01:04
r24641 | ruoso++ | [mildew] support twigil in &?ROUTINE
r24641 | ruoso++ | [mildew] implement implicit CONTROL in Routines...
01:06 stephens left 01:20 mberends_ left 01:24 kisu_ is now known as kisu
pugs_svn r24642 | ruoso++ | [smop] fetches the routine from the scalar in handle_return 01:48
r24642 | ruoso++ | [mildew] fix missing goto in the implicit CONTROL block of routines.
r24642 | ruoso++ | [mildew] That means YAY! mildew implements the seantics of return control exception
ruoso for those who are curious, look at v6/mildew/t/control_exception_routine.t 01:51
ruoso sleep ^ 01:52
er...
ruoso sleep &
02:06 Limbic_Region joined 02:12 Limbic_Region left 02:18 nomas joined 02:19 nomas left 02:34 aindilis` is now known as aindilis 02:45 dwhipp joined 02:46 Whiteknight joined
dwhipp pugs: 10 < 5|25 < 20 02:46
p6eval pugs: RESULTĀ«(Bool::False)Ā»
dwhipp rakudo: 10 < 5|25 < 20 02:47
p6eval rakudo 34401: RESULTĀ«any(Bool::True, Bool::False)Ā»
dwhipp rakudo: say "true" if 10 < 5|25 < 20
p6eval rakudo 34401: OUTPUTĀ«trueā¤Ā»
dwhipp rakudo: say "false" unless 10 < 5|25 < 20
p6eval rakudo 34401: RESULTĀ«any(Bool::True, Bool::False)Ā»
03:11 apeiron left
dwhipp rakudo: sub infix:<%%> { ... } 03:16
p6eval rakudo 34401: OUTPUTĀ«Statement not terminated properly at line 1, near ":<%%> { .."ā¤ā¤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)ā¤Ā»
dwhipp pugs: sub infix:<%%> { ... }
p6eval pugs: RESULTĀ«\sub :(@_) "$_" := "Scalar" #<Scalar:0xb7a500b5>ā¤ "@_" := "Array" #<Array:0xb7a500bd>ā¤ "&?ROUTINE" := "Sub" #<Sub:0xb7184961>ā¤ "&?BLOCK" := "Sub" #<Sub:0xb7184961> {"&infix:%%" := "Sub" #<Sub:0xb653965d>, "$_" := "Scalar" #<Scalar:0xb7a6fb25>ā¤ ...
03:17 alanhaggai_ joined 03:31 alanhaggai left 03:36 meppuru joined 03:40 Vejeta joined 03:52 meppl left 03:57 azawawi joined 03:58 apeiron joined 03:59 alanhaggai_ is now known as alanhaggai 04:01 elmex_ joined 04:09 azawawi_ left 04:17 elmex left, elmex_ is now known as elmex 04:23 dwhipp left 04:26 Whiteknight left 04:27 alc joined 04:29 abebae joined 04:30 alester joined 04:32 ChrisDavaz joined 04:48 alc left 04:53 drbean_ joined 05:05 drbean left
meppuru good night 05:10
05:12 meppuru left 05:18 cspencer joined 06:14 abebae left 06:26 cspencer left
slavik anyone around? 07:28
does Perl6 have SysV IPC? 07:30
mberends There's a new IO subsystem in the pipeline that will also do sockets etc. Timescale unknown. 07:37
pun not intended
slavik mberends: I am also interested in msq, shm and such 07:38
not just sockets
07:40 tuxdna joined
slavik I was thinking of using mod_perl as a wrapper for perl6 code and then using fifos to communicate between the two for whatever perl6 needed. like DB connections and such 07:40
mberends I like playing with IPC too. SysV is probably a longer way away. First Parrot needs to get there, then Rakudo.
slavik mberends: but what about NCI bindings? 07:41
can't parrot langs just use NCI bindings to the C library for IPC and such? 07:42
mberends recently I read something here about NCI being tricky. 07:43
slavik oh ...
mberends sorry
slavik hmm, there is no threading in perl6, is there? 07:44
mberends the November wiki engine has a CGI style interface to a webserver
no I don't think threading is available either 07:45
slavik I am waiting for mod_parrot/mod_perl6 ... 07:46
mberends cool, it will be great to run Perl 6 based web servers
slavik it's being worked on, but so far, apache fails to load it due to null PMC access or something like that 07:47
mberends null PMC access can mean any of hundreds of possible problems 07:48
slavik so I've been told
:(
mberends did you ever try Perl 5 HTTP::Daemon? 07:49
it should be possible to emulate that in Rakudo with the help of netcat (nc)
also what November does, but with netcat as a primitive webserver 07:50
slavik mberends: the biggest issue is not running perl6 code, because then, you could have a simple perl5/php wrapper to just run the specified perl6 code through rakudo and make it look like perl6 code with mod-rewrite 07:51
mberends yes, you really want tighter integration
me, I'm happy if Perl 6 is doing the application work, regardless of the plumbing 07:52
slavik so that when /index.p6 is requested, the actual page to load will be: /index.php?file=index.p6 and index.php will simply be something like <? print `perl6 $DocumentRoot/index.p6` ?> or something like that 07:53
right
mberends: is there a DBI in Perl6?
mberends there is only a MySQL driver, but it does SELECT, INSERT etc 07:54
slavik does it do update?
mberends: I am not looking for advanced things for DB, just simple stuff that a web site might need 07:55
I want to build a wordpress that does not suck
in perl6
mberends it's probably workable, but I never looked closely enough
slavik hmm, I only see postgre pbc/pir ... 08:06
that's ok, too I guess
08:06 araujo left
mberends see parrot/examples/nci/mysqltest.p6 and parrot/ext/SQLite3/DBDI/Driver/SQLite3.pm 08:09
slavik neat, ty 08:10
mberends the MySQL code looks less complete than the SQLite stuff 08:11
slavik k
it will probably be good by the time mod_perl6 is ready ;) 08:12
mberends definitely
08:16 vixey joined
slavik someone just tried to use re to parse Xorgconf ... naturally, I unleassed a P6 grammar on them 08:32
unleashed*
08:36 dukeleto joined
slavik opensource.nokia.com/projects/symbi...index.html 08:42
mberends interesting, I use a 9300i Communicator. The Development Perl is 5.9 though... 08:45
08:46 dukeleto_ left
slavik 5.9 is good enough ... 08:46
wow 9300i, that's old
I got the e90 :D 08:47
opensource.nokia.com/projects/PAMP
WOAH!!!
apache, mysql and php on the communicator 08:48
08:48 azawawi_ joined
slavik bitchin' :) 08:49
mberends impressed
08:50 barney joined 08:56 dukeleto left 08:58 justatheory joined, dukeleto joined 09:01 azawawi left, azawawi_ is now known as azawawi 09:06 iblechbot left 09:15 slavik left 09:21 dukeleto_ joined 09:33 dukeleto left 09:37 dukeleto joined 09:42 dukeleto left 09:48 dukeleto joined, dukeleto_ left 10:09 azawawi left 10:10 dukeleto_ joined, dukeleto left 10:20 justatheory left 10:26 masak joined 10:35 dukeleto joined
masak @tell TimToady in case I understood you correctly and prefix:<*> is a fossil, and you're thinking of removing it, I've found occurences at S02:780, S03:259 and S13:50 10:42
lambdabot Consider it noted.
masak @ask TimToady do Rats have introspection methods? do rules and grammars? 10:43
lambdabot Consider it noted.
masak @ask S02:1885 says `system "greet";` -- shouldn't that be `run "greet";`? 10:44
lambdabot Consider it noted.
10:44 Grrrr joined 10:45 dukeleto_ left
literal I hope you're not expecting lambdabot to deliver a message to S02:1885 :) 10:47
masak literal: S02:1885 is a very old friend of mine.
@ask TimToady S02:1885 says `system "greet";` -- shouldn't that be `run "greet";`? 10:48
lambdabot Consider it noted.
masak literal: thanks. :P
10:50 ilogger2 joined
masak I read through all the synopses tonight, looking for omissions in S29. 10:52
now I have a long list.
should I (1) nopaste it here so that people can comment on it, (2) ask the questions one by one, or (3) blog about it?
&
10:56 alanhaggai_ joined 10:57 Grrrr joined 10:59 iblechbot joined 11:26 alanhaggai_ left 11:37 alanhaggai joined
pugs_svn r24643 | ruoso++ | [mildew] support for CALLER pseudo-package using a "flattened lexical scope" that turns postcircumfix:{ } into lookup (Implementing MY:: should be dead-easy now). 11:53
r24643 | ruoso++ | [smop] mold frame now has .lexical that stores the lexical scope for that frame.
r24643 | ruoso++ | [smop] s1p_code sets the lexical scope in the frame.
r24643 | ruoso++ | [smop] s1p_flattenedscope implements postcircumfix:{ } by calling lookup in the proxied scope
r24644 | ruoso++ | [mildew] return_function.t shows how the "return" function willbe implemented, and it is implemented in Perl 6 ;). 11:58
r24644 | ruoso++ | [mildew] add a test for CALLER::<> and MY::<>
r24644 | ruoso++ | [mildew] support MY::<>
ruoso the return function almost works in mildew, it is getting out of the correct routine, it is not yet setting the return value correctly... 11:59
look into v6/mildew/t/return_function.t 12:00
12:03 pmurias joined
ruoso hi pmurias 12:03
pmurias ruoso: hi 12:05
ruoso good news, we have a return function ;)
it's almost working
12:06 azawawi joined, alanhaggai_ joined
azawawi hi 12:06
ruoso hi azawawi
pmurias ruoso: is return a function? 12:07
ruoso a sub, actually
but I think it is the same thing
12:10 alanhaggai left
pmurias perl6: say &return 12:10
p6eval elf 24644: OUTPUTĀ«/home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.rb:141:in `block in to_dump0': undefined method `to_dump0' for true:TrueClass (NoMethodError)ā¤ from /home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.rb:140:in `each'ā¤ from
../home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.r...
..rakudo 34420: OUTPUTĀ«returnā¤Ā»
..pugs: OUTPUTĀ«<SubPrim(return)>ā¤Ā»
pmurias perl6: say &say
p6eval elf 24644: OUTPUTĀ«/home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.rb:141:in `block in to_dump0': undefined method `to_dump0' for true:TrueClass (NoMethodError)ā¤ from /home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.rb:140:in `each'ā¤ from
../home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.r...
..rakudo 34420: OUTPUTĀ«sayā¤Ā»
..pugs: OUTPUTĀ«<SubPrim(say)>ā¤Ā»
pmurias perl6: say &no_such
p6eval elf 24644: OUTPUTĀ«/home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.rb:141:in `block in to_dump0': undefined method `to_dump0' for true:TrueClass (NoMethodError)ā¤ from /home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.rb:140:in `each'ā¤ from
../home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.r...
..pugs: OUTPUTĀ«*** ā¤ Unexpected end of inputā¤ expecting "::" or signature valueā¤ Variable "&no_such" requires predeclaration or explicit package nameā¤ at /tmp/MoMrARxOKr line 1, column 13ā¤Ā»
..rakudo 34420: OUTPUTĀ«ā¤Ā»
azawawi quick question, what's a good module name that converts Arabic to Arabish (i.e. sms chat arabic)? 12:11
ruoso now we have another hard issue to solve... 12:12
pmurias yes... 12:13
ruoso I think the spec says a capture in item context returns the invocant
but that doesn't fit very well with the return function... 12:14
pmurias $$capture?
ruoso yes\
12:14 jiing_ joined
ruoso rakudo: sub foo { return 1 }; my @a = foo; say @a.perl; 12:14
p6eval rakudo 34420: OUTPUTĀ«[1]ā¤Ā»
ruoso rakudo: sub foo { return 1,2 }; my @a = foo; say @a.perl; 12:15
p6eval rakudo 34420: OUTPUTĀ«too many arguments passed (2) - at most 1 params expectedā¤current instr.: 'return' pc 14386 (src/builtins/control.pir:29)ā¤Ā»
ruoso pugs: sub foo { return 1,2 }; my @a = foo; say @a.perl;
p6eval pugs: OUTPUTĀ«\(1, 2)ā¤Ā»
ruoso it seems that both pugs and rakudo doesn't have that well solved also 12:16
pugs: sub foo { return 1,2 }; my $a = foo; say $a.perl; 12:17
p6eval pugs: OUTPUTĀ«\\(1, 2)ā¤Ā»
pmurias ruoso: the capture can't change in item context otherwise you wouldn't be able to store it easily
ruoso actually, if we don't BIND it, there's no problem 12:18
because it will be safe inside a scalar
pmurias $foo = \(1,2,3); # the capture it's in item context here
ruoso hmm... indeed
maybe the \ operator already jails it inside a scalar?
and the | operator takes it out 12:19
pmurias maybe 12:27
ruoso is there some spec on how this should be made? 12:29
I mean
my $a = sub { return 1,2 }.()
my @a = sub { return 1,2 }.()
my @a = sub { return 1 }.()
my $a = sub { return 1 }.()
pmurias i'm in p5 interop mode today so the fine points of p6 escape me ;) 12:31
ruoso TimToady, what should the above result? 12:32
vixey perl6: ().() 12:33
p6eval rakudo 34420: OUTPUTĀ«invoke() not implemented in class 'ResizablePMCArray'ā¤current instr.: '_block14' pc 61 (EVAL_15:37)ā¤Ā»
..elf 24644: OUTPUTĀ«Use of uninitialized value in subroutine entry at (eval 115) line 3.ā¤Can't use string ("") as a subroutine ref while "strict refs" in use at (eval 115) line 3.ā¤ at ./elf_f line 3861ā¤Ā»
..pugs: OUTPUTĀ«*** Cannot cast from VList [] to Pugs.AST.Types.VCode (VCode)ā¤ at /tmp/QXdF09T87O line 1, column 1 - line 2, column 1ā¤Ā»
12:36 icwiener joined
pmurias lunch with grandparents& 12:36
12:36 pmurias left 12:47 azawawi left 12:49 lichtkind joined 12:58 dukeleto_ joined 12:59 ejs joined, c9s joined 13:05 alanhaggai_ is now known as alanhaggai
ruoso just sent a mail to p6-language about the return issue 13:20
13:24 dukeleto_ left
ruoso rakudo: my $word = 'banana'; my $guess = '??????'; my $letter = 'a'; while ($word ~~ /<$letter>/) { $guess[$/.start] = $letter}; say $guess; 13:26
p6eval rakudo 34420: OUTPUTĀ«Statement not terminated properly at line 1, near "~~ /<$lett"ā¤ā¤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)ā¤Ā»
ruoso rakudo: my $word = 'banana'; my $guess = '??????'; my $letter = 'a'; while ($word ~~ /<$letter>/) { $guess[$/.start] = $letter}; say $guess; 13:27
p6eval rakudo 34420: OUTPUTĀ«Statement not terminated properly at line 1, near "~~ /<$lett"ā¤ā¤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)ā¤Ā»
ruoso rakudo: my $word = 'banana'; my $guess = '??????'; my $letter = 'a'; while ($word ~~ /$letter/) { $guess[$/.start] = $letter}; say $guess;
p6eval rakudo 34420: OUTPUTĀ«Null PMC access in get_string()ā¤current instr.: '' pc 342 (EVAL_13:139)ā¤Ā»
ruoso rakudo: my $word = 'banana'; my $guess = '??????'; my $letter = 'a'; while ($word ~~ /$letter/) { $guess.substr($/.start) = $letter}; say $guess;
p6eval rakudo 34420: OUTPUTĀ«Null PMC access in get_string()ā¤current instr.: '' pc 342 (EVAL_13:139)ā¤Ā»
ruoso pugs: my $word = 'banana'; my $guess = '??????'; my $letter = 'a'; while ($word ~~ /$letter/) { $guess.substr($/.start) = $letter}; say $guess; 13:28
p6eval pugs: OUTPUTĀ«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {ā¤ unshift @INC, '/home/evalenv/pugs/perl5/Pugs-Compiler-Rule/lib';ā¤ unshift @INC, '/home/evalenv/pugs/third-party/Parse-Yapp/lib';ā¤ eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;ā¤}ā¤'Pugs::Runti...
ruoso pugs: my $word = 'banana'; my $guess = '??????'; my $letter = 'a'; while ($word ~~ /<$letter>/) { $guess.substr($/.start) = $letter}; say $guess;
p6eval pugs: OUTPUTĀ«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {ā¤ unshift @INC, '/home/evalenv/pugs/perl5/Pugs-Compiler-Rule/lib';ā¤ unshift @INC, '/home/evalenv/pugs/third-party/Parse-Yapp/lib';ā¤ eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;ā¤}ā¤'Pugs::Runti...
ruoso hmpf
rakudo: my $word = 'banana'; my $guess = '??????'; my $letter = 'a'; while ($word ~~ /a/) { $guess.substr($/.start) = $letter}; say $guess;
p6eval rakudo 34420: OUTPUTĀ«Method 'start' not found for invocant of class 'Match'ā¤current instr.: '_block30' pc 387 (EVAL_13:161)ā¤Ā»
ruoso rakudo: my $word = 'banana'; my $guess = '??????'; my $letter = 'a'; while ($word ~~ /a/) { $guess.substr($/.pos) = $letter}; say $guess;
p6eval rakudo 34420: OUTPUTĀ«Method 'pos' not found for invocant of class 'Match'ā¤current instr.: '_block30' pc 387 (EVAL_13:161)ā¤Ā»
13:29 dukeleto joined
ruoso rakudo: my $word = 'banana'; my $guess = '??????'; my $letter = 'a'; while ($word ~~ /a/) { $guess.substr($/.from) = $letter}; say $guess; 13:30
p6eval rakudo 34422: No output (you need to produce output to STDOUT)
ruoso I guess using the match in the while still doesn't provide the desired outcome 13:31
rakudo: my $word = 'banana'; my $guess = '??????'; my $letter = 'a'; $word ~~ /a/; $guess.substr($/.from) = $letter; say $guess;
p6eval rakudo 34422: OUTPUTĀ«??????ā¤Ā»
ruoso rakudo: my $word = 'banana'; my $guess = '??????'; my $letter = 'a'; $word ~~ /a/; $guess[$/.from] = $letter; say $guess;
p6eval rakudo 34422: OUTPUTĀ«Method 'postcircumfix:[ ]' not found for invocant of class 'Str'ā¤current instr.: 'postcircumfix:[ ]' pc 1600 (src/classes/Positional.pir:85)ā¤Ā»
ruoso rakudo: my $word = 'banana'; my $guess = '??????'; my $letter = 'a'; $word ~~ /a/; $guess.substr($/.from, 1, $letter); say $guess;
p6eval rakudo 34422: OUTPUTĀ«too many arguments passed (4) - at most 3 params expectedā¤current instr.: 'parrot;Any;substr' pc 11730 (src/builtins/any-str.pir:534)ā¤Ā»
ruoso rakudo: my $word = 'banana'; my $guess = '??????'; my $letter = 'a'; $word ~~ /a/; $guess.substr($/.from, $letter); say $guess; 13:32
p6eval rakudo 34422: OUTPUTĀ«??????ā¤Ā»
ruoso rakudo: my $word = 'banana'; my @guess = <? ? ? ? ? ?>; my $letter = 'a'; $word ~~ /a/; @guess[$/.from] = $letter; say $guess;
p6eval rakudo 34422: OUTPUTĀ«Scope not found for PAST::Var '$guess'ā¤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:102)ā¤Ā»
ruoso rakudo: my $word = 'banana'; my @guess = <? ? ? ? ? ?>; my $letter = 'a'; $word ~~ /a/; @guess[$/.from] = $letter; say @guess;
p6eval rakudo 34422: OUTPUTĀ«?a????ā¤Ā»
13:33 alanhaggai_ joined
ruoso rakudo: my $word = 'banana'; my $guess = <? ? ? ? ? ?>; my $letter = 'a'; while ($word ~~ /a/ :global) { $guess.substr($/.from) = $letter}; say $guess; 13:35
p6eval rakudo 34422: OUTPUTĀ«Statement not terminated properly at line 1, near ":global) {"ā¤ā¤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)ā¤Ā»
ruoso rakudo: my $word = 'banana'; my $guess = <? ? ? ? ? ?>; my $letter = 'a'; while ($word ~~ m:g/a/) { $guess.substr($/.from) = $letter}; say $guess; 13:36
p6eval rakudo 34422: OUTPUTĀ«Statement not terminated properly at line 1, near "a/) { $gue"ā¤ā¤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)ā¤Ā»
13:36 alanhaggai left, alanhaggai_ is now known as alanhaggai, cookys joined 13:37 kisu_ joined
ruoso does rakudo support regex modifiers? 13:39
13:40 dukeleto_ joined 13:48 dukeleto left 13:56 aindilis joined 13:57 DemoFreak joined 14:02 meppl joined 14:04 jan_ joined
masak rakudo: my $a = 'abc'; substr($a, 1, 1) = 'x'; say $a 14:06
p6eval rakudo 34422: OUTPUTĀ«abcā¤Ā»
14:08 justatheory joined 14:13 mberends joined 14:14 Grrrr left
pugs_svn r24645 | ruoso++ | [smop][mildew] return is taking only the first positional argument at the moment. 14:19
mberends masak, that last substr was pure GWBASIC - how dare you speak that here! 14:22
masak mberends: S29 and some spectests are on my side on that one, I'm afraid.
but Rakudo doesn't implement it yet.
pugs: my $a = 'abc'; substr($a, 1, 1) = 'x'; say $a
p6eval pugs: OUTPUTĀ«axcā¤Ā»
masak Pugs does.
mberends ;-) 14:23
btw, it made me cackle to read your script that began 'sub merge' 14:24
masak I've been cackling at that too.
though it was quite unintentional, I swear.
mberends: did you experience any segfaults when you ran the program? 14:25
14:25 pmurias joined
mberends yes, you mean just ^D to an input prompt? 14:26
14:26 alanhaggai left
masak for example, yes. 14:26
actually finishing a game sets it off too.
mberends I think exit() is broken. I hit that problem elsewhere.
masak yes, I have an RT ticket about that somewhere. 14:27
mberends try perl6 -e'exit(0)'
masak works fine.
pugs_svn r24646 | ruoso++ | [mildew] support (|$capture) in a signature, this means return is now returning a capture, so we are depending on the issue posted on p6-language to proceed 14:28
masak ah, #57330 14:29
mberends exit() has segfaulted here on Debian amd64 for quite some time
masak mberends: have you reported it to rakudobug? 14:30
mberends sorry, no 14:31
masak please do. :) the devs love to hear about segfaults. 14:32
14:32 ejs left
mberends ok, later today, when full attention span available 14:33
14:33 ejs joined
masak mberends: sure, no rush. 14:33
mberends later will also be able to try druid game a few more times 14:34
masak \o/ 14:35
I should work on that P2P feature, then :) 14:36
mberends really? with UDP or TCP?
masak a bit more lo-tek than that. my current plan is to imitate git's SHA1 hashes, where a druid game state corresponds to a git commit 14:37
mberends heh 14:38
masak all the player's ongoing games would reside in a ~/.druid file
I don't know if it's such a good idea, but I thought I'd try ;)
mberends nice, when you have neurons and hertz to burn.. 14:39
masak well, it is Christmas, after all ;) 14:40
mberends therefore calories to burn as well..
14:48 riffraff joined 14:56 abebae joined, Grrrr joined
pugs_svn r24647 | ruoso++ | [mildew] signature still BIND values for now... 15:00
r24647 | ruoso++ | [smop] mold debug prints the pointer of the frame, so we know when it is recursing...
r24647 | ruoso++ | [smop] native capture implements (partially) the coercion to item context as in the p6-language post
15:03 c9s left, c9s joined, c9s left, c9s joined, c9s left, c9s joined 15:05 alanhaggai joined
pugs_svn r24648 | pmurias++ | [smop] calling arbitary methods on SV* works, added SV*.int 15:17
pmurias moritz_: ping
15:20 rff joined
pmurias @tell moritz_ i changed smop to use cmake instead of scons, and so we need scons in the chroot for the smop evalbot to work 15:23
lambdabot Consider it noted.
barney did you mean: scons instead of cmake ? 15:28
15:30 abebae left 15:31 riffraff left
pmurias barney: yes 15:32
15:32 dukeleto_ left 15:33 dukeleto joined
pmurias mildew: $OUT.print("hi") 15:35
p6eval mildew: OUTPUTĀ«Use of uninitialized value $output in concatenation (.) or string at mildew line 628.ā¤output= too many arguments --exec --file /tmp/5Lf3TQu3LD at mildew line 628.ā¤Ā»
pugs_svn r24649 | pmurias++ | [evalbot] update the way mildew is invoked 15:39
pmurias evalbot control restart 15:40
mildew: $OUT.print("hi")
15:40 p6eval joined
pmurias mildew: $OUT.print("hi") 15:40
p6eval mildew: No output (you need to produce output to STDOUT)
15:41 dukeleto left
pmurias mildew: $OUT.print("hi") 15:41
p6eval mildew: No output (you need to produce output to STDOUT)
pmurias mildew: $OUT.print("hi") 15:43
p6eval mildew: No output (you need to produce output to STDOUT)
15:44 dukeleto joined
masak @ask TimToady is .as still a part of Perl 6, or is the usage at S02:707 a fossil? 15:58
lambdabot Consider it noted.
16:00 jhorwitz joined
pmurias pmichaud: what happend to the "This week in Perl 6" revival plan? 16:03
pmichaud i got sidetracked :-(
I still need to be doing it, though.
so far I've been more successful at writing code than writing prose 16:04
on the whole I prefer that for now.
of course, I'd be very happy if someone else decided to pick it up... :-) 16:05
16:09 c9s left, c9s joined 16:15 alanhaggai_ joined 16:19 cspencer joined 16:23 alanhaggai left, alanhaggai_ is now known as alanhaggai
pmurias ruoso: when i load SMOP.pm from P5Interpreter.eval i get: 16:30
Can't load module SMOP, dynamic loading not available in this perl. (You may need to build a new perl executable which either supports dynamic loading or has the SMOP module statically linked into it.)
ruoso pmurias, you need to initialize the Dynaloader 16:31
pmurias, see perldoc perlembed
rakudo_svn r34428 | pmichaud++ | [rakudo]: spectest-progress.csv update: 264 files, 5905 passing, 0 failing 16:40
16:42 alanhaggai_ joined 16:43 rff left 16:44 alanhaggai left
masak pmichaud: greetings. I've combed through the specs and found omissions in S29. now I have a bigger list than before I lost my laptop. :) 16:51
pmurias: but I recall having something on the list that you said about the functions needing to be reorganized the same way as Rakudo's builtins. what was that, more exactly? 16:52
sorry, that should be pmurias, no pmurias. 16:53
&
pmichaud masak: (reorganized) most of the builtins are now methods on Any, instead of methods on List, Str, Num, etc. 16:57
as far as where to send the list, my first thought is p6l, but perhaps it would be better to clean them up first. Discussions on p6l sometimes take odd tangents that don't lead to resolution. 16:58
17:03 araujo joined 17:04 alanhaggai_ is now known as alanhaggai 17:06 icwiener left
masak pmichaud: I've almost cleaned the list up so that I can nopaste it here. I'll do that first, and maybe some things will get resolved immediately. 17:06
pmichaud okay. I expect to be distracted over the next day or so, as I'm working on a major refactor of Rakudo's parameter and variable handling
masak basically, I have two types of question: 'should X be in S29' and, 'is this right?' 17:07
pmichaud++
pmichaud: good luck with that. looking forward to the result.
pmichaud yes. We've been needing the refactor for about seven months, and more crufty code keeps being layered on top of the existing code.
masak I like the fact that you care about code purity. 17:08
pmichaud if we don't, then it becomes a house of cards that becomes unmaintainable. See also: Parrot.
masak makes it less likely that Rakudo will paint itself into a corner somehow.
aye.
one example of an 'is this right?' question, is: 'Does everything have .print and .say methods? Where is this documented?' 17:16
cspencer pmichaud: for Ranges created as in: 1..100:by(2), will the :by(2) Pair eventually be passed into the range creation operators as an optional parameter? 17:17
17:18 Matt-W joined
pmichaud yes. 17:19
masak: I think .print and .say are also defined on Any. Perhaps Object.
cspencer i'm just updating one of the range patches i'd submitted earlier, can i stub the :by semantics in as well?
pmichaud sure. 17:20
cspencer ok
thanks!
Matt-W I've been experimenting with Rakudo the last few days. Generally quite impressed with how much works.
So well done 17:21
pmichaud thanks!
masak pmichaud: about most things moving to Any: how does that affect S29? the methods in src/builtins/ are still divided according to the class they are most commonly associated with; it's easier to find things that way. this indicates that the sections (List/Hash/Str etc) in S29 should perhaps remain as they are. but maybe signatures need changing?
Matt-W It is doing some frustrating things though
pmichaud masak: I agree with keeping things in sections -- that's how Rakudo organizes the source also. We have src/builtins/any-{list|num|str}.pir for the various methods. 17:22
masak pmichaud: exactly. that's what I was referring to.
cspencer matt-w: what kind of frustrating things have you noticed? :) 17:23
Matt-W cspencer: sometimes when I try and call a method of an object, or access an attribute from within one of its methods, it starts complaining that it's not defined for invocants of type X, where X has so far been Failure and PGE::Match, neither of which make any sense 17:24
masak are 'use' and 'require' keywords (as opposed to builtin functions)? do they belong in S29?
pmichaud they're keywords.
at least, statement_control:use and package_declarator:require 17:25
masak ok.
I'll leave them out for now.
pmichaud Matt-W: "Failure" usually indicates an uninitialized object of some sort. 17:26
17:26 DemoFreak left
pmichaud Matt-W: "PGE::Match" means that we haven't completely mapped match objects into Rakudo yet. Although I thought I took care of most of them a couple of days ago. 17:26
17:26 DemoFreak joined
Matt-W I just did an svn update, building it to see if it makes any difference 17:26
pmichaud Best way to get them fixed is to report them as bugs: [email@hidden.address] :-)
masak it'd be a nice thing to have a script that extracted things from S29 Ć  la 'perldoc -f' -- hence my question. 'perldoc -f use' does give a summary.
Matt-W What I should do is boil it down to a shorter bit of code that exhibits the problem 17:27
Because I can't see how what I'm doing is wrong, so I do think it is a bug
pmichaud masak: hopefully we can do that when we get a little closer to Prelude. That's one of the driving reasons for me doing today's variable refactor.
Matt-W: you can also nopaste it here
masak pmichaud: ah, goodie.
already now I feel the need to visualise S29 somehow, to get an overview of what it actually contains. if I find the inspiration to write a script that summarizes S29, I might drop it in util/ in the Pugs repo. 17:29
cspencer will :by($x) always assume that $x is going to be a integral step (or numeric even)?
pmichaud cspencer: I don't know.
cspencer ie) is ('A'..'Z'):by('A') illegal?
hmm
ok
pmichaud cspencer: in general it's a little dangerous to assume things are integers in Perl 6. :-)
cspencer heh
masak another question: do junction objects have a .values method? where is this specced? do they have other methods?
pmichaud masak: this has been a point of discussion recently. 17:30
masak cspencer: I'd say it's illegal :)
pmichaud: I guessed as much.
cspencer perhaps i'll just stub them in as Num's then
masak pmichaud: I wouldn't be surprised if they turned out to have all of .values, .keys, and .kv -- that'd at least be consistent. 17:31
pmichaud masak: that would surprise me very much for Junction.
masak pmichaud: that is, they're a kind of collection.
pmichaud but they're not.
Matt-W I'm not sure .keys means anything for a junction
they just have values in them don't they?
masak Matt-W: hm, that's true. they're not ordered.
pmichaud my $a = any( \@a, \@b ); $a.values # should be a junction of the values of @a and @b
masak does Set have all of .keys, .values and .kv? 17:32
pmichaud in general, methods autothread over the values within the Junction. So I'd expect .keys, .kv, etc to do the same.
masak but not .values?
pmichaud and .values, too.
(more)
masak ok 17:33
Matt-W Can I specify how to stringify my own classes in Rakudo yet?
masak Matt-W: yes. just provide a Str method.
pmichaud The latest proposal among the design team was that Junctions have a .eigenstates method to return the components of the Junction as a list
Matt-W masak: excellent. Thanks.
masak pmichaud: oh, that's what the .eigenmumble thing was all about.
pmichaud right. 17:34
so, this is what Rakudo implements at themoment.
but as yet I haven't seen any "official" declaration of it at the moment. I do know that in general treating Junctions like lists is incorrect.
17:34 Grrrr left 17:35 Grrrr joined
masak this is what makes S29 work hard. :) things need to be condensed from traces of discussions and hints. 17:35
ruoso rakudo: sub foo { return 1,2 }; my $a = foo(); say $a.perl
p6eval rakudo 34430: OUTPUTĀ«too many arguments passed (2) - at most 1 params expectedā¤current instr.: 'return' pc 14386 (src/builtins/control.pir:29)ā¤Ā»
pmichaud rakudo doesn't support returning lists yet.
ruoso do you plan already how to make it work? 17:36
pmichaud it'll just package up the arguments into a capture and return that.
ruoso right...
pmichaud, could you please take a look at a message I've sent today to p6-language about return 17:37
?
pmichaud ruoso: I looked at the message, but I don't have a response.
ruoso: and today is a bad day for me to anything but answer very short questions not requiring design
Matt-W oh maybe this is the problem. Are negative array indices implemented yet? 17:38
pmichaud Matt-W: yes, as @a[*-1]
ruoso ok... I think I'll just implement as I think it should be and refactor later if that's not the case...
pmichaud, thanks anyway
Matt-W pmichaud: oh the * is new then. I didn't know about that.
masak Matt-W: the negative array indices mean something else. see S09.
pmichaud ruoso: the question you gave in your message are the same questions I've had about captures.
Matt-W aww now it says null PMC access. Hmm. 17:39
masak: I shall go look
ruoso pmichaud, that's a comforting thought... it's always good to know you're doing the same questions other people is doing...
Matt-W masak: at one time I knew what was going on in Perl 6 inside out, but I lost track of a lot of it since
masak Matt-W: know the feeling. :) 17:40
Matt-W aaah so that's what negative indices do now 17:41
yes that makes sense
TimToady Matt-W: do you need a commit bit?
lambdabot TimToady: You have 10 new messages. '/msg lambdabot @messages' to read them.
pmichaud TimToady: is there a logical ordering to the rules and tokens in STD.pm ? 17:43
Matt-W TimToady: Perhaps if I identify a problem caused by a bug or a missing feature rather than my lacking knowledge of Perl 6
pmichaud (or a general principle that it follows?)
TimToady heh, <lambdabot> Plugin `tell' failed with: thread killed
cspencer timtoady: on the subject of commit bits, i got a pugs svn bit the other day, but my svn username was entered as 'cspenSer' as opposed to 'cspenCer'. is that easily fixable?
TimToady hmm 17:44
pmichaud: not really, other than similar things go close, and ops are in prec order 17:45
pmichaud TimToady: okay, thanks. 17:46
masak TimToady: I had a few spec questions. did they get lost in the threadkill? 17:47
ruoso hi TimToady, I have more hard questions for you ;)
masak rule #3 in language design: everybody wants Larry. 17:48
TimToady cspencer: not sure. can try issuing commitbit under other name and see what it says, or maybe there some way you can fix it
Matt-W pmichaud: I get null PMC every time I try to use [*-1] on an array which is an attribute of an object. Is this expected? 17:49
17:49 alester joined
cspencer timtoady: i've looked through all the web interface options provided to me, but haven't seen anything i can do. a reissue might be the easiest way, when you get a chance :) 17:49
17:49 alanhaggai_ joined
pmichaud Matt-W: it wouldn't surprise me -- I don't know how well object attributes support arrays yet. 17:49
TimToady I've tried a reissue, but it didn't show up in the list as pending, so I dunno... 17:50
pmichaud Matt-W: object attributes are mostly jnthn++'s doing
cspencer timtoady: got it, thank you!
TimToady masak: I backlog
masak rakudo: class A { has @.foo is rw }; my $a = A.new; $a.foo = 1,2,3; say $a.foo[*-1]
TimToady++
p6eval rakudo 34432: OUTPUTĀ«3ā¤Ā»
Matt-W pmichaud: I might see if I can make sense of any of the code for it, I've not got anything else much to do this evening
masak Matt-W: worksforme.
Matt-W masak: hmm
jnthn Matt-W: What doesn't work? 17:51
Matt-W I've got a test case, I'll put it up...
jnthn It's possible it is something that didn't work in the first place, or something that came up in postcircumfix changes and we didn't have tests to identify...
pasteling "Matt-W" at 81.101.136.8 pasted "Object attribute arrays and negative indices" (15 lines, 276B) at sial.org/pbot/34079 17:53
17:53 alanhaggai left
Matt-W I'm using a Rakudo I updated from svn about half an hour ago 17:53
masak Matt-W: should be recent enough :) 17:54
17:54 DemoFreak left
Matt-W It works, by the way, when the array is not part of an object 17:54
17:54 DemoFreak joined
masak rakudo: class A { has @.foo; method bar { @.foo[0] = "Hey" } }; A.new.bar 17:54
p6eval rakudo 34432: RESULTĀ«"Hey"Ā»
masak rakudo: class A { has @.foo; method bar { @.foo[0] = "Hey"; say @.foo[*-1] } }; A.new.bar 17:55
p6eval rakudo 34432: OUTPUTĀ«Null PMC access in find_method()ā¤current instr.: 'parrot;A;_block40' pc 446 (EVAL_13:170)ā¤Ā»
masak there it is.
Matt-W yup
that's exactly it
masak Matt-W: will you submit to rakudobug, or shall I?
pmichaud guesses there's an issue with the @.foo accessor. 17:56
Matt-W If someone can point me at some guidelines for a suitable submission I'll do it
masak Matt-W: just paste the past minute's discussion to [email@hidden.address]
&
Matt-W &...? 17:58
ruoso Matt-W, that usually means that he is putting itself into background
s/itself/himself/
Matt-W ah of course, I assumed it was some further instruction from his previous comment 17:59
pugs_svn r24650 | ruoso++ | [smop] native capture returns an array in item context if it 0 or more than one positional arguments... It returns the first positional argument
Matt-W I should have guessed
ruoso oh wow... now that was a bad commit message
that's what happen when you get up in the middle of the sentence 18:00
Matt-W it's not the best way to stunning sentences...
ruoso now I just need to figure out why that capture is empty... 18:02
18:25 ejs left 18:28 Whiteknight joined, Psyche^ joined 18:29 alanhaggai__ joined
cspencer rakudo: min(2, 10).say 18:31
p6eval rakudo 34434: OUTPUTĀ«2ā¤Ā»
cspencer rakudo: min(10,2).say 18:32
p6eval rakudo 34434: OUTPUTĀ«2ā¤Ā»
18:36 ejs joined 18:44 alanhaggai_ left 18:45 Psyche^ is now known as Patterner
cspencer how can one call the ?? ... !! construct as a function from PIR code? 18:48
18:49 meteorjay joined 18:51 araujo left 18:52 alanhaggai joined
cspencer rakudo: (1..10).reverse.WHAT.say 18:55
p6eval rakudo 34434: OUTPUTĀ«Listā¤Ā»
18:56 alanhaggai__ left 18:59 aindilis left, aindilis joined
pugs_svn r24651 | ruoso++ | [smop] creates the array correctly when coercing capture to item. 19:00
r24651 | ruoso++ | [smop] s1p_array.shift
r24651 | ruoso++ | [mildew] tests returning one or several items
19:01 DemoFreak left 19:04 ejs left
ruoso pmurias, now return officially works ;) 19:11
pugs_svn r24652 | ruoso++ | [smop/src-s1p] Return is promoted as part of the src-s1p 19:12
ruoso TimToady, I implemented capture coercion to item as explained in the message I sent today to p6-language. The visible outcome can be seen in v6/mildew/t/return_function.t. When you have some time, could you please take a look at it? 19:14
19:17 simcop2387 joined 19:27 vixey joined 19:32 ejs joined, icwiener joined 19:38 jhorwitz left 19:43 lambdabot joined 19:46 alanhaggai_ joined 19:47 masak joined 19:50 alester left
masak use.perl.org/~masak/journal/38170 19:55
cspencer masak: that looks like a good list 19:59
masak cspencer: thank you. I'm posting it to p6l as we speak.
cspencer i had a questions about a couple of those items myself, it's nice to have something up and out there though :)
masak aye.
I'm sure I missed a few things, too.
20:01 alanhaggai left
cspencer masak: do you know if it's possible to invoke the (...) ?? ... !! operator in PIR? 20:01
i'm trying to do a "if (cond) return x else return y" without a bunch of goto's 20:02
masak cspencer: interesting question. :) seems to me it ought to be possible.
but I'm no authority on PIR.
cspencer ah ok :)
no prob then, thanks :)
masak cspencer: try generating some PIR code with `perl6 --target=PIR` and see what you get.
cspencer i'll help you knock out a couple of the items on your list in the next while too
hey, good call, thanks
masak cspencer++ # help with S29, yay! 20:03
cspencer looks like it gets expanded into an if statement with goto's 20:07
masak perhaps not so surprising. :)
cspencer not so much, i suppose! :) 20:08
i'd though there was a shortcut that i'd seen for that a couple month ago, but i was likely imagining things again :)
masak perl6: my @a = <OH HAI>; say @a[False]; say @a[True] 20:09
p6eval pugs, rakudo 34439: OUTPUTĀ«OHā¤HAIā¤Ā»
..elf 24652: OUTPUTĀ«Argument "\x{46}\x{61}..." isn't numeric in array element at (eval 119) line 4.ā¤Argument "\x{54}\x{72}..." isn't numeric in array element at (eval 119) line 5.ā¤OHā¤OHā¤Ā»
masak cspencer: you could always index over a two-element array :) 20:10
not that I'd recommend such a thing... but it has the advantage of having no gotos.
cspencer true enough. i think in this case, it would probably have more steps to create and initialize the array though :) 20:11
i'll try to figure something out, this way doesn't seem quite right
20:12 rhr_ joined
pugs_svn r24653 | ruoso++ | [mildew] the tests for return already cover what the tests in ROADMAP planned; 20:14
20:18 ejs left
cspencer rakudo: ('A' + 1).say 20:22
p6eval rakudo 34441: OUTPUTĀ«1ā¤Ā»
masak because 'A' numifies to 0.
cspencer yep, that's what i figured
i'm just working on the Range :by($x) stuff and i'm wondering about valid increment values 20:23
ie) 1..100:by(2) makes sense as does 1..100:by(0.5) 20:24
masak cspencer: I've never heard about anyone talk about something other than numbers.
cspencer but i'm wondering what to do in cases of 'A'..'Z':by(1.5)
ok
masak cspencer: in that latter case, I'd throw a domain exception, or even better, die at compile time.
cspencer so for non-numeric ranges, force integral increment values? 20:25
TimToady $a..$b:by($c)
cspencer timtoady: it's safe to assume the $c is going to be numeric? 20:27
TimToady yes, but I could see possible uses for fractional values if we treat 'A'..'Z' as a list to be indexed into by the current numeric value 20:28
'A'..'Z':by(.5) ==> AABBCCDDEE...
cspencer ah ok
so we'd use the floor of the increment in that case 20:29
TimToady though I'd not go out of my way to support that
since it could be considered Born Obfuscated
cspencer heh
TimToady but if it has no other meaning and falls out of the semantics
so 'A'..'Z':by(2) would be ACEG... 20:30
cspencer right
TimToady 'A','C','E'...* ;)
cspencer alright, for a non-numeric ranges i'll implement the increments like that for the time being 20:31
thanks for the clarification :)
TimToady did the new commitbit help at all?
cspencer i'll be testing it out shortly when i commit some new tests for ranges :)
TimToady re $a..$b:by($c), it actually parses wrong, since identifiers can be extended by adverbs 20:32
so it parses as $a .. ($b:by($c))
one would have to say $a..$b :by($c)
cspencer ah ok, i think i may have seen it referenced as the former somewhere in the docs 20:33
or i might have misread that, i'll go re-check
are all decreasing ranges (ie. 10..1) considered to be null ranges? 20:34
TimToady it works find as long as the final value of the range doesn't end with an identifier
yes
just as in P5
cspencer but it's still possible to iterate over a null range?
TimToady sure, but nothing happens :)
cspencer ok
ah ok 20:35
TimToady you have to have a null range possible from $a..$b and you can't if it autoreverses
cspencer alright, gotcha, thank you :) 20:36
is there a test for null ranges? ie) are they considered defined? or is there a $r.null method? 20:40
20:40 bsdperl joined 20:43 apeiron joined 20:49 aindilis` joined 20:50 aindilis left, DemoFreak joined 20:55 justatheory_ joined, justatheory left 20:58 icwiener left, DemoFreak left 21:00 simcop2387 left
moritz_ pmurias: ii scons 1.0.0-1 A replacement for Make 21:00
21:01 simcop2387 joined 21:02 icwiener joined
pugs_svn r24654 | moritz++ | [t/spec] some small test additions and unfudges 21:07
21:08 DemoFreak joined
ruoso is simply a smartmatch sufficient to mark an exception as handled 21:14
?
21:24 bsdperl left, bsdperl joined
pmichaud cspencer: I'm sure a null range is still defined. 21:26
cspencer how would one test for nullness? 21:27
aside from iterating over it
pmichaud don't know off the top of my head. .elems might be a somewhat imprecise guess.
cspencer it might not even been an issue, i suppose, i was just wondering :)
21:44 Ehtyar joined, Tobi joined 21:47 aindilis` left, aindilis` joined 21:51 perl7 joined, Tobi left 21:55 justatheory_ left 22:02 dwhipp joined 22:09 mogaal joined 22:10 perl7 left 22:13 alester joined
cspencer is there a test for number-ness in p6? ie) such that i can tell if the value in variable $x is an Int/Num/Ratio/Complex etc? 22:22
22:22 kisu__ joined
cspencer or do they share a common parent class? 22:23
22:23 eternaleye joined 22:24 vixey left 22:27 kisu_ left
pmichaud if this is for :by($x), I'd just use whatever numeric value $x happens to give. 22:30
I wouldn't try to test it for number-ness.
rakudo_svn r34453 | pmichaud++ | [rakudo]: Update grammar to use goal matching syntax.
22:30 pina joined
cspencer mmm...no i was testing for numeric ranges vs non-numeric ranges, whose :by increments have to be handled differently 22:30
pmichaud then instead of testing for numberness, I'd check for the non-numeric types. 22:31
e.g., Str.
cspencer is it alright if i create a private !numeric method for the moment and we'll work out the finer details later? 22:32
pmichaud I'd prefer not to do that. 22:33
cspencer ok
may i ask why?
pmichaud again, I'd check for the special case (Str) instead of checking for the normal case (numeric)
cspencer there could be other special cases, no?
such as enums
wolverian surely this is a generic facility
like haskell's Enum type
s,type,typeclass,
pmichaud enums are just Int or int in the normal case 22:34
cspencer oh ok
wolverian I'd certainly like to be able to implement ranges for my own types
pmichaud wolverian: and you certainly can do that. I'm saying the default shouldn't be doing explicit checks for the default.
wolverian shouldn't it just be a multimethod, anyway. 22:35
pmichaud yes, probably.
cspencer i have a feeling i'm complicating things unnecessarily :)
wolverian then we're in violent agreemet, I think. :)
s,met,ment,
pmichaud and "doing checks for 'is this numeric'" goes against a multimethod approach
pmurias moritz_: ls 22:36
ln
suck my dick
pmichaud (violent agreement) Yes.
pmurias cs 22:37
klnhjdslhds
sknasoia
exit
logout
'/cvx;l kjldcbjbgvkldf'
b ds'
bnl
bnldfs'a/n\ zd8b. /in
wolverian uh.
cspencer i second that uh
wolverian pmurias needs to lock his session when leaving the computer, I think 22:38
pmurias, actually, I'm not sure if a multimethod is the best approach. a Range role (or just Enumerable) might be cleaner. I haven't thought about multimethods much yet, so I don't know which one is better architecture. 22:39
(in this context)
pmichaud right. In the meantime, I vote for "simplest implementation that works." :-) 22:40
cspencer hah, ok, i'll work on that then :)
masak cspencer: I think I read about ranges and how to check them for emptiness last night. let me check. 22:41
cspencer: ah. S03:2818. 22:42
cspencer where 2818 is the line number? 22:43
masak rakudo: my $r = 10..2; say $r.to < $r.from
p6eval rakudo 34450: OUTPUTĀ«1ā¤Ā»
masak cspencer: yes. most of us have the Pugs repo checked out, and refer to the synopses by POD file and line number.
cspencer great, thanks :) 22:44
masak np :)
rakudo: my $r = 10..2; say .to < .from given $r
p6eval rakudo 34450: OUTPUTĀ«1ā¤Ā»
masak loves Perl 6
pmichaud that assumes a positive :by, yes?
masak um. yes.
rakudo: my $r = 10..2; say $r.by
p6eval rakudo 34450: OUTPUTĀ«Method 'by' not found for invocant of class 'Range'ā¤current instr.: '_block14' pc 99 (EVAL_15:48)ā¤Ā»
pmichaud (:by not implemented in Rakudo yet -- that's what cspencer is working on :-) 22:45
masak I don't know how to introspect that on Ranges.
pmichaud I suspect it will indeed be .by
masak not specced, if I'm not mistaken.
cspencer i suppose the issue i'm working around is more dealing with fractional :by increments
where fractional increments make sense for numeric types
masak cspencer: are there tests for this? 22:46
cspencer masak: not yet, no
masak cspencer: want me to write some for you while you implement? :)
cspencer but for non-numeric types, the :by uses a floor method (or something similar) for determining the correct element to return 22:47
masak: that would be great!
ie)
'A'..'Z' :by(0.5) would return 'AABBCCDD' as its iterated over
hmm...i'll go back and think about this some more 22:48
pmichaud how about 'AA'..'ZZ' :by(0.75) ?
'AA', 'AA', 'AB', 'AC', 'AD', 'AD', 'AE', ... ? 22:49
masak looks right to me.
cspencer that looks about right, i think
(this is according to TimToady earlier in the day) 22:50
pmichaud so, 'Z'..'A' :by(-0.5) would be 'Z', 'Y', 'Y', 'X', ... , 'B', 'B', 'A', 'A' ?
cspencer can you iterate like that on null ranges? 22:51
pmichaud ...is that a null range?
cspencer maybe i'm unclear on the definition of a null range
masak cspencer: note the negative :by
cspencer ah
gotcha
sorry 22:52
perhaps 'Z', 'Z', 'Y', 'Y'...'Z', 'Z' would be appropriate for that
masak I've found svn.pugscode.org/pugs/t/operators/a...odifiers.t
cspencer: why two 'Z's? 22:53
(at the beginning)
I just unconsciously assumed that the chars behaved like truncated integers. 22:54
cspencer one for 'Z' and one for ('Z' - 0.5), no?
masak cspencer: sure, but to me, 'Z' - 0.5 is 'Y' :)
see 'truncated integers' above.
pmichaud just like floor(10-0.5) is 9
cspencer ah, i'm getting all mixed up with negatives and floors and ceil's now 22:55
pmichaud there's also a very interesting issue with ranges, in that I wonder if \x00 .. \xff does what most people would expect.
cspencer :)
masak I'm having trouble seeing anyone using this feature, ever. :P
pmichaud er.
wait
cspencer hmmm
pmichaud '\x00'..'\xff'
masak pmichaud: that's interesting. non-interpolated string... 22:56
pmichaud oh, I meant interpolating
(too much parrot)
masak oh.
heh.
pmichaud although I suspect it might not do what is expected in the non-interpolating case either :-)
"\x00".."\xff"
masak certainly not. :) 22:57
pmichaud in particular, the successor of "\x39" is not "\x3a"
masak is so happy -- by email, he was just electronically selected on linte to receive the sum of 720,000$ US Dollars through a till-now unheard-of foundation 22:58
strangers are so kind.
pmichaud this comes up to some degree in regexes, too... <[ \x00 .. \xff ]> 22:59
masak pmichaud: ah, yes. what does \x do again?
pmichaud well, "\x41" == 'A'
"\x42" == 'B'
etc.
masak pmichaud: then wouldn't that interpolation happen first, and the range after? 23:00
pmichaud masak: sure, it would.
masak then I don't see the problem.
pmichaud but I'm not sure that the range from codepoint 0 to codepoint 255 includes all of the intermediate codepoints
masak depends on which result the user expects, of course.
23:00 mberends left
pmichaud if we define range in terms of succ 23:00
masak pmichaud: why wouldn't it?
pmichaud for example:
rakudo: say "\x4a".succ 23:01
p6eval rakudo 34454: OUTPUTĀ«Kā¤Ā»
pmichaud er, wrong codepoint
rakudo: say "\x5a".succ
p6eval rakudo 34454: OUTPUTĀ«AAā¤Ā»
masak oh!
er.
pmichaud rakudo: say "\x5a", ' ', "\x5a".succ
masak yes, that's a case of "too much magick"
p6eval rakudo 34454: OUTPUTĀ«Z AAā¤Ā»
masak so "\x00".."\xff" might stop at Z and not go further? 23:02
pmichaud might stop at '9'
rakudo: say "\x39".succ
p6eval rakudo 34454: OUTPUTĀ«10ā¤Ā»
masak yes, was going to say that :)
cspencer sorry, was away from the computer for a bit 23:04
rakudo: say "\x5a" 23:05
p6eval rakudo 34454: OUTPUTĀ«Zā¤Ā»
masak adverbial_modifiers.t is a bit double-edged... it contains some :by tests, but it also contains a lot of other stuff. seems heavily Pugs-aligned. I'm thinking of adding a new test file in t/spec/ instead. 23:06
pmichaud I'd add :by tests to something dealing with ranges, or a new range-by.t 23:07
cspencer masak: we also don't have the :by(..) adverbial modifier quite yet, i don't think
masak cspencer: noted.
pmichaud: I'll check what's appropriate.
pmichaud I suspect that Range.new( :from(0), :to:(10), :by(2) ) ought to work at some point. 23:08
23:08 dduncan joined
pmichaud (if it doesn't already.) 23:08
masak ooh.
another test.
cspencer ah ok, i'll check that, hadn't tried creating it like that
23:08 dduncan left
masak rakudo: Range.new( :from(0), :to:(10), :by(2) ) 23:08
pmichaud rakudo: say Range.new( :from(0), :to(10), :by(2) );
p6eval rakudo 34454: OUTPUTĀ«Statement not terminated properly at line 1, near "( :from(0)"ā¤ā¤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)ā¤Ā»
rakudo 34454: OUTPUTĀ«You passed an initialization parameter that does not have a matching attribute.ā¤current instr.: 'die' pc 14740 (src/builtins/control.pir:204)ā¤Ā»
cspencer that's probably choking on the :by 23:09
masak though it doesn't say. :)
pmichaud rakudo: say Range.new( :from(0), :to(10) );
p6eval rakudo 34454: OUTPUTĀ«012345678910ā¤Ā»
pmichaud good call, cspencer
in which case adding 'by' isn't hard :-)
cspencer heh, no it's not, i've got that in my version here :)
sorry, pointed out the obvious there :)
hahah
i'm going to leave it as integral :by args for the moment 23:11
ruoso hi pmurias
masak cspencer: Merry Christmas! in case I haven't said it already. it's nice to have you with us. 23:12
cspencer masak: thank you!
masak: i feel like i've got quite the uphill learning curve to get past, but it's been fun thus far :) 23:13
masak perl6: $str =~ m/bar/ # apparently, there's a 'braino test' in the Pugs test suite
p6eval pugs: OUTPUTĀ«*** ā¤ Unexpected " =~"ā¤ expecting "::"ā¤ Variable "$str" requires predeclaration or explicit package nameā¤ at /tmp/qTlFJdqPqi line 1, column 5ā¤Ā»
..elf 24654: OUTPUTĀ«Global symbol "$str" requires explicit package name at (eval 115) line 3.ā¤ at ./elf_f line 3861ā¤Ā»
..rakudo 34454: OUTPUTĀ«Scope not found for PAST::Var '$str'ā¤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:102)ā¤Ā»
masak perl6: my $str; $str =~ m/bar/
p6eval pugs: OUTPUTĀ«*** ā¤ Unexpected "m"ā¤ There is no =~ operator in Perl 6 -- did you mean ~~ (match) or ~= (concat-assign)?ā¤ at /tmp/E5W1UZyCtB line 1, column 18ā¤Ā»
..rakudo 34454: RESULTĀ«"_block28"Ā»
..elf 24654: OUTPUTĀ«Use of uninitialized value $str in pattern match (m//) at (eval 115) line 4.ā¤Ā»
masak cspencer: I had the same feeling through all of 2005.
cspencer: but then Haskell was involved, so it was even more uphill. :) 23:14
23:14 dwhipp left
masak (never really grokked Haskell, either.) 23:14
cspencer masak: actually, i remember touching on haskell back around that time myself, quite the different mindset involved :)
masak indeed.
23:15 icwiener left
masak I like it, mind you. 23:15
monads are great.
but they're also alien algebra from a future fourth dimension.
cspencer masak: are you one of the pugs developers too, then?
masak cspencer: what's the criterion? :) 23:16
I've made a commit or two to Pugs, yes.
cspencer masak: hahah, i'll leave that up to you :)
nice
masak yeah, those were fun times. 23:18
ruoso rakudo: class MyFailure is Failure {}; sub foo { MyFailure.new().throw(); }; sub bar { foo(); CATCH { when MyFailure { say 1 }; }; bar(); 23:21
p6eval rakudo 34454: OUTPUTĀ«Unable to parse block; couldn't find final '}' at line 1, near ""ā¤ā¤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)ā¤Ā»
ruoso rakudo: class MyFailure is Failure {}; sub foo { MyFailure.new().throw(); }; sub bar { foo(); CATCH { when MyFailure { say 1 }; }; }; bar(); 23:22
p6eval rakudo 34454: OUTPUTĀ«Method 'throw' not found for invocant of class 'MyFailure'ā¤current instr.: 'bar' pc 349 (EVAL_12:155)ā¤Ā»
ruoso rakudo: class MyFailure is Failure {}; sub foo { fail MyFailure; }; sub bar { foo(); CATCH { when MyFailure { say 1 }; }; }; bar();
p6eval rakudo 34454: RESULTĀ«Null PMC access in find_method()ā¤current instr.: '_block14' pc 64 (EVAL_13:39)ā¤Ā»
ruoso pugs: class MyFailure is Failure {}; sub foo { fail MyFailure; }; sub bar { foo(); CATCH { when MyFailure { say 1 }; }; }; bar();
p6eval pugs: RESULTĀ«*** Failedā¤ at /tmp/rMroet2UC8 line 1, column 127-132ā¤ /tmp/rMroet2UC8 line 1, column 80-85ā¤ /tmp/rMroet2UC8 line 1, column 51-65ā¤Ā»
pmichaud we don't have any form of "custom failure" types yet.
masak we have enough of the regular ones :P
masak ducks 23:23
ruoso rakudo: sub foo { Failure.new().throw(); }; sub bar { foo(); CATCH { when Failure { say 1 }; }; }; bar();
p6eval rakudo 34454: OUTPUTĀ«Method 'throw' not found for invocant of class 'Failure'ā¤current instr.: 'bar' pc 253 (EVAL_12:117)ā¤Ā»
cspencer pugs: .say for 0..10 :by(2)
p6eval pugs: OUTPUTĀ«*** ā¤ Unexpected ":by"ā¤ expecting operatorā¤ at /tmp/pPCzpgf7cO line 1, column 16ā¤Ā»
ruoso rakudo: sub foo { fail Failure }; sub bar { foo(); CATCH { when Failure { say 1 }; }; }; bar();
p6eval rakudo 34454: RESULTĀ«Null PMC access in find_method()ā¤current instr.: '_block14' pc 64 (EVAL_13:39)ā¤Ā»
cspencer ugs: .say for 0..10:by(2)
ruoso pugs: sub foo { fail Failure }; sub bar { foo(); CATCH { when Failure { say 1 }; }; }; bar();
p6eval pugs: OUTPUTĀ«*** No such subroutine: "&Failure"ā¤ at /tmp/IvbBgEwTqZ line 1, column 11-24ā¤Ā»
cspencer pugs: .say for 0..10 :by(2)
p6eval pugs: OUTPUTĀ«*** ā¤ Unexpected ":by"ā¤ expecting operatorā¤ at /tmp/3vseueca7P line 1, column 16ā¤Ā»
ruoso meh
pmichaud ruoso: I doubt rakudo is going to shed any light on Failure types or exception handling at the moment.
cspencer pugs: .say for 0..10:by(2) 23:24
p6eval pugs: OUTPUTĀ«*** ā¤ Unexpected ":by"ā¤ expecting "_", fraction, exponent, term postfix or operatorā¤ at /tmp/3pFf4tcZEj line 1, column 15ā¤Ā»
ruoso my question is actually simple
does the smartmatch realized by "when" suffices to mark the exception as handled?
(that was a badly written sentence...) 23:25
ruoso will try again
masak ruoso: I understood you.
ruoso ah, at least
:0
;)
pmichaud I think that "when" by itself doesn't handle the exception.
(or its smart match)
although 'default' appears to be, according to S04 23:26
masak sounds a bit inconsistent. 23:27
ruoso so we need to
pmichaud let's phrase it differently.
ruoso .handle = 1
to mark as handled
pmichaud reading S04, there's an implicit die $! at the end of a CATCH block that re-throws any exception that makes it to that point.
This implies that any when blocks prior to that will avoid that implicit die $!, thus the exception is not re-thrown. 23:28
this is regardless of whether the exception is marked as "handled"
ruoso hmmm... 23:29
pmichaud (I'm not claiming it makes sense -- I'm just reading/interpreting what S04 says.) 23:30
ruoso sure sure...
masak so even handled exceptions are re-thrown if the end of the 'when' block is reached?
pmichaud I would think they're rethrown only if the when block explicitly rethrows them 23:31
i.e., a CATCH block looks like
CATCH {
when ExceptionTypeA { ... }
when ExceptionTypeB { ... }
(implicit) die $!
}
so if any of the when blocks are activated, we never reach the die 23:32
and thus the exception is not rethrown unless the when block does so explicitly
masak rakudo: 'AA'.pred.say
p6eval rakudo 34454: OUTPUTĀ«AAā¤Ā»
masak pmichaud: ah. now I see what you mean. 23:33
ruoso pmichaud, ok... I supppose I misunderstand 'when' 23:34
but I didn't think that having a "when" block would make the other parts of the block unreachable 23:37
pmichaud sure
when XYZ { ... } automatically breaks out of the block that sets $_
(which in this case is the CATCH block itself.)
ruoso hmmm... is that spec? 23:38
pmichaud one has to explicitly say "continue" inside the when block to make it check subsequent 'when' conditions
the "automatic breakout" is the think that makes 'when' significantly different from 'if'
*thing
(yes, it's spec for 'when' -- see S04 description of given/when) 23:39
ruoso that makes it easier...
23:40 iblechbot left
ruoso but makes CONTROL and CATCH considerably inconsistent 23:40
(at least I think so)
masak tricky question: would ('a'..'h' :by(1.6)) generate 'a b d e g' or 'a b d e g h'?
I'm leaning towards the former.
pmichaud I'm leaning towards the latter.
masak let's make it the latter, then.
pmichaud because 'h' is still in the range. 23:41
masak a better example would perhaps be 'a'..'f' :by(1.6)
pmichaud 'a', 'b', 'd', 'e' 23:42
masak agreed. 23:43
what about 'a'..'c' :by(-.5)?
pmichaud realizing of course that this means we're explicitly defining range to _not_ be in terms of succ. I think that's probably a wise move somehow.
cspencer rakudo: my $r = 1^..^10; say $r.perl ~ " - " ~ $i while (my $i = $r.shift);
p6eval rakudo 34454: OUTPUTĀ«2^..^10 - 2ā¤3^..^10 - 3ā¤4^..^10 - 4ā¤5^..^10 - 5ā¤6^..^10 - 6ā¤7^..^10 - 7ā¤8^..^10 - 8ā¤9^..^10 - 9ā¤Ā»
masak sorry, 'c'..'a' :by(-.5)
one 'a' or two at the end?
ruoso hmmm... this 'implicit $!' thing in CATCH is incredibly weird 23:44
pmichaud 'c'..'a' :by(-0.5) ==> 'c', 'b', 'b', 'a', 'a'
masak pmichaud: good. agreed.
ruoso implicit 'die $!', I mean 23:45
because as the stack is not unwinded while the exception is not handled
the idea of the exception being re-thrown doesn't look very right 23:46
cspencer if i create a range such as "1^..^10", and then shift a value off it, it should print out via a perl method as "2..^10", no?
and not "2^..^10" as it currently is
ruoso the natural would be to check if the exception was handled, and, if not, continue traversing backwards in the stack looking for CATCH blocks
cspencer make that ".perl method" in the first 23:47
masak cspencer: 2^..^10 looks good to me.
cspencer doesn't that mean we'd be excluding 2 from the range? it was originally defined as "1^..^10"
pugs_svn r24655 | masak++ | [t/spec/S03-operators] added range-by.t with tests for ranges modified with the
r24655 | masak++ | :by adverb
masak cspencer: yes. I'm not sure I see what you see. 23:48
cspencer rakudo: my $r = 1^..^10; say $r.perl ~ " - " ~ $i while (my $i = $r.shift);
masak cspencer: specify what bothers you about the 2 being excluded.
p6eval rakudo 34454: OUTPUTĀ«2^..^10 - 2ā¤3^..^10 - 3ā¤4^..^10 - 4ā¤5^..^10 - 5ā¤6^..^10 - 6ā¤7^..^10 - 7ā¤8^..^10 - 8ā¤9^..^10 - 9ā¤Ā»
cspencer just wondering if the current implementation of Range.perl needs fixing 23:49
masak that last 9 is slightly worrying, though.
cspencer rakudo: my $r = 1^..^10; say $r.perl while (my $i = $r.shift);
p6eval rakudo 34454: OUTPUTĀ«2^..^10ā¤3^..^10ā¤4^..^10ā¤5^..^10ā¤6^..^10ā¤7^..^10ā¤8^..^10ā¤9^..^10ā¤Ā»
masak rakudo: say (9^..^10).shift
p6eval rakudo 34454: OUTPUTĀ«Undefined value shifted from empty rangeā¤ā¤Ā»
masak that's more like it :) 23:50
pmichaud the current implementation of Range is likely correct w.r.t. the current spec.
if I start with $r = 1^..^10
and then shift a value from $r
cspencer yes
masak cspencer: added some tests for you in range-by.t
pmichaud $r needs to be 2^..^10
_otherwise_, we end up with this: 23:51
cspencer doesn't that imply that the 2 should be excluded from the range?
masak cspencer: yes, it does.
pmichaud my $r = 1^..^10; my $a = $r.shift; my $b = $r.shift; say "$a $b"
we want to make sure that $b is _not_ 2
changing the range to become 2..^10 would mess that up
cspencer alrighty :) 23:52
bbl, dinner making time
masak pmichaud++ # for explaining. I couldn't even see what the problem was. :)
time to sleep, here
good night, people.
23:52 masak left
ruoso pmichaud, do you have that implicit 'die $!' in CATCH implemented now? 23:53
23:54 apeiron left
ruoso I'm really uncomfortable with it... 23:55
pmichaud ruoso: no, we haven't really worked too hard on CATCH blocks yet.
ruoso: they haven't been a critical feature for implementation.
(also Parrot exceptions have had their own issues, which Tene++ is clearing up.) 23:56
ruoso right...
23:57 lichtkind left, apeiron joined
ruoso but one thing that really looks bad in the 'rethrowing' is that the context information of the exception points to the place where it was thrown 23:57
I'm afraid we would have a lot of effort to keep the original context information after the rethrow 23:58
pmichaud well, I think we have to make a distinction between "original throw" and "rethrow"
23:59 kisu_ joined, alester left
pmichaud at least, that's the conclusion we've been coming to in Parrot (although it's still up in the air) 23:59
ruoso I'd be more confortable with an implicit: