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:00 pmurias left 00:06 pdcawley left 00:07 Aisling joined 00:14 Whiteknight joined 00:15 jferrero joined
cspencer eric256: was the idea to have other people commit into that repo you'd set up, or start their own? 00:36
00:52 DemoFreak left 00:58 Limbic_Region joined 01:14 Limbic_Region left 01:15 Limbic_Region joined 01:25 alanhaggai joined 01:33 jhorwitz left
lichtkind can you declare classes is finel? 01:35
final
There is no syntax for declaring individual classes closed or final. 01:36
found it :)
cspencer in PIR, is there a way of writing a single multi method that runs on two different types?
ie) is there a way of doing an or in the :multi(...) syntax?
01:39 dukeleto_ joined 01:40 alanhaggai_ joined 01:43 alanhaggai left, alanhaggai_ is now known as alanhaggai 01:55 Whiteknight left 01:58 jferrero left
eric256 cspencer: i would like to have other people commit to it 02:03
should i have setup a perl6 account and then started an examples repo? so it was perl6/examles instead of eric256/perl6-examples? 02:04
once it gets going i figured i'd be able to add a "make perl6-examples" to the parrot/language/perl6 make file ;) but that can wait till there is stuff in it
i'm also wondering about getting a bot in here monitoring git and posting updates or aggregating updates to perl6 t/spec and perl6-examples in an RSS feed or something similar 02:05
cspencer that would be great, i wouldn't mind submitting a couple of the euler solutions myself :)
eric256 go for it, i'm hoping if we follow similar patterns as i setup for euler we could have multiple solutions for each problem and have something to run them all and compare run times etc 02:08
cspencer great, ok
i'll register for an account later on this evening
i assume you probably have to grant me perms. to commit?
eric256 actualy i think its fully public already 02:09
you'll just need to sign up and register a public key with it then add the repo
cspencer oh ok, i'll try to check out the repo. after dinner then, thanks :)
literal why not just update the the examples/euler in the pugs repo? 02:11
it's already there and changes to it are announced here
eric256 literal a number of those examples (i.e. most of them) don't work on rakudo 02:12
plus since they are language independent i thought it would be nice to get them out in a seperate repo
literal use fudge? :P
language independent?
eric256 plus commits to the examples for github are automatic i.e. no one has to approve you in order for you to add. so people don't have to come in here and get a commit bit
sorry
literal you mean implementation independent
eric256 implementation independent
yes
;)
oh and github has a nice web based interface hehe 02:13
and i should probably add all of those reasons to the README ;) 02:14
pugs_svn r24548 | pmichaud++ | [t/spec]: Unfudge a spectest in do.t. 02:22
02:27 elmex left
eric256 pmichaud: did you do your post yet? 02:32
02:43 xuser left, xuser joined 02:44 kisu_ joined 02:47 kisu left 02:48 xuser left 02:49 xuser joined 02:53 meppl joined 02:54 alc joined 02:55 alanhaggai left 03:08 alester joined, alester left 03:10 alester joined 03:11 alester left, Limbic_Region left 03:12 alester joined 03:13 alester left, alester joined
eric256 sings a little song to himself 03:19
cspencer eric256: you around?
oh, there you are
eric256 ha!
lol
cspencer i'm trying to do a push to the git repo, but it's telling me permission denied
eric256 yep and been adding to my own repo like crazy ;) well maybe not crazy but ...well adding to it
cspencer i've not used git much, do you have much insight on that?
heh
eric256 you signed up for git and added your public key?
cspencer i did indeed 03:20
eric256 then login and goto the perl6-examples and it has "Your Clone URL"
clicking on that gives you the code to create a local mirro
i'gve been using git for all of 5 hours...so i'm probably not going to be a ton of help if it all doesn't just work right ;) 03:21
cspencer hmm...the "Your Clone URL" is different from "Public Clone URL"?
hey, that's 10 times the experience i've got then! ;) 03:22
i'll fiddle with it for a while
eric256 yea you have to use the your clone in order to push 03:26
i also had to use the fix it had for Mac OS to get my linux to work
for ssh keys
cspencer hmm 03:27
ok
oh ok see, i have to fork it first
ah, there we go 03:29
03:30 eternaleye_ joined
lichtkind a lexikal my variable of a class is shared by all objects? 03:31
03:31 eternaleye left
eric256 fork it? 03:32
eternaleye_ lichtkind: AIUI each object belonging to that class has a separate copy of that variable, each of which can be accessed by that object's methods, but not externally
eric256 i don't think thats the way to go about it...now we have different versinos
cspencer eric256: apparently...not sure it was the correct way to do it, but it seemed to work
lichtkind eternaleye_: you described attributes but what i mean is a real old school var 03:33
eric256 you should be able to push to mine
cspencer hmm
it informs me i don't have permissions to do so
eric256 odd
lemme look
eternaleye_ lichtkind: A 'my' variable declared in the class is an attribute AFAIK
lichtkind no isnt 03:34
attributes are declared with has
eternaleye_ I was under the impression that that was how one declares a private attribute
eric256 try now cspencer on my fork/branch whatever ;) 03:35
cspencer alright, one sec
lichtkind eternaleye_: privat attr are : has $!attr;
my and our has no effect on attributes - quote from s12 03:36
cspencer that did it
lichtkind there visibility comes from the twigil
cspencer do you have to manually add new users that can commit? 03:37
eric256 shoot apparently
well i don't care for that at all
cspencer heh, alright
eric256 though i did get a list of forks and the ability to apply them back automaticaly
well manualy by batch though
03:37 hercynium joined
eric256 still...hmm 03:37
cspencer hmm is right
lichtkind eternaleye_: thanks for effort but i seemed to be already bit deepr into this :) 03:40
can anyone here aprove some weird oop question? 03:41
a lexikal var of a class is shared by all obj?
03:41 meppuru joined 03:43 GitHub182 joined
GitHub182 perl6-examples: 3Eric Hodges 07master0 SHA1-4a5affe 03:43
Adding answer to euler #2
is.gd/cT6q
perl6-examples: 3Eric Hodges 07master0 SHA1-1161e69
Merge branch 'master' of [email@hidden.address]
is.gd/cT6r
03:43 GitHub182 left
eric256 oh dear 03:43
oh good
lol
03:55 alester left
cspencer is that git-bot courtesy git hub? 03:56
meppuru good night
cspencer good night :)
meppuru ;) 03:57
03:57 meppuru left
eric256 cspencer: yep 03:57
but if it spews like that its going to annoy the crap out of everyone ;)
i'm trying to do euler problem 3 but i have to research the math first ;) 03:58
hehe
03:58 meppl left
eternaleye_ eric256: This is inefficient, but it should work: dpaste.com/101484/ 04:18
(re Euler 3)
Although, rakudo barfs on loop()
or maybe it's the true, one sec 04:19
Well, dpaste.com/101488/ segfaults rakudo r34100 04:21
eric256 rakudo: say Bool:true; 04:22
p6eval rakudo 34224: OUTPUT[Statement not terminated properly at line 1, near ":true;"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤]
eric256 rakudo: say Bool:True;
p6eval rakudo 34224: OUTPUT[Statement not terminated properly at line 1, near ":True;"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤]
eric256 rakudo: say Bool::true;
p6eval rakudo 34224: OUTPUT[Use of uninitialized value␤␤]
eric256 rakudo: say Bool::True;
p6eval rakudo 34224: OUTPUT[1␤]
eric256 with that change the error i get is "get_iter() not implemented in class 'Undef'" 04:25
but then i realize i haven't rebuilt my perl6 today, so i'm going to do that ;)
eternaleye_ It's likely the for @primes -> $prime {} 04:26
I think that it's just that it's after the bool thing - Bool::true just allowed it to get to that error
eric256 rakudo: my @primes = (1,2,3,5); for @primes -> $prime { .say };
p6eval rakudo 34224: OUTPUT[Use of uninitialized value␤␤Use of uninitialized value␤␤Use of uninitialized value␤␤Use of uninitialized value␤␤]
eric256 rakudo: my @primes = (1,2,3,5); for @primes -> $prime { $prime.say };
p6eval rakudo 34224: OUTPUT[1␤2␤3␤5␤]
eternaleye_ Weird 04:27
eric256 rakudo: loop ( my Int $i = 1; $i <= sqrt( 100 ); ++$i ) { say $i };
p6eval rakudo 34224: OUTPUT[1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤]
eric256 rakudo: loop ( my Int $i = (1)[-1]; $i <= sqrt( 100 ); ++$i ) { say $i }; 04:28
p6eval rakudo 34224: OUTPUT[Method 'postcircumfix:[ ]' not found for invocant of class 'Int'␤current instr.: 'postcircumfix:[ ]' pc 1568 (src/classes/Positional.pir:77)␤]
eric256 rakudo: loop ( my Int $i = list(1)[-1]; $i <= sqrt( 100 ); ++$i ) { say $i };
p6eval rakudo 34224: OUTPUT[1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤]
eric256 odd i thought maybe it was in there
rakudo: my Int Array @primes = ( 2 ); loop (my Int $i = @primes[-1]; $i < sqrt ( 100 ); ++ $i) { say $i }; 04:30
p6eval rakudo 34224: OUTPUT[get_iter() not implemented in class 'Undef'␤current instr.: '_block14' pc 160 (EVAL_12:72)␤]
eric256 there it is
rakudo: my @primes = ( 2 ); loop (my Int $i = @primes[-1]; $i < sqrt ( 100 ); ++ $i) { say $i };
p6eval rakudo 34224: OUTPUT[2␤3␤4␤5␤6␤7␤8␤9␤]
eric256 waits for perl6 to rebuild
eternaleye_ Well, that's interesting 04:31
dpaste.com/101494/ dumps "Warning\n" to the terminal over and over 04:33
Ah, that's the break; statements. It said last; wasn't okay, so that was a guess. What's perl6's equvalent to last? 04:35
eric256 i thought last. lol 04:39
maybe return?
rakudo: for (1..100) {.say; last; };
p6eval rakudo 34224: OUTPUT[1␤Could not find non-existent sub last␤current instr.: '_block29' pc 188 (EVAL_14:89)␤]
eric256 rakudo: for (1..100) {.say; return; };
p6eval rakudo 34224: OUTPUT[1␤No exception handler and no message␤current instr.: 'return' pc 14152 (src/builtins/control.pir:39)␤]
eric256 goes to check the specs 04:40
could be its just not implemented yet
rakudo: for (1..100) {.say; last(); }; 04:41
p6eval rakudo 34224: OUTPUT[1␤Could not find non-existent sub last␤current instr.: '_block29' pc 188 (EVAL_14:89)␤]
04:43 alester joined
eric256 rakudo: my $foo = 1; given (1) { when (1) {$foo = 2; break; $foo = 4} }; say $foo; 04:46
p6eval rakudo 34227: OUTPUT[2␤]
eric256 so break works in given 04:47
rakudo: for (1..100) {.say; break; };
p6eval rakudo 34227:
..OUTPUT[1␤Warning␤2␤Warning␤3␤Warning␤4␤Warning␤5␤Warning␤6␤Warning␤7␤Warning␤8␤Warning␤9␤Warning␤10␤Warning␤11␤Warning␤12␤Warning␤13␤Warning␤14␤Warning␤15␤Warning␤16␤Warning␤17␤Warning␤18␤Warning␤19␤Warning␤20␤Warning␤21␤Warning␤22␤Warning␤23␤Warning␤24␤Warning␤25␤Warning␤26␤Warning␤27␤...
eric256 opps.. apparently it doesn't work in a for loop. lmao
04:48 aindilis left
cspencer good night all 04:49
04:49 cspencer left
eric256 yea all the loop tests for last() are skipped, fudged for now.. 04:49
eternaleye_ Well, those are optimizations ( cut runtime to ~1/8 ) 04:51
Oh, I just realized I made a major error. I just popped the last prime, not the greatest prime which divides $num 04:53
So I'd have to loop over @primes and add any where $num % $prime == 0 to @divisors, then pop( @divisors ) 04:54
The basic idea is to create a list of all primes up to sqrt( num ) ( because nothing larger than it's square root will be a factor ) and find the biggest one that factors $num 04:55
04:55 GitHub186 joined
GitHub186 perl6-examples: 3Eric Hodges 07master0 SHA1-73de98f 04:55
Adding answer to euler #3
is.gd/cTC0
04:55 GitHub186 left
eric256 eternaleye_: yea, thats my code, its just not good at finding primes ;) 04:56
bed time if you want to add to perl6-examples on github just @tell eric256 <your github id> and i'll add you when i get the message 04:59
later
04:59 eric256 left 05:09 lichtkind left 05:25 xinming joined 05:46 hercynium left
pugs_svn r24549 | pmichaud++ | [t/spec]: Unfudge tests for whatever star in array slices. 05:50
rakudo_svn r34231 | pmichaud++ | [rakudo]: Add whatever star to list and array slices. 06:00
06:04 azawawi left 06:45 ashizawa joined 06:52 alester left 07:04 adc_penner joined 07:07 kisu joined 07:09 justatheory joined
rakudo_svn r34237 | pmichaud++ | [rakudo]: spectest-progress.csv update: 261 files, 5790 passing, 0 failing 07:20
07:23 kisu_ left
eternaleye_ Does gather/take work yet? 07:25
pmichaud mostly. It's not lazy yet.
eternaleye_ Ah.
Do you know why Rakudo would segfault on this? dpaste.com/101510/ . The top error it gives (r34100) is Method 'HOW' not found for invocant of class 'Iterator' 07:26
pmichaud you're using @primes in sub testPrime before it's been defined? 07:27
that'd be my initial guess. 07:28
eternaleye_ Oh, shoot
pmichaud but that gather loop is likely to act like an infinite loop for now, since we don't do laziness. (At least I don't think we do.) 07:29
eternaleye_ Okay. Although, even this segfaults (setting @primes to (2, 3), defining the sub, and setting primes to (@primes, gather...) dpaste.com/101511/ 07:31
pmichaud just a sec, I'll try on my box. 07:32
and is it really a segfault, or just that it stops running?
eternaleye_ *** glibc detected *** ./perl6: corrupted double-linked list: 0x0000000002c44400 ***
pmichaud okay.
did you perhaps try running as parrot perl6.pbc instead of the perl6 "binary" ?
eternaleye_ Oh, I'll try that. I probably need sleep, sorry if I'm being slow 07:33
Okay, no segfault then. Although the HOW error is still there. 07:34
pmichaud yes, I get the error also. Something to do with assignment.
checking. 07:35
it's an assignment inside the gather 07:36
07:37 cspencer joined
eternaleye_ pmichaud: Not defining $isPrime as Bool fixes it, instead it starts eating memory eagerly :D Thanks! 07:39
pmichaud oh, yes.
I think there's an issue with type constraints at the moment.
I haven't been able to track it down precisely, but it wouldn't surprise me if that's the issue. 07:40
also, it's looking to me as though gather/take might not be working all that well either. It doesn't seem to know when to quit.
cspencer pm: i've got a patch that implements the Mapping interface for the Env object, resolving the issues in #57400. have you had a chance to review the other Mapping.pir changes? 07:41
pmichaud not yet. 07:42
cspencer ok
pmichaud I'm writing blog posts now, then probably need some sleep.
cspencer heh, sure, fair enough :)
pmichaud so I'd apply Mapping.pir first thing tomorrow morning.
how are you handling Mapping for Env, out of curiosity?
I was planning to do it with a specialized Proxy object.
cspencer by implementing an iterator method for Env 07:43
oh ok
pmichaud an iterator for Env?
cspencer i had keys/values/pairs/etc. working for it
pmichaud maybe I'm thinking of a different issue.
cspencer rt.perl.org/rt3/Public/Bug/Display.html?id=57400
pmichaud oh, it resolves the .keys, .kv, etc probems in #57400 07:44
cspencer perhaps not all of the issues, but it will work for all of the methods implemented in Mapping.pir
yes
pmichaud oh, that will be very nice.
cspencer yes, seems to be working well from my initial tests 07:45
pmichaud it should -- you have the correct approach for that.
cspencer good to hear :)
ok, i'll check back tomorrow then, going to get some sleep myself :) 07:46
have a good night
pmichaud you also -- great work!
cspencer thanks!
07:46 cspencer left 07:56 alanhaggai joined 08:04 pdcawley joined 08:21 alanhaggai left 08:31 eternaleye_ is now known as eternaleye 08:36 maerzhase joined 08:37 iblechbot joined 08:44 ejs joined 08:45 ejs1 joined 08:52 masak joined 09:03 ejs left 09:06 DemoFreak joined 09:09 masak left 09:10 eternaleye left, eternaleye joined, masak joined 09:17 mpeter joined 09:18 araujo left 09:20 bacek__ left
masak rakudo: eval "sub x { say q<O, NI HAO> }"; say "before call"; x 09:23
p6eval rakudo 34238: OUTPUT[O, NI HAO␤before call␤Could not find non-existent sub x␤current instr.: '_block14' pc 107 (EVAL_13:47)␤]
masak um. fail.
masak submits rakudobug
09:24 adc_penner left 09:31 maerzhase left
rakudo_svn r34239 | bernhard++ | [codingstd] trailing whitespace 09:40
masak github++ # they do so many things right! 09:57
ruoso @tell pmurias are you going to work on smopp5? or just embedding p5 without integrating the runloops? 10:05
lambdabot Consider it noted.
10:05 alc left 10:07 elmex joined
eternaleye @tell eric256 Euler #8 solution at dpaste.com/101537/ 10:10
lambdabot Consider it noted.
10:16 jferrero joined
masak eternaleye: some pretty long lines in that piece of code... 10:26
also, things are indented twice each time.
10:27 pmurias joined 10:33 alech joined
eternaleye masak: The long line is a 1000-digit number from Euler 10:34
masak eternaleye: dpaste.com/101544/ 10:35
eternaleye Oh, and the output thing. Oops
That works!
masak :)
eternaleye @tell eric256 masak++ improved the formatting, dpaste.com/101544/ 10:36
lambdabot Consider it noted.
10:36 Aisling left 10:38 gfldex is now known as Guest6748, gfldex_ joined
masak eternaleye: is this an original work, or did you copy it from the Pugs repo? I'm about to slap a license onto the perl6-examples repo, and I don't want to step on anyone's toes. 10:38
eternaleye masak: Original, but feel free to put on any licence. Artistic, GPL, LGPL, BSD, MIT are all fine 10:39
masak I'm going with Artistic 2.0, same as Pugs has. 10:40
10:40 Guest6748 left
eternaleye Grr, Euler #9 is annoying. I don't want to bruteforce it, so I'm solving for a & b, but I can't figure out how to factor 'ab - 1000a - 1000b + 500000 = 0' 10:43
10:53 iblechbot left
masak eternaleye: ISTR that you can generate a pythagorean triplet from the previous one. that might help. 10:53
10:56 ruoso left 10:57 xinming_ joined 11:02 xinming left
masak rakudo: for 1..500 -> $a { for $a+1..500 -> $b { my $c = sqrt($a*$a + $b*$b); next if $c != floor($c); say [$a, $b, $c].fmt("%d") if $a + $b + $c == 1000 } } 11:04
p6eval rakudo 34239: No output (you need to produce output to STDOUT)
masak ah. timeout.
...and that was brute-forcing, I know. :)
rakudo: for 200..500 -> $a { for $a+1..500 -> $b { my $c = sqrt($a*$a + $b*$b); next if $c != floor($c); say [$a, $b, $c].fmt("%d") if $a + $b + $c == 1000 } } # cheating 11:05
p6eval rakudo 34239: OUTPUT[200 375 425␤] 11:06
masak I have no a-priori basis for starting at 200, I just wanted to show that the algorithm produces an answer.
TimToady: btw, I'm asking myself if the format parameter in .fmt shouldn't have a default "%s". in the above case, it would have allowed me to omit the "%d" argument (as I unconsciously assumed, despite having documented the method myself) 11:11
11:13 alech left 11:14 alech joined 11:17 pdcawley left
masak rakudo: my @a = 1,2,3,4; say @a[*-1] 11:17
p6eval rakudo 34239: OUTPUT[4␤]
masak whoa! pmichaud++ 11:18
11:20 donaldh joined 11:27 bsdperl joined 11:35 dmq joined 11:42 DemoFreak left 11:43 DemoFreak joined 11:45 GitHub64 joined
GitHub64 perl6-examples: 3Carl Masak 07master0 SHA1-08743c2 11:45
[README] various whitespace, capitalization and formatting changes
is.gd/cVDc
11:45 GitHub64 left
masak ooh, nice. one-time bots :) 11:46
the things they come up with nowadays... 11:47
whoever set that one up: could we have one that reports viklund/november commits to #november-wiki, too? kthxbai. 11:48
11:52 iblechbot joined 11:53 schmalbe joined 11:58 vixey joined
pugs_svn r24550 | pmurias++ | [smop] started migrating to scons - SConstruct builds test 03 11:59
12:10 cspencer joined, alech left 12:11 alech joined 12:25 alech_ joined 12:29 alech left 12:31 alanhaggai joined 12:51 rjh- joined 12:55 alanhaggai left 12:56 vixey left 12:58 alech_ left 12:59 alech joined 13:03 PZt joined 13:06 bacek joined 13:07 alanhaggai joined
bacek perl6: my @a=(1,2); say @a.WHAT 13:08
p6eval elf 24550, pugs, rakudo 34242: OUTPUT[Array␤]
bacek hmm...
perl6: my @a=(1,2); say @a.perl
p6eval rakudo 34242: OUTPUT[[1, 2]␤]
..pugs: OUTPUT[\(1, 2)␤]
..elf 24550: OUTPUT[[1,2]␤]
bacek perl6: my @a=(1,2); my @b = eval @a.perl; say ~@b 13:09
p6eval rakudo 34242: OUTPUT[1 2␤]
..elf 24550: OUTPUT[12␤]
..pugs: OUTPUT[CaptSub {c_feeds = [:MkFeed {f_positionals = [:IFinite 1,IFinite 2:], f_nameds = []}:]}␤]
bacek perl6: my @a=(1,2); push @a, eval @a.perl; say ~@a 13:10
p6eval pugs: OUTPUT[1 2 CaptSub {c_feeds = [:MkFeed {f_positionals = [:IFinite 1,IFinite 2:], f_nameds = []}:]}␤]
..elf 24550: OUTPUT[Undefined subroutine &GLOBAL::push called at (eval 121) line 4.␤ at ./elf_f line 3861␤]
..rakudo 34242: OUTPUT[1 2 1 2␤]
bacek perl6: my @a=(1,2); push @a, eval @a.perl; say +@a 13:11
p6eval pugs, rakudo 34242: OUTPUT[3␤]
..elf 24550: OUTPUT[Undefined subroutine &GLOBAL::push called at (eval 121) line 4.␤ at ./elf_f line 3861␤]
13:17 eric256 joined 13:25 alech left
eric256 @tell masak that bot is in the services channel of your repo ;) just add sever,port and channel and the ncheck the "active" box and off it goes. 13:26
lambdabot Consider it noted.
13:26 Lorn joined
eric256 @tell masak ++ for adding licensing info ;) 13:27
lambdabot Consider it noted.
13:30 jferrero left 13:32 eric256 left
cspencer rakudo: my Int $x = Inf; say "x = $x" 13:35
p6eval rakudo 34242: OUTPUT[Type mismatch in assignment.␤current instr.: 'die' pc 14533 (src/builtins/control.pir:188)␤]
cspencer rakudo: my Num $x = Inf; say "x = $x" 13:36
p6eval rakudo 34242: OUTPUT[x = inf␤]
cspencer rakudo: say "Range: " ~ (1..10) 13:44
p6eval rakudo 34242: OUTPUT[Range: 1 2 3 4 5 6 7 8 9 10␤]
masak lambdabot: any messages for me? 13:45
apparently not. :) 13:46
lambdabot masak: You have 2 new messages. '/msg lambdabot @messages' to read them.
cspencer rakudo: Inf.say 13:48
p6eval rakudo 34242: OUTPUT[inf␤]
cspencer rakudo Inf.int.say
rakudo: Inf.int.say
p6eval rakudo 34242: OUTPUT[-2147483648␤]
rjh- rakudo: NaN.say 13:50
p6eval rakudo 34242: OUTPUT[nan␤]
masak cspencer: that Inf.int.say result seems a bit worrisome to me. 13:53
cspencer yeah
masak rakudo: say Inf.WHAT
p6eval rakudo 34242: OUTPUT[Num␤]
masak cspencer: care to report it?
cspencer pmichaud just implemented -Inf/Inf yesterday
masak cspencer: yep.
cspencer so it's probably just been overlooked for the moment
sure, i'll put it in
masak cspencer++ 13:54
13:54 alanhaggai left
cspencer i wonder what the appropriate value for that would be 13:54
masak Inf
:)
cspencer heh, true :) 13:55
perhaps Inf needs to become its own class as somepoint
it should probably display as "Inf" or "-Inf" when printed as opposed to lowercase "inf" 13:56
13:56 apeiron left
masak yes, I thought about that too 13:56
rjh- while we're at it
rakudo: NaN.int.say
p6eval rakudo 34242: OUTPUT[-2147483648␤]
13:56 apeiron joined
masak popular value, that 2**31 13:56
cspencer heh, i'll put that in the ticket as well
masak er, -2**31
cspencer that was just put in yesterday too
rjh- same for -NaN and -Int i guess
*Inf 13:57
cspencer is there a method like .int that forces numeric (ie. Num) context? 13:58
pmurias pugs: +"123a" 14:04
lambdabot pmurias: You have 1 new message. '/msg lambdabot @messages' to read it.
p6eval pugs: RESULT[123.0]
pmurias @tell ruoso i'll use pcl at first then i'll work on smopp5 14:06
lambdabot Consider it noted.
pugs_svn r24551 | pmurias++ | [smop] removed small memory leak
14:07 DemoFreak left, cspencer left 14:09 DemoFreak joined 14:15 justatheory left
masak @tell eric256 re git tutorial: www.newartisans.com/blog_files/git....tom.up.php is really good. also www-cs-students.stanford.edu/~blynn/gitmagic/ 14:16
lambdabot Consider it noted.
14:17 DemoFreak left 14:19 DemoFreak joined
pugs_svn r24552 | pmurias++ | [smop] removed another small memory leak 14:19
14:22 ashizawa left 14:24 drbean joined
rjh- rakudo: (1,2,3) ~ (4,5) 14:25
p6eval rakudo 34243: RESULT["1 2 34 5"]
pugs_svn r24553 | moritz++ | [t] and [t/spec] 14:26
r24553 | moritz++ | * more smartlinks
r24553 | moritz++ | * moved passing_the_pair_class_to_a_sub.t to spec/integration.t
r24553 | moritz++ | * test that optional params can't go before positional ones
r24553 | moritz++ | * test that MAIN sub in eval() is not executed
r24553 | moritz++ | * moved var/contextual.t, a vew oo/roles/*.t and blocks/wrap.t to spec/
r24553 | moritz++ | * removed outdated oo/roles/properties.t
r24553 | moritz++ | * moved arity tests to spec/, updated and enhanced
r24553 | moritz++ | * remove unneeded evals
r24553 | moritz++ | * merge oo/class/anonymous.t into spec/S12-class/anonymous.t
masak moritz_++, you madman! been using the train again? 14:27
pugs_svn r24554 | moritz++ | [t/spec]
r24554 | moritz++ | * added tests for $obj.@candidates(@args) and other
r24554 | moritz++ | indirect method call syntaxes
r24554 | moritz++ | * added tests for various direct method call syntaxes
r24554 | moritz++ | * added tests for lvalue methods
r24554 | moritz++ | * tests for class methods, including 'method ^classmethod' syntax
moritz_ masak: no, just two days with not much to do
masak I sit in awe at your restlessness.
14:29 justatheory joined 14:31 alanhaggai joined 14:38 ejs1 left, ejs joined
moritz_ oh, and I submitted three new bug reports 14:38
14:41 alanhaggai left, alanhaggai joined
masak not bad. :) 14:42
14:42 DemoFreak left
rakudo_svn r34245 | moritz++ | [rakudo] three more tests for t/spectest.data 14:50
14:50 vixey joined 14:51 DemoFreak joined
masak moritz_: I finally got in touch with Mr Game Maker. druid is now public. github.com/masak/druid/ 14:52
moritz_ Yes! 14:53
14:54 DemoFreak left
masak (turned out the best way to reach him was to challenge him to a game of Druid on a game server.) 14:55
moritz_ lol
did you beat him?
14:55 eric256 joined
masak moritz_: still ongoing. very exciting. www.gamerz.net/pbmserv/Druid/Druid.php?539 14:56
and no, I don't expect to beat him. this is only my tenth game or so, ever. he must have played hundreds.
moritz_ what are the typical time scales for such a game? 14:57
masak moritz_: depends. this is asynch, so somewhere between a week and a year, I'd say.
synchronous games seldom last longer than two hours.
eric256 oh that game makes a lot more sense in the 3d view
lambdabot eric256: You have 1 new message. '/msg lambdabot @messages' to read it.
masak eric256: my ASCII implementation is 3d, too. 14:58
eric256 so red is trying to get a continuos line of red from left to right, and white is top to bottom? hmm
masak aye.
moritz_ rakudo: say (1..3).first({$_ % 2 == 0} ) 14:59
p6eval rakudo 34244: OUTPUT[2␤]
moritz_ rakudo: say (1..3).reduce({$^a - $^b})
p6eval rakudo 34244: OUTPUT[-4␤]
masak anyone want to challenge me to a game on that server, I'm game.
moritz_ rakudo: say (1..3).reduce({$^a + $^b})
p6eval rakudo 34244: OUTPUT[6␤]
PerlJam moritz_: does .reduce() pat attention to the arity of the sub? 15:00
s/pat/pay/
moritz_ rakudo: say (1..3).reduce({$^a + $^b + $^c})
PerlJam: I think it needs arity 2
p6eval rakudo 34244: OUTPUT[6␤]
PerlJam heh 15:01
moritz_ rakudo: say (1..10).reduce({$^a + $^b + $^c})
p6eval rakudo 34244: OUTPUT[Use of uninitialized value␤55␤]
PerlJam that's interesting
pugs_svn r24555 | moritz++ | [t/spec] test that .first and .reduce work on ranges
moritz_ PerlJam: feel free to add tests and/or open a ticket
masak rakudo: say (1..10).reduce({}) 15:02
p6eval rakudo 34244: OUTPUT[No applicable methods.␤␤current instr.: '_block14' pc 87 (EVAL_15:42)␤]
masak rakudo: say (1..10).reduce({ say "!" })
p6eval rakudo 34244: OUTPUT[Cannot reduce() using a unary or nullary function.␤current instr.: 'die' pc 14533 (src/builtins/control.pir:188)␤]
PerlJam yeah, it needs arity >= 2
masak oh, so it does have some checks.
PerlJam is looking at the code now
eric256 rakudo: say (1..9).reduce({$^a + $^b + $^c}) 15:03
p6eval rakudo 34244: OUTPUT[45␤]
masak PerlJam: are you also submitting a rakudobug? otherwise I am.
PerlJam go ahead
masak submits rakudobug
eric256 whats the bug?
moritz_ rakudo: my $x = 0; say (1..9).reduce({$x++; $^a + $^b + $^c}); say $x
p6eval rakudo 34244: OUTPUT[45␤4␤]
masak eric256: the "Use of uninitialized value" warning above.
15:04 cspencer joined
moritz_ masak: maybe that's because it just doesn't work to reduce a list of every possible size with a three-arg function? 15:04
15:04 alester joined
eric256 but it was unitiliazed 15:04
masak moritz_: yes, now that I look at it, I think so too.
eric256: what was?
PerlJam still a bug though 15:05
(IMHO)
eric256 $^b and $^c for the last run
masak PerlJam: aye, it shouldn't warn, methinks
eric256: you're right.
eric256 rakudo: (1).reduce( { $^a.say});
p6eval rakudo 34244: OUTPUT[Cannot reduce() using a unary or nullary function.␤current instr.: 'die' pc 14533 (src/builtins/control.pir:188)␤]
eric256 rakudo: (1).reduce( { $^a.say; $^b.say'});
p6eval rakudo 34244: OUTPUT[Statement not terminated properly at line 1, near "'});"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤]
eric256 rakudo: (1).reduce( { $^a.say; $^b.say;});
p6eval rakudo 34244: OUTPUT[Method 'iterator' not found for invocant of class 'Int'␤current instr.: 'parrot;Any;reduce' pc 10125 (src/builtins/any-list.pir:409)␤]
PerlJam yeah, it pushes an appropriate number of undef to fill out the arity of the sub.
eric256 rakudo: list(1).reduce( { $^a.say; $^b.say;});
p6eval rakudo 34244: RESULT[1] 15:06
rjh- how else would you handle it?
eric256 ohh but that should have the same error then
rakudo: list(1).reduce( { $^a + $^b;});
p6eval rakudo 34244: RESULT[1]
eric256 rakudo: list(1).reduce( { $^a + $^b + $^c;});
p6eval rakudo 34244: RESULT[1]
eric256 rakudo: list(1,2).reduce( { $^a + $^b + $^c;});
p6eval rakudo 34244: OUTPUT[Use of uninitialized value␤]
eric256 okay thats a bit weird
masak something inconsistent is going on. 15:07
rjh- in the first case the reduce block is never executed 15:08
PerlJam rakud: list().reduce( { $^a + $^b });
rakudo: list().reduce( { $^a + $^b });
p6eval rakudo 34244: RESULT[undef]
eric256 rakudo: list(1,2).reduce( { $^a + ($^b//0) + ($^c//0);}); 15:09
p6eval rakudo 34244: RESULT[3]
rjh- rakudo: list(1).reduce( { say "cake!" } );
p6eval rakudo 34244: OUTPUT[Cannot reduce() using a unary or nullary function.␤current instr.: 'die' pc 14533 (src/builtins/control.pir:188)␤]
pugs_svn r24556 | pmurias++ | [smop] removed memory leak
rjh- rakudo: list(1).reduce( { $^a + $^b; say "cake!" } );
p6eval rakudo 34244: RESULT[1]
eric256 no cake for you
cspencer reduce only takes two variables
PerlJam shouldn't list() produce an empty list?
eric256 cspencer: but why?
why not let someone reduce however they want? 15:10
cspencer well
eric256 rakudo: list(1..10).reduce( { $^a + ($^b//0) + ($^c//0);});
p6eval rakudo 34244: RESULT[55]
cspencer hmmm
eric256 rakudo: list(1..4).reduce( { $^a + ($^b//0) + ($^c//0);});
rjh- wow
p6eval rakudo 34244: RESULT[10]
masak rakudo: say list() 15:11
p6eval rakudo 34244: OUTPUT[␤]
15:11 jhorwitz joined
cspencer from what i understand, the first value into reduce acts as an accumulator of sorts, to which the second value is added or subtracted or whatevered 15:12
rjh- rakudo: list(1,2,3).reduce( { $^a + $^b * $^c } )
p6eval rakudo 34244: RESULT[7]
rjh- reduce works on 3 variables
cspencer hmmm
alright then :)
i didn't expect that
rjh- it slices the list in blocks of .arity, and runs the fn over them
i guess $^a is always the accumulator?
cspencer ah ok
yes
rjh- so .arity - 1 15:13
cspencer the first var should be the accumulator
i was probably working off the lisp definition of reduce which is why i expected it to be of arity 2 :)
rjh- rakudo: list(1,2,3,4,5).reduce( { $^a + $^b * $^c } )
p6eval rakudo 34244: RESULT[27]
rjh- yup
eric256 my above reduce would be : $^a = 1, $^b = 2, $^c = 3; then second step $^a = 6, $^b = 4, $^c = 0
which spec is reduce defined in? 15:14
cspencer S29 15:15
PerlJam S29:826
(and it doesn't appear to be specced to allow for arbitrary arity :) 15:16
rjh- can reduce() be called with pointy subs
eric256 hmm spec implementation wants arity 2 ;(
rjh- (1..10).reduce -> $a, $b { $a * $b } or somesuch
PerlJam rjh: try it :)
rjh- rakudo: (1..10).reduce -> $a, $b { $a * $b }
p6eval rakudo 34245: OUTPUT[Statement not terminated properly at line 1, near "-> $a, $b "␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤]
masak rakudo: (1..10).reduce(-> $a, $b { $a * $b }) 15:17
p6eval rakudo 34245: OUTPUT[Statement not terminated properly at line 1, near "(-> $a, $b"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤]
PerlJam looks like "no"
rjh- pugs: (1..10).reduce(-> $a, $b { $a * $b })
p6eval pugs: RESULT[3628800]
rjh- whoop
eric256 perl6: (1..10).reduce(-> $a, $b { $a * $b }) 15:18
p6eval elf 24556: OUTPUT[Parse error in: /tmp/MkCxfDDRja␤panic at line 1 column 0 (pos 0): Can't understand next input--giving up␤WHERE: (1..10).reduce(-> $a, $b { $a␤WHERE:/\<-- HERE␤ STD_red/prelude.rb:99:in `panic'␤ STD_red/std.rb:76:in `scan_unitstopper'␤ STD_red/std.rb:224:in `comp_unit'␤
..STD_r...
..rakudo 34245: OUTPUT[Syntax error at line 1, near "\ufeff(1..10).r"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤]
..pugs: RESULT[*** ␤ Unexpected "\65279("␤ expecting "use", statements or "}"␤ at /tmp/Le6AykRFyh line 1, column 10␤]
rjh- what is elf?
eric256 perl6: (1..10).reduce(-> $a, $b { $a * $b })
p6eval rakudo 34245: OUTPUT[Statement not terminated properly at line 1, near "(-> $a, $b"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤]
..elf 24556: OUTPUT[AST handler circumfix:pblock partially unimplemented at ./elf_f line 2401␤]
..pugs: RESULT[3628800]
eric256 unicode bit me agian
moritz_ perl6: say [*] 1..10 15:19
p6eval pugs, rakudo 34245: OUTPUT[3628800␤]
..elf 24556: OUTPUT[Parse error in: /tmp/PyJUu1tmT0␤panic at line 1 column 0 (pos 0): Can't understand next input--giving up␤WHERE: say [*] 1..10␤WHERE:/\<-- HERE␤ STD_red/prelude.rb:99:in `panic'␤ STD_red/std.rb:76:in `scan_unitstopper'␤ STD_red/std.rb:224:in `comp_unit'␤ STD_red/std.rb:210:in
.....
rjh- n/m
masak rjh-: Elf is a Perl 6 implementation in Perl 6. 15:20
rjh- thanks 15:21
15:25 alanhaggai left
cspencer rakudo: (1..Inf).elems.say 15:30
p6eval rakudo 34245: No output (you need to produce output to STDOUT)
masak sounds like the non-lazy answer. :) 15:33
rjh- rakudo: (1..Inf).elems 15:34
that was probably a mistake
p6eval rakudo 34245: No output (you need to produce output to STDOUT)
moritz_ no, the problem is that we don't have lazy lists yet
rjh- so rakudo infinite loops at list creation? 15:35
moritz_ presumably
rjh- isn't a Range an object with a start and end point, and an iterator?
moritz_ rakudo: (1..Inf); say "alive"
p6eval rakudo 34245: OUTPUT[alive␤]
moritz_ ah right, it loops on .elems 15:36
rjh- so presumably it runs the iterator when .elems is called
moritz_ aye
that could be fixed by adding a Range.elems multi that does the "right" thing
rjh- rakudo: (1..10).elems 15:37
p6eval rakudo 34245: RESULT[10]
moritz_ rakudo: (1..10:by(2)).elems
p6eval rakudo 34245: OUTPUT[Statement not terminated properly at line 1, near ":by(2)).el"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤]
moritz_ ah, no adverbs on operators yet
pmurias is it possible to encode the LD_LIBRARY_PATH into an executable 15:38
rjh- is anyone working on adverbs?
cspencer i'm just working on a Range patch to deal with infinite lists in some cases 15:39
15:39 donaldh left
pmurias LD_LIBRARY_PATH='...' ... is getting annoying 15:39
cspencer i believe if you do an infinite range right now, it tries to flatten it to a list to do elems
rjh- am i confused or couldn't you determine .elems without generating a list 15:41
cspencer you could, but the Range implementation wasn't :)
rjh- :) 15:42
cspencer (or at least i don't think it was when i'd looked at it last)
i'm pretty sure it tries to flatten to a list in a lot of cases
i was going to work on that today to fix up the cases of infinite ranges
rjh- so the Range falls back to list methods automatically?
cspencer seems to in a lot of cases 15:43
rjh- rakudo: (1..10).pop
p6eval rakudo 34245: RESULT[10]
rjh- rakudo: (1..10).shift
p6eval rakudo 34245: RESULT[1]
rjh- rakudo: (1..10).unshift(1)
p6eval rakudo 34245: OUTPUT[Method 'unshift' not found for invocant of class 'Range'␤current instr.: '_block14' pc 83 (EVAL_15:43)␤]
rjh- rakudo: (1..10).push(1)
15:43 maerzhase joined
p6eval rakudo 34245: OUTPUT[Method 'push' not found for invocant of class 'Range'␤current instr.: '_block14' pc 83 (EVAL_15:43)␤] 15:43
masak so pop and shift are there, but not unshift and push? 15:44
rjh- rakudo: my $a = (1..10);
masak that's a bit unfair.
p6eval rakudo 34245: RESULT[1..10]
rjh- rakudo: my $a = (1..10); pop $a; $a ~~ Range
p6eval rakudo 34245: OUTPUT[No applicable methods.␤␤current instr.: '_block14' pc 101 (EVAL_15:48)␤]
masak submits rakudobug
rjh- i can't imagine how you'd push onto a range
it would need to convert itself into a list 15:45
erm, array
rakudo: my $a = (1..10); pop $a;
p6eval rakudo 34246: OUTPUT[No applicable methods.␤␤current instr.: '_block14' pc 102 (EVAL_14:48)␤]
rjh- rakudo: my $a = (1..10); $a.pop;
p6eval rakudo 34246: RESULT[10]
masak yes, now that I think about it...
rjh- rakudo: my $a = (1..10); $a.pop; $a ~~ Range;
p6eval rakudo 34246: RESULT[1]
rjh- what?!
eric256 isn't (1..Inf, 5) allowed? i thought i saw that somewhere in the specs..dunno how that would work though 15:46
masak rjh-: pop is probably non-destructive in this case.
rjh- right, makes sense. pop/shift modify the start/end of the range
masak rakudo: my $a = (1..10); say $a.pop; say $a.pop
p6eval rakudo 34246: OUTPUT[10␤9␤]
masak or not. hm.
rjh- so push/unshift would need to change it to an Array, if they were implemented
masak rakudo: my $a = (1..10); say $a.pop; say $a.pop; say $a.WHAT
p6eval rakudo 34246: OUTPUT[10␤9␤Range␤] 15:47
masak rjh-: aye. I'll withhold that ticket.
15:47 alech joined
rjh- rakudo: my $a = (1..Inf, 5); say $a.WHAT 15:48
p6eval rakudo 34246: No output (you need to produce output to STDOUT)
15:49 ruoso joined
rjh- converts Range into Array and does list flattening 15:49
ruoso Hello! 15:50
lambdabot ruoso: You have 1 new message. '/msg lambdabot @messages' to read it.
cspencer rjh-: and probably runs out of memory creating an infinite list in the process, i imagine :)
rjh- would be a safe bet :) 15:51
pmurias ruoso: hi 15:52
ruoso: i hunted do the leaks ;) 15:53
s/do/down/ 15:54
ruoso: you are ok with me switching from cmake-- to scons? 15:55
rjh- masak: i just read your post about using return in a code block. pretty spiffy, but what if the code block is executed a few more subs deep? it's not consistent 15:57
masak rjh-: it's a local variable.
rjh- right, i meant in the general sense
in perl 5 you can do sub foo { no warnings 'exiting'; last MOVE; }
that will exit the MOVE: { } block, no matter where it is 15:58
do you know if that can be done in Perl 6?
masak rjh-: I guess it can, but I haven't tried.
don't know if `last LABEL` is supported yet.
(by Rakudo)
rjh- i doubt it since Perl 5 didn't like the idea of using last to exit a sub :) 15:59
masak rjh-: I'm trying to understand exactly what you mean by "it's not consistent ... in the general sense". having trouble understanding exactly what danger it is you're referring to. 16:00
rjh-: as long as you only do it locally, you're fine, though.
rjh-: I can imagine that labels are only visible in the current lexical scope, or some such.
rjh- well, it may be that I want to 'flunk' the move several subroutines deep 16:01
in which case return will only exit the most immediately surrounding block
this is a throw/catch sort of thing. Ruby can do it with Kernel.throw
i think labels are dynamically scoped 16:02
masak rjh-: I think ruoso said that return is dynamically scoped, too.
so if I define the block in input_valid_move, I'm fine. 16:03
rjh- ahh!
masak btw, that code is online now: github.com/masak/druid/tree/master/druid.p6#L60 16:04
pugs_svn r24557 | pmurias++ | [smop] removed cmake-- support, scons is the default now 16:14
wolverian masak, I'd write the move cases as a given/when 16:16
masak wolverian: good idea. 16:17
wolverian: you mean the one on line 70, right?
eric256 hey perl 5 went Git ! ;) 16:18
masak and possibly also line 147.
wolverian masak, and the if on line 67.
pmurias, what's wrong with cmake? (just curious. haven't used scons.)
masak wolverian: ooh, true.
16:22 Khisanth left, alanhaggai joined
pugs_svn r24558 | moritz++ | [S12] fixed small typo 16:24
cspencer is the '!FAIL'('...failure reason...') method supposed to cause an error to be thrown?
masak wolverian: fixed, thanks.
cspencer or does it just return an error string?
moritz_ cspencer: I think the plan is to throw an error if 'use fatal' is in effect
cspencer ok
16:25 kisu left
pmurias wolverian: cmakes uses a custom "language" 16:26
wolverian yeah.
pmurias which makes specifing new build rules hard
16:27 schmalbe left 16:28 hercynium joined 16:29 riffraff joined, maerzhase left
pmurias wolverian: have you used cmake much? 16:31
pugs_svn r24559 | moritz++ | [t] move oo/methods/ref.t to spec/ 16:32
wolverian pmurias, I haven't written my own rules. 16:33
16:34 ruoso left
eric256 man reading some p5p mailing lists...and il thought perl6 was disorganized ;) 16:35
moritz_ don't read devel-devel then ;-) 16:36
16:39 masak left
pmurias moritz_: devel-devel? 16:40
moritz_ erm, debian-devel
moritz_ can't type today
16:42 alech_ joined, alech left 16:43 alanhaggai left 16:44 alanhaggai joined 16:45 alech_ left
eric256 don't some systems handle backwards compatibility by allowing multiple versions of the same thing to run concurrently? ie.e perl 5.8 and 5.10 and 5.12 and 6.0 all at the same time? seems like that would make developing the next version easier since you don't have to worry about backwards compatibility..hmm i hope perl6 is going that direction 16:46
moritz_ eric256: perl 6 explicitly breaks backwards compatiblity
eric256: that's the whole point ;-)
rjh- perl5 and perl6 are seperate packages under virtually every package system i know of 16:48
i don't think you have to worry about that
moritz_ on my system rakudo now passes 5814 tests. YaY. 16:49
rakudo: print 4814 - 5790
p6eval rakudo 34246: OUTPUT[-976]
eric256 watches his point sail by
lol
moritz_ rakudo: print 5814 - 5790
p6eval rakudo 34246: OUTPUT[24]
pmurias eric256: the problem with such a scheme is what does /usr/bin/perl point to 16:50
rjh- eric256: a better answer -- you can declare the version of perl you want to use with a 'use' pragma
eric256 rjh-: thats exactly what i'm talking about
rjh- in perl 5.8.9 at least
eric256 and /usr/bin/perl just points to something that checks for use version and hands off 16:51
rjh- in perl6 it's more like the perl runtime pretends to be an older version
pmurias version declaration is specced
16:51 riffraff left
moritz_ if the binary is just called 'perl', then it has to assume perl 5 until it finds a 'class' keyword in the first line or a 'use v6'; 16:52
eric256 as long as we arn't sitting here in 5 years arguing about addeing stuff to 6.5 that will break something in 6.0 ;) 16:53
pmurias chromatic wanted to add a 'class' keyword to perl5... 16:54
16:54 iblechbot left 16:55 ejs left
moritz_ pmurias: yes, if that's done, we have to just rely on 'use v6' 16:55
16:55 alech joined
rjh- ...so the proper approach is to name the binary perl6 16:57
?
cspencer rakudo: ('a'..'a').say
p6eval rakudo 34246: OUTPUT[a␤]
16:57 aindilis joined
cspencer rakudo: 'a'.say 16:57
p6eval rakudo 34246: OUTPUT[a␤]
rjh- ('a'..'a').elems 16:58
rakudo: ('a'..'a').elems
p6eval rakudo 34246: RESULT[1]
eric256 rjh-: i would think the proper approach would be to always declare your version ;)
rjh- hmm, i guess i think of perl 5 and 6 as entirely different languages, so 'version' seems misleading 16:59
cspencer rakudo: ('a'..'a').WHAT.say 17:01
p6eval rakudo 34246: OUTPUT[Range␤]
cspencer rakudo: < a >.WHAT.say
p6eval rakudo 34246: OUTPUT[Str␤]
17:01 Khisanth joined 17:02 khisanth_ joined
rjh- rakudo: [1,2,3] eqv (1,2,3) 17:03
p6eval rakudo 34246: OUTPUT[Could not find non-existent sub infix:eqv␤current instr.: '_block14' pc 123 (EVAL_13:51)␤]
cspencer rakudo: say "Range: " ~ ('a'..'a') ~ "\n";
p6eval rakudo 34246: OUTPUT[Range: a␤␤] 17:04
17:06 khisanth__ joined, iblechbot joined, azawawi joined
azawawi good evening 17:07
17:07 hudnix_ left
pmichaud good morning. :-) 17:10
17:10 khisanth_ left 17:11 bacek left
eric256 with github...is having people fork and then pulling in there updates better than having one large project with a ton of collaborators? 17:11
cspencer does perl 6 already support arbitrary precision integers? or is that yet to come? 17:13
pmichaud yet to come.
cspencer ok
pmichaud we're waiting to see how Parrot decides to handle it, first.
cspencer ah ok
i'll just mark it as a TODO in my patch then
moritz_ actually pugs does implement it
cspencer moritz: sorry, i should have been more specific and said 'rakudo' :) 17:14
17:14 Khisanth left, khisanth__ is now known as Khisanth
pmichaud rakudo: my @a = 1..5; say @a.elems; 17:17
p6eval rakudo 34246: OUTPUT[5␤]
cspencer pm: i've got a patch coming your way to deal with 1..Inf ranges a bit better
pmichaud okay
just the elements function, or something more? 17:18
sorry, .elems
cspencer that and stringification, conversion to int/num
pmichaud are you creating a new type, or ...? 17:19
17:19 hudnix_ joined
cspencer no, just modifying the existing Range and checking for infinite cases 17:19
pmichaud you mean stringification of ranges?
cspencer yes, that's right
pmichaud what's the spec say for that?
rakudo: say ~(1..5); 17:20
p6eval rakudo 34246: OUTPUT[1 2 3 4 5␤]
pmichaud that looks right to me.
moritz_ rakudo: say ~(1^..^5)
p6eval rakudo 34246: OUTPUT[2 3 4␤]
cspencer i meant in the case of a range of one to infinity
or negative infinity to one
pmichaud if you stringify 1..Inf, I would expect it to eat up all the space. 17:21
i.e., to trail off forever.
17:21 ejs joined
cspencer i was just returning a string of "1..Inf" in that case 17:21
pmichaud I'd like to see a spec for that.
rjh- if you take the view that a range is just an optimised array
17:21 ejs left, ejs joined
pmichaud i.e., if it's not specified that way, I don't want to introduce that particular behavior. 17:22
cspencer alright
pmichaud pugs: say ~(1..Inf);
moritz_ pugs did lazyness only with one particular backend (not the default one)
p6eval pugs: No output (you need to produce output to STDOUT) 17:23
cspencer ah ok, pugs is probably creating an infinite list then
pmichaud anyway, I'd ask p6l what they wish to do in cases like this. I.e., if we can detect that we're going to use an infinite amount of memory, then throw an exception or something instead of actually using up the memory. 17:24
cspencer ok
pmichaud Ranges need work in the spec anyway -- there are some contradictions.
anyone know why bacek submitted RT #61598? It appears to me that .elems already works on Array. 17:26
17:28 meppl joined
moritz_ rakudo: my @a = 1..4; say @a.elems 17:28
p6eval rakudo 34246: OUTPUT[4␤]
moritz_ pmichaud: dunno, ask him 17:29
rjh- rakudo: my @a = [1,2,3,4];
p6eval rakudo 34246: RESULT[[[1, 2, 3, 4]]]
rjh- rakudo: my $a = (1,2,3,4); 17:30
p6eval rakudo 34246: No output (you need to produce output to STDOUT)
moritz_ maybe I should change p6eval's output to use a different quoting character
perhaps RESULT«...»
rjh- lol chevrons
pmichaud I was about to suggest that :-)
rjh- rakudo: my $a = (1,2,3,4); say defined $a; say $a; 17:31
p6eval rakudo 34246: OUTPUT[1␤1 2 3 4␤]
rjh- how come there's no output from that assignment?
pmichaud assignment doesn't normally do output?
rjh- rakudo: my @a = [1,2,3,4];
p6eval rakudo 34246: RESULT[[[1, 2, 3, 4]]]
moritz_ rakudo: say (my $a = (1, 2, 3)).perl
p6eval rakudo 34246: OUTPUT[[1, 2, 3]␤]
pmichaud I have no idea why/how evalbot is choosing to do its output. 17:32
pugs_svn r24560 | moritz++ | [irclog] use different result/output separator
moritz_ pmichaud: if (!length $response){ $program = '( ( do { ' . $program . "\n} ).perl ).print";
pmichaud: that's what evalbot does to programs that doen't produce any output 17:33
and then it executes $program again
rjh- makes sense
rakudo: 5
p6eval rakudo 34246: RESULT[5]
rjh- rakudo: my $a = 5;
p6eval rakudo 34246: RESULT[5]
pmichaud oh, perhaps the do { ... } is changing things.
rjh- rakudo: my $a = [1,2,3];
17:34 p6eval joined
moritz_ sorry, just restarted p6eval, takes some time to reconnect 17:34
rakudo: 4
p6eval rakudo 34246: RESULT«4»
rjh- rakudo: my @a = (1,2,3);
p6eval rakudo 34246: RESULT«[1, 2, 3]»
rjh- yay
rakudo: my $a = (1,2,3);
p6eval rakudo 34246: RESULT«[1, 2, 3]»
pmichaud yay
_much_ nicer.
moritz++
17:35 riffraff joined 17:36 alech_ joined, alech left
rakudo_svn r34247 | pmichaud++ | [rakudo]: @*INC should be an Array, not a List (RT #61608, moritz++) 17:40
pmichaud moritz_: t/spec/S29-os/system-with-spaces.t says at the top that the tests are relevant only for Pugs. If that's true, perhaps the file doesn't belong in t/spec? 17:41
17:43 pdcawley joined
moritz_ pmichaud: dunno, I have a hard time figuring out what it actually does 17:43
I'll move it to t/pugs/ for now
pmichaud that would be good. 17:44
moritz_ pmichaud++
pugs_svn r24561 | moritz++ | [t/spec] move a test to ../pugs/ that seems to be not generally relevant
moritz_ moritz.faui2k3.org/tmp/perl6-lines.png # some usage statistics 17:48
(it's not so easy to export a chart from openoffice.org 2) 17:49
pmichaud I've noticed this. I always have to go through openoffice draw.
17:49 alech_ left, hudnix_ left
moritz_ in the end I just made a screenshot 17:51
I tried the xhtml export (for which I had to configure a java runtime environment first), and it simply didn't include the chart
pmichaud right. openoffice draw works pretty good for me. Just copy the chart to the clipboard, switch into draw, paste, resize to taste, export as <whatever> 17:52
18:04 alech joined 18:10 mpeter left 18:11 hudnix_ joined 18:12 alech left 18:17 eternaleye left 18:25 adc_penner joined 18:34 rjh- left, Psyche^ joined
pugs_svn r24562 | pmichaud++ | [t/spec]: unfudge passing tests in arity.t 18:35
18:51 adc_penner left, adc_penner joined, Patterner left, Psyche^ is now known as Patterner 19:05 alech joined
cspencer rakudo: (0..*).from.say 19:05
p6eval rakudo 34248: OUTPUT«0␤»
cspencer rakudo: (0..*).to.say 19:06
p6eval rakudo 34248: OUTPUT«Whatever<0xb661dd24>␤»
19:08 DemoFreak joined, ejs left 19:11 adc_penner is now known as |poo2 19:12 ejs joined, |poo2 is now known as adc_penner 19:27 alech_ joined
azawawi moritz_: ping pong 19:27
azawawi [Padre::Plugin::Perl6] Syntax checking is up & running with full error messages from STD.pm ;-) 19:28
19:28 schmalbe joined
pugs_svn r24563 | lwall++ | [STD] some syntax tweaks for failing test parses 19:30
r24563 | lwall++ | [Makefile] make STD lexer gen part of standard make
azawawi testing
19:34 Juerd_ joined 19:38 mberends joined 19:41 gbacon left
pasteling "azawawi" at 212.38.145.126 pasted "STD.pm failure parsing testcase" (34 lines, 500B) at sial.org/pbot/33987 19:43
azawawi TimToady: ping 19:44
19:45 alech left
azawawi TimToady: Please See the above to replicate the problem that i have been having with STD.pm after the latest context var emulation fix. 19:45
azawawi hopes to release it soon to fix the 'use STD' dependency in Padre 0.22... 19:46
rakudo_svn r34249 | pmichaud++ | [rakudo]: Refactor some Mapping methods (RT #61618, cspencer++) 19:50
r34249 | pmichaud++ | * Patch courtesy Cory Spencer [email@hidden.address]
r34250 | pmichaud++ | [rakudo]: Eliminate strcasecmp from inf/nan conversions (particle++)
eric256 watches cspencer burn it up ;)
and pmichaud++ aint to shabby either 19:51
pugs_svn r24564 | azawawi++ | [Syntax::Highlight::Perl6] Updated to latest STD.pm
pasteling "azawawi" at 212.38.145.126 pasted "Syntax::Highlight::Perl6 'make test failure results'" (44 lines, 1.9K) at sial.org/pbot/33988 19:54
"azawawi" at 212.38.145.126 pasted "Syntax::Highlight::Perl6 'make test failure results'" (44 lines, 1.9K) at sial.org/pbot/33989
20:09 bacek joined
pmichaud rakudo: say "+Inf" < 3; 20:10
p6eval rakudo 34248: OUTPUT«0␤»
eric256 rakudo: say "+Inf".perl 20:13
p6eval rakudo 34248: OUTPUT«"+Inf"␤»
eric256 rakudo: say +Inf.perl
p6eval rakudo 34248: OUTPUT«inf␤»
eric256 rakudo: say -Inf.perl
p6eval rakudo 34248: OUTPUT«-inf␤»
eric256 cool
20:15 dalek left, dalek joined 20:16 ejs left 20:24 alech_ left 20:25 alech joined
pugs_svn r24565 | azawawi++ | [Syntax::Highlight::Perl6] Moved bin/ to more standard script/ 20:34
r24565 | azawawi++ | [Syntax::Highlight::Perl6] Moved to Module::Install
r24566 | azawawi++ | [Syntax::Highlight::Perl6] Updated Changes 20:36
20:38 araujo joined 20:39 maerzhase1 joined 20:40 alech left
eric256 @seen cspencer 20:42
lambdabot cspencer is in #perl6. I last heard cspencer speak 1h 36m 26s ago.
eric256 cspencer: pig
cspencer: ping
lol 20:43
20:51 c9s_ joined 21:05 lichtkind joined
lichtkind TimToady: did you work for unisys or nasa when you created perl? 21:06
21:06 alech joined 21:09 Lorn left, c9s left, justatheory left
pugs_svn r24567 | bacek++ | [spec] Added test to one element list reduce. 21:11
21:21 jhorwitz left 21:22 riffraff left
eric256 lichtkind: en.wikipedia.org/wiki/Perl 21:23
21:23 riffraff joined
lichtkind eric256: no i think i once talked with him and he said unisys 21:23
eric256 "Larry Wall began work on Perl in 1987, while working as a programmer at Unisys," thats what it says. who knows if its right or not 21:24
lichtkind eric256: a year later he come to JPL
eric256 wants to work at NASA or JPL or anywhere ;)
lichtkind right later in article i just read the head 21:25
21:25 hudnix_ left
pugs_svn r24568 | azawawi++ | [Syntax::Highlight::Perl6] Updated MANIFEST.SKIP 21:25
eric256 who runs lambdabot? 21:26
nm 21:28
21:28 hudnix_ joined 21:29 mberends left 21:30 alech left 21:32 alech joined
lichtkind eric256: thanks 21:34
eric256 yea i can't vouch for the veracity of that article though ;) being wikipedia and all
now i'm trying to figure out if i can write a irc bot in perl6 ;)
are network sockets working yet?
21:35 alech left 21:36 riffraff left 21:37 alech joined, riffraff joined
lichtkind eric256: no clue i just do p6 in theory 21:39
maybe ask moritz_ 21:40
eric256 wonders if he could build a class with embeded PIR to do network communication... 21:44
21:47 donaldh joined
cspencer eric256: pong! 21:50
eric256 hey. i was going to ask you to commit a fork to perl6-examples, but i figured out how to write a small perl5 script to login to github and add users as collaborators, now i just need a bot to listen in here and people should be able to do perl6-exampes:@add eric256 and add themselves ;) 21:51
just gotta figure out the bot part ;)
cspencer ah, great :)
eric256 anyone know of examples for including PIR in rakudo? 21:52
21:52 Aisling joined 21:53 alech_ joined 21:54 alech left
lichtkind eric256: ask jnthn :) 21:56
22:00 zev joined 22:01 alech_ left, alech joined
pmichaud eric256: including PIR in rakudo is just q:PIR { ... } 22:05
eric256: use %r for any return value you want from the q:PIR 22:06
eric256 thanks, yea i gotta get the http.pir example file working, then i should be able to start embeding it in a perl6 class ;) maybe
unfortunatly it appears that the example file doesn't even work at the moment 22:07
22:09 zev is now known as zev_, zev_ is now known as zev 22:10 eternaleye joined
cspencer pm: how do you propose infinite ranges should be represented when converted to strings for the time being? 22:10
pm: i think the test files for pugs have them as "(1, 2, 3, ..., Inf)"
eric256 wouldn't the whatever work there? (1,2,3,*, Inf) 22:12
cspencer eric256: i think the whatever gets converted to an Infinity of some sort in the process 22:13
so: (0..*) becomes (0..Inf)
not sure though
22:15 zev left, zev joined
zev hello again, all 22:16
is there any major difference between using .local variables and registers like $I0 in PIR?
PerlJam zev: .locals have meaningful names. 22:17
eric256 zev: you probably want #parrot on irc.perl.org for parrot questions, though a fair number of people are in both ;) 22:18
zev ok, but there isn't any reason not to use .locals? 22:20
PerlJam zev: no. 22:21
pmichaud cspencer: I don't have a proposal for representing ranges as strings.
cspencer ok
pmichaud cspencer: I suggest asking p6l. :-)
cspencer oh right, sorry, you'd suggested that this morning :/ 22:22
short term memory problem
zev PerlJam: thanks
pmichaud currently pugs represents them by eating up all memory. :-)
pugs: say ~(1..5);
p6eval pugs: OUTPUT«1 2 3 4 5␤»
pmichaud pugs: say ~(1..Inf); # wait a while
cspencer right, ok
p6eval pugs: No output (you need to produce output to STDOUT) 22:23
pmichaud "Whatever" gets converted to infinity if it's not inside of something that sets a context for the whatever
for example, @a[5..*] isn't an infinite list.
(unless @a is infinite)
cspencer right, ok
but (1..*) would be considered infinite 22:24
so the Whatever would become Inf
22:29 kisu joined
PerlJam It makes me wonder what Whatever() becomes 22:29
(the wrong thing I know)
but I read (1..*) as (1..whatever), so why not spell it that way (modulo syntax)
(1..Whatever()) doesn't work though 22:30
pmichaud "would become Inf" is probably wrong. "Evaluates as Inf" is more precise.
cspencer ah ok
pmichaud it still remains a Whatever object.
PerlJam: perhaps you meant Whatever.new() ? 22:31
PerlJam But that doesn't read as well :)
pmichaud neither of those read as well as (1..*) :-) 22:32
PerlJam Do you lose the syntactic * when a Range is constructed? Or can you just output "($range.from..$range.to)" ?
(I kind of thought it was lost) 22:33
pmichaud I don't quite understand "syntactic *"
when a Range is constructed, it just keeps its endpoints. 22:34
22:34 duke_leto joined
pmichaud rakudo: say (1..*).to.WHAT; 22:34
p6eval rakudo 34259: OUTPUT«Whatever␤»
PerlJam The string representation of a Range should be "($r.from..$r.to)" IMHO. But if the .to portion doesn't keep the "*", but is instead "+Inf" (or something), then we can't get "(1..*)" out of that. 22:35
22:35 pmurias left
pmichaud I don't think the string representation of a Range should be as you just gave 22:35
PerlJam er, "($r.from()..$r.to())" maybe 22:36
pmichaud that would mean: ~(1..5, 7) would stringify to "1..5 7"
PerlJam why not?
pmichaud if you're wanting a perlish representation of the Range, use .perl 22:37
PerlJam Hmm.
I guess so.
pmichaud rakudo: say *.perl; 22:38
p6eval rakudo 34259: 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)␤»
PerlJam Looks like a candidate for warning though. ("Are you *sure* you want to evaluate 1..* here?" :)
pmichaud yes, I did recommend earlier that stringifying an infinite range could produce a failure/warning. 22:39
eric256 rakudo: say (*).perl
p6eval rakudo 34259: OUTPUT«Method 'perl' not found for invocant of class 'Whatever'␤current instr.: '_block14' pc 64 (EVAL_13:38)␤»
pmichaud fixes.
22:39 hudnix_ left 22:42 Whiteknight joined 22:46 Limbic_Region joined, donaldh left 22:47 riffraff left
cspencer rakudo: say (0..Inf).perl 22:48
p6eval rakudo 34259: OUTPUT«0..inf␤»
zev how does one currently declare a regex in rakudo?
(or create anonymously)
pmichaud zev: / pattern / 22:51
zev: my $regex = /pattern/
eric256 rakudo: my $test = /a/; say 'hello" ~~ $test; 22:52
p6eval rakudo 34259: OUTPUT«Statement not terminated properly at line 1, near "'hello\" ~~"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
eric256 rakudo: my $test = /a/; say "hello" ~~ $test;
p6eval rakudo 34259: OUTPUT«␤»
eric256 rakudo: my $test = /a/; say "hello a" ~~ $test;
p6eval rakudo 34259: OUTPUT«a␤»
eric256 okay...that wasn't entirely what i expected ;) lol
pmichaud what did you expect?
zev hrm. it looks like the second form of subst doesn't quite work then
rakudo: say "foofoofoo".subst("foo", /bar/, :nth(2)) 22:53
p6eval rakudo 34259: OUTPUT«foo_block22foo␤»
eric256 i guess just true or false, but this is far more usefull.. bad perl5-- ;)
22:53 alech_ joined 22:54 alech left
pmichaud zev: you're trying to replace a string with a regex? 22:54
that's.... odd.
zev oh, whoops. I swapped the first and second args 22:55
pmichaud rakudo: say "foofoofoo".subst(/foo/, 'bar', :nth(2))
p6eval rakudo 34259: OUTPUT«foobarfoo␤»
eric256 ohh now thats spiffy
pmichaud rakudo: say "foofoofoo".subst(/foo/, 'bar', :nth(1|3))
zev but should it really put _block22 in there?
p6eval rakudo 34259: OUTPUT«barfoofoo␤»
pmichaud hmmm, that didn't work. oh well.
_block22 was the "name" of the regex.
Perhaps it should stringify differently. 22:56
But we're kinda stuck on subroutine types in parrot at the moment -- all we have is "Sub"
zev rakudo: say "foofoofoo".subst(/foo/, "bar", :nth(2))
p6eval rakudo 34259: OUTPUT«foobarfoo␤»
pmichaud and not an easy way to convert them to some other type.
22:59 DemoFreak left, DemoFreak joined
rakudo_svn r34260 | pmichaud++ | [rakudo]: Add .perl to Whatever. 23:00
23:01 bacek__ joined
eric256 rakudo: say "foofoofoo".subst(/foo/, 'bar', :nth(2,3)); 23:08
p6eval rakudo 34259: OUTPUT«Non-dwimmy hyperoperator cannot be used on arrays of different sizes or dimensions.␤current instr.: 'die' pc 14617 (src/builtins/control.pir:188)␤»
23:08 DemoFreak left
eric256 rakudo: say "foofoofoo".subst(/foo/, 'bar', :nth(2)); 23:08
p6eval rakudo 34259: OUTPUT«foobarfoo␤»
23:08 DemoFreak joined
zev is it perferable to attach a patch to an existing ticket or to create a new new ticket via email with the patch? 23:09
pmichaud attach to existing ticket. 23:10
zev ok
pmichaud perhaps change the subject to include [PATCH]
if you're worried that it won't get noticed.
23:11 hercynium left
zev I'm getting a bunch of lines like "Missing test file: t/spec/S29-list/pick.t" when I try to make spectest. I know I used to have to run some commands in t/, but I don't see scripts there anymore. what am I missing? 23:16
pmichaud try "svn up t/spec" 23:17
although "make spectest" is supposed to do that for you.
23:17 alech joined
zev it is up to date, but I'm still getting missing files 23:18
pmichaud try removing t/spec entirely, then do "make t/spec" and get a fresh checkout. 23:19
23:20 stephens joined
zev that worked. thanks 23:21
23:22 schmalbe left, gfldex_ left, alech_ left
zev what's the difference between the .t and .rakudo files? 23:25
23:26 adc_penner left
eric256 .rakudo are the same version of the .t file but fudged to work with rakudo 23:26
pmichaud .t are the original files. .rakudo are the files after .... what eric256++ said
eric256 that way a different perl6 implementation can use the same test files and fudge/skip different tests
23:26 DemoFreak left
pmichaud .rakudo are the files where #?rakudo skip "..." has been converted to comment out the skipped sections. 23:26
zev ah 23:27
23:27 DemoFreak joined
zev pugs question: is the git repository at git://github.com/audreyt/pugs.git kept in sync with svn? 23:32
err, I guess it doesn't actually matter because I don't think I can commit via git:// urls 23:33
23:39 lichtkind left 23:49 alech left 23:51 iblechbot left 23:52 vixey left 23:58 eric256 left