Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-12-24

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:03 alanhaggai joined #perl6
00:04 Juerd_ ATTN feather users: please clean homedirs
00:07 Juerd_ (use "ncdu" to visualise disk usage)
00:07 cspencer joined #perl6
00:07 cspencer left #perl6
00:07 cspencer joined #perl6
00:14 cspencer pugs: (1..10).reverse.WHAT.say
00:14 lambdabot cspencer: You have 1 new message. '/msg lambdabot @messages' to read it.
00:14 p6eval pugs: OUTPUT«Array␤»
00:15 eternaleye joined #perl6
00:18 pugs_svn r24592 | hinrik++ | [util/perl6.vim] timestamp
00:22 alc joined #perl6
00:25 cspencer pugs: (1..10).reverse.perl.say
00:25 p6eval pugs: OUTPUT«(10, 9, 8, 7, 6, 5, 4, 3, 2, 1)␤»
00:26 cspencer should a Range reversed return another Range object?
00:27 cspencer i would think yes, since it should be lazily evaluated and not flattened to a list before reversal
00:32 TimToady yes
00:32 cspencer timtoady: thanks :)
00:35 alanhaggai_ joined #perl6
00:37 azawawi_ joined #perl6
00:39 pmichaud reversing a range also reverses its :by value, iirc.
00:42 cspencer right, that would make sense too :)
00:42 cspencer pmichaud: was the Inf you'd added the other day destined to become its own class at some point?
00:42 pmichaud I'm waiting to see how Parrot decides to handle it.
00:42 cspencer ok
00:43 pmichaud at this point it's not likely to become a separate class, unless the spec says it has to be one.
00:43 cspencer ah ok
00:44 cspencer i imagine the parrot implementors will be weighing in on that prior to the 1.0 release in the spring?
00:44 pmichaud it's slated to be address before the Jan release.
00:44 pmichaud *addressed
00:45 cspencer oh, that's soon, great
01:12 meppl good night
01:20 rakudo_svn r34305 | pmichaud++ | [rakudo]:  Merge 'last' and 'redo' functions from pctloop2 branch.
01:39 cspencer rakudo: (1..10).list.say
01:39 p6eval rakudo 34306: OUTPUT«12345678910␤»
01:40 rakudo_svn r34309 | pmichaud++ | [rakudo]:  Correct loop_statement to execute iteration expression on 'next'.
01:44 [particle]1 joined #perl6
02:00 cspencer Inf.perl.say
02:00 cspencer rakudo: Inf.perl.say
02:02 p6eval rakudo 34310: OUTPUT«inf␤»
02:07 lambdabot joined #perl6
02:15 cspencer rakudo: 1..10:by(2)
02:15 p6eval rakudo 34310: OUTPUT«Statement not terminated properly at line 1, near ":by(2)"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
02:38 cspencer rakudo: ('A'..12).perl.say
02:38 p6eval rakudo 34312: OUTPUT«"A"..12␤»
02:39 cspencer pugs: .say for ('A'..10)
02:39 p6eval pugs: OUTPUT«A␤B␤C␤D␤E␤F␤G␤H␤I␤J␤K␤L​␤M␤N␤O␤P␤Q␤R␤S␤T␤U␤V␤W␤X␤Y␤Z␤»
02:40 cspencer is the Range ('A'..10) valid?  if so, how should it iterate over its elements?
02:40 cspencer rakudo: .say for ('A'..12)
02:40 p6eval rakudo 34312: RESULT«Method 'perl' not found for invocant of class 'Iterator'␤current instr.: '_block14' pc 64 (EVAL_15:39)␤»
02:41 simcop2387 joined #perl6
02:43 kisu__ joined #perl6
02:48 pugs_svn r24593 | pmichaud++ | [t/spec] Unfudge some redo tests.
02:50 eternaleye rakudo: say [+] ( split( "", 4150 ).map( { $_ ** 5 } ) )
02:50 p6eval rakudo 34312: OUTPUT«4150␤»
02:50 eternaleye rakudo: subset Valid of Int where { [+] ( split( "", $_ ).map( { $_ ** 5 } ) ) == $num }; my Valid $val = 4150
02:50 p6eval rakudo 34312: OUTPUT«Scope not found for PAST::Var '$num'␤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:102)␤»
02:50 eternaleye Are subset types implemented yet?
02:51 eternaleye oh wait, pasted the wrong code
02:51 eternaleye rakudo: subset Valid of Int where { [+] ( split( "", $_ ).map( { $_ ** 5 } ) ) == $_ }; my Valid $val = 4150
02:51 p6eval rakudo 34312: OUTPUT«Type mismatch in assignment.␤current instr.: 'die' pc 14790 (src/builtins/control.pir:204)␤»
03:02 eternaleye Oh, that's non-intuitive
03:02 eternaleye rakudo: subset Valid of Int where { ( [+] ( split( "", $_ ).map( { $_ ** 5 } ) ) ) == $_ }; my Valid $val = 4150
03:02 p6eval rakudo 34312: RESULT«4150»
03:03 eternaleye Is [+] supposed to associate more weakly than == ?
03:19 azawawi joined #perl6
03:20 eternaleye @tell eric256 I found a solution for Euler #30
03:20 lambdabot Consider it noted.
03:20 eternaleye @tell eric256 `sub isValid { if ( ( [+] split( "", @_[0] ).map( { $_ ** 5 } ) ) == @_[0] ) { return 1; } else { return 0; } }; say [+] map( { $_ if isValid( $_ ); } , 2 .. 100000 );`
03:20 lambdabot Consider it noted.
03:21 eternaleye @tell eric256 ( 9 ** 5 * 7 is 6 digits, so a solution must be < 100000 )
03:21 lambdabot Consider it noted.
03:27 TimToady [+] is a list operator, so you need [+](...) == or ([+] ...) ==
03:28 TimToady but you don't need the parens on the conditional
03:28 TimToady 'if (' is usually wrongish in p6
03:29 TimToady and completely wrong if you omit the space
03:29 azawawi TimToady: hi
03:30 eternaleye rakudo: subset Valid of Int where {  [+](  split( "", $_ ).map( { $_ ** 5 } )  ) == $_ }; my Valid $val = 4150
03:30 p6eval rakudo 34313: OUTPUT«Type mismatch in assignment.␤current instr.: 'die' pc 14790 (src/builtins/control.pir:204)␤»
03:31 eternaleye I think it's parsing as [+] (      (  split( "", $_ ).map( { $_ ** 5 } )  ) == $_    )
03:33 azawawi TimToady: any plans to make STD.pm pass my 'make test' soon?
03:34 alanhaggai joined #perl6
03:42 diakopter TimToady: ping?
03:43 dpuu joined #perl6
03:43 dpuu rakudo: 1 X 4
03:43 p6eval rakudo 34313: RESULT«[1, 4]»
03:44 dpuu rakudo: (1 X 4).elems
03:44 p6eval rakudo 34313: RESULT«2»
03:44 diakopter syntacticosemantic and morphophonemic
04:02 elmex_ joined #perl6
04:04 alanhaggai joined #perl6
04:05 eternaleye @tell eric256 Euler 29: my %nums; for map( { my $x = $_; map( { $x ** $_ }, 2 .. 100 ) }, 2 .. 100 ) -> $num { %nums{ $num } = 1; }; say %nums.keys.elems;
04:05 lambdabot Consider it noted.
04:06 Limbic_Region joined #perl6
04:28 kisu_ joined #perl6
04:29 bacek joined #perl6
04:30 bacek perl6: say elems [1,2,3,4]
04:30 p6eval pugs: OUTPUT«4␤»
04:30 p6eval ..rakudo 34313: OUTPUT«1␤»
04:30 p6eval ..elf 24593: OUTPUT«Undefined subroutine &GLOBAL::elems called at (eval 119) line 3.␤ at ./elf_f line 3861␤»
04:33 Limbic_Region joined #perl6
04:36 azawawi joined #perl6
04:42 cspencer rakudo: loop($i=0; $i < 10; $i++) { say "i: $i" }
04:42 p6eval rakudo 34313: OUTPUT«Scope not found for PAST::Var '$i'␤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:102)␤»
04:43 cspencer rakudo: loop(my $i=0; $i < 10; $i++) { say "i: $i" }
04:43 p6eval rakudo 34313: OUTPUT«i: 0␤i: 1␤i: 2␤i: 3␤i: 4␤i: 5␤i: 6␤i: 7␤i: 8␤i: 9␤»
04:45 bacek pugs: my %h; ++%h<$_> for <1 2 2 4 4>; say %h.perl
04:45 p6eval pugs: OUTPUT«\(\("\$_", 5),)␤»
04:45 bacek pugs: my %h; ++%h{$_} for <1 2 2 4 4>; say %h.perl
04:45 p6eval pugs: OUTPUT«\(\("1", 1), \("2", 2), \("4", 2))␤»
04:53 afterburn joined #perl6
04:53 afterburn moritz_: I'm trying to use your irclog code and the cgi portion is giving me some trouble
05:00 [particle] joined #perl6
05:03 afterburn left #perl6
05:05 [particle]1 joined #perl6
05:39 cspencer left #perl6
05:56 dukeleto_ perl6: say NaN
05:56 p6eval elf 24593, pugs: OUTPUT«NaN␤»
05:56 p6eval ..rakudo 34313: OUTPUT«nan␤»
05:56 dukeleto_ that's not quite right, is it?
05:57 r0bby joined #perl6
06:00 Minthe joined #perl6
06:01 kisu__ joined #perl6
06:11 dukeleto_ perl6: printf "%d", NaN;
06:11 justatheory joined #perl6
06:11 dukeleto_ perl6: printf "%d", NaN
06:12 p6eval rakudo 34313: OUTPUT«-2147483648»
06:12 p6eval ..pugs: No output (you need to produce output to STDOUT)
06:12 p6eval ..elf 24593: OUTPUT«Undefined subroutine &GLOBAL::printf called at (eval 117) line 3.␤ at ./elf_f line 3861␤»
06:12 p6eval rakudo 34313: OUTPUT«-2147483648»
06:12 p6eval ..pugs: No output (you need to produce output to STDOUT)
06:12 p6eval ..elf 24593: OUTPUT«Undefined subroutine &GLOBAL::printf called at (eval 117) line 3.␤ at ./elf_f line 3861␤»
06:13 kisu_ joined #perl6
06:15 masak joined #perl6
06:20 rakudo_svn r34314 | pmichaud++ | [rakudo]:  Make sure infix:<~> and prefix:<~> return Str.
06:20 rakudo_svn r34314 | pmichaud++ | We hopefully can get rid of this when we have HLL support, but
06:20 rakudo_svn r34314 | pmichaud++ | let's at least get them right for now.
06:56 ashizawa joined #perl6
07:03 pugs_svn r24594 | leto++ | Tests for sprintf %s handling of NaN and Inf
07:04 Jonanin joined #perl6
07:10 rakudo_svn r34316 | pmichaud++ | [rakudo]:  List methods are already in Any, no need to have them in List also.
07:20 masak rakudo: loop { last }; say "still alive"
07:20 p6eval rakudo 34317: OUTPUT«still alive␤»
07:23 alexn_org joined #perl6
07:25 Jonanin left #perl6
07:32 Tene perl6: my @list = [] xx 10; @list[0] = 'a'; say @list.perl;
07:32 p6eval pugs: OUTPUT«\("a",)␤»
07:32 p6eval ..elf 24594: OUTPUT«["a",[],[],[],[],[],[],[],[],[]]␤»
07:32 p6eval ..rakudo 34317: OUTPUT«["a", [], [], [], [], [], [], [], [], []]␤»
07:32 Tene perl6: my @list = [] xx 10; @list[0].push('a'); say @list.perl;
07:32 p6eval elf 24594: OUTPUT«[["a"],["a"],["a"],["a"],["a​"],["a"],["a"],["a"],["a"],["a"]]␤»
07:32 p6eval ..rakudo 34317: OUTPUT«[["a"], ["a"], ["a"], ["a"], ["a"], ["a"], ["a"], ["a"], ["a"], ["a"]]␤»
07:32 p6eval ..pugs: OUTPUT«\(\("a",),)␤»
07:33 masak rakudo: my @a = 1..5; shift @a; pop @a; say @a
07:34 p6eval rakudo 34317: OUTPUT«234␤»
07:34 masak rakudo: my @a = 1..5; $_(@a) for &shift, &pop; say @a
07:34 p6eval rakudo 34317: OUTPUT«234␤»
07:34 masak Rakudo++
07:40 masak rakudo: my @a = [&shift, &shift, &pop, &say, &say]; @a[0](@a) while @a;
07:40 p6eval rakudo 34317: OUTPUT«invoke() not implemented in class 'ResizablePMCArray'␤current instr.: '_block14' pc 202 (EVAL_12:83)␤»
07:41 masak rakudo: my @a = &shift, &shift, &pop, &say, &say; @a[0](@a) while @a;
07:41 p6eval rakudo 34317: RESULT«[]»
07:48 japhb joined #perl6
07:55 pmichaud it is truly scary to see some of the code snippets you all write.
07:55 masak :D
08:09 masak actually, I'm not quite sure why that last one terminates.
08:09 pmichaud me neither.
08:09 masak seems to me it _should_ get stuck on the last &say.
08:09 alech joined #perl6
08:10 rakudo_svn r34319 | pmichaud++ | [rakudo]:  Matches now produce Rakudo Match objects instead of PGE::Match.
08:10 masak rakudo: my @a = &say; @a[0](@a) while @a; # sorry, p6eval!
08:11 p6eval rakudo 34317:
08:11 p6eval ..OUTPUT«say␤say␤say␤say␤say␤say␤say␤say␤say␤say␤​say␤say␤say␤say␤say␤say␤say␤say␤say␤say␤say␤say␤s​ay␤say␤say␤say␤say␤say␤say␤say␤say␤say␤say␤say␤sa​y␤say␤say␤say␤say␤say␤say␤say␤say␤say␤say␤say␤say​␤say␤say␤say␤say␤say␤say␤say␤say␤say␤say␤say␤say␤​say␤say␤say␤say␤say␤say␤say␤say␤say␤say␤say�
08:29 Tene masak: the one you were confused about loops on &pop three times.
08:29 Tene popping off &say twice and then itself.
08:29 masak oh, right.
08:30 masak writing self-modifying code is hard!
08:30 Tene hehe
08:49 alech joined #perl6
08:50 rakudo_svn r34321 | pmichaud++ | [rakudo]:  Clean up reverse methods and functions.
08:50 pmichaud glad to see rakudo got it right, though.
08:51 pmichaud I'm getting to the point where I trust rakudo about such things more and more.  :-)
08:51 masak me too. :)
08:51 pmichaud the  eval "sub x { say <OMG> }"   example had me concerned until I saw TimToady++'s reply.  :-)
08:51 masak :)
08:52 masak pmichaud: do you think it'd be possible to add a warning against that mistake. it might become quite common.
08:52 masak s/\./?/
08:53 ChrisDavaz joined #perl6
08:53 pmichaud it might be possible... but it'd also be fairly difficult unless done at the parser level.
08:54 masak ok.
08:54 masak well, no big deal really. I just thought it'd be a nice touch, in case it turned out to be easy.
08:55 masak something like "Warning: Curly block inside interpolating string argument to eval. Probably not what you meant."
08:55 justatheory joined #perl6
09:15 pmurias joined #perl6
09:18 ejs joined #perl6
09:30 alech_ joined #perl6
09:38 alech_ joined #perl6
09:40 rakudo_svn r34322 | pmichaud++ | [rakudo]: spectest-progress.csv update: 264 files, 5837 passing, 0 failing
09:44 iblechbot joined #perl6
09:54 pdcawley joined #perl6
09:55 adc_penner joined #perl6
09:58 alech joined #perl6
09:59 barney joined #perl6
10:00 rakudo_svn r34323 | pmichaud++ | [rakudo]:  Refactor to simplify returning Match object from regexes.
10:00 rakudo_svn r34324 | pmichaud++ | [rakudo]:  Clean up some bugs in .subst reported by skids1++ .
10:00 rakudo_svn r34324 | pmichaud++ | There's still a lot more that needs fixing here, though.
10:18 ejs joined #perl6
10:28 cspencer joined #perl6
10:29 masak rakudo: for 1..10 { continue if $_ % 2; .say }
10:29 p6eval rakudo 34324: OUTPUT«Warning␤1␤2␤Warning␤3␤4␤Warn​ing␤5␤6␤Warning␤7␤8␤Warning␤9␤10␤»
10:29 masak hm.
10:30 masak whence the warnings?
10:30 meppl joined #perl6
10:34 alanhaggai joined #perl6
10:47 * masak realizes that continue does not mean the same in Perl 6 as in Java
10:47 masak ah.
10:47 masak rakudo: for 1..10 { next if $_ % 2; .say }
10:47 p6eval rakudo 34325: OUTPUT«2␤4␤6␤8␤10␤»
10:47 masak rakudo: continue
10:47 p6eval rakudo 34325: OUTPUT«Warning␤»
10:50 rakudo_svn r34327 | bernhard++ | [codingstd] remove trailing spaces
11:11 alanhaggai_ joined #perl6
11:12 iblechbot joined #perl6
11:21 Minthe joined #perl6
11:21 Minthe left #perl6
11:28 pmurias masak: re warning i don't think such a warnning is desirable,eval is/should be uncommon
12:05 ChrisDavaz joined #perl6
12:11 masak pmurias: if a tiny proportion of Perl 6 users use eval, and a high percentage of them fall into the eval/interpol-string/block trap, might not a warning be worthwhile? (at least if it's easy to implement, which pmichaud hinted it's not)
12:14 pmurias masak: it's hard to know upfront if that use case will be problematic
12:15 masak aye. all I know is I fell into the trap, and I consider myself a fairly seasoned Perl 6 user.
12:15 pmurias it's also depends if people will want to use {} interpolation legitimately
12:17 masak that's true. they might actually know what they want, and then the warning will need to be quiesced somehow.
12:18 iblechbot_ joined #perl6
12:22 pmurias masak: what do you expect the .Str method to do on a SV*?
12:22 masak what's a SV*?
12:23 pmurias a perl5 scalar
12:23 masak hm.
12:24 masak is there a good reason to single it out as such? otherwise I'd expect it to simply be stringified.
12:25 pmurias the perl5 object stored in that scalar might have a Str method
12:25 masak that's true.
12:26 masak maybe that should take precedence, then.
12:27 masak I'm having a hard time thinking of a sensible use case that could shed light on what a programmer expects in this case.
12:33 kisu__ joined #perl6
12:33 masak rakudo: say (1..8).reverse.WHAT
12:33 p6eval rakudo 34331: OUTPUT«Str␤»
12:33 * masak submits rakudobug
12:35 masak rakudo: say (1, 2, 3, 4).reverse.WHAT
12:35 p6eval rakudo 34331: OUTPUT«List␤»
12:45 masak rakudo: say (1..8).list.reverse.WHAT # temporary workaround
12:45 p6eval rakudo 34332: OUTPUT«List␤»
12:52 alanhaggai joined #perl6
12:58 pmurias @tell ruoso git clone git@gitorious.org:smopp5/mainline.git asks be for a password?
12:58 lambdabot Consider it noted.
13:05 alech joined #perl6
13:22 alanhaggai_ joined #perl6
13:39 SamB joined #perl6
13:39 literal http://www.reddit.com/r/programming/comments/7lf1​u/coding_challenge_divide_a_list_into_n_sublists/
13:40 literal so, what's the shortest way to do this in Perl 6?
14:02 alech joined #perl6
14:08 alech joined #perl6
14:15 justatheory joined #perl6
14:30 ruoso joined #perl6
14:32 ruoso hi pmurias
14:32 lambdabot ruoso: You have 1 new message. '/msg lambdabot @messages' to read it.
14:33 ruoso pmurias, gitorious use ssh key auth
14:33 pmurias ruoso: hi
14:34 pmurias ruoso: so i have to get an account on gitorious?
14:34 ruoso yes
14:36 pmurias registered there
14:36 ruoso I presume you're going to register with pmurias as username
14:37 pmurias yes
14:38 ruoso you're a committer alread
14:39 ruoso you might want to sync with the p5 git repo also,
14:39 ruoso so you can keep the branch up-to-date
14:55 pmurias ruoso: dSP;ENTER; causes a valgrind warning any idea why?
14:56 pmurias with my_perl storing the perl5 interpreter i initialised ealier
14:56 ruoso hmm... I don't know if p5 is valgrind-clean
14:57 ruoso pmurias, my internet connection is specially slow today, would you mind sync-ing gitorious and blead?
14:58 Limbic_Region joined #perl6
14:59 pmurias ENTER does a segfault too
14:59 pmurias ruoso: ok i'll do it
15:00 ruoso pmurias, ok, segfault means you're doing something wrong
15:02 pmurias ruoso: how should i do the sync?
15:02 alech joined #perl6
15:03 ruoso you can add a remote to .git/config
15:04 ruoso [remote "blead"]
15:04 ruoso url = git://perl5.git.perl.org/perl.git
15:04 ruoso fetch = +refs/heads/*:refs/remotes/origin/*
15:04 ruoso actually it's not exactly that
15:04 ruoso in the last line, it's refs/remotes/blead
15:04 ruoso not origin
15:05 ruoso then you can just git pull blead
15:05 ruoso and git push
15:10 vixey joined #Perl6
15:12 ruoso is there any spec on the exceptions API?
15:13 ruoso pmurias, how is the .ri language defined? I'd like to add a %has $foo that would provide the storage and accessors for a Scalar
15:16 ruoso hmm... wait... %attr and %getter does that already... nevermind
15:22 dwhipp rakudo: sub x ($x where "x") { say "X" }; x("x")
15:22 p6eval rakudo 34337: OUTPUT«Parameter type check failed in call to x␤current instr.: 'die' pc 14690 (src/builtins/control.pir:204)␤»
15:22 dwhipp rakudo: sub x ($x where /x/) { say "X" }; x("x")
15:22 p6eval rakudo 34337: OUTPUT«Method 'push' not found for invocant of class 'Perl6;Grammar'␤current instr.: 'parrot;Perl6;Grammar;Actions;_block6895' pc 157512 (src/gen_actions.pir:19785)␤»
15:22 dwhipp rakudo: sub x ($x where { $^x eq "x" }) { say "X" }; x("x")
15:22 p6eval rakudo 34337: OUTPUT«X␤»
15:23 dwhipp seems that "where" clauses don't do smart-matching
15:26 dwhipp sub x (where {/x/} $x) { say "X" }; x("x")
15:26 dwhipp rakudo: sub x (where {/x/} $x) { say "X" }; x("x")
15:26 p6eval rakudo 34337: No output (you need to produce output to STDOUT)
15:27 dwhipp (that one gives a segv)
15:28 dwhipp rakudo: sub x (Any where {/x/} $x) { say "X" }; x("x")
15:28 p6eval rakudo 34337: No output (you need to produce output to STDOUT)
15:28 * ruoso points rakudobug@perl.org to dwhipp
15:28 dwhipp thx
15:33 pugs_svn r24595 | ruoso++ | [smop] start to document how exceptions will work in SMOP
15:34 ruoso pmurias, take a look at lowdoc/04
15:36 maerzhase joined #perl6
15:45 pmichaud pugs:  my $p = a => 2;  say $p.perl;
15:45 p6eval pugs: OUTPUT«\\("a", 2)␤»
15:46 pmichaud pugs:  my @a = (a => 1, b=>2, c=>3); say @a.perl;
15:46 p6eval pugs: OUTPUT«\(\("a", 1), \("b", 2), \("c", 3))␤»
16:05 pmurias ruoso: seems ok
16:07 pmurias ruoso: the ri language is defined by it's implementation in tool/ri
16:07 pmurias * tools/ri
16:14 stephens joined #perl6
16:14 aindilis joined #perl6
16:16 iblechbot joined #perl6
16:18 dwhipp simple question: does Rakudo do coercion yet -- i.e. "5" as Int ... obviously that doesn't work, but maybe I'm getting the syntax wrong
16:21 alc joined #perl6
16:26 pmichaud +"5" works :-)
16:27 pmichaud we don't implement 'as' yet, no.
16:27 dwhipp rakudo: my Int $a = +"5"
16:28 p6eval rakudo 34337: OUTPUT«Type mismatch in assignment.␤current instr.: 'die' pc 14690 (src/builtins/control.pir:204)␤»
16:28 pmichaud hmm.
16:28 pmichaud it must think that +"5" is a Num.
16:28 dwhipp rakudo: my Num $a = +"5"
16:28 p6eval rakudo 34337: RESULT«5»
16:28 dwhipp rakudo: my Int $a = int +"5"
16:28 p6eval rakudo 34337: RESULT«5»
16:28 pmichaud we still have some work to do to get the Int/Num mapping straight.
16:28 pmichaud my Int $a = int "5"
16:28 pmichaud rakudo: my Int $a = int "5"
16:29 p6eval rakudo 34337: RESULT«5»
16:34 dwhipp rakudo: my @values = <1 2 a b 3 c>.map: { /\D/ ?? ~$_ !! +$_ }; say @values.perl
16:34 p6eval rakudo 34337: OUTPUT«["1", "2", "a", "b", "3", "c"]␤»
16:35 pmichaud I don't think rakudo recognizes   /\D/  as an "immediate match" yet.
16:35 pmichaud and it might need to be  m/\D/  (but I still don't think rakudo recognizes that.)
16:36 dwhipp rakudo: my @values = <1 2 a b 3 c>.map: { $_ ~~ /\D/ ?? ~$_ !! +$_ }; say @values.perl
16:36 p6eval rakudo 34337: OUTPUT«[1, 2, "a", "b", 3, "c"]␤»
16:36 dwhipp :-)
16:37 pugs_svn r24596 | pmichaud++ | [t/spec]:  Remove a suspicious test.
16:40 rakudo_svn r34338 | pmichaud++ | [rakudo]:  Adjust Pair.perl .
16:47 pdcawley joined #perl6
17:09 ejs joined #perl6
17:18 alexn_org joined #perl6
17:25 pugs_svn r24597 | pmichaud++ | [t/spec]:  Add test for list context and infix:<Z>
17:25 kidd hi. I've just installed parrot feliz loro for first time.  Is there any REPL to start messing with it?
17:26 cspencer kidd: as in a perl 6 REPL?
17:28 kidd yup, or something like parrot -e 'say "foo"'
17:28 cspencer sure
17:28 cspencer switch into languages/perl6
17:29 cspencer and run "make perl6"
17:29 kidd ah, great. thanks
17:29 cspencer (assuming you've already built parrot)
17:32 cspencer that should generate a perl6 binary that you can run as ./perl6 for a REPL or you can pass it a file to run
17:35 kidd I'm building it now. Thanks cspencer
17:35 cspencer no problem :)
17:37 ChrisDavaz joined #perl6
17:43 dwhipp rakudo: .say for <A B>.map: { [ .split("") ] }
17:43 p6eval rakudo 34338: OUTPUT«A␤B␤»
17:43 dwhipp rakudo: .say for <A>.map: { [ .split("") ] }
17:43 p6eval rakudo 34338: OUTPUT«Method 'iterator' not found for invocant of class 'Str'␤current instr.: 'parrot;Any;map' pc 9625 (src/builtins/any-list.pir:228)␤»
17:44 pmichaud dwhipp: there are a number of people (and some tests) that claim that .map should not work on scalars.  (I disagree.)
17:44 pmichaud in this instance, the complaint is essentially that Str doesn't have a .map method.
17:46 dwhipp actually, my complaint would be that <...> is a list constructor -- so shouldn't behave differently when quoting only one ele,
17:46 pmichaud <...>  is *not* a list constructor.
17:46 pmichaud <A>  is same as ('A')
17:46 pmichaud which is a Str
17:47 apeiron joined #perl6
17:47 cspencer should S05-substitution/[match | subst].t spec tests be failing at the moment?
17:47 pmichaud cspencer: I don't think they should no.
17:47 cspencer hmmm, maybe i need a parrot rebuild then
17:48 dwhipp OK ... but it still causes a nasty edge case when passed one elem -- reduces scalability of code
17:48 pmichaud dwhipp: which is why I think .map should treat a scalar as a list of one element.
17:48 pmichaud .join already does this.
17:48 pmichaud rakudo:  say <A>.join('x');
17:48 p6eval rakudo 34338: OUTPUT«A␤»
17:48 pmichaud rakudo:  say <A B>.join('x');
17:48 p6eval rakudo 34338: OUTPUT«AxB␤»
17:49 pmichaud rakudo:  say <A B>.WHAT;
17:49 p6eval rakudo 34338: OUTPUT«List␤»
17:49 pmichaud rakudo:  say <A>.WHAT;
17:49 p6eval rakudo 34338: OUTPUT«Str␤»
17:50 dwhipp rakudo: say <A>.elems
17:50 p6eval rakudo 34338: OUTPUT«1␤»
17:50 pmichaud I think I'll just go ahead and modify Rakudo's .map (and .grep and other list operators) to work that way, and adjust the tests to match.
17:50 dwhipp yup, I vote that it's a list of one elem
17:50 pmichaud I'm pretty sure that's the way TimToady was leaning
17:50 pmichaud but it'll come after lunch.
18:03 icwiener joined #perl6
18:16 cspencer do patches to spectests get sent to a different address than perl6 patches?
18:16 cspencer or can they be bundled up into the same diff?
18:18 dwhipp rakudo: my @primes; for 2 .. 20 -> $n { @primes.push($n) unless $n % any(@primes)==0 }; .say for @primes
18:18 p6eval rakudo 34338: OUTPUT«2␤3␤5␤7␤11␤13␤17␤19␤»
18:18 dwhipp sometimes p6 makes things too easy!
18:21 azawawi joined #perl6
18:21 azawawi hi
18:21 cspencer dwhipp: that's really nice!
18:22 cspencer hi azawawi
18:32 Psyche^ joined #perl6
18:48 [particle]1 cspenser: do you have a pugs commit bit?
18:48 [particle]1 you can commit the spectest changes directly
18:49 cspencer particle: i don't, no
18:49 cspencer how does one apply for one of those? :)
18:51 [particle]1 give me your email address, and i give you one now :)
18:53 cspencer sure: cspencer@sprocket.org
18:53 cspencer thanks! :)
18:53 [particle]1 the invite is on its way!
18:53 cspencer thank you very much!
19:00 DemoFreak joined #perl6
19:13 icwiener Haha, I just head somebody talking about this "we don't accept patches, we grant commit access" thing. :D
19:14 TimToady would you like a commit bit?
19:14 vixey ♥ pugs
19:14 TimToady but do you ♥ Haskell?  :D
19:14 vixey a little bit :)
19:16 icwiener No, I do not want a commit bit. It would make me one of those zero committers because I have no clue about language design... ;)
19:16 icwiener I could fix typos in comments though. :D
19:17 TimToady you don't need to have a clue about language design to write tests; you just need to know how to put the language through unexpected contortions, for which it's beneficial *not* to be a language designer
19:20 * icwiener thinks ...
19:21 icwiener Is there a little tutorial something that explains how to write tests? Or is looking at the existing tests the way to go?
19:22 vixey hm there's no way to reset your password for pugscode?
19:22 TimToady vixey: we just send a new invite to do that
19:22 TimToady you want that?
19:22 vixey yeah please
19:22 vixey .. again :(, I had to reset it before
19:23 TimToady what was your nick?
19:23 vixey fax
19:24 TimToady still v.s@gmail?
19:24 vixey yes
19:25 TimToady okay, sent, I suspect
19:25 vixey that's it! thank you :)
19:26 TimToady icwiener: I'd just watch masak for a while, and then do the same thing.  :)
19:27 icwiener TimToady: Sounds good. :)
19:28 TimToady but it's also valuable to point out places that are difficult to get into due to lack of docs
19:28 TimToady and everyone who documents their way in is helpful to the next person trying to get in
19:29 TimToady anyway, if you /msg me an email address and a preferred nick, I can send you a commit bit
19:30 TimToady then we can at least get any administrative obstructions out of the way... :)
19:31 TimToady and there's a HOWTO doc in t/
19:33 bacek joined #perl6
19:34 ruoso TimToady, btw... I agree it's a little weird that we CATCH but don't throw
19:35 TimToady so maybe just go with throw for now, esp if it's only a method
19:36 ruoso right... but that doesn't solve the problem for control exceptions
19:36 ruoso because I presume we need two different functions to that,
19:36 TimToady throw can be generic
19:36 ruoso and it checks if $_ ~~ Failure?
19:37 ruoso sounds a little bit boring to do that everytime
19:37 ruoso when you have so clear difference between the scenarios
19:38 TimToady point
19:38 ruoso 'abnormal flow' in one word?
19:40 TimToady well, .throwcontrol is dehuffmanized then
19:41 ruoso well, it certainly is dehuffmanized, it's even de-pretty-ized
19:41 ruoso not to say ugly-ized
19:41 ruoso :)
19:41 TimToady we want to encourage people to use goto instead  :)
19:41 ruoso heh
19:41 ruoso what about loose ??
19:42 ruoso heh
19:42 TimToady maybe even .throw_control_exception
19:42 TimToady slightly less ugly
19:42 ruoso indeed
19:42 ruoso well
19:43 TimToady I was thinking we try to avoid _ in builtins, but there's prefix_circumfix_meta_operator
19:43 ruoso I was considering those as functions, not methods
19:43 ruoso if we consider as methods, we can just use throw
19:43 TimToady THROW_CONTROL_EXCEPTION is really hard to type without capslock
19:44 TimToady so maybe just give the CONTROL exceptions long names :)
19:44 ruoso I was assuming ControlException to be part of their name
19:44 ruoso like ReturnControlException
19:44 TimToady something to be said for ControlException in front instead
19:44 TimToady then you can line them up nicer
19:45 ruoso hm?
19:45 TimToady ControlExceptionReturn
19:45 TimToady ControlExceptionNext
19:45 TimToady ControlExceptionLast
19:45 TimToady ControlExceptionGoto
19:45 ruoso ok, got it... makes sense...
19:45 ruoso so there's no fail()-like function for control exceptions
19:46 ruoso and .throw is how you raise an exception by using its object
19:46 ruoso (being Failure or Control Exception)
19:46 pmichaud .throw was my first thought when this came up.
19:46 ruoso I had my mind looking for functions, for some reason
19:48 ruoso but making it as methods only makes much sense
19:48 ruoso fail is a conveninence function, just like return
19:52 * ruoso later & (now I have no excuse to postpone implementing return in SMOP)
19:55 pugs_svn r24598 | schwarzer++ | first customary add yourself to the AUTHORS file test commit :)
19:55 TimToady welcome aboard, icwiener++
19:57 dukeleto joined #perl6
20:06 * pmurias finds it confusing when people have a different irc nick and svn user name
20:08 * TimToady makes a noise like a turnip
20:11 Eevee joined #perl6
20:16 ruoso pmurias, better for us, who get more karma ;)
20:22 azawawi joined #perl6
20:23 pmichaud turnips make noise?
20:24 azawawi yeah turnips' noise ;-)
20:25 dukeleto_ joined #perl6
20:26 * azawawi thinks about getting a more cool nickname ;-)
20:30 cspencer if one creates a range as in: "$r = 1..10:by(2)", the the increment value available via: "$r.by" ?
20:31 pmichaud I would think so.
20:31 pugs_svn r24599 | pmurias++ | [smop] calling a argumentless perl5 subroutine works
20:31 cspencer ok
20:32 cspencer pmichaud: i saw you'd noted that the vtable('get_string') method was wrong in Mapping.pir - do you recall what was wrong with it?
20:32 pmichaud it will cause .Str to not work for any subclasses of Mapping
20:33 pmichaud (that choose to override it)
20:33 cspencer oh ok
20:33 pmichaud It's just a note to come back and fix it up later.
20:33 cspencer alright
20:34 pmichaud (also so that people don't blindly copy it to other classes w/o asking about it :-)
20:34 pmichaud afk, shopping
20:35 cspencer later :)
20:38 icwiener TimToady: Thank you. :) (a bit late due to a telephone call)
20:50 adc_penner left #perl6
20:58 dwhipp rakudo: say "improper collapse" if 10 < (5|25) < 20
20:58 p6eval rakudo 34339: OUTPUT«improper collapse␤»
21:21 mberends joined #perl6
21:23 ruoso Merry Christmas to you all, even if we didn't get the present we wanted this year, I'm pretty confident we're having christmass  earlier next year... ;P
21:24 pmurias merry christmas
21:25 vixey hehe
21:29 * pmurias relised he forgot to remove printf("DESTROY ALL HUMANS!!!n"); from P5Interpreter.DESTROYALL when commiting... ;)
21:29 vixey haha
21:29 vixey I don't think you are the only one writing things like this when testing :)
21:30 pugs_svn r24600 | hinrik++ | [util/perl6.vim] add Q[wx], q[wx] and qq[wx]
21:35 ejs joined #perl6
21:40 rakudo_svn r34340 | chromatic++ | [Rakudo] Fixed some compilation warnings in MultiSub PMC.
21:44 pugs_svn r24601 | hinrik++ | [util/perl6.vim] recognize one adverb with Q[wx], q[wx] and qq[wx]
22:10 cspencer should stringifying or calling .perl on a Range output the :by increment value? ie) "$r = 1..10; $r.perl.say" would produce "1..10:by(1)"  Or should that only be output in cases where the :by isn't the default value?
22:16 pmichaud I'd prefer to see it output :by only when not the default.
22:17 pmichaud technically as long as it produces something that evals back to the same range, it's valid.
22:17 pmurias ruoso: what are the magic warn if refcounts are incorrect options?
22:22 cspencer pmurias: good point
22:22 pugs_svn r24602 | pmichaud++ | [t/spec]:  Update map/grep/reduce/kv tests to work with scalar invocants.
22:30 rakudo_svn r34342 | pmichaud++ | [rakudo]:  Fix $x.map to work as list of 1 element.
22:34 cspencer pmichaud: i resubmitted that Range patch for infinite ranges
22:52 pugs_svn r24603 | hinrik++ | [util/perl6.vim] allow any number of ignored adverbs after the first significant one
22:53 pdcawley joined #perl6
23:01 DemoFreak joined #perl6
23:05 lambdabot joined #perl6
23:15 araujo joined #perl6
23:29 alech joined #perl6
23:32 plash_ joined #perl6
23:32 plash_ left #perl6
23:36 DemoFreak joined #perl6
23:47 ewilhelm joined #perl6

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

Perl 6 | Reference Documentation | Rakudo