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 duke_leto left
literal without using :to, which string delimiters are valid? all bracketing characters except (), plus // ? 00:06
and except <>, I presume
00:08 eternaleye_ joined
literal ah hm, never mind 00:09
00:10 maerzhase1 left 00:13 eternaleye left
zev If I'm adding additional tests which pass under a patch I just submitted (but don't without the patch), should I mark the tests todo? 00:14
00:16 ruoso joined
ruoso btw... pmurias++ # plumbing 00:21
cspencer rakudo: say *.perl 00:25
00:25 gbacon joined
p6eval rakudo 34262: OUTPUT«Statement not terminated properly at line 1, near ".perl"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤» 00:25
00:25 eternaleye joined
cspencer rakudo: say (*).perl 00:25
p6eval rakudo 34262: OUTPUT«*␤»
pugs_svn r24569 | zev++ | additional substitution tests 00:40
00:40 eternaleye_ left
pmichaud zev: yes, mark the tests as 'skip' or 'todo' until the patch has been applied. 00:47
zev done 00:48
pmichaud literal: all bracketing characters are valid delimiters
00:50 hudnix_ joined
pugs_svn r24570 | pmichaud++ | [t/spec]: Adjust plan for test added to reduce.t in r24567. 00:51
rakudo_svn r34263 | pmichaud++ | [rakudo]: refactor more "list methods" from Mapping into Any 01:00
01:04 stephens left 01:05 hudnix_ left 01:11 ewilhelm_ joined, cspencer left
pmichaud are 'next', 'last', and 'NEXT', 'LAST', etc. honored in map and grep? 01:12
01:14 Limbic_Region left
zev I'm looking at #58524, which references S04. S04 says that "=<>" is equivilent to "=$*ARGS". should that be "@*ARGS"? 01:15
pmichaud no, it's $*ARGS 01:16
@*ARGS is an array
lambdabot Unknown command, try @list
pmichaud $*ARGS is a magic filehandle iterator
zev I ask because misc.pir has the '=<>' sub calling 'prefix:=' with "get_hll_global '@ARGS'" as its argument 01:17
pmichaud yes, it's wrong. 01:18
(misc.pir, that is.)
zev then it should be get_hll_global '$*ARGS' ?
pmichaud it can be, if someone would write the code for '$*ARGS' :-) 01:19
(rakudo doesn't implement $*ARGS yet.)
01:19 hudnix_ joined 01:23 alc joined 01:24 ruoso left
zev so, it's supposed to be an iterator that iterates over either the command line arguments or standard in? 01:25
pmichaud over the files given by the command line arguments, yes.
zev what is the $*ARGS capture then? 01:26
pmichaud I don't understand.
zev (I'm looking at the table in S06 under 'Declaring a MAIN subroutine')
wolverian www.itu.dk/people/mir/typesafepatterns.pdf reminds me of some aspects of given/when 01:27
01:27 kisu_ joined
pmichaud $*ARGS as a capture (as described in S06) would be the command line arguments after they've been processed for option switches 01:28
I'm not sure that's intended to be the same $*ARGS described in S02/S04 01:29
so perhaps one or the other is a typo
if they are intended to be the same, then iterating over $*ARGS is what produces the successive opens of any filenames given in @*ARGS 01:30
01:30 alanhaggai left
zev how would it be different if they weren't the same $*ARGS? 01:30
01:31 kisu left
pmichaud I don't know. 01:31
we probably need a clarification from p6l
zev ok. I'll send mail
anyway, so $*ARGS should iterate over all the files specified on the command line followed by stdin 01:41
in terms of implementation, does it make sense for it to be an instance of a subclass of IOIterator? 01:42
01:43 alexn_org joined
zev or perhaps this is something that would be better implemented in Perl6 itself (to get anonymous subclasses) 01:44
s/itself//
TimToady rakudo: Whatever.perl 01:47
lambdabot TimToady: You have 6 new messages. '/msg lambdabot @messages' to read them.
p6eval rakudo 34263: RESULT«"Whatever"»
TimToady rakudo: *.defined
p6eval rakudo 34263: OUTPUT«Statement not terminated properly at line 1, near ".defined"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
TimToady o_O
literal so, "" is q:q:qq ? 01:48
er, Q:q:qq
TimToady just Q:qq
literal does :qq imply :q ?
TimToady they are different animals 01:49
rakudo: defined(*)
p6eval rakudo 34263: RESULT«1»
TimToady rakudo: defined(Whatever)
p6eval rakudo 34263: RESULT«0»
TimToady rakudo: **.perl
literal if "" is just Q:qq which doesn't imply :q, then it shouldn't interpolate \", \\ ... right?
p6eval rakudo 34263: OUTPUT«Null PMC access in get_number()␤current instr.: 'parrot;Whatever;' pc 8525 (src/classes/Whatever.pir:41)␤»
TimToady qq and q have independent backslashing rules 01:50
literal hm, I just noticed that :qq implies :b which says "Interpolate \n, \t, etc. (implies :q at least)" 01:51
TimToady for instance, the default is different for things that didn't need backslashing
01:52 azawawi_ joined
TimToady :b is the qq semantics, not sure what the parenthetical remark means 01:53
literal so q{\s\d\k} == '\f\b\g', while qq{\s\d\k} == 'fbg' ?
assuming \s, \d, \k are meaningless espace sequences 01:54
er, that was supposed to be sdk there, not fbg
TimToady yes 01:55
02:01 azawawi left
zev is there something wrong with the perl.org mail system? Email I've sent to perl6-language hasn't been delivered to me. Or has p6l become moderated? 02:02
meppl good night 02:03
02:04 meppl left 02:06 DemoFreak left
pmichaud zev: email on perl.org is sometimes slow. 02:24
02:24 Whiteknight left
pmichaud zev: also, I've noticed that sometimes individual accounts get moderated if they haven't posted for a while. (This happens to me sometimes.) 02:24
02:24 apeiron left 02:25 apeiron joined
pmichaud TimToady: when we say that 'map' and 'for' are isomorphic, does that extend to things like NEXT/LAST/REDO closure traits? 02:25
TimToady seems reasonable 02:26
pmichaud is 'next' lexical like 'return' is lexical?
02:27 alexn_org left
pmichaud i.e., if I have for @list { ... my @b = map { next if ... }, @something } 02:27
then the "next" applies to the lexical for loop, and not the 'map' ?
TimToady why shouldn't it apply to the map? 02:28
pmichaud it certainly _can_, but afaik 'map' isn't a statement construct just yet 02:29
TimToady lemme stew about it over dinner.
pmichaud okay.
pmichaud had stew for dinner last night. 02:30
Khisanth so next won't be an alternate way to spell goto anymore? :P 03:18
03:19 hercynium joined 03:20 alanhaggai joined
TimToady how do you suppose goto works? 03:21
the implementation of goto LABEL in perl 5 is over 100 lines long. Perl's goto was never C's goto. :) 03:25
03:37 cspencer joined 03:38 hercynium left
pugs_svn r24571 | pmichaud++ | [t/spec]: Unfudge some more rakudo tests. 03:40
03:42 Minthe joined 03:44 Minthe left 03:45 aindilis` joined 03:50 pdcawley left 04:00 aindilis left 04:02 elmex_ joined 04:10 pdcawley joined 04:17 elmex left, elmex_ is now known as elmex 04:22 ChrisDavaz joined 04:34 pdcawley left
azawawi_ good morning 04:42
04:57 Minthe joined 04:58 kisu_ left, kisu joined
azawawi_ Hello 05:03
05:04 azawawi_ is now known as azawawi
cspencer good evening! 05:08
azawawi not bad... 3 mins response time ;-) 05:09
05:09 masak joined
azawawi 5 min to be exact 05:09
cspencer hah, yeah there was some serious lag time in that response :)
05:09 alester_ joined
azawawi lol 05:10
azawawi Padre::Plugin::Perl6 - Syntax highlighting + checking while you type Perl 6 code
cspencer azawai: what's padre? 05:17
azawawi an Perl IDE based on scintilla... 05:18
cspencer ah ok
azawawi padre.perlide.org/
cspencer i've not heard of that one before
azawawi basically you have two Perl IDEs Padre and Kephra atm 05:19
cspencer alright. i've not heard of the other one either, i suppose i don't very far from emacs all that often :) 05:20
azawawi Padre has a Vi-plugin but i suppose that you wont like it 05:21
cspencer probably wouldn't switch to vi for it, no :)
05:27 Minthe left
cspencer i'm out for the night, good night :) 05:30
05:30 cspencer left
masak azawawi++ # making the Perl 6 world more colorful 05:34
azawawi masak: did u try it? ;-) 05:35
masak not yet, no.
I'm also an entrenched Emacs user.
azawawi next step Perl6 snippets and autocompletion ;-)
masak ooh, autocompletion!
azawawi why do u think i used STD.pm ? ;-) 05:36
btw, STD.pm error information is now available in Padre
05:43 sail0r joined, ChrisDavaz left
masak cool. 05:44
azawawi the cool thing is to have the tree node information while you type 05:45
along with wizards for Perl6 code 05:46
you sometimes have to create wizards to create wizards ;-)
masak meta-wizards. 05:47
literal azawawi: you said something about porting perl6.vim to Perl regexes. If you meant Perl 5, then there's a big problem because Perl 5 only support constant-length lookbehind 05:49
perl6.vim uses variable-length lookbehind/lookahead *a lot* :P
05:53 ChrisDavaz joined 06:03 sail0r left
azawawi literal: oh well; i havent started on it yet. thx for the information. 06:04
06:07 xuser left 06:10 alc left, azawawi left 06:21 xuser joined 06:28 alanhaggai_ joined 06:41 alech joined 06:44 alanhaggai left
pugs_svn r24572 | hinrik++ | [util/perl6.vim] prevent non-function/method keywords from highlighting when followed by parens, fix nesting of multiline comments with long delimiters, some interpolation fixes, support Q//, q//, qq//, etc (no heredocs yet) 06:50
06:53 alanhaggai_ left 06:59 justatheory joined
pugs_svn r24573 | hinrik++ | [util/perl6.vim] fix for escaped closing delimiters in some strings 06:59
07:07 masak left 07:09 adc_penner joined, alc joined
pugs_svn r24574 | hinrik++ | [util/perl6.vim] compress the list of routines into fewer lines 07:15
07:17 redicaps1 joined
pugs_svn r24575 | hinrik++ | [util/perl6.vim] add missing comma, oops 07:23
r24576 | hinrik++ | [util/perl6.vim] add another keyword 07:24
07:29 justatheory left 07:33 bacek__ left 07:37 justatheory joined 07:52 alester_ left
pugs_svn r24577 | zev++ | typo in test description 08:00
08:04 iblechbot joined 08:06 redicaps1 left
pugs_svn r24578 | hinrik++ | [util/perl6.vim] correct a wrongly escaped double quote 08:10
r24579 | hinrik++ | [util/perl6.vim] allow pipe a string delimiter 08:12
literal rakudo: my $str = q$a test$; $str.perl 08:13
p6eval rakudo 34268: RESULT«"\"a test\""»
08:16 maerzhase joined 08:24 alech left 08:28 alexn_org joined 08:31 DemoFreak joined 08:35 alexn_org left 08:55 barney joined 09:09 c9s_ is now known as c9s 09:12 alech joined 09:17 adc_penner left 09:23 sail0r_ joined, alc left 09:27 ChrisDavaz left 09:42 donaldh joined 09:43 rgrau joined 09:53 alech_ joined 09:54 alech left 10:01 clintongormley joined 10:09 clintongormley left 10:10 maerzhase left 10:12 alech_ left 10:13 alech joined 10:17 clintongormley joined 10:33 alech left, alech joined 10:34 maerzhase joined 10:35 ejs joined 10:51 alech left, alech joined 11:03 justatheory left 11:13 alech_ joined 11:14 ruoso joined 11:15 pmurias joined 11:17 alech left, alech_ left
pugs_svn r24580 | pmurias++ | [smop] added p5interpreterer.ri which is exposed in the lexical prelude as P5Interpreter which currently can only eval p5 code as strings 11:20
r24580 | pmurias++ | the build system does nastyish stuff to link in libperl
pmurias ruoso: hi 11:21
ruoso hi pugs_svn
oops
pmurias heh
ruoso hi pmurias
it seems you're doing a lot of work :) 11:22
pmurias the output from eval_pv disappears when stdin is redirected to a file
any ideas what causes this
?
ruoso you mean stdin fed from a file 11:24
or stdout redirected to a file
?
pmurias sorry stdout
ruoso it's probably because of buffering
pmurias ruoso: it's ok that i change the build system to scons? 11:25
ruoso conceptually, yes...
but i'm not being able to build it 11:26
pmurias that not good
ruoso it tries to find libsmop while building smop
when it runs X
(wth is X?) 11:27
pmurias m0ld_exe
pmurias changes the name
ruoso oh right...
call it just m0ld
(ok, there's a directory with that name... 11:28
11:34 maerzhase left 11:41 Lorn joined
pmurias a ./Setup configure when typed from the shell works, when scons calls it doesn't :( 11:44
ruoso hmm 11:45
pmurias, you missed smop_p5.h
pugs_svn r24581 | pmurias++ | [smop] added missing file 11:47
11:53 maerzhase joined 11:55 kisu_ joined
pugs_svn r24582 | pmurias++ | [smop] fixed the build system 11:57
r24582 | pmurias++ | m0ld is built by the Makefile as scons conflicts with ./Setup configure (why?)
12:00 kisu left
pugs_svn r24583 | ruoso++ | [smop] small fix in makefile 12:03
ruoso valgrind and pcl don't get together nicely
pmurias, btw... where was the leak? 12:05
pugs_svn r24584 | pmurias++ | [smop] make also creats a m0ld_exe with a linked in SMOP for mildew 12:07
r24584 | pmurias++ | [mildew] added (failing) t/p5.t
r24585 | ruoso++ | [smop] fix test/04... it was returning null from SMOP_MESSAGE...;
pmurias ruoso: 2 in not releasing molds
the third one was in the native capture 12:08
ruoso the last one surprised me
12:10 alexn_org joined
ruoso pmurias, I think I'm going to work on sanitizing the interpreter usage according to lowdoc/03 12:10
actually, 02
so we can implement exception handling 12:11
pmurias doesn't 02 describe the current state? 12:12
btw it might make sense to merge has_next/next/eval into eval 12:16
ruoso pmurias, it describe how we already think it should be 12:35
but not every continuation has .back being set all the time
and none of them has .control and .catch
pmurias continuations should have a .clone method if we want to support continuations 12:36
ruoso that would be cool
pmurias the continuations we currently have are really coroutines
ruoso well... the definition for "continuation" is not that strict 12:37
but I see what you mean
it is still a continuation, even if it can only be invoked once
but at least mold can be cloned easily 12:38
pmurias got any solutions for making pcl valgrind clean? 12:41
12:44 ChrisDavaz joined
ruoso pmurias, I don't think it can be 12:53
it messes with the things valgrind is trying to take account of
13:09 donaldh left 13:10 alester_ joined 13:24 sail0r joined 13:25 alester_ left 13:33 sail0r_ left
pugs_svn r24586 | pmurias++ | [mildew] t/p5.t sets autoput outflush 13:34
13:41 bacek left
pmurias ruoso: i'll move test 37 to TODO 13:42
13:50 alester_ joined 13:52 justatheory joined 13:55 meppl joined 13:57 ejs1 joined 13:59 alester_ left
ruoso pmurias, ok 14:02
mildew: ::P5Interpreter.new().eval("$|=1; print qq(pmurias++\n) for 1..5"); 14:04
p6eval mildew: OUTPUT«--exec use ./Setup configure --user --flags=SMOP␤»
ruoso meh 14:05
pmurias, how hard you think it would be to make a m0ld compiler in p5 and using SMOP XS?
14:05 alexn_org left
pmurias ruoso: you want to drop the haskell dependency? 14:07
14:07 ejs left
ruoso well, we already depend on p5, if it's not too hard, it would be nice... 14:07
and it would have the advantage that it could only "require SMOP" when trying to exec 14:08
and thus avoiding the circularity between m0ld and libsmop 14:09
pmurias, we could even write the m0ld grammar in Perl 6 ;) 14:12
pmurias ruoso: how do you intend to run the Perl 6 grammar
?
ruoso the same way STD runs 14:14
pmurias it's a bit frail
i went that way with sm0p and it broke a couple of times 14:15
ruoso but I think Parse::RecDescent would be enough to parse m0ld
pugs_svn r24587 | pmurias++ | [smop] 14:16
r24587 | pmurias++ | moved old tests to test/old
r24587 | pmurias++ | test 37 to test/TODO
r24587 | pmurias++ | tests to be compiled are specified using a glob instead of a hardcoded list
14:19 vixey joined
pmurias the circularity could be avoided even without a rewrite of the m0ld compiler 14:22
rewritting something in a uglier way is not very fun so i think it's only worth trying to get rid of the dependency if it's a problem for people 14:25
ruoso: btw the new Makefile automaticly creates a --flags=SMOP m0ld
mildew: $OUT.print("Hello") 14:26
p6eval mildew: OUTPUT«--exec use ./Setup configure --user --flags=SMOP␤»
pmurias moritz_: ping
14:28 neenaoffline joined 14:29 donaldh joined
zev ... 8 hours is quite a delay for mail delivery 14:30
neenaoffline can I report a bug in parrot here? 14:36
cause the parrotcode trac doesn't let new users create new tickets, and #parrot has 3 users 14:37
ruoso neenaoffline, a parrot bug or a rakudo bug?
neenaoffline, try #parrot@irc.perl.org
PerlJam neenaoffline: try #parrot on irc.perl.org
neenaoffline: What's the bug? 14:38
14:45 jhorwitz joined, spx2 joined
pmurias my_perl is assumed by perl5 macros to store the perl interpreter? 14:46
ruoso: why do we use a _struct suffix instead of not defining a typedef? 14:50
ruoso we do define typedefs
neenaoffline PerlJam: it's kinda old, not sure if it still exists, but 14:55
and I don't think it's SCOK 14:56
"This is parrot version 0.8.0 built for i386-linux. " 14:57
so, I am guessing it's fixed.
PerlJam maybe
run against parrot 0.8.2
14:57 alester is now known as jayswife 14:58 jayswife is now known as alester, alech joined
neenaoffline I'm not running anything, I was just poking around the .pasm / .pir files when I found that 14:58
15:06 alc joined 15:08 alech_ joined, alech left 15:09 sail0r left 15:11 alanhaggai joined 15:13 eric256 joined
eric256 rakudo: 6 710 15:23
p6eval rakudo 34275: OUTPUT«Statement not terminated properly at line 1, near "710"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
15:23 alech_ left, alanhaggai left
eric256 rakudo: (<1 2 3> X~X <a b c>).say 15:23
p6eval rakudo 34275: OUTPUT«1a1b1c2a2b2c3a3b3c␤»
eric256 helps to get the right clip board ;)
rakudo: (<1 2 3> X~X <a b c>).join.say
p6eval rakudo 34275: OUTPUT«1a 1b 1c 2a 2b 2c 3a 3b 3c␤»
15:29 ejs1 left
rakudo_svn r34276 | pmichaud++ | [rakudo]: spectest-progress.csv update: 264 files, 5833 passing, 0 failing 15:30
pugs_svn r24588 | pmurias++ | [smop] 15:33
r24588 | pmurias++ | P5Interpreter.eval returns a wrapped SV*
r24588 | pmurias++ | .Str on a wrapped SV* returns a idconst
ruoso pmurias++ # this p5 interation is awesome 15:35
15:35 spx2 left 15:37 donaldh left, kisu_ left
clkao 不是應該超過 4100 才空? 15:38
15:39 kisu_ joined
pmurias clkao: ? 15:40
eric256 Interation? 15:45
ruoso er... bad translation from portuguese 15:46
eric256 ohhh lol i thought it was some new thing ;)
ruoso the correct word would be interaction 15:47
15:47 alanhaggai joined
clkao sorry, must be weird irssi history or mispaste 15:50
eric256 tries to figure out how he has no writing utencils at his work desk 15:51
16:06 kisu_ is now known as kisu 16:14 masak joined 16:17 donaldh joined
ruoso eric256, don't you have a keyboard? 16:22
masak keyboards are notoriously bad at leaving writing marks on paper, however.
BinGOs 'writing', yes. leaving marks, depends how hard you hit the paper with the keyboard. 16:23
16:23 alc left
masak I wouldn't call that modus operandi optimal. 16:24
BinGOs >>:)
16:25 alanhaggai_ joined
ruoso masak, he didn't say the media where he wanted to write on... 16:26
16:27 pdcawley joined 16:30 alech joined
eric256 yea i do mostly IM and email so i often have a hard time finding pens 16:31
now if i could just get a scanner that worked with linux i could get rid of all this frakin paper ;)
hudnix_ get a digital camera. 16:32
ruoso has been using digital cameras as scanners for some time already...
eric256, most HP scanners work on linux 16:33
16:36 alech left, maerzhase left
eric256 ruoso: yea i found one that worked, but it was huge. one of these days 16:39
masak bad pen day. 16:40
rakudo: +* 16:41
p6eval rakudo 34276: OUTPUT«Null PMC access in get_number()␤current instr.: 'parrot;Whatever;' pc 8525 (src/classes/Whatever.pir:41)␤»
masak cackles evilly
masak submits rakudobug
16:42 alanhaggai left 16:45 alanhaggai__ joined 16:55 mberends joined
masak I don't think I've ever submitted a rakudobug using a two-char program before. 16:58
ruoso (rakudobug golf)++ 16:59
;)
masak :D
eric256 you are insane masak 17:00
eric256 things the compile should be programmed to reply "Bad masak" whenever that code is executed
masak eric256: thanks to my insanity, Rakudo is a lot more stable today than it would otherwise have been. 17:01
eric256 i do'nt doubt that 17:02
masak every day I try to think of new ways to bring Rakudo to its knees.
(but only because I care, of course)
17:03 alanhaggai_ left
masak rakudo: say 'foo' ~ (0..999).pick 17:04
p6eval rakudo 34276: OUTPUT«foo148␤»
masak rakudo: say ('foo' ~ (0..999).pick).() 17:05
p6eval rakudo 34276: OUTPUT«invoke() not implemented in class 'String'␤current instr.: '_block14' pc 102 (EVAL_15:45)␤»
masak hm.
I was planning on creating 1000 subroutines named "foo$n" using eval and a for loop, and then executing one of them randomly. 17:06
but it seems that I cannot call methods that way.
rakudo: eval 'foo' ~ (0..999).pick ~ '()'
eric256 thanks the perl6 gods
p6eval rakudo 34276: RESULT«Null PMC access in find_method()␤current instr.: '_block14' pc 64 (EVAL_15:39)␤»
masak that shouldn't happen. 17:07
rakudo: foo148()
p6eval rakudo 34276: OUTPUT«Could not find non-existent sub foo148␤current instr.: '_block14' pc 48 (EVAL_13:36)␤»
eric256 rakudo: sub foo1 { say "hello" }; eval 'foo' ~ (1).pick ~ '()';
p6eval rakudo 34276: OUTPUT«hello␤»
eric256 rakudo: sub foo1 { say "hello" }; eval 'foo' ~ (1,2).pick ~ '()';
p6eval rakudo 34276: OUTPUT«hello␤»
eric256 rakudo: sub foo1 { say "hello" }; eval 'foo' ~ (1,2).pick ~ '()';
p6eval rakudo 34276: RESULT«Null PMC access in find_method()␤current instr.: '_block14' pc 64 (EVAL_13:39)␤»
eric256 rakudo: eval 'foo()'; 17:08
p6eval rakudo 34276: RESULT«Null PMC access in find_method()␤current instr.: '_block14' pc 64 (EVAL_13:39)␤»
masak rakudo: eval 'sub foo'~$_~' { say "OH HAI" }' for 0..999; eval 'foo' ~ (0..999).pick ~ '()' 17:09
here we go.
p6eval rakudo 34276: No output (you need to produce output to STDOUT)
masak bah. timeout.
rakudo: eval 'sub foo'~$_~' { say "OH HAI" }' for 0..99; eval 'foo' ~ (0..99).pick ~ '()'
eric256 rakudo: eval "sub foo$_ { say 'OH HAI $_' }" for 0..9; eval 'foo' ~ (0..9).pick ~ '()' 17:10
opps
masak :)
p6eval rakudo 34276: No output (you need to produce output to STDOUT)
rakudo 34276: OUTPUT«OH HAI $_␤OH HAI $_␤OH HAI $_␤OH HAI $_␤OH HAI $_␤OH HAI $_␤OH HAI $_␤OH HAI $_␤OH HAI $_␤OH HAI $_␤»
eric256 well that was...unexpected
masak eric256: you just made the same mistake I made yesterday in a bug report :)
eric256 oh?
masak eric256: no, actually not.
as TimToady++ explained. 17:11
eric256 oh wait the { } interpolated it huh
rakudo: eval "sub foo$_ \{ say 'OH HAI $_' \}" for 0..9; eval 'foo' ~ (0..9).pick ~ '()'
p6eval rakudo 34276: OUTPUT«OH HAI 7␤»
masak a block in a double-quoted string is executed immediately -- yes.
ruoso rakudo: MY::{"foo$_ "} := { say "OH $_" } for 0..99; MY::{"foo"~(0..99).pick}.();
p6eval rakudo 34276: OUTPUT«Statement not terminated properly at line 1, near "::{\"foo$_ "␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
ruoso std: MY::{"foo$_ "} := { say "OH $_" } for 0..99; MY::{"foo"~(0..99).pick}.();
PerlJam That seems like it's going to catch alot of people initially.
p6eval std 24588: OUTPUT«00:07 86m␤»
masak PerlJam: maybe one could have a warning for {} in "" in eval args. 17:12
eric256 PerlJam: i dunno, maybe, but mostly people doing stuff like generating functions. it was fairly obvious after a few seconds thought...just so un perl5
ruoso rakudo: module Foo; Foo::{"foo$_ "} := { say "OH $_" } for 0..99; Foo::{"foo"~(0..99).pick}.();
p6eval rakudo 34276: OUTPUT«Statement not terminated properly at line 1, near "::{\"foo$_ "␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
ruoso std: module Foo; Foo::{"foo$_ "} := { say "OH $_" } for 0..99; Foo::{"foo"~(0..99).pick}.();
p6eval std 24588: OUTPUT«00:07 86m␤»
PerlJam eric256: sure ... many things are "obvious" once you're in the proper mindframe :) 17:13
ruoso std: module Foo; Foo::{"&foo$_ "} := { say "OH $_" } for 0..99; Foo::{"&foo"~(0..99).pick}.();
eric256 what kind of output was that?
p6eval std 24588: OUTPUT«00:07 87m␤»
ruoso but that might interpolate, I think...
std: module Foo; Foo::{'&foo'~$_} := { say "OH $_" } for 0..99; Foo::{'&foo'~(0..99).pick}.(); 17:14
p6eval std 24588: OUTPUT«00:07 87m␤»
ruoso pugs: module Foo; Foo::{'&foo'~$_} := { say "OH $_" } for 0..99; Foo::{'&foo'~(0..99).pick}.();
p6eval pugs: OUTPUT«*** ␤ Unexpected "Foo"␤ expecting ";", Doc block, block declaration, declaration, construct or expression␤ at /tmp/PFdxOxvMYK line 1, column 13␤»
eric256 PerlJam: true
17:14 alanhaggai__ left, alanhaggai__ joined
ruoso masak, btw... rakudo doesn't yet support package lookup, it seems... but the code above was supposed to do what you mean 17:14
pugs: MY::{'&foo'~$_} := { say "OH $_" } for 0..99; MY::{'&foo'~(0..99).pick}.(); 17:15
p6eval pugs: OUTPUT«*** ␤ Unexpected "MY"␤ expecting program␤ at /tmp/hE7XyV5LMr line 1, column 1␤»
masak ruoso: aye.
arguably in a purer way than mine. 17:16
eric256 rolls out jabber IM to his company and crosses his fingers
ruoso masak, I don't know how far in the rakudo ROADMAP is package lookup
but it might deserve a request... 17:17
masak it might deserve a TODO rakudobug 17:18
ruoso even if not for the MY:: pseudo-package
doing normal package lookup is already an interesting feature
17:19 adc_penner joined 17:31 Chillance joined, azawawi joined
azawawi hi 17:32
pmurias ruoso: adding stuff to a lexical scope at runtime is not allowed
azawawi: hi
masak azawawi: hi
17:32 rgrau left, masak left
pmurias mildew: say "hi" 17:33
p6eval mildew: OUTPUT«--exec use ./Setup configure --user --flags=SMOP␤»
azawawi thinks about Padre::Plugin::Mildew ;-)
pmurias that would be nice 17:41
i would have to fix Padre::Plugin::Vi to make padre a decent editor than ;)
17:43 xinming joined
ruoso pmurias, is it really forbidden? 17:47
azawawi pmurias: maybe i could help with the Padre Vi plugin support 17:48
pmurias: and btw i tested --snippet-html mode and it works in various blogging websites that allow you to put HTML. 17:49
pmurias ruoso: S11:175 17:51
pmichaud also S02:1821 17:52
17:53 rserrano2009 joined
ruoso right... but the non-pseudo-package lookup still works 17:54
(and I do think a pragma could allow modifying MY::)
17:55 alech joined
ruoso ah... you're allowed to modify MY:: 17:55
you just can't ADD a new symbol
that makes more sense
pmurias azawawi: the Padre::Plugin::Vi has hardcode vi commands like 'dw' instead of understanding the general command + object form, it's not a hard thing to fix, it's just that padre doesn't have enough cool features for me to get round to switching to it 17:56
ruoso is always tempted to try Padre, but never have the time to actually doing it 17:57
17:57 xinming_ left, pmurias left
PerlJam ruoso: I tried one of the earlier versions and it shows great promise. 17:59
rserrano2009 hi, speak spanish channel about perl ??
17:59 dwhipp joined
rserrano2009 sorry but my inglish is very bad 18:00
PerlJam rserrano2009: This channel is about perl 6. You likely want #perl or #perlhelp
rserrano2009 thank you PerlJam
18:00 neenaoffline left 18:01 rserrano2009 left 18:03 Whiteknight joined
dwhipp what happenned to implicit $_? I tried "say for @x" (on rakudo) and got +@n blank lines -- looking at the spec, it says it should be a compiler error. 18:03
18:06 alech left, alech joined
mberends rakudo: my @x=<P E R L>; .say for @x; 18:06
p6eval rakudo 34276: OUTPUT«P␤E␤R␤L␤»
18:07 jferrero joined, alanhaggai joined
ruoso dwhipp, the implicit $_ is still there, it's say that no longer tries to look at it 18:08
dwhipp OK so the latest rakudo looks good -- I'll make sure I'm up to date.
ruoso you have some alternatives...
the first is what mberends tried above
but you still have:
rakudo: my @x = <P e r l 6>; { $^a.say } for @x 18:09
p6eval rakudo 34276: OUTPUT«P␤e␤r␤l␤6␤»
dwhipp ah! missed the "dot" -- need to use method calls to use implicit $_
ruoso rakudo: my @x = <P e r l 6>; $^a.say for @x; # I'm not sure you're allowed to do that without the block 18:10
p6eval rakudo 34276: OUTPUT«too few arguments passed (0) - 1 params expected␤current instr.: '_block14' pc 35 (EVAL_11:26)␤»
ruoso rakudo: my @x = <P e r l 6>; -> $it { $it.say } for @x
p6eval rakudo 34276: OUTPUT«Syntax error at line 1, near "-> $it { $"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
ruoso rakudo: my @x = <P e r l 6>; for @x -> $it { $it.say }
p6eval rakudo 34276: OUTPUT«P␤e␤r␤l␤6␤»
18:11 alech left 18:13 alech joined
ruoso is it sane to assume that ReturnControlException is a prototype that is closed and final? 18:13
meaning that you can't subclass it, nor compose roles into it... 18:14
this would be important because it would mean we can make it as a native type in SMOP
(that is, allows pointer comparison of the ResponderInterface 18:15
@tell pmurias do you think we could have a "leave" operator in mold? This operator would call setr on the back with the given register and goto the back frame... 18:19
lambdabot Consider it noted.
18:19 dmq left, BinGOs left, BinGOs joined 18:22 alanhaggai__ left
ruoso is there any glance on what is the name of the function that raises control exceptions? 18:24
I presume fail() is only going to raise failures
i was thinking that raise() is a good name
TimToady might want to dehuffmanize it a bit more than that, if users rarely see it 18:33
18:34 apeiron left 18:35 apeiron joined 18:37 gbacon left
azawawi TimToady: 206 lines/sec for STD.pm parsing speed so far ;-) 18:38
18:38 Psyche^ joined
TimToady we'll get it going faster eventually... 18:38
biab &
eric256 do you raise an exception object? i.e. Exception::ReadOnly.raise("This file is read only.") 18:39
eric256 looks for a synopsis on exceptions
azawawi Padre 0.22 coming soon...
dwhipp rakudo: my @a = <7 5 7 7 13>; say ((( @a X-X @a ).grep: { $_ == 0 }).elems - @a.elems)/2 18:40
p6eval rakudo 34277: OUTPUT«3␤»
pmichaud dwhipp: that scares me.
dwhipp That's an answer to the first "winter scipting games" challenge
eric256 indeed it is 18:41
dwhipp problem is, "X-X" does the full cross-product, not justhte diagonal halves
pmichaud please please please post (and explain) it somewhere. :-)
eric256 i was going to use a cross but couldn't decide what to do about matching itself, yours is good, albeit scary 18:42
dwhipp explaination -- "@x X-X @x " is zero for all elems that are pairs
then I count them
18:42 gbacon joined
eric256 i think he meant somwhere else ;) 18:42
dwhipp but I need to adjust the count to remove the diagonal and the repeats
eric256 hence the /2 right? 18:43
oh wait i get it, /2 is for both halves of the pair, -@.elems is for the pairs that are themselves
dwhipp - @a.elems gets rid of the diagonal
pmichaud yes, I meant post and explain somewhere else. So others can see the awesome beauty and power that is Perl 6. :-)
dwhipp Perhaps "beauty", yes. But to my mind it shows that the cross operator is too limited for true elegance 18:44
eric256 is there anyway to get all the elements in an array that arn't the current one? hmm @a(*..^$i^..*) ?
clintongormley heh pmichaud, you're sounding like the genie in Aladdin
AWESOME POWER 18:45
itty-bitty living space
eric256 dwhipp: when its done you'll be able to make your own infix opperators etc, so you could make a special cross product
pmichaud clintongormley: yes, I was channeling the genie when I wrote that.
"AWESOME POWER of Perl 6, in itty bitty pieces of code!"
clintongormley :D 18:46
and more power to you
pmichaud and yes, it might show that the cross operator is too limited, or that we might find a nicer idiom for this
ruoso dwhipp, I couldn't find the proposed challenge, have a link?
dwhipp www.microsoft.com/technet/scriptcen...vent1.mspx 18:47
18:50 maerzhase joined, Patterner left, Psyche^ is now known as Patterner
dwhipp If X,X is the full cross product, then what would be the diagonal cross ... Y,Y or Z,Z perhaps 18:51
I'm trying to figure out, specwise. how to express/define such a metaoperator in pure P6 18:52
ruoso isn't there a math symbol for that? 18:53
pugs_svn r24589 | azawawi++ | [Syntax::Highlight::Perl6] Updating to the latest perl6.vim 18:56
ruoso is X,X slice-aware? 18:57
18:57 alech left
ruoso my @a = (7 5 7 7 13); my @@b = @a X-X @a; say @@b[0;0]; 18:57
pugs: my @a = (7 5 7 7 13); my @@b = @a X-X @a; say @@b[0;0]; 19:00
p6eval pugs: OUTPUT«*** ␤ Unexpected "@a"␤ expecting "=", operator, ")", context, ":" or "("␤ at /tmp/u6up7eCeCS line 1, column 4␤»
ruoso pugs: my @a = (7, 5, 7, 7, 13); my @@b = @a X-X @a; say @@b[0;0];
p6eval pugs: OUTPUT«*** ␤ Unexpected ";"␤ expecting "x", octal digit, "o", "b", fraction, exponent, term postfix, operator or "]"␤ at /tmp/BiqEhg7BBR line 1, column 56␤»
ruoso meh...
I just wish someone had implemented slices... 19:03
rakudo: my @a = (7, 5, 7, 7, 13); my @@b = @a X-X @a; say @@b[0;0]; 19:04
p6eval rakudo 34281: OUTPUT«Statement not terminated properly at line 1, near "@@b = @a X"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
pmichaud rakudo doesn't do slices yet, but we're closing in on it.
eric256 rakudo: my @a = (1..5); say @a[0..^0];
p6eval rakudo 34281: OUTPUT«12345␤»
pugs_svn r24590 | azawawi++ | [Syntax::Highlight::Perl6] Updated changes and ignoring generated files 19:05
pmichaud eric256 found a rakudobug 19:06
eric256 i was trying to get the slice of everything but my element ;( lol 19:07
ruoso eric256, you should be able to do... 19:11
rakudo: my @a = (1..5); say @a[0..$^a,$^a..^@a] for (1..5);
p6eval rakudo 34281: OUTPUT«too few arguments passed (0) - 1 params expected␤current instr.: '_block14' pc 35 (EVAL_14:26)␤»
ruoso rakudo: my @a = (1..5); { say @a[0..$^a,$^a..^@a] } for (1..5); 19:12
p6eval rakudo 34281: OUTPUT«122345␤123345␤123445␤123455␤12345Use of uninitialized value␤␤»
eric256 rakudo: my @a = (1..5); { say @a[0..^$^a,$^a^..^@a] } for (1..5);
p6eval rakudo 34281: OUTPUT«1345␤1245␤1235␤1234␤12345␤»
eric256 its close
lol
ruoso rakudo: my @a = (1..5); { say @a[0..^$^a,$^a^..^@a] } for (0..4);
p6eval rakudo 34281: OUTPUT«2345␤1345␤1245␤1235␤1234␤»
eric256 what? hey 19:13
lol
ruoso rakudo: my @a = (1..5); @a.map { say @a[0..^$^a,$^a^..^@a] };
p6eval rakudo 34281: OUTPUT«Statement not terminated properly at line 1, near "{ say @a[0"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
ruoso rakudo: my @a = (1..5); map @a, { say @a[0..^$^a,$^a^..^@a] };
p6eval rakudo 34281: OUTPUT«No applicable methods.␤␤current instr.: '_block14' pc 108 (EVAL_14:50)␤»
eric256 rakudo: my @a = (1..5); my $i = 0; say @a[0..^$i];
p6eval rakudo 34281: OUTPUT«12345␤»
eric256 i don't understand why that doesn't work, but your does 19:14
they seem the same (for element 0)
ruoso that is a bug
eric256 okay so its treating $^a right and $i wrong
19:15 aindilis` left
ruoso rakudo: say 0..0 19:15
p6eval rakudo 34281: OUTPUT«0␤»
ruoso rakudo: say 0..^0
p6eval rakudo 34281: OUTPUT«␤»
ruoso rakudo: my $i = 0; say 0..^$1
rakudo: my $i = 0; say 0..^$i
p6eval rakudo 34281: OUTPUT«Use of uninitialized value␤␤»
rakudo 34281: OUTPUT«␤»
ruoso eric256, the thing is that @a[] returns all elements currently in rakudo (which I presume to be a bug) 19:16
pmichaud @a[] returning all elements is correct. 19:17
lambdabot Maybe you meant: arr ask
ruoso ok then
pmichaud @a[@b] returning all elements when @b is empty is a bug.
lambdabot Unknown command, try @list
ruoso ah.. ok
sounds better
pmichaud so, since 0..^0 produces an empty list, we're tickling the rakudobug.
in which it's returning all elements.
ruoso rakudo: my @a = 7, 5, 7, 7, 13; say @a.grep({ $^a ~~ @a[0..$^a,$^a^..^@a] }).elems; 19:21
p6eval rakudo 34283: OUTPUT«Non-dwimmy hyperoperator cannot be used on arrays of different sizes or dimensions.␤current instr.: 'die' pc 14760 (src/builtins/control.pir:188)␤»
ruoso uh?
rakudo: my @a = 7, 5, 7, 7, 13; say @a.grep({ $^a == any @a[0..$^a,$^a^..^@a] }).elems;
p6eval rakudo 34283: OUTPUT«Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of
..uni...
TimToady why are you comparing the index to array *values*? 19:23
ruoso am I?
ahhh 19:24
TimToady @a[] does a lookup # shutup lambdabot
lambdabot Maybe you meant: arr ask
ruoso rakudo: my @a = 7, 5, 7, 7, 13; (0..^@a).map({ @a[$^a] == any @a[0..$^a,$^a^..^@a] }).elems; 19:25
p6eval rakudo 34283: RESULT«5»
TimToady oh, wait, you're feeding $^a with values too, nevermind
but seems like you want to be working with indices, not values
ruoso rakudo: say 1 == any (2,3,4) 19:26
p6eval rakudo 34283: OUTPUT«Junction<0xb5f6a8ac>␤»
ruoso rakudo: say (1 == any (2,3,4)).true
p6eval rakudo 34283: OUTPUT«0␤»
zev rakudo: say 1 ~~ any(2, 3, 4)
p6eval rakudo 34283: OUTPUT«0␤»
TimToady rakudo: say 1 ~~ any 2,3,4 19:27
p6eval rakudo 34283: OUTPUT«0␤»
ruoso rakudo: my @a = 7, 5, 7, 7, 13; (0..^@a).grep({ @a[$^a] == any @a[0..$^a,$^a^..^@a] }).elems;
p6eval rakudo 34283: RESULT«5»
ruoso rakudo: my @a = 7, 5, 7, 7, 13; (0..^@a).grep({ say @a[0..$^a,$^a^..^@a] }).elems; 19:28
p6eval rakudo 34283: OUTPUT«757713␤757713␤757713␤757713␤757713␤»
TimToady $_ is a 33% shorter than $^a
ruoso rakudo: my @a = 7, 5, 7, 7, 13; (0..^@a).grep({ @a[$^a] == any @a[0..^$^a,$^a^..^@a] }).elems;
p6eval rakudo 34283: RESULT«3» 19:29
19:29 Aisling left
ruoso rakudo: my @a = 7, 5, 7, 7, 13; (0..^@a).grep({ @a[$_] == any @a[0..^$_,$_^..^@a] }).elems; 19:29
p6eval rakudo 34283: RESULT«3»
ruoso dwhipp, ^
19:31 clintongormley left
ruoso it's interesting that two features make all the difference in the above code 19:39
the first being junctions, which make the comparison much cleaner
and the second is the new range constructor syntax
besides that, the code isn't that different from what I would do in p5 19:40
rakudo: say 1 ~~ (1,2,3) 19:43
p6eval rakudo 34283: OUTPUT«Non-dwimmy hyperoperator cannot be used on arrays of different sizes or dimensions.␤current instr.: 'die' pc 14760 (src/builtins/control.pir:188)␤»
ruoso pugs: say 1 ~~ (1,2,3)
p6eval pugs: OUTPUT«␤»
dwhipp I like the junctions approach, but I just know that "people" will complain about the line-noise with all those range constructors. 19:44
ruoso just put spaces around it ;)
dwhipp I've been playing a little, and I think I'd like to be able to code it as: "say ((@x %==% @x).grep: { $^same }).elems"
ruoso rakudo: my @a = 7, 5, 7, 7, 13; (0..^@a).grep({ @a[$_] == any @a[ 0 ..^ $_ , $_ ^..^ @a] }).elems;
p6eval rakudo 34283: RESULT«3» 19:45
dwhipp Also, I did a quick writeup at use.perl.org/~dpuu/journal/
19:48 simcop2387 left
pmichaud dwhipp ++ 19:50
dwhipp++
(get that postfix in the right spot :-) 19:51
TimToady $_ if $_ != $^x for 0..^@a
szabgab Padre now supports Perl6 highlighting using STD thanks to azawawi
ruoso TimToady, rakudo currently only support $^x if you put a explicit block 19:53
and it really makes sense, because where would $x be declared otherwise?
dwhipp I think the junctional version is doing too much work: it's comparing the current element againt both halves of the diagonal:
ruoso is it? 19:54
dwhipp rakud: my @a = < 7 5 7 7 13 >; (^@a).grep({ @a[$_] == any @a[ $_ ^..^ @a] }).elems;
rakudo: my @a = < 7 5 7 7 13 >; (^@a).grep({ @a[$_] == any @a[ $_ ^..^ @a] }).elems;
p6eval rakudo 34283: RESULT«3»
ruoso ah... I see what you mean
that's even better
dwhipp rakudo: my @a = < 1 2 2 3 4 4 5 >; (^@a).grep({ @a[$_] == any @a[ $_ ^..^ @a] }).elems; 19:55
p6eval rakudo 34283: RESULT«3»
dwhipp but that's the wrong answer :-(
ruoso rakudo: my @a = 1, 2, 2, 3, 4, 4, 5; (0..^@a).grep({ @a[$_] == any @a[ 0 ..^ $_ , $_ ^..^ @a] }).elems;
p6eval rakudo 34283: RESULT«4»
dwhipp correct answer is 2! 19:56
ruoso is it? 19:57
dwhipp I see only two pairs! 19:58
and if we need to divide by two, then the earlier answer would become wrong
ruoso well, in that case I see only 2 pairs in <7 5 7 7 13> too
it's counting the number of cards that have a pair
hmm... 20:00
ok...
dwhipp, you're right...
dwhipp re-reading the original challenge, it suggests not
(my reply was to your original, not to you're statement that I was correct :-) ) 20:01
ruoso so it really requires a cross operation 20:03
20:09 pmurias joined
dwhipp my @a = < 1 2 2 3 4 4 4 5 >; say (0 .. @a-2).grep({ @a[$_] == any @a[ $_+1 .. @a-1] }).elems 20:10
rakudo: my @a = < 1 2 2 3 4 4 4 5 >; say (0 .. @a-2).grep({ @a[$_] == any @a[ $_+1 .. @a-1] }).elems
p6eval rakudo 34283: OUTPUT«3␤»
dwhipp this gives the correct result for hte "count number of cards that have subsequent partners" question 20:11
but we need the overall range to be "0 .. @a-2", not "0..@a-1" 20:12
so ^@a doesn't work as a range in this context
ruoso maybe 0 ..^ @a.last makes it clearer
0 ..^ @a.end actually 20:13
dwhipp is this an edge-case bug with junctional behavior -- or just a gotcha?
ruoso what do you mean?
dwhipp rakudo: 3 == any() 20:14
p6eval rakudo 34283: RESULT«any()»
dwhipp rakudo: ?(3 == any())
p6eval rakudo 34283: RESULT«Bool::False»
20:15 alanhaggai_ joined
ruoso ah... but if you have @a[$x..$x], you're hitting the rakudobug 20:15
because it was supposed to return an empty list, but it's returning the entire lits
dwhipp OK, so once that's fixed the "(^@a).grep: {...}" should work. No need to figure out the exact range expression @a.end-1 20:17
eric256 could you just get the indexs that are not the current index?
rakudo: say ( any(1..5) != 4)
p6eval rakudo 34283: OUTPUT«Junction<0xb5f76bec>␤»
eric256 rakudo: say ( any(1..5) != 4).perl
p6eval rakudo 34283: OUTPUT«any(Bool::True, Bool::False)␤»
eric256 rakudo: say ( any(1..5) != 4).values 20:18
p6eval rakudo 34283: OUTPUT«Method 'values' not found for invocant of class 'Junction'␤current instr.: '_block14' pc 105 (EVAL_15:46)␤»
20:18 dwhipp left
eric256 (1..5).map {$_ != 5}; 20:18
rakudo: (1..5).map {$_ != 5};
p6eval rakudo 34283: OUTPUT«Statement not terminated properly at line 1, near "{$_ != 5};"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
eric256 rakudo: (1..5).map {$_ != 5;}; 20:19
p6eval rakudo 34283: OUTPUT«Statement not terminated properly at line 1, near "{$_ != 5;}"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
eric256 rakudo: say( list(1..5).map {$_ <> 5 });
p6eval rakudo 34283: OUTPUT«Statement not terminated properly at line 1, near "( list(1.."␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
ruoso rakudo: my @a = < 1 2 2 3 4 4 4 5 >; say (0 ..^ @a.end).grep({ @a[$_] == any @a[ $_ ^..^ @a] }).elems
p6eval rakudo 34283: OUTPUT«3␤»
eric256 correct answer is 4 ;)
rakudo_svn r34284 | coke++ | Eliminate [DEPRECATED] runtime/parrot/library/Parrot/Capture_PIR.pir 20:20
r34284 | coke++ |
r34284 | coke++ | was only referenced by one language, but it wasn't being used.
eric256 the any doesn't match cause its returning 1 if there is 1 or more matches
you actualy want to count all the occurences of the same value after this one 20:21
ruoso TimToady, I'm about to implement the raise of control exceptions, do you have any suggestion for the name of the function that will raise a control exception? since raise() looks too short for such low usage... 20:22
eric256 throw_the_freakin_exception_please() ;) 20:26
20:29 barney left
eric256 rakudo: my @cards = (1,2,2,3,4,4,4,5); my $pairs = 0; for @cards.kv -> $i, $v { say "$i -> $v: { @cards }"; say @cards[$i..5];}; 20:31
p6eval rakudo 34284: OUTPUT«0 -> 1: 1 2 2 3 4 4 4 5␤Undefined value shifted from empty range␤444441␤1 -> 2: 1 2 2 3 4 4 4 5␤Undefined value shifted from empty range␤44441␤2 -> 2: 1 2 2 3 4 4 4 5␤Undefined value shifted from empty range␤4441␤3 -> 3: 1 2 2 3 4 4 4 5␤Undefined value shifted from empty
..range␤44...
eric256 i don't understand why i keep getting the undefined values? if i replace $i with a hard coded value it works fine
20:33 alanhaggai left 20:34 Aisling joined 20:36 adc_penner left
TimToady seems a little strange not to use throw when we're using CATCH...but that's the same length 20:36
20:37 alech joined
TimToady on the other hand, throw is not the opposite of CONTROL 20:40
20:40 Aisling left
TimToady obviously we should use KAOS 20:40
20:41 unobe joined, alech left 20:43 alech joined
unobe rakudo: my @x = <7 5 7 7 13>; (([+] (@x X==X @x)) - @x.elems)/2; 20:44
p6eval rakudo 34284: RESULT«3»
unobe rakudo: my @x = <1 2 2 3 4 4 4 5>; (([+] (@x X==X @x)) - @x.elems)/2;
p6eval rakudo 34284: RESULT«4»
pmurias propably kaos rather than KASO to keep the symmetry
lambdabot pmurias: You have 1 new message. '/msg lambdabot @messages' to read it.
pmurias ruoso: re msg, we discussed it before, interpreter.return(...) would be enough 20:45
20:46 pdcawley left
eric256 unobe: very nice 20:47
unobe eric256: i noticed above tho' that the output dwhipp was expecting was 3. 20:48
I count three pairs between the 4's and a pair of 2's
I'm looking at the microsoft page right now 20:49
20:50 alech_ joined, alech left
unobe rakudo: my @x = <1 2 2 3 4 4 4 5>; (([+] (@x XeqX @x)) - @x.elems)/2; 20:50
p6eval rakudo 34284: RESULT«4»
unobe rakudo: my @x = <1 2 2 3 4 K 4 4 5 K Q J>; (([+] (@x XeqX @x)) - @x.elems)/2;
p6eval rakudo 34284: RESULT«5» 20:51
unobe rakudo: my @x = <6 5 6 6 K>; (([+] (@x XeqX @x)) - @x.elems)/2;
p6eval rakudo 34284: RESULT«3»
eric256 your results all look right
20:52 jan_ left
unobe yay :-) 20:52
eric256 rakduo: my @cards = <1 2 2 3 4 4 4 5>; my $p = 0; for (0..@cards-2){ my $i = $_; $p += (@cards[$i..^@cards].grep: { $_ == @cards[$i]}).elems-1;};$p.say(); 20:53
okay that works localy! ;)
a little wordy cause of a bug with $_ it seems
TimToady it shouldn't work
for (){} should be a hash subscript 20:54
eric256 rakduo: my @cards = <1 2 2 3 4 4 4 5>; my $p = 0; for (0..@cards-2) { my $i = $_; $p += (@cards[$i..^@cards].grep: { $_ == @cards[$i]}).elems-1;};$p.say();
unobe *rakudo
eric256 rakudo: my @cards = <1 2 2 3 4 4 4 5>; my $p = 0; for (0..@cards-2) { my $i = $_; $p += (@cards[$i..^@cards].grep: { $_ == @cards[$i]}).elems-1;};$p.say(); 20:55
details detail
p6eval rakudo 34284: OUTPUT«4␤»
eric256 ;)
unobe :-)
eric256 rakudo: my @cards = <6 5 6 6 K>; my $p = 0; for (0..@cards-2) { my $i = $_; $p += (@cards[$i..^@cards].grep: { $_ == @cards[$i]}).elems-1;};$p.say();
p6eval rakudo 34284: OUTPUT«3␤»
eric256 rakudo: my @cards = <6 5 6 6 K>; my $p = 0; for (0..@cards-2) -> $i { $p += (@cards[$i..^@cards].grep: { $_ == @cards[$i]}).elems-1;};$p.say(); 20:56
p6eval rakudo 34284: OUTPUT«Undefined value shifted from empty range␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized
..va...
eric256 yea it doesn't like that for some reason
unobe remove the parens?
around 0..@cards-2?
eric256 rakudo: my @cards = <6 5 6 6 K>; my $p = 0; for 0..@cards-2 -> $i { $p += (@cards[$i..^@cards].grep: { $_ == @cards[$i]}).elems-1;};$p.say();
p6eval rakudo 34284: OUTPUT«Undefined value shifted from empty range␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized
..va...
unobe hmm 20:57
eric256 yea i don't know what that deal is
unobe Does 0..@cards work? 20:58
(not to get the correct answer, but for syntax)
rakudo: my @cards = <6 5 6 6 K>; my $p = 0; for 0..@cards -> $i { $p += (@cards[$i..^@cards].grep: { $_ == @cards[$i]}).elems-1;};$p.say(); 20:59
p6eval rakudo 34284: OUTPUT«Undefined value shifted from empty range␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized
..va...
unobe guess not
20:59 Whiteknight left
eric256 no i'm not realy sure what i'm doing wrong there 20:59
unobe rakudo: my @cards = <6 5 6 6 K>; my $p = 0; for 0..2 -> $i { $p += (@cards[$i..^@cards].grep: { $_ == @cards[$i]}).elems-1;};$p.say();
p6eval rakudo 34284: OUTPUT«Undefined value shifted from empty range␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized
..va...
unobe rakudo: my @cards = <6 5 6 6 K>; my $p = 0; for 1..2 -> $i { $p += (@cards[$i..^@cards].grep: { $_ == @cards[$i]}).elems-1;};$p.say(); 21:00
p6eval rakudo 34284: OUTPUT«Undefined value shifted from empty range␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Undefined value shifted from empty range␤Use of
..un...
unobe lost
21:01 ejs joined, Lorn left, alech_ left 21:02 alech joined 21:03 jan_ joined
unobe rakudo: my @cards = <6 5 6 6 K>; my $p = 0; for 0..@cards-2 -> $i { .say }; 21:03
p6eval rakudo 34284: OUTPUT«Use of uninitialized value␤␤Use of uninitialized value␤␤Use of uninitialized value␤␤Use of uninitialized value␤␤»
unobe rakudo: my @cards = <6 5 6 6 K>; my $p = 0; for 0..@cards-2 -> $i { $i.say };
p6eval rakudo 34284: OUTPUT«./parrot: error while loading shared libraries: /home/evalenv/parrot/blib/lib/libparrot.so.0.8.2: file too short␤»
unobe rakudo: my @cards = <6 5 6 6 K>; my $p = 0; for 0..@cards-2 -> $i { $i.say }; 21:04
p6eval rakudo 34284: OUTPUT«0␤1␤2␤3␤»
unobe hmm
rakudo: my @cards = <6 5 6 6 K>; my $p = 0; for 1..2 -> $i { $p += (@cards[$i..^@cards].grep: { $i == @cards[$i]}).elems-1;};$p.say();
p6eval rakudo 34284: OUTPUT«Undefined value shifted from empty range␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Undefined value shifted from empty range␤Use of uninitialized value␤Use of uninitialized value␤Use of uninitialized value␤Use of
..un...
eric256 try +$i in the range
i think $i isn't realy an int
unobe rakudo: my @cards = <6 5 6 6 K>; my $p = 0; for 1..2 -> $i { $p += (@cards[+$i..^@cards].grep: { $i == @cards[$i]}).elems-1;};$p.say();
p6eval rakudo 34284: OUTPUT«-2␤»
eric256 tada 21:05
unobe rakudo: my @cards = <6 5 6 6 K>; my $p = 0; for 0..@cards-2 -> $i { $p += (@cards[+$i..^@cards].grep: { $i == @cards[$i]}).elems-1;};$p.say();
p6eval rakudo 34284: OUTPUT«-4␤»
unobe eric256++
eric256 my @cards = <1 2 2 3 4 4 4 5 5>; my $p = 0; for @cards[0..@cards-2].kv -> $k, $v { $p += (@cards[$k+0..^@cards].grep: {$_ == $v}).elems -1 }; say $p;
rakudo: my @cards = <1 2 2 3 4 4 4 5 5>; my $p = 0; for @cards[0..@cards-2].kv -> $k, $v { $p += (@cards[$k+0..^@cards].grep: {$_ == $v}).elems -1 }; say $p;
p6eval rakudo 34284: OUTPUT«5␤»
eric256 still fugly though
21:05 alanhaggai__ joined
unobe so is that a rakudobug? 21:06
eric256 i think so yes
thats two for me ;)
unobe is $_ the same as $k? 21:07
ah, no
eric256 .kv on an array returns the index and then the value so i put those in $k and $v 21:11
unobe right, and since $_ is in grep, it's not $k 21:12
I like the .kv usage 21:13
it's just the p +=
it's just the $p += part
eric256 yea i dunno what to do with that. could push them onto an array and sum it, but i'm not sure thats much of a win 21:15
21:16 cspencer joined 21:20 alanhaggai_ left 21:23 dwhipp joined
dwhipp rakudo: my @a = < 1 2 3 >; for @a -> $x, $y { say $x, $y // "-" } 21:24
p6eval rakudo 34288: OUTPUT«12␤StopIteration␤current instr.: '_block14' pc 143 (EVAL_14:61)␤» 21:25
dwhipp rakudo: my @a = < 1 2 3 >; for @a -> $x, $y? { say $x, $y // "-" }
p6eval rakudo 34288: OUTPUT«12␤StopIteration␤current instr.: '_block14' pc 143 (EVAL_14:61)␤»
dwhipp rakudo: my @a = < 1 2 3 >, undef; for @a -> $x, $y? { say $x, $y // "-" }
p6eval rakudo 34288: OUTPUT«12␤3-␤»
dwhipp rakudo: my @a = < 1 2 3 >; for @a -> $x, $y? { say $x, $y // "-" }
p6eval rakudo 34288: OUTPUT«12␤StopIteration␤current instr.: '_block14' pc 143 (EVAL_14:61)␤» 21:26
dwhipp rakudo: my @a = < 1 2 3 >; for @a -> $x, *@rest { say $x, @rest }
p6eval rakudo 34288: OUTPUT«12␤StopIteration␤current instr.: '_block14' pc 143 (EVAL_14:61)␤»
dwhipp rakudo: my @a = < 1 2 3 >; for @a -> $x ;; *@rest { say $x, @rest } 21:27
p6eval rakudo 34288: OUTPUT«12␤StopIteration␤current instr.: '_block14' pc 143 (EVAL_14:61)␤»
21:28 jferrero left
dwhipp rakudo: my @a = < 1 2 3 4>; for @a -> $x ;; *@rest { say $x, @rest } 21:29
p6eval rakudo 34288: OUTPUT«12␤34␤»
dwhipp rakudo: my @a = < 1 2 3 4>; for @a -> $x ;; |@rest { say $x, @rest }
p6eval rakudo 34288: OUTPUT«Statement not terminated properly at line 1, near "-> $x ;; |"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
21:30 cspencer left 21:33 Aisling joined 21:34 alanhaggai joined 21:35 aindilis joined
eric256 that kind of syntax would make things sweet, having a non consuming param after -> 21:38
21:39 alanhaggai__ left 21:49 justatheory left 21:51 rindolf joined 21:52 stephens joined 21:54 alech left, cspencer joined, alech joined 21:59 aindilis` joined 22:01 kisu_ joined 22:02 Whiteknight joined 22:04 eternaleye_ joined 22:05 eternaleye left, eric256 left 22:06 ruoso left 22:08 alech left 22:09 kisu left, kidd joined 22:13 aindilis left 22:16 jferrero joined
cspencer rakudo: cmp(10, 1).say 22:24
p6eval rakudo 34295: OUTPUT«Could not find non-existent sub cmp␤current instr.: '_block14' pc 62 (EVAL_13:40)␤» 22:25
cspencer rakudo: infix:cmp(10, 1).say
p6eval rakudo 34295: OUTPUT«Statement not terminated properly at line 1, near ":cmp(10, 1"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
cspencer (10 cmp 1).say
rakudo: (10 cmp 1).say
p6eval rakudo 34295: OUTPUT«1␤»
22:28 ejs left
cspencer does the infix 'cmp' force stringification of its arguments before comparison? 22:29
22:31 lichtkind joined 22:34 alech joined 22:40 rindolf left 22:46 alanhaggai_ joined 22:49 alanhaggai left 22:50 km2 joined, alanhaggai__ joined 22:59 alech_ joined 23:01 alester left 23:05 alanhaggai_ left 23:10 alech left 23:11 bacek__ joined, alanhaggai__ left 23:12 alanhaggai__ joined 23:13 pmurias left 23:16 aindilis` left 23:18 awwaiid joined 23:25 lichtkind_ joined, alanhaggai joined, alech_ left, lichtkind_ left 23:26 maerzhase left 23:28 justatheory joined 23:38 justatheory left 23:39 iblechbot left 23:41 unobe is now known as unobe_away, alanhaggai__ left 23:44 lichtkind left 23:45 cspencer left
TimToady @tell cspencer no, cmp is generic. leg is the new spelling of the string-forcing comparison 23:48
lambdabot Consider it noted.
23:52 donaldh left 23:54 DemoFreak left, unobe_away is now known as unobe 23:55 DemoFreak joined 23:58 unobe left
pugs_svn r24591 | hinrik++ | [util/perl6.vim] add more delimiters for Q//, fix glitch with contextualizers in strings, refactor some loops, add some missing escaped string delimiters, require a colon before full-name Q adverbs 23:59