pugscode.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, smop: etc.) || We do Haskell, too | > reverse . show $ foldl1 (*) [1..4] | irclog: irc.pugscode.org/
Set by TimToady on 25 January 2008.
rakudo_svn r28657 | coke++ | RT#56076 ([PATCH] MACOSX_DEPLOYMENT_TARGET not defined during OSX PPC Rakudo build) 00:36
r28657 | coke++ |
r28657 | coke++ | This adds (proactively, in some cases) the MACOSX_DEPLOYMENT_TARGET env. var
r28657 | coke++ | to the various languge builds; we've found this to be required on OSX with
r28657 | coke++ | the current code base.
r28657 | coke++ |
r28657 | coke++ | Patch courtesy Packy Anderson (packy++ at dardan dot com)
r28658 | jkeenan++ | Correct POD formatting errors. 00:39
cjfields pugs: say 'ABC'.trans('A-Z' => 'a-z'); 02:34
p6eval OUTPUT[aBC␤]
diakopter ran some load tests on the packrat parser
:( it's still broken 02:35
disabling it for now... as with the opp, it won't need left recursive rules
without it enabled, parse times are n**2+n+3, where n is 50 statements 02:36
cjfields pugs: say "\b\n".trans('\b' => 'A', '\n' => 'B'); 02:39
p6eval OUTPUT[AB␤]
cjfields oi...
pugs: say "\b\n".trans("\b" => 'A', "\n" => 'B'); 02:40
p6eval OUTPUT[A␤␤]
cjfields oi oi oi...
cjfields pugs: say "\b\n\n".trans("\b" => 'A', "\n" => 'B'); 02:51
p6eval OUTPUT[A␤␤␤]
cjfields pugs: print "\b\n".trans("\b" => 'A', "\n" => 'B');
p6eval OUTPUT[A␤]
diakopter so it stringifies the key in qq 02:52
cjfields back 03:43
diakopter: 'so it stringifies the key in qq'; well, pugs does so only partially (works with /b,leaves out /n). However, it interprets escaped chars in qw (single quotes) as if they are qq. 03:45
so it's a mixed bag, really, but I'm not expecting the correct answer from pugs... 03:46
just a close to correct one!
speaking of pugs, nice to see a renewed effort to get it running again using the latest ghc 03:51
scrottie "speaking of pugs, nice to see a renewed effort to get it running again using the latest ghc" -- yay! 05:39
diakopter scrottie: see the updated INSTALL file 06:03
it works 06:04
diakopter amending my previous performance statements
fixed the packratness; got rid of a bunch of WRONG premature optimization... and then did some other kinds of RIGHT premature optimization
regression line for time vs input is 0.09n**2+0.9n+0.1 06:05
so, a slight polynomial term but dominated by linear. 06:06
so, 1200 chars in 12 seconds. now it's only 1/20 the speed of STD5 06:10
pugs_svnbot r20968 | diakopter++ | [yap6] 07:05
r20968 | diakopter++ | * LOTS of performanc improvements; it's actually usable, barely.
pugs_svnbot r20969 | moritz++ | [spec] finer graded fudging of complex.t 07:23
bacek_ moritz_: its actually bug in Test.pm 07:29
in 'approx'
moritz_ bacek_: how so?
bacek_ abs($x-$y)
moritz_ and no abs(Complex) multi? 07:30
bacek_ yes
moritz_ frome the mathematical POW it looks fine
bacek_ perl6: say cis(3*pi/2)
p6eval kp6 r20969: OUTPUT[no method 'APPLY' in Class 'Undef'␤ at compiled/perl5-kp6-mp6/lib/KindaPerl6/Runtime/Perl5/MOP.pm line 345␤
..pugs: OUTPUT[*** No such subroutine: "&cis"␤ at /tmp/T6jpJZSr7l line 1, column 5 - line 2, column 1␤]
..rakudo r28667: OUTPUT[-1.83691e-16-1i␤]
..elf r20969: OUTPUT[Undefined subroutine &GLOBAL::pi called at (eval 119) line 3.␤ at ./elf_f line 3854␤]
bacek_ he. Looks like rakudo right about result. 07:31
So its just test wrong. It should be -1i
moritz_ aye 07:32
bacek_: are you going to fix it? 07:34
moritz_ pmichaud: btw as long as method fallback is still active, rand($Num) is valid syntax (as fallback for $Num.rand) 07:36
bacek_ moritz_: no... I'm not 100% sure... 07:38
moritz_ bacek_: but I am ;) 07:39
bacek_ perl6: my $arg = 3*pi/2; say cis($arg); say cos($arg) + 1i*sin($arg)
p6eval kp6 r20969: OUTPUT[no method 'APPLY' in Class 'Undef'␤ at compiled/perl5-kp6-mp6/lib/KindaPerl6/Runtime/Perl5/MOP.pm line 345␤
..pugs: OUTPUT[*** No such subroutine: "&cis"␤ at /tmp/e8ObffV8hK line 1, column 23-32␤]
..rakudo r28667: OUTPUT[-1.83691e-16-1i␤-1.83691e-16-1i␤]
..elf r20969: OUTPUT[Undefined subroutine &GLOBAL::pi called at (eval 127) line 3.␤ at ./elf_f line 3854␤]
moritz_ and I'm the one who broke it in the first place ;)
bacek_ moritz_: yeap. test is wrong 07:40
rakudo: say -1i
p6eval rakudo r28667 OUTPUT[-1␤]
bacek_ but we can't unfudge it yet :)
moritz_ yes, it's missing the prefix:<-> 07:41
which you've submitted a patch for iirc
bacek_ #56540 iirc :)
moritz_ doesn't remeber ticket numbers ;) 07:42
bacek_ #56230. Just checked my inbox :)
pugs_svnbot r20970 | bacek++ | [spec] Fix test and fudge reason in complex.t 07:44
bacek_ steal little bit of karma from moritz
moritz_ you can have all of my #perl6 karma if you implement perl 6 for me ;) 07:45
bacek_ moritz_: in progress :)
moritz_ I know ;) 07:46
bacek_ r28610... There is Num.unpolar already...
rakudo: say 1.unploar(1i) 07:47
p6eval rakudo r28667 OUTPUT[Method 'unploar' not found for invocant of class 'Int'␤current instr.: '_block11' pc 49 (EVAL_13:20)␤
bacek_ rakudo: say 1.unpolar(1) 07:48
p6eval rakudo r28667 OUTPUT[Method 'unpolar' not found for invocant of class 'Int'␤current instr.: '_block11' pc 38 (EVAL_13:19)␤
moritz_ rakudo: say (1.1).unpolar(1)
p6eval rakudo r28667 OUTPUT[0.594333+0.925618i␤]
bacek_ yak... Its Int ot Num promotion problem
rakudo: say 1.0.unpolar(2) 07:49
p6eval rakudo r28667 OUTPUT[-0.416147+0.909297i␤]
moritz_ woders if Num shouldn't just be a role that all numeric types do
bacek_ moritz_: +1.
Why you calculate $angle in complex.t?
moritz_ I was too lazy to write 110 tests manually 07:50
sigh, why do some of my pages don't display correctly in FF3? 07:52
bacek_ but $angle not used... 07:54
moritz_ in the first block, yes
that's not intentional
bacek_ You steal my cpu-cicles!!! :) 07:56
moritz_ bacek_: but only to prevent you from sending more spam (/me ducks) 07:57
;-)
bacek_ but my spam contains patches for rakudo! 07:58
ok. time to go home. See you in couple of hours.
moritz_ ciao 07:58
moritz_ rakudo: say pi / 2 09:31
p6eval rakudo r28667 OUTPUT[1.5708␤]
moritz_ bacek++ # bringing my attention to uc.t 10:20
pugs_svnbot r20971 | moritz++ | [spec] S29-str/uc.t
r20971 | moritz++ | * comment one test that is likely to be out of date
r20971 | moritz++ | (wrt newer Unicode versions)
r20971 | moritz++ | * improved fudging - now ready for inclusion in spectest_regression
moritz_ uhm, why did I think it's ready for spectest_regression? still reports number of tests wrongly 10:21
pugs_svnbot r20972 | moritz++ | [spec] S29-uc.t: fixed test count in fudged output 10:26
moritz_ freenode had a hiccup ;) 11:24
jfredett /who 13:08
oops
DietCoke ME! 13:09
moritz_ /nick TooMuchTimeCoke ;-) 13:16
diakopter I like VanillaZero, myself 13:19
pmichaud 07:33 <moritz_> pmichaud: btw as long as method fallback is still active, rand($Num) is valid syntax (as fallback for $Num.rand) 14:12
I don't think that's correct.
method fallback says that given $x.foo(), if no 'foo' method is found for $x then it will try foo($x)
pmichaud it doesn't say that because $x.foo() exists then foo($x) must also exist. 14:12
i.e., method fallback doesn't mean that foo($x) will try $x.foo() 14:14
moritz_ pmichaud: uhm yes, you're right 14:20
pugs_svnbot r20973 | diakopter++ | [yap6] fix stupid bugs from yesterday. 15:22
r20973 | diakopter++ | now that the speed is tolerable, working on the opp.
cognominal_ what is the perl6 way to get to the last element of an array? 17:15
moritz_ cognominal_: @array[*-1] 17:16
cognominal_ works in rakudo?
moritz_ nope
cognominal_ ok
moritz_ rakudo: my @a = <a b c>; say @a[@a.end]
p6eval rakudo r28668 OUTPUT[Method 'end' not found for invocant of class 'Perl6Array'␤current instr.: '_block11' pc 77 (EVAL_13:29)␤
moritz_ rakudo: my @a = <a b c>; say @a[@a.last]
p6eval rakudo r28668 OUTPUT[Method 'last' not found for invocant of class 'Perl6Array'␤current instr.: '_block11' pc 77 (EVAL_13:29)␤
moritz_ pugs: my @a = <a b c>; say @a[@a.end] 17:17
p6eval OUTPUT[c␤]
cognominal_ rakudo: my @a = <a b c>; say @a[@a.top]
p6eval rakudo r28668 OUTPUT[Method 'top' not found for invocant of class 'Perl6Array'␤current instr.: '_block11' pc 77 (EVAL_13:29)␤
pmichaud top/end/last not implemented :-)
moritz_ TODO: implement List.lend
s/lend/end/
cognominal_ in fact I was asking for NQP :)
pmichaud ...NQP?
moritz_ nqp: my @a = <a b c>; say @a[@a.end] 17:18
p6eval OUTPUT[Statement not terminated properly at line 1, near "= <a b c>;"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤called from Sub 'parrot;NQP::Grammar;statement_list' pc 3940 (src/Grammar_gen.pir:1362)␤called from Sub 'parrot;NQP::Grammar;state...
moritz_ nqp: my @a = (1, 2, 3); say @a[@a.end]
p6eval OUTPUT[Statement not terminated properly at line 1, near "= (1, 2, 3"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤called from Sub 'parrot;NQP::Grammar;statement_list' pc 3940 (src/Grammar_gen.pir:1362)␤called from Sub 'parrot;NQP::Grammar;state...
pmichaud nqp doesn't support '='. all functions require parens.
moritz_ nqp: my @a := (1, 2, 3); say @a[@a.end()]
p6eval OUTPUT[Statement not terminated properly at line 1, near "@a[@a.end("␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤called from Sub 'parrot;NQP::Grammar;statement_list' pc 3940 (src/Grammar_gen.pir:1362)␤called from Sub 'parrot;NQP::Grammar;state...
pmichaud all functions (including 'say') require parens :-) 17:19
moritz_ nqp: my @a := (1, 2, 3); say(@a[@a.end()]);
diakopter I can't believe I'm actually *using* an Acme module for something useful
p6eval OUTPUT[Method 'end' not found for invocant of class 'ResizablePMCArray'␤current instr.: '_block11' pc 27 (EVAL_3:13)␤called from Sub 'parrot;PCT::HLLCompiler;eval' pc 806 (src/PCT/HLLCompiler.pir:481)␤called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1088 (src/PCT/HLLCompiler.pir:6...
moritz_ pmichaud: thanks ;)
pmichaud didn't know that p6eval supported nqp :-)
cognominal_ these two, := and paren, I know even if I still trip over them 17:20
pmichaud I should probably have infix:<=> throw a more useful excecption. 17:25
*exception.
moritz_ pmichaud: it supports nearly everything that suports 'say("hi")' - except perl 5.10, of course ;)
evalbot control restart
pugs_svnbot r20974 | moritz++ | [evalbot] truncate stack traces in NQP output - we need a more general
r20974 | moritz++ | solution for filtering
moritz_ nqp: say foo bar 17:25
p6eval nqp: OUTPUT[Statement not terminated properly at line 1, near "foo bar"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤
moritz_ ok, truncation works
afk 17:27
cognominal_ nqp: my %a; %a{'a'}++ 17:33
p6eval nqp: OUTPUT[increment() not implemented in class 'Undef'␤current instr.: '_block11' pc 25 (EVAL_4:16)␤
cognominal_ nqp: my %a; %a{'a'}.defined()
p6eval nqp: OUTPUT[Method 'defined' not found for invocant of class 'Undef'␤current instr.: '_block11' pc 28 (EVAL_4:14)␤
cognominal_ nqp: my %a; say(%a{'a'}.WHAT()) 17:34
p6eval nqp: OUTPUT[Method 'WHAT' not found for invocant of class 'Undef'␤current instr.: '_block11' pc 28 (EVAL_4:14)␤
cognominal_ nqp: my %a; %a<a> := 0 ; say ++%a{'a'} 17:40
p6eval nqp: OUTPUT[increment() not implemented in class 'Sub'␤current instr.: '_block11' pc 31 (EVAL_4:17)␤
cognominal_ nqp: my %a; %a<a> := 0 ; say( ++%a{'a'} )
p6eval nqp: OUTPUT[0␤] 17:41
cognominal_ nqp: my %a; %a<a> := 0 ; say( %a<a> := %a<a> + 1 )
p6eval nqp: OUTPUT[1␤]
pugs_svnbot r20975 | diakopter++ | [yap6] 18:38
r20975 | diakopter++ | * a banillion more speed/memory usage premature optimizations. :)
Auzon pugs: say 'A' .. 'ZZ' 18:43
p6eval OUTPUT[ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJBKBLBMBNBOBPBQBRBSBTBUBVBWBXBYBZCACBCCCDCECFCGCHCICJCKCLCMCNCOCPCQCRCSCTCUCVCWCXCYCZDADBDCDDDEDFDGDHDIDJDKDLDMDNDODPDQDRDSDTDUDVDWDXDYDZEAEBECEDEEEFEGEHEIEJEKELEMENEOEPEQERESETEUEVEW...
rakudo_svn r28670 | pmichaud++ | [rakudo]: 18:46
r28670 | pmichaud++ | * Fix problem with 'sprintf' method appearing in wrong namespace.
r28670 | pmichaud++ | * Oddly, the problem appeared because running 'perl6.pir' gave
r28670 | pmichaud++ | different results (an exception) from running 'perl6.pbc'. I
r28670 | pmichaud++ | have no clue why the difference existed.
pmichaud pugs: say 'A' .. 'BB' 18:47
p6eval OUTPUT[ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABB␤]
pmichaud rakudo: say 'A' .. 'BB'
p6eval rakudo r28669 OUTPUT[AB␤]
pmichaud hrm.
it stops at 'C' because it thinks that 'C' is greater than 'BB'. 18:48
that's.... interesting.
pugs: say 'B' ^.. 'BB' 18:49
p6eval OUTPUT[CDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABB␤]
pmichaud pugs: say 'B' ^..^ 'BB'
p6eval OUTPUT[CDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBA␤]
pmichaud pugs: say 'B' ^..^ 'AG' 18:50
p6eval OUTPUT[CDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF␤]
pmichaud say '0' .. '19' 18:51
pugs: say '0' .. '19'
p6eval OUTPUT[012345678910111213141516171819␤]
pmichaud pugs: say '0' .. '00'
p6eval OUTPUT[0123456789␤]
pmichaud pugs: say '0'..'01'
p6eval OUTPUT[0123456789␤]
diakopter pugs: say '0A'..'1A' 18:52
p6eval OUTPUT[0A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z1A␤]
diakopter pugs: say 'A0'..'Z0' 18:53
p6eval OUTPUT[A0A1A2A3A4A5A6A7A8A9B0B1B2B3B4B5B6B7B8B9C0C1C2C3C4C5C6C7C8C9D0D1D2D3D4D5D6D7D8D9E0E1E2E3E4E5E6E7E8E9F0F1F2F3F4F5F6F7F8F9G0G1G2G3G4G5G6G7G8G9H0H1H2H3H4H5H6H7H8H9I0I1I2I3I4I5I6I7I8I9J0J1J2J3J4J5J6J7J8J9K0K1K2K3K4K5K6K7K8K9L0L1L2L3L4L5L6L7L8L9M0M1M2M3M4M5M6M7M8M9N0N1N2N3N4N5N6N7N8N9...
diakopter weird
Auzon What's weird? 18:54
diakopter Auzon: nm :/ 18:54
TimToady '0' .. '00' seems incorrect 18:55
pugs_svnbot r20976 | diakopter++ | [yap6]
r20976 | diakopter++ | * less grammar recursion; more speed improvements.
r20976 | diakopter++ | * memoizing fully fixed now...
pmurias diakopter: hi
rakudo_svn r28671 | pmichaud++ | [rakudo]:
r28671 | pmichaud++ | * Fix ranges on incrementing strings (e.g., 'A'..'BK')
TimToady it should be equivalent to '0' .. '99'
diakopter pugs: say '0A'..'1A0' 18:56
p6eval OUTPUT[0A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z1A1B1C1D1E1F1G1H1I1J1K1L1M1N1O1P1Q1R1S1T1U1V1W1X1Y1Z2A2B2C2D2E2F2G2H2I2J2K2L2M2N2O2P2Q2R2S2T2U2V2W2X2Y2Z3A3B3C3D3E3F3G3H3I3J3K3L3M3N3O3P3Q3R3S3T3U3V3W3X3Y3Z4A4B4C4D4E4F4G4H4I4J4K4L4M4N4O4P4Q4R4S4T4U4V4W4X4Y4Z5A5B5C5D5E5F5G5H5I5J...
TimToady (by the exceed-the-length rule)
pmurias TimToady: did you see my changes?
pmichaud TimToady: does it _only_ check length?
TimToady if it doesn't get an exact match, it only checks lengths, like p5
pmichaud ah, length or exact match 18:57
pmurias should go fetch his laptop instead of talking via cgi-irc
pmichaud hrm.
diakopter hm; evalbot's perl 5.8 doesn't like my qr||sp
TimToady you can't rely on anything other than equality
pmichaud so, 'A'..'Bz' would be the same a 'A' .. 'ZZ' ? 18:58
diakopter oh; that's b/c I don't need the p suffix
TimToady pmichaud: yes
pmichaud okay. That complicates things a bit, but I guess we can get there.
TimToady I think it simplifies things
pmichaud currently I think pugs does: if length smaller, always increment 18:59
if length bigger, stop
if length equal, compare
TimToady that seems sane, as long as compare only means test-for-equality
diakopter hey, more speed ^
pmichaud how would we check if $z ~~ 'A' .. 'AA' ? 19:00
pugs_svnbot r20977 | diakopter++ | [yap6]
r20977 | diakopter++ | * don't need 5.10 p suffix
pmichaud iterate through the range looking for $z ?
ruoso wonders if TimToady have some time to think about the metamethods thing... (I know I'm being annoying with that)
TimToady no, I'm only stealing some lunch time from $dayjob to try to catch up here, and still haven't even read any email today 19:01
diakopter snaps his fingers at p6eval 19:02
ruoso ok... I'm not in a rush also... just making sure it stays on topic...
TimToady I think Mooseyfolk are likelier to give you good feedback on that. I installed the .HOW Curtain for a reason... 19:04
which is that I mostly don't want to think about it. :)
pmurias TimToady: seen my commits to STD yet? pmichaud raised some objections about them 19:05
pmichaud more questions than objections. :-) 19:06
TimToady what did you do?
ruoso TimToady, that is already peer-reviewed with nothingmuch... I think it's just a matter of 'is this the way to go?'
pmurias fixed EXPR a bit
listops generate proper match objects
and EXPR receives a string instead of a hash as passing hashes is broken in gimme5 19:07
and EXPR respects the initial precedence
it's one commit really 19:08
TimToady I don't know what "initial precedence" means. the precedence that is passed in is not "initial", it's the limit on precedence looseness
diakopter qr/^(\Q$want\E)/s 19:09
oops
pmurias TimToady: didn't know how to phrase it correctly
TimToady is there an example to think about?
diakopter initial meaning innermost?
or outermost? 19:10
pmichaud effectively the change is that EXPR() now accepts a precedence level as an argument instead of a hash containing %preclim<prec>
TimToady it's used for things like preventing you from saying $a ?? $b = 2 !! $c
it will treat = like a terminator
pmichaud i.e., it receives $preclim directly instead of setting $preclim to %preclim<prec>
TimToady not quibbling about the string, as long as we only need the precedence, but we might want other things later 19:11
pmichaud (I'm neither for nor against the change -- I was simply wondering about it.)
(fwiw, Rakudo has already been using a simple string as its argument instead of a hash.)
TimToady I'd be more inclined to fix gimme5 to pass a hash correctly 19:12
pmichaud that was my guess. :-)
TimToady but it's no great shakes either way
pmichaud okay, works for me! 19:12
afk # lunch for real this time.
pmurias re example to think about was it directed to me? 19:15
the think i wanted it to work was => which was broken but now works 19:16
TimToady => should simply be parsed as item assignment, which is tighter than comma 19:17
TimToady pmurias_: => should simply be parsed as item assignment, which is tighter than comma 19:21
pmurias_ TimToady: it's parsed by fatarrow which calls EXPR with a limit 19:23
i didn't change that but i made EXPR respect the limit
TimToady: when does autoquoting happen? 19:24
the synopsis state that the left side can be anything 19:25
TimToady fatarrow is only for bare identifiers, but yes, it needs to know the precedence in EXPR
ordinary => is defined down with the other binary assignment ops 19:26
pmurias_ 1=>2; dosn't work 19:27
TimToady at line 2724 19:28
well, there's lots of things don't work yet. :)
pmurias_ TimToady: 2724 in the current revision? 19:29
TimToady yes
pmurias_ 20956? 19:31
TimToady how does your current code distinguish item assignment from list assignment?
20977 19:32
oh, wait, it did a merge
TimToady so my line numbers are probably off 19:33
about 30 lines off, probably
anyway, just a few lines below where you commented out the makes
TimToady I went ahead and checked in my current copy, even though it's messing up on final curlies right now 19:40
pugs_svnbot r20978 | lwall++ | [STD] current snapshot, some things break
pmurias sorry my laptop hanged strangely 19:40
i just commented the stuff in infix:<=> as it was creating errors
i didn't fix it properly
TimToady: what would you prefere me to work on getting agentz's tracer to work with STD5 or feeding STD's parse tree into elf?
TimToady when I get off $job I'll be working on a more general memoizing capability, which will hopefully fix the current problem with block endings, and the hardwired stopper state check
elf sounds like it's more on some kind of critical path 19:41
and I doubt the format of the parse tree will change rapidly
pmurias i already started on that one ;)
i actually plan to use {*} hook points
TimToady it'll be nice to get the canonical *cough* parser up on evalbot at some point 19:42
well, that's what the {*} are there for
pmurias diakopter asked for putting STD into evalbot but it creates a lot of output 19:43
diakopter TimToady: p6eval runs 5.8
TimToady I was thinking more on the level of say "howdy"
Auzon Is file input the current best way to get an iterator that terminates?
TimToady not parse tree output
pmurias i'll head of to work than ;) 19:44
TimToady Auzon: seem to be missing some context...
Auzon I'm trying to test the eager operator. 19:45
TimToady well, if
if Range objects worked...
though maybe that doesn't help 19:46
Auzon I guess I need some way to determine that the iterator is fully read, too. 19:46
TimToady gather/take would be good for that, if implemented
since it runs arbitrary code on the take end 19:47
or you could do eager 1..* and see if you run out of memory :P
Auzon I don't see a runs_out_of_resource_ok() subroutine. I'd need to implement that first. 19:49
TimToady I think file io might be the best bet for now
assuming *that* is implemented :) 19:50
diakopter canonical 19:59
pmichaud (more general memoizer)++ 20:05
I've been thinking a similar thing for PCT's grammars.
Auzon rakudo: gather {} 20:07
p6eval rakudo r28671 OUTPUT[Null PMC access in type()␤current instr.: 'parrot;Perl6;Grammar;Actions;statement_prefix' pc 123897 (src/gen_actions.pir:11710)␤
pmichaud gather not implemented yet.
Auzon That's what I was checking
pmichaud and empty closures still return null :-|
cjfields On S05 transliteration: Are we using 'A..Z' for range values instead of 'A-Z' (or both)? 20:08
pmichaud cjfields: Perl 6 no longer uses '-' to indicate ranges.
cjfields cheers!
cjfields Also, are we planning on supporting the tr/// p5 options: (c)omplement, (d)elete, (s)quash)? Couldn't find anything to verify one way or the other... 20:11
Auzon and here was me thinking that tr///c meant 'count' :P
cjfields looking at A05... 20:24
cjfields Nope, nothing there. Though I can see issues with implementing 'complement' if we want many-to-one... 20:35
moritz_ I think the general sentiment is "don't worry too much about transliteration, we have powerful regexes" ;) 20:37
Auzon Somewhat related: Can we have glob() use regexes? (The format for $pattern is not specified in S16) 20:38
moritz_ Auzon: I think glob() will call the underlying system (?) call 20:39
PerlJam That would *so* confuse people!
glob does globbing, not regex
moritz_ Auzon: you can still use grep rx$regex/, readdir; or some such
PerlJam that said, having some sort of file selector thing (not called glob) with a switchable pattern matcher would be nice. 20:40
moritz_ and it's nice if you can do stuff like @*ARGV = glob @*ARGV if $on_windows;
PerlJam: what's wrong with regexes + grep? ;) 20:41
PerlJam Hmm.. I wonder if we could get m:glob/.../ just like we have m:p5/.../ :-)
moritz_ you can write regex modifiers as macros
shouldn't be too hard to write one that translates globs to regexes
Auzon moritz_: readdir can't mimic glob('*/*') :-/ 20:42
moritz_ Auzon: right. 20:43
PerlJam well, PGE already had parsers for p5, p6, and glob (I wrote some of the glob one actually)
s/had/has/ 20:48
pmichaud more likely is
use STDPatterns;
@a = grep &STDPatterns::glob, @list;
lambdabot Maybe you meant: activity activity-full admin all-dicts arr ask . ? @ v
pmichaud or <glob>, or something like that.
or even glob('pattern') to return a regex that does globbing the way you want :-)
Auzon I guess it'd be really easy to implement a regexglob()
pmichaud q:glob/ ... /;
anyway, it can be easily done as a library :-)
moritz_ pmichaud: or just m/:glob/.../
pmichaud after that it's just a matter of syntax.
pugs_svnbot r20979 | Auzon++ | [gsoc_spectest] Some tests for eager and hyper (8 new tests added) 21:08
r20979 | Auzon++ | Added more TASKS for S03 and one for S16
moritz_ does prefix:<=> consume an Range? 21:31
Auzon moritz_: It iterates a range 21:32
moritz_ Auzon: yes, but iteration != consumation 21:33
Auzon: in p5, each %hash also iteratets over the hash without destroying it
Auzon: so unless it's in spec I doubt that your test cases are right
I'd suggest a different scheme 21:34
my $counter = 0; my @test = gather { for 1 .. 5 { take 1; $couter++ } }
is @test[0], 1;
is $counter, 1, 'only one iteration' # that's the test for lazyness 21:35
then my @second_test = eager gather {... same code here }
is $counter, 5, 'eager is eager';
I fear that the Range object hides its lazyness too well te be tested for
Auzon Alright, yeah, that looks a lot better. So is gather the way to build a generic iterator object? 21:37
moritz_ it's one of the easiest 21:38
moritz_ (it's actually used for iterators, continuations, coroutines - whatever you want to call it) 21:38
bascially for anything that should be lazily executed and returns more than one value 21:39
Auzon ok, thanks moritz_ :) 21:40
moritz_ IIRC kp6 has a similar lazyness test already 21:45
btw gather...take can be used for implementing lazy builtins quite nicely 21:46
sub infix:<xx>(@ary, Num $count) { return gather { take @ary for ^$count } }