Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-07-11

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 cbk_ tann, yah TimToady is really good and knows allot of perl
00:00 TimToady #perl6 is the land of seeing accurately, and sometimes that makes one feel like crap
00:00 tann cbk_: of course, he does! ;)
00:00 * TimToady included
00:02 cbk_ rakudo: %petList($pet).kv -> $key, $value;
00:02 p6eval rakudo 02d0ed: OUTPUT«Statement not terminated properly at line 2, near "-> $key, $"␤in Main (src/gen_setting.pm:3340)␤»
00:03 cbk_ I just can't find a way or a good example on how to set a the value of a particular key
00:03 tann $pet_list{$pet} = "parrot";
00:03 tann oops
00:03 tann %pet_list{'parrot'} = 'miago';
00:04 tann rakudo: my %pet_list; %pet_list{parrot} = 'miago'; say %pet_list.perl;
00:04 p6eval rakudo 02d0ed: OUTPUT«Could not find non-existent sub parrot␤»
00:04 tann rakudo: my %pet_list; %pet_list{'parrot'} = 'miago'; say %pet_list.perl;
00:05 p6eval rakudo 02d0ed: OUTPUT«{"parrot" => "miago"}␤»
00:05 cbk_ I was getting an error like that earlier
00:05 TimToady do autoquoting with <parrot> instead of {parrot} in p6
00:05 tann so p6 no longer stringifies hash keys
00:05 tann s/no longer/does not/
00:05 tann like p5
00:05 TimToady well, that's an odd way to say it
00:05 TimToady by default, hash keys still are strings
00:06 TimToady but the autoquoting rules are revised
00:06 eternaleye tann: <stuff> is like qw/stuff/, and <<stuff>> is like qqw/stuff/
00:06 eternaleye (not sure about the last)
00:06 TimToady you still get autoquoting on =>, as in parrot => 'miago'
00:06 TimToady but not inside {}
00:06 TimToady we use separate syntax for string keys now %pet_list<parrot>
00:06 eternaleye (in anycase, <<stuff>> is doublequoted splits-on-whitespace)
00:07 TimToady <stuff> splits on whitespace too
00:07 TimToady <<stuff>> also allows shell-style quoting and interpolation
00:08 tann rakudo: my %list<parrot dog mouse> = <miago pluto micky>; say %list.perl;
00:08 p6eval rakudo 02d0ed: OUTPUT«Could not find non-existent sub mouse␤»
00:08 eternaleye TimToady: Hence my originally saying it was like qw//, I was making the distinction between <stuff> and <<stuff>> as being singlequoting : doublequoting
00:08 TimToady yes, to the first approximation
00:09 TimToady but << foo "bar baz" "$x" >> will certain have exactly three elements
00:09 TimToady regardless of how many words are in $x
00:09 cbk_ well how do handle something like where the value is a number and you want to increment that value? Like $value = $value + 1
00:09 eternaleye Nice, I wasn't aware of that!
00:09 TimToady well, that would work
00:10 cbk_ the key is the name of the pet and the value is the number of votes
00:10 TimToady but often people use autoincrement
00:10 TimToady which is $value++
00:10 eternaleye cbk_: see also $v += 1 and $v++ and ++$v
00:10 TimToady all of which work as in C
00:11 TimToady rakudo: my $value = 0; say ++$value
00:11 p6eval rakudo 02d0ed: OUTPUT«1␤»
00:11 tann rakudo: my $x = "aaa"; say ++$x;
00:11 p6eval rakudo 02d0ed: OUTPUT«aab␤»
00:12 TimToady showoff :)
00:12 cbk_ %pet_list; %pet_list{'parrot'} = 'miago'; this sets the key but I want find the key then do a $value++
00:12 cbk_ on that key
00:12 tann %pet_list<parrot>++;
00:12 TimToady which ends up with 'miagp' :)
00:13 cbk_ TimToady, I was hoping it woud be that easy :(
00:13 TimToady or do you want miago to have a number that  you increment?
00:13 tann rakudo: my %list = (parrot => 0); %list<parrot>; say %list<parrot>
00:13 p6eval rakudo 02d0ed: OUTPUT«0␤»
00:13 TimToady %pet_list<parrot><miago>++
00:14 M_o_C joined #perl6
00:14 tann rakudo: my %list = (parrot => 0); %list<parrot>++; say %list<parrot>
00:14 p6eval rakudo 02d0ed: OUTPUT«1␤»
00:14 cbk_ what does OUTPUT <<1>> mean from p6eval?
00:15 TimToady it means that's the current value of %list<parrot>
00:15 tann melikes <> .. qw() just urgg...timtoady's thing
00:15 TimToady as seen by the 'say' command
00:15 timbunce What's the rakudo equivalent of perl5's -I option to add directories to the search path? I can't seem to find one.
00:15 TimToady it's possible it pays attention to PERL6LIB
00:16 tann cbk_: <<1>> is just the output format of p6eval...rakudo evaluates the code .. and in this case, it sees %list<parrot> has a value of 1
00:17 timbunce I see PERL6LIB in src/builtins/globals.pir - great. That'll do for now. Thanks
00:17 TimToady if it works :)
00:17 cbk_ ok
00:17 tann if it doesn, try again..rakudo is known to be very disagreeable as pmichaud said
00:19 tann i'm getting all excited..looks like tim is hacking on dbi 2.0 for p6
00:20 Sunbeam joined #Perl6
00:20 Sunbeam[Pinged] joined #Perl6
00:20 timbunce If someone could add line number info to the "Use of type object as value" error I'd be grateful.
00:21 eternaleye rakudo: ( '!edHllo owr,l'.comb Z ( 12, 1, 11, 0, 2, 3, 4, 6, 8, 7, 9, 5, 10 ) ).map( {; $^b => $^a } ).sort.map( *.value ).say
00:21 p6eval rakudo 02d0ed:  ( no output )
00:21 eternaleye rakudo: ( '!edHllo owr,l'.comb Z ( 12, 1, 11, 0, 2, 3, 4, 6, 8, 7, 9, 5, 10 ) ).map( {; $^b => $^a } ).sort.map( *.value ).say
00:21 p6eval rakudo 02d0ed: OUTPUT«Hello, world!␤»
00:22 cbk_ eternaleye: nice!
00:22 tann moritz_: tim is calling you out
00:32 cbk_ TimToady, yes miago was really just going to be a number not a word, and that way I want to add to it. this hash represents the number of votes a pet gets. like dog would be the key and 1 would be the value. and then we also have bird with a value of 2
00:34 cbk_ would I have to pull out the key/values out first then find the matching key and then ++ the value?
00:35 TimToady what are you imagining when you say "pull out"?
00:35 buubot joined #perl6
00:35 TimToady the whole point of associative arrays is to avoid dealing with all the elements
00:36 cbk_ like using a for loop to find the matching key and then use kv to put values into $key and $value then just use $key and $value to update the %hash ?
00:37 TimToady rakudo: my %votes; my $pet = 'parrot'; %votes{$pet}++; %votes{$pet}++; say %votes.perl
00:37 p6eval rakudo 02d0ed:  ( no output )
00:37 TimToady rakudo: my %votes; my $pet = 'parrot'; %votes{$pet}++; %votes{$pet}++; say %votes.perl
00:37 p6eval rakudo 02d0ed:  ( no output )
00:37 TimToady hmm, probably recompiling
00:38 TimToady but yes, any time you find yourself iterating over the keys of a hash to find a particular entry, you're misusing hashes
00:39 TimToady it would be like looking at all the indexes of an array to see which one is 5 when you already know you want @array[5] directly
00:39 cbk_ TimToady, this is what I was trying to do before I knew I could do something like this %petList<dog>++ (I know this only changes the key)
00:39 TimToady it changest the value corresponding to the key
00:39 TimToady *changes
00:39 TimToady it doesn't change the key, which is still 'dog'
00:40 TimToady that is how we prefer to say it
00:42 TimToady rakudo: my %votes; my $pet = 'parrot'; %votes{$pet}++; %votes{$pet}++; say %votes.perl
00:42 p6eval rakudo 02d0ed: OUTPUT«{"parrot" => 2}␤»
00:42 cbk_ well i was going to do something like this: get the key/value for pet in question then do %petList<$value><$key>++
00:43 TimToady which won't work at all
00:43 TimToady because <> *quotes*
00:43 TimToady use {} for normal subscripting with a variable
00:43 cbk_ ok
00:44 TimToady but I don't understand why you're trying to subscript using $value anyway
00:44 TimToady what do you think it refers to?
00:45 TimToady and why are you using a value as a key?
00:45 cbk_ well I was just trying to solve my increment the value problem any way I could
00:45 TimToady you need to think about these things clearly; you can't just type random code and hope it works
00:46 TimToady the value is the destination, it's not the path to the destination
00:46 TimToady all you have to do to find the destination is talk about the path to the destination
00:47 TimToady the value will automatically be there at the end of the path
00:47 cbk_ It seams like most of the perl 6 examples on the net don't work because they are out of date :( thats why I was trying other things
00:47 TimToady so %votes{$pet} is all you need to get to the number of votes for that particular key
00:48 cbk_ oh!
00:48 TimToady rakudo: my %votes; for <parrot dog fish dog cat dog parrot> -> $pet { %votes{$pet}++; }; say %votes.perl
00:48 p6eval rakudo 02d0ed: OUTPUT«{"parrot" => 2, "dog" => 3, "fish" => 1, "cat" => 1}␤»
00:49 TimToady rakudo: my %votes; for <parrot dog fish dog cat dog parrot> -> $pet { %votes{$pet}++; }; say %votes<dog>
00:49 p6eval rakudo 02d0ed: OUTPUT«3␤»
00:50 TimToady rakudo: my %votes; for <parrot dog fish dog cat dog parrot> -> $pet { %votes{$pet}++; }; say %votes{'dog'} # same thing
00:50 p6eval rakudo 02d0ed: OUTPUT«3␤»
00:51 cbk_ that looks like it works.  let me digest it for about a hour. :)
00:51 TimToady have the appropriate amount of fun :)
00:53 cbk_ TimToady, by the way I'm only working on perl 6 programs like this because the lack of them on the net. will post all my perl 6 examples to my website: http://independentcomputing.biz/
00:54 cbk_ watch out I have a html 5 <video> which has a auto plays there and is quite annoying
00:54 cbk_ sorry
00:56 literal there's also a perl6-examples repository on github which you might want to contribute to
00:57 literal http://github.com/perl6/perl6-examples/tree/master
00:57 cbk_ well I wanted to at least get some working examples there first.  I have been using the gethub example page for most of my perl 6 examples
00:59 cbk_ by the way, When wizard.pl was the reason I started all this.  I would like to get that to work in perl 6!
00:59 cbk_ looks like fun!
01:01 tann cbk_: you might wanna format your code within html tags such as <code> ... </code> or <pre>...</pre> so the indentation doesn't get all messed up
01:02 cbk_ tann, thats a drupl thing :( I
01:02 cbk_ i'm using a out of the box theme and have not the time to fix it
01:03 tann cbk_: doesn't it give you the option to do html tags? it shoud
01:03 tann no
01:03 cbk_ the code is in fact in side <code> tags
01:03 tann in the editor, there should be an option to switch to raw html
01:04 cbk_ yes it does all my post are made as full html
01:04 tann replace code by pre
01:04 cbk_ with code inside <code></code> tags
01:04 tann and see if it properly formats your code
01:04 cbk_ ok
01:05 alester joined #perl6
01:08 cbk_ tann, that worked! thanks much.  (Now I have to set my tab size to like 2 or 3 spaces)
01:11 tann cbk_: what's petReq for?
01:12 cbk_ pet request list. ( a pet has to be requested 3 times before it get on the available list.
01:13 cbk_ I know it's kinda of a useless example but I think it will help others learn perl 6 and show some more completed things
01:14 tann rakudo: my %h = (a => 1, b => 2); my $v = %h.delete('a'); say $v; say %h.perl;
01:14 p6eval rakudo 02d0ed: OUTPUT«1␤{"b" => 2}␤»
01:14 cbk_ I have a non OO version that does work and now the OO version is kicking my butt
01:16 cbk_ please don use the code thats on my site now.  It was a early version and was not really complete.  I need to update that.  (After dinner) brb
01:16 last joined #perl6
01:20 cls_bsd joined #perl6
01:21 tann rakudo: class PetList { my %petList; method checkList(Int $petID) { if ++%petList{$petID} > 2 { say "you can have this pet $petID" } else { say "not yet: $petID" }  } };
01:21 p6eval rakudo 02d0ed:  ( no output )
01:22 tann cbk_: ^^^ along those lines
01:29 eternaleye rakudo: class PetList( has %.petlist; method checkList( Str $petType ) { ++%petList{$petType} > 2 ??  say "Sure, you can have a $petType!" !! say "You're the fifth person I've told today, we don't stock that as there's no call for it!"; } }; my $list = PetList.new; for <dog cat budgie parakeet dog elephant dog> -> $pet { $list.checkList( $pet) };
01:29 p6eval rakudo 02d0ed: OUTPUT«Unable to parse class definition at line 2, near "( has %.pe"␤in Main (src/gen_setting.pm:1490)␤»
01:29 eternaleye rakudo: class PetList { has %.petlist; method checkList( Str $petType ) { ++%petList{$petType} > 2 ??  say "Sure, you can have a $petType!" !! say "You're the fifth person I've told today, we don't stock that as there's no call for it!"; } }; my $list = PetList.new; for <dog cat budgie parakeet dog elephant dog> -> $pet { $list.checkList( $pet) };
01:29 p6eval rakudo 02d0ed: OUTPUT«Symbol '%petList' not predeclared in checkList (/tmp/x8hcNK1R1P:2)␤in Main (src/gen_setting.pm:3340)␤»
01:29 eternaleye rakudo: class PetList { has %.petList; method checkList( Str $petType ) { ++%petList{$petType} > 2 ??  say "Sure, you can have a $petType!" !! say "You're the fifth person I've told today, we don't stock that as there's no call for it!"; } }; my $list = PetList.new; for <dog cat budgie parakeet dog elephant dog> -> $pet { $list.checkList( $pet) };
01:29 p6eval rakudo 02d0ed: OUTPUT«Symbol '%petList' not predeclared in checkList (/tmp/W7dc5ARxJt:2)␤in Main (src/gen_setting.pm:3340)␤»
01:29 eternaleye rakudo: class PetList { has %.petList; method checkList( Str $petType ) { ++%.petList{$petType} > 2 ??  say "Sure, you can have a $petType!" !! say "You're the fifth person I've told today, we don't stock that as there's no call for it!"; } }; my $list = PetList.new; for <dog cat budgie parakeet dog elephant dog> -> $pet { $list.checkList( $pet) };
01:29 p6eval rakudo 02d0ed: OUTPUT«You're the fifth person I've told today, we don't stock that as there's no call for it!␤You're the fifth person I've told today, we don't stock that as there's no call for it!␤You're the fifth person I've told today, we don't stock that as there's no call for it!␤You're the
01:29 p6eval ..fifth p…
01:29 eternaleye Drat, too many
01:30 eternaleye rakudo: class PetList { has %.petList; method checkList( Str $petType ) { ++%.petList{$petType} > 2 ??  say "Sure, you can have a $petType!" !! say "You're the fifth person I've told today, we don't stock that as there's no call for it!"; } }; my $list = PetList.new; for <dog cat dog elephant dog> -> $pet { $list.checkList( $pet) };
01:30 p6eval rakudo 02d0ed: OUTPUT«You're the fifth person I've told today, we don't stock that as there's no call for it!␤You're the fifth person I've told today, we don't stock that as there's no call for it!␤You're the fifth person I've told today, we don't stock that as there's no call for it!␤You're the
01:30 p6eval ..fifth p…
01:30 eternaleye rakudo: class PetList { has %.petList; method checkList( Str $petType ) { ++%.petList{$petType} > 2 ??  say "Sure, you can have a $petType!" !! say "We don't have any $petType."; } }; my $list = PetList.new; for <dog cat dog elephant dog> -> $pet { $list.checkList( $pet) };
01:30 p6eval rakudo 02d0ed: OUTPUT«We don't have any dog.␤We don't have any cat.␤We don't have any dog.␤We don't have any elephant.␤Sure, you can have a dog!␤»
01:31 eternaleye cbk_: tann: ^^^
01:31 cbk_ eternaleye, I'm looking at now....
01:37 FurnaceBoy joined #perl6
01:39 cbk_ eternaleye, I REALLY like how you did that checkList method! I was trying to keep %petList inside the class though to keep the data private.  but it looks like this is the easiest way
01:41 eternaleye cbk_: It is inside the class - in a class, 'my' declares a static variable and 'has' declares an instance variable IIRC
01:42 eternaleye rakudo: class PetList { has %.petList; method checkList( Str $petType ) { ++%.petList{$petType} > 2 ??  say "Sure, you can have a $petType!" !! say "We don't have any $petType."; } }; say %.petList
01:42 p6eval rakudo 02d0ed: OUTPUT«Lexical 'self' not found␤»
01:42 eternaleye rakudo: class PetList { has %.petList; method checkList( Str $petType ) { ++%.petList{$petType} > 2 ??  say "Sure, you can have a $petType!" !! say "We don't have any $petType."; } }; say %petList
01:42 p6eval rakudo 02d0ed: OUTPUT«Symbol '%petList' not predeclared in <anonymous> (/tmp/aCcLp0D1rl:2)␤in Main (src/gen_setting.pm:3340)␤»
01:42 cbk_ eternaleye, oh sorry would help if i was viewing the whole thing.
01:42 eternaleye What's more, it autogenerates an accessor
01:43 eternaleye rakudo: class PetList { has %.petList; method checkList( Str $petType ) { ++%.petList{$petType} > 2 ??  say "Sure, you can have a $petType!" !! say "We don't have any $petType."; } }; PetList.new.petList.say
01:43 p6eval rakudo 02d0ed: OUTPUT«␤»
01:44 eternaleye rakudo: class PetList { has %.petList; method checkList( Str $petType ) { ++%.petList{$petType} > 2 ??  say "Sure, you can have a $petType!" !! say "We don't have any $petType."; } }; my $list = PetList.new; $list.checkList( 'dog' ); list.checkList( 'cat' ); $list.petList.perl.say
01:44 p6eval rakudo 02d0ed: OUTPUT«We don't have any dog.␤Method 'checkList' not found for invocant of class 'List'␤»
01:44 eternaleye rakudo: class PetList { has %.petList; method checkList( Str $petType ) { ++%.petList{$petType} > 2 ??  say "Sure, you can have a $petType!" !! say "We don't have any $petType."; } }; my $list = PetList.new; $list.checkList( 'dog' ); list.checklist( 'cat' ); $list.petList.perl.say
01:44 p6eval rakudo 02d0ed: OUTPUT«We don't have any dog.␤Method 'checklist' not found for invocant of class 'List'␤»
01:44 eternaleye rakudo: class PetList { has %.petList; method checkList( Str $petType ) { ++%.petList{$petType} > 2 ??  say "Sure, you can have a $petType!" !! say "We don't have any $petType."; } }; my $list = PetList.new; $list.checkList( 'dog' ); $list.checkList( 'cat' ); $list.petList.perl.say
01:44 p6eval rakudo 02d0ed: OUTPUT«We don't have any dog.␤We don't have any cat.␤{"dog" => 1, "cat" => 1}␤»
01:45 eternaleye 'has' is kind of a special declarator: $.variable is an attribute with an accessor, 'is rw' adds a mutator, and $!variable is a private attribute.
01:47 eternaleye Although... It might be that it's not 'has' that does the magic, and it would work for static attributes too. I'm not sure; I'll go read the spec
01:48 eternaleye cbk_: so you could change %.petList to %!petList if you wanted it to be a private attribute
01:48 cbk_ eternaleye, yah I had that in one of my first try's but removed them because errors. but now that I know it does I will put it back in.
02:57 starc_ joined #perl6
03:18 starc_ left #perl6
03:25 ihrd joined #perl6
03:29 ihrd left #perl6
03:45 azawawi joined #perl6
03:52 azawawi good morning
03:54 r696 joined #perl6
03:59 TimToady howdy
04:04 azawawi std: =$fh
04:04 p6eval std 27503: OUTPUT«##### PARSE FAILED #####␤Illegal pod directive at /tmp/VufZL1LYU2 line 1:␤------> [32m=[31m$fh[0m␤    expecting pod_comment␤FAILED 00:02 35m␤»
04:05 azawawi std: =$fh =end
04:05 p6eval std 27503: OUTPUT«##### PARSE FAILED #####␤Illegal pod directive at /tmp/HzQXUiMsbe line 1:␤------> [32m=[31m$fh =end[0m␤    expecting pod_comment␤FAILED 00:02 35m␤»
04:06 azawawi std: =begin =$fh =end
04:06 p6eval std 27503: OUTPUT«##### PARSE FAILED #####␤Unrecognized token after =begin at /tmp/lOth4SDpQ9 line 1:␤------> [32m=begin [31m=$fh =end[0m␤FAILED 00:02 35m␤»
04:06 azawawi TimToady: how can i get trigger the error "Obsolete pod format, please use =begin/=end instead" for =$fh
04:07 amoc joined #perl6
04:08 TimToady std: =head1 Foo␤␤stuff␤␤=cut
04:08 p6eval std 27503: OUTPUT«##### PARSE FAILED #####␤Obsolete pod format, please use =begin/=end instead at /tmp/ofNHJzP69w line 1:␤------> [32m=[31mhead1 Foo[0m␤    expecting pod_comment␤FAILED 00:02 35m␤»
04:08 alester joined #perl6
04:10 azawawi TimToady: thx
04:16 eternaleye std: ␠=$fh
04:16 p6eval std 27503: OUTPUT«##### PARSE FAILED #####␤Can't understand next input--giving up at /tmp/GkwZsx3Btm line 1:␤------> [32m[31m␠=$fh[0m␤    expecting any of:␤  prefix or noun␤   statement end␤    statement list␤   whitespace␤FAILED 00:02 36m␤»
04:17 eternaleye std: ␠say "hello";
04:17 p6eval std 27503: OUTPUT«##### PARSE FAILED #####␤Can't understand next input--giving up at /tmp/ku4OQBBYoZ line 1:␤------> [32m[31m␠say "hello";[0m␤    expecting any of:␤  prefix or noun␤   statement end␤    statement list␤   whitespace␤FAILED 00:02 36m␤»
04:17 azawawi TimToady: what's the purpose of STASH.pm ?
04:18 eternaleye Hm. It seems there is nothing similart to the newline escaping going on for spaces. That makes it kinda difficult to avoid embedded comments in the first column and 'ancient iteration' being parsed as Pod
04:19 sri_kraih_ joined #perl6
04:21 TimToady sorry, had to go out and watch the ISS fly over :)
04:21 azawawi have fun
04:22 TimToady STASH is the object representing a symbol table
04:22 TimToady either lexical or package
04:29 eternaleye joined #perl6
04:33 synth joined #perl6
04:54 kate21de joined #perl6
04:55 tann joined #perl6
04:57 azawawi joined #perl6
04:58 azawawi TimToady: while trying to make S:H:P6 use the latest STD, I stumbled across this scoping problem: http://gist.github.com/145079
04:59 synthEEEE joined #perl6
05:31 tann rakudo: my Int @a = [1, 2]; say @a.perl;
05:31 p6eval rakudo 02d0ed: OUTPUT«Array assignment type check failed; expected Int, but got Array␤in Main (/tmp/KTJRaXx1bU:2)␤»
05:32 tann std: my Int @a = [1];
05:32 p6eval std 27503: OUTPUT«ok 00:02 37m␤»
05:35 kane_ joined #perl6
05:44 xinming_ joined #perl6
05:51 cls_bsd joined #perl6
06:11 xinming joined #perl6
06:17 literal rakudo: my Int @a = 1, 2; say @a.perl;
06:17 p6eval rakudo 02d0ed: OUTPUT«[1, 2]␤»
06:17 literal rakudo: my Array @a = [1, 2]; say @a.perl;
06:17 p6eval rakudo 02d0ed: OUTPUT«[[1, 2]]␤»
06:18 tann rakudo: my Int $x = (1..6).pick
06:18 p6eval rakudo 02d0ed: OUTPUT«Assignment type check failed; expected Int, but got Array␤in Main (/tmp/4GC7XjQvbN:2)␤»
06:21 tann rakudo: my $x = (1..6).pick; say $x;
06:21 p6eval rakudo 02d0ed: OUTPUT«2␤»
06:25 masak joined #perl6
06:25 masak morning, PIR-camels!
06:26 xinming_ joined #perl6
06:32 masak std: Statbuf
06:32 p6eval std 27503: OUTPUT«Undeclared name:␤      Statbuf used at 1 ␤ok 00:02 36m␤»
06:32 masak TimToady: ^
06:36 tann std: my Int $x = (1..6).pick;
06:36 p6eval std 27503: OUTPUT«ok 00:02 37m␤»
06:37 masak std: my Int $x = 'bulbous bouffant';
06:37 p6eval std 27503: OUTPUT«ok 00:02 37m␤»
06:37 * masak cackles
06:37 tann uh oh
06:38 masak tann: note that STD.pm only performs _syntactic_ checks
06:39 tann masak: why my Int $x = 0, 1;  ok but not my Int $x = [0, 1]; nor my Int $x = (1..5).pick  ?
06:39 tann s/$x/@x/
06:40 tann and pick was a wrong example
06:40 masak because in the second case, you try to assign an Array to an Int.
06:42 masak the third case might not work for similar reasons.
06:42 masak I tend to write .pick[0] just to be sure.
06:42 Su-Shee joined #perl6
06:42 Su-Shee hi
06:42 tann ah
06:42 tann tricky here
06:42 masak Su-Shee: \o
06:43 masak tann: as soon as you introduce types, things get very precise :)
06:43 tann so with my Int @x = [0, 1]; @x[0] <= [0, 1]
06:43 tann ?
06:44 masak tann: oh, you had a @ sigil in that example too?
06:44 masak well, that changes things.
06:44 tann so for typed arrays, lists are mandatory?
06:44 masak now you're trying to assign an Array to the first place of an Array[Int], which will also fail.
06:44 tann rakudo: my Int @x = [0, 1];
06:44 p6eval rakudo 02d0ed: OUTPUT«Array assignment type check failed; expected Int, but got Array␤in Main (/tmp/H2cQUCTggF:2)␤»
06:44 masak rakudo: my Int @x = 0, 1;
06:44 p6eval rakudo 02d0ed:  ( no output )
06:45 masak tann: that's how you do it.
06:45 tann oh man
06:45 masak tann: calm down, it'll settle soon. :)
06:45 tann methinks, novices will get confused
06:45 masak tann: it sure confused me.
06:45 masak but mainly 'cause I have Perl 5 baggage.
06:46 tann i'm afraid it's sorta the same syndrome as my @x; $x[0] = 'urg'; in p5
06:46 masak uj, gotta go. see y'all later.
06:47 masak tann: no, I don't agree.
06:47 xinming joined #perl6
06:54 iblechbot joined #perl6
07:03 finanalyst joined #perl6
07:03 frew joined #perl6
07:07 renormalist joined #perl6
07:08 omega joined #perl6
07:08 Helios joined #perl6
07:09 gfldex joined #perl6
07:09 SmokeMachine joined #perl6
07:09 christine joined #perl6
07:09 gbacon joined #perl6
07:09 drbean joined #perl6
07:09 simcop2387 joined #perl6
07:09 s1n joined #perl6
07:09 cxreg joined #perl6
07:10 drbean joined #perl6
07:10 christin1 joined #perl6
07:11 tann rakudo: sub foo { return 1, 2, 3; }; my @a = foo(); say @a.perl
07:11 p6eval rakudo 02d0ed: OUTPUT«too many arguments passed (3) - at most 1 param expected␤in sub foo (/tmp/KHAVWHkT8z:2)␤called from Main (/tmp/KHAVWHkT8z:2)␤»
07:12 mberends joined #perl6
07:13 frew_ joined #perl6
07:16 tann rakudo: sub foo { return list 1, 2, 3 }; my @a = foo(); say @a.perl;
07:16 p6eval rakudo 02d0ed: OUTPUT«[1, 2, 3]␤»
07:19 tann rakudo: my @a; say @a ~~ [] ?? 'void' !! 'filled';
07:19 p6eval rakudo 02d0ed: OUTPUT«void␤»
07:28 tann rakudo: my @evens = (1..10).grep: { $_ % 2 == 0 }; say @evens.perl
07:28 p6eval rakudo 02d0ed: OUTPUT«[2, 4, 6, 8, 10]␤»
07:30 tann rakudo: my @evens = 0, 2 ... 100 [+];
07:30 p6eval rakudo 02d0ed: OUTPUT«Statement not terminated properly at line 2, near "[+];"␤in Main (src/gen_setting.pm:3340)␤»
07:31 eternaleye tann: THe syntax for that is my @evens = 0, 2 ... &[+]; but we don't do laziness yet
07:32 eternaleye the & 'noun-ifies' the + operator, but as-is you have to return an empty list eventually in the closure or it runs forever
07:32 tann my @a = 1..3.grep: { $_ % 2 }; say @a.perl;
07:32 eternaleye tann: But even that doesn't do what you want
07:33 eternaleye Since it would give 0, 2, 2, 4, 6, 10, etc
07:33 tann eternaleye: yes..i noticed that :)
07:34 eternaleye Although, .. supports a :by adverb
07:34 eternaleye 2 .. 10 :by(2)
07:34 tann does rakudo support that now?
07:34 eternaleye Not sure
07:34 tann last time i checked it didn't
07:34 eternaleye rakudo: .say for 2 .. 10 :by(2);
07:34 p6eval rakudo 02d0ed: OUTPUT«Statement not terminated properly at line 2, near ":by(2);"␤in Main (src/gen_setting.pm:3340)␤»
07:34 eternaleye pugs: .say for 2 .. 10 :by(2);
07:34 p6eval pugs: OUTPUT«*** ␤    Unexpected ":by"␤    expecting operator␤    at /tmp/w8x3PgIvDK line 1, column 18␤»
07:36 tann what's a readable way of checking if a list/array is empty?  @a ~~ []  vs @a vs  @a.elems == 0   etc..
07:36 eternaleye rakudo: my @a = 1,2,3; my @b = (); say @a.empty; say @b.empty
07:36 p6eval rakudo 02d0ed: OUTPUT«Method 'empty' not found for invocant of class 'Perl6Array'␤»
07:37 eternaleye tann: Actually, just an 'if' on .elems works, since 0 ~~ Bool::False
07:37 tann s32 mentions elems for arrays
07:37 eternaleye rakudo: my @a = 1,2,3; my @b = (); say @a.elems; say @b.elems
07:37 p6eval rakudo 02d0ed: OUTPUT«3␤0␤»
07:38 tann eternaleye: i am inspired by scala's and erlang's quicksort showoff in wikipedia
07:39 tann so, i hacked out a working quicksort (abeit extremely naive) for p6
07:39 tann scalar and erlang checks for empty list are quite intuitive
07:40 tann such as if list is []
07:40 tann or list is Nil etc...
07:40 tann so i was wondering what the most readable way of checking empty list in p6
07:40 eternaleye rakudo: my @a = 1,2,3; my @b = (); say @a ~~ Nil; say @b ~~ Nil
07:40 p6eval rakudo 02d0ed: OUTPUT«0␤0␤»
07:41 eternaleye (Nil is real in Perl 6, but it 'becomes' undef, the empty list, etc. as necessary
07:41 tann ya know i wanna sell p6 to novices so cryptic stuff like  return @list unless @list is avoided :)
07:41 eternaleye tann: return @list if +@list? one more character, and it makes it clear that you're looking at it numerically
07:42 tann i think that would scare novices even more :)
07:42 eternaleye s/if/unless/
07:42 tann i wanna convert php people to p6!!!
07:42 eternaleye tann: return @list unless ?@list - forces boolean context
07:43 Su-Shee tann: "uhoh" :)
07:43 tann return @list unless @list.elems;
07:43 tann something like that
07:43 tann ya know
07:43 tann :)
07:43 Matt-W well you can do that, sure
07:43 eternaleye tann: TIMTOWTDI
07:44 tann yes, but there's also PBP :)
07:44 eternaleye ?
07:44 tann damian's bible perl best practices
07:44 eternaleye AH
07:45 lisppaste3 tann pasted "naive quicksort" at http://paste.lisp.org/display/83406
07:46 Matt-W perl best practices in perl 6 will be different
07:46 tann i wanna put a naive quicksort in wikipedia to counter those of scalar and erlang
07:46 eternaleye For instance, use strict is the default
07:47 tann unlike the examples of scalar and erlang, this actually works :P
07:48 Matt-W that's always a good start
07:48 eternaleye Hmm, eight more days untill the anniversary of the Perl 6 design process being announced
07:48 eternaleye *until
07:49 Matt-W it doesn't matter! all that matters is the date of christmas
07:49 tann agree with matt-w :)
07:52 Su-Shee well I still take p6 even if it's released on easter. ;)
07:53 Matt-W except of course we don't know that date yet, so...
07:53 Su-Shee I don't think that the release date this or next year is really what's important for the success of p6.
07:54 Matt-W what's really important is that when we say 'here is Perl 6.0.0', it's really really good
07:55 Su-Shee well it has to be adopted by people. and after some discussions yesterday I get the impression, that many non-perl-people seem to be very interested.
07:56 Su-Shee I always thought p6 would be the next-generation language for p5 people..
07:57 Matt-W p5 people can be very stubborn
07:57 Matt-W personally I can't wait to migrate, but...
07:57 Matt-W of course it'd help a lot if we ever manage to get a perl5-on-parrot to help migration
07:57 Su-Shee I put very much hope on the parrot-rakudo duo and the extensibility.
07:59 Su-Shee put hope in? anyway. if perl6 is smooth and easy to use and has great bindings, people will buy it. :)
07:59 tann perl gods, please end my misery with an early christmas
07:59 Matt-W Patches please the Perl gods
08:00 Su-Shee :)
08:01 tann rakudo: my @a = 1..5; @a.pick(1, :repl); say @a.perl;
08:01 p6eval rakudo 02d0ed: OUTPUT«[1, 2, 3, 4, 5]␤»
08:01 tann rakudo: my @a = 1..5, @a.pick(*, :repl); say @a.perl;
08:02 p6eval rakudo 02d0ed: OUTPUT«Infinite lazy pick not implemented␤in Main (/tmp/NtBnaNWWwD:2)␤»
08:03 tann rakudo: my @a = 1..5.pick(2, :repl); say @a.perl;
08:03 p6eval rakudo 02d0ed: OUTPUT«[1, 2]␤»
08:08 eternaleye Matt-W: It does matter, it means we get to bake a cake for Camelia!
08:09 rfordinal joined #perl6
08:11 eternaleye Also, regarding p5-on-Parrot, ISTR TimToady working on something called MAD[props]? in the existing p5 compiler that spit out the internal state in what is essentially an annotated XML AST for p5
08:11 buubot joined #perl6
08:12 beggars joined #perl6
08:14 rfordinal left #perl6
08:23 ejs joined #perl6
08:29 tann rakudo: my @a = 1..5; say @a.delete(3); say @a.perl;
08:29 p6eval rakudo 02d0ed: OUTPUT«4␤Null PMC access in isa()␤in method Any::map (src/gen_setting.pm:191)␤called from method List::perl (src/gen_setting.pm:921)␤called from Main (/tmp/f9nhzVveZa:2)␤»
08:30 tann rakudo: my @a = 1..5; say delete @a[3]; say @a.perl;
08:30 p6eval rakudo 02d0ed: OUTPUT«No applicable candidates found to dispatch to for 'delete'␤in Main (/tmp/dKQPXRuvTm:2)␤»
08:43 finanalyst rakudo: my @a = 1..5; say @a[3].delete; say @a.perl
08:43 p6eval rakudo 02d0ed: OUTPUT«Method 'delete' not found for invocant of class 'Int'␤»
08:48 jauaor joined #perl6
08:53 jauaor :)
08:58 kate21de1 joined #perl6
09:13 nickname joined #perl6
09:32 cookys joined #perl6
09:47 last joined #perl6
09:50 meppl joined #perl6
10:09 molaf joined #perl6
10:12 davef joined #perl6
10:19 davef Hi - why does 'method getGlobalTransactionId( --> Array of Int ) { ... } ' (within a role) - warn of 'Use of type object as value'?
10:31 DemoFreak joined #perl6
10:52 masak joined #perl6
10:55 masak rakudo: my @a = 0..1; @a.delete(0); say @a.perl
10:55 p6eval rakudo 02d0ed: OUTPUT«Null PMC access in isa()␤in method Any::map (src/gen_setting.pm:191)␤called from method List::perl (src/gen_setting.pm:921)␤called from Main (/tmp/tFTw79p6Cl:2)␤»
10:55 * masak submits rakudobug
10:57 masak rakudo: my @a = 0..1; @a[0] = undef; say @a.perl
10:57 p6eval rakudo 02d0ed: OUTPUT«[undef, 1]␤»
10:58 masak my bet is that .delete does something naughty.
10:58 icwiener joined #perl6
10:59 mberends masak: \o
10:59 masak mberends: ahoj!
11:00 masak mberends: I have now used up the first box of diverse condiments you gave me. thank you.
11:00 mberends had some for breakfast :)
11:01 masak mberends: casting a glance at the second box, I noticed that it says 'stamped little mice' on it. I was first alarmed, then amused.
11:01 masak let's see if I get it right from memory: 'gestampte muisjes', yes?
11:03 mberends exactly :) http://nl.wikipedia.org/wiki/Gestampte_muisjes
11:03 masak 'broodbeleg' :)
11:03 Su-Shee ok, I know some dutch, but I better check on gestampte muisjes.. :)
11:04 Whiteknight joined #perl6
11:04 mberends bread confectionery
11:05 masak apparently they have been crushed for the benefit of certain young ladies.
11:06 masak (...who thought that the original mice were a bit hard on the teeth)
11:06 mberends the aniseed grains were apparently too coarse for _older_ ladies, hence the idea of crushing them.
11:06 masak oh. right.
11:06 masak 'oudere'.
11:06 masak Google Translate, this is your final warning.
11:07 mberends masak: did you book travel and accommodation for Lisbon yet?
11:08 masak travel -- yes; accomodation -- still holding out for some Esperanto contacts who might want to host me.
11:09 mberends If hostel rates are affordable, I'm considering a slightly longer stay
11:09 masak aye.
11:09 masak me too.
11:09 * masak is staying 30th to 8th
11:13 mberends going by the yapc website, http://www.alfaiataria.org/goodnight/ looks good
11:14 masak guess it's high season now, eh?
11:15 mberends yes, no question about that
11:20 last joined #perl6
11:22 Su-Shee interesting conference travel choices this year.. desktop summit on gran canaria.. yapc in lisbon... :)
11:30 eMaX joined #perl6
11:39 masak hm, let's see. things I could hack on today: Web.pm, proto, November, u4x.
12:00 barney joined #perl6
12:03 payload joined #perl6
12:09 M_o_C joined #perl6
12:10 Jedai joined #perl6
12:25 pugs_svn r27504 | kyle++ | [t/spec] Test for RT #67446
12:29 abra joined #perl6
12:29 KyleHa joined #perl6
12:30 KyleHa perl6: my @a=0..1;@a.delete(0);map { .say }, @a;
12:30 p6eval rakudo 02d0ed: OUTPUT«No applicable candidates found to dispatch to for 'map'␤in Main (/tmp/vsy9Okbh9k:2)␤»
12:30 p6eval ..elf 27504: OUTPUT«Use of uninitialized value in concatenation (.) or string at ./elf_h line 5105.␤syntax error at (eval 125) line 5, near "{->say"␤ at ./elf_h line 5881␤»
12:30 p6eval ..pugs: OUTPUT«␤1␤»
12:34 amoc joined #perl6
12:34 ihrd joined #perl6
12:36 ihrd left #perl6
12:43 jauaor http://nopaste.info/72f3e0dd92.html
12:43 jauaor :D
12:45 masak forthwards, comrades!
12:46 jauaor haha
12:46 jauaor this is a small language i am writing
12:46 jauaor it is actually more inspired in J
12:46 jauaor :D
12:48 KyleHa rakudo: my @a=0..1;@a.delete(0);map { .say }, @a;
12:48 p6eval rakudo 02d0ed: OUTPUT«No applicable candidates found to dispatch to for 'map'␤in Main (/tmp/d19scfkNtM:2)␤»
12:48 KyleHa What should that do?  Output '1', right?
12:48 * masak thinks so
12:49 masak there's something fishy going on with that .delete function
12:49 masak rakudo: my @a=0..1; map { .say }, @a;
12:49 p6eval rakudo 02d0ed: OUTPUT«0␤1␤»
12:55 pugs_svn r27505 | kyle++ | [t/spec] .delete causes a problem for map too
13:01 r696 left #perl6
13:07 synth joined #perl6
13:08 pugs_svn r27506 | kyle++ |  r32436@livetext-laptop:  kyle | 2009-07-10 15:41:17 -0500
13:08 pugs_svn r27506 | kyle++ |  [t/spec] A few tests for fff operator (more needed)
13:09 KyleHa That there svk is pertnear nifty, I reckon.
13:13 masak it is.
13:13 masak git-svn, too.
13:18 KyleHa I suppose I ought to go the git-svn route, since svk is going all eol.
13:19 finanalyst rakudo: my @x=1,2,3,undef,3,2;say ?(all(@x) ~~ .defined)
13:19 p6eval rakudo 02d0ed: OUTPUT«1␤»
13:20 finanalyst should this be 0?
13:20 finanalyst s/shouldnt/should/
13:22 masak finanalyst: well, a junction is defined.
13:23 finanalyst yes but i was trying to test the elements of the array
13:23 masak yes, I see.
13:23 finanalyst rakudo: my @x=1,2,3,4; say ?(all(@x) < 3.5)
13:23 p6eval rakudo 02d0ed: OUTPUT«0␤»
13:24 finanalyst voila
13:24 masak rakudo: my @a = 1,2,3,undef,3,2; say [&&] @a>>.defined
13:24 p6eval rakudo 02d0ed: OUTPUT«say requires an argument at line 2, near " [&&] @a>>"␤in Main (src/gen_setting.pm:2444)␤»
13:24 masak hm, [&&] NYI?
13:26 finanalyst rakudo: my @x=1,2,3,undefined,4; say (@x>>.defined).perl
13:26 p6eval rakudo 02d0ed: OUTPUT«Could not find non-existent sub undefined␤»
13:26 finanalyst rakudo: my @x=1,2,3,undef,4; say (@x>>.defined).perl
13:26 p6eval rakudo 02d0ed: OUTPUT«[Bool::True, Bool::True, Bool::True, Bool::False, Bool::True]␤»
13:28 finanalyst rakudo: my @x=1,2,3,undef,4; say (@x >>.defined).perl
13:28 p6eval rakudo 02d0ed: OUTPUT«Statement not terminated properly at line 2, near ">>.defined"␤in Main (src/gen_setting.pm:3340)␤»
13:29 finanalyst no whitespace permitted before >> ?
13:36 finanalyst my @x=1,2,3,4; my @z; for @x { @z[*] = $_ }; say @z.perl
13:37 finanalyst rakudo:my @x=1,2,3,4; my @z; for @x { @z[*] = $_ }; say @z.perl
13:37 finanalyst rakudo: my @x=1,2,3,4; my @z; for @x { @z[*] = $_ }; say @z.perl
13:37 p6eval rakudo 02d0ed: OUTPUT«[]␤»
13:38 finanalyst i was expecting [1,2,3,4]
13:49 finanalyst akudo: my @x=1,2,3,4; my @z; for @x { @z[+@z] = $_ }; say @z.perl
13:49 finanalyst rakudo: my @x=1,2,3,4; my @z; for @x { @z[+@z] = $_ }; say @z.perl
13:49 p6eval rakudo 02d0ed: OUTPUT«[1, 2, 3, 4]␤»
13:50 finanalyst am i wrong in thinking @a[*] should act in the same way as @a[+@a] ?
13:53 masak finanalyst: yes, I think you are.
13:53 finanalyst ok, i will post a bug
13:53 masak finanalyst: you'd want @a[+*].
13:53 masak finanalyst: why? I just said that I think you're wrong.
13:54 finanalyst sorry. no post bug
13:54 finanalyst rakudo: my @x=1,2,3,4; my @z; for @x { @z[+*] = $_ }; say @z.perl
13:54 p6eval rakudo 02d0ed: OUTPUT«[4]␤»
13:54 masak now _that_ might very well be wrong.
13:55 finanalyst shall i post a bug?
13:55 masak .[+*] should mean 'first element after the end of the array'
13:55 masak finanalyst: please do.
14:00 davef joined #perl6
14:12 macae joined #perl6
14:32 skids__ joined #perl6
14:37 kane_ joined #perl6
14:39 masak rakudo: $*IN.get.words.pick.say
14:39 p6eval rakudo 02d0ed: OUTPUT«Strome,␤»
14:39 masak :)
14:42 davef rakudo: role x { method y( --> Array of Int) {...} }
14:42 p6eval rakudo 02d0ed: OUTPUT«Use of type object as value␤»
14:43 davef std: role x { method y( --> Array of Int) {...} }
14:43 p6eval std 27506: OUTPUT«ok 00:02 37m␤»
14:43 masak rakudo: $*IN.lines.words.sort(*.chars)[*-1].say
14:43 p6eval rakudo 02d0ed: OUTPUT«hoffnungsreich.␤»
14:44 masak rakudo: $*IN.lines.words.sort(*.chars)[*-1].uc.say
14:44 p6eval rakudo 02d0ed: OUTPUT«HOFFNUNGSREICH.␤»
14:44 masak :)
14:45 davef Hi - does the fact that std shows something as OK and rakudo warns 'Use of type object as value' mean that rakudo doesn't yet implement this?
14:45 masak davef: not in general, no. but in this case, I think that's the case.
14:45 masak I've also been seeing that warning in silly situations lately.
14:45 davef is there a workaround?
14:46 masak davef: dunno. what is it you're aiming to do?
14:47 davef trying to translate JDBC API to P6 as a starter for the new DBI. Working my way through the errors/warnings trying to get a clean run for Tim.
14:47 masak rakudo: role R { method y(--> Array) {} }
14:47 p6eval rakudo 02d0ed:  ( no output )
14:47 masak rakudo: role R { method y(--> Array of Int) {} }
14:47 p6eval rakudo 02d0ed: OUTPUT«Use of type object as value␤»
14:47 masak there you go. it's the 'of Int' part that's NYI.
14:48 davef I have a whole bunch of java:: return types - I guess I'll just have to ignore for now, maybe emit them as comments.
14:50 davef Do you know if there's a P6 equivalent of the Java 'throws' associated with interface definitions?
14:50 masak good question.
14:50 * masak checks S06
14:51 last joined #perl6
14:53 davef thanks - will have another dig :)
14:54 TimToady davef: no, there isn't
14:54 PerlJam joined #perl6
14:54 RonOreck joined #perl6
14:54 huf joined #perl6
14:54 kst joined #perl6
14:54 jjore joined #perl6
14:54 IRSeekBot joined #perl6
14:54 buu joined #perl6
14:54 tarbo2 joined #perl6
14:54 ilogger2 joined #perl6
14:54 patmat joined #perl6
14:54 jiing joined #perl6
14:55 masak davef: no, does not seem like it.
14:55 davef thanks - thought I might have just missed it. Is there another way of encapsulating this information?
14:56 masak I was just thinking about that.
14:56 masak so what you want to express is that this particular method throws a set of exception types, and only those?
14:58 davef yes - I'm not sure how it's going to be used as this will be the basis for DBDI developers to generate drivers for different vendor DBs.
14:59 masak it's a noble goal, but I can see no mechanism that will do this easily for you.
15:00 masak it's a kind of declaration that I don't usually associate with Perl, but with Java.
15:00 TimToady I think it's a sign of overreliance on exceptions as an API control mechanism
15:00 TimToady we're trying to go the other direction, and make exceptions *more* exceptional
15:00 TimToady because they mess up implicit threading badly
15:01 TimToady you can't hyperize an operator that randomly throws exceptions on one of its elements
15:01 TimToady it blows all the other parallel calculations out of the water unnecessarily
15:02 TimToady so we're moving more toward inband failure propagation via "unthrown" exceptions
15:03 TimToady but those should not generally be used as normal values either in a good API, especially to indicate "no more data"
15:05 TimToady </end_of_diatribe>
15:07 davef Most of the JDBC stuff seems to throw 'SQLExceptions', I guess they're formatting and passing on the vendors exceptions.
15:08 davef I'll emit comments and defer the design decision until either I know more or someone who knows what they're doing has a suggestion :)
15:09 Limbic_Region joined #perl6
15:15 pmurias joined #perl6
15:16 pmurias davef: a dynamicly checked throws declaration is hardly usefull isn't it?
15:18 masak pmurias: why would it be dynamically checked?
15:18 frankshaw joined #perl6
15:19 TimToady well, this was one of the reasons the Javafolk didn't want to add an instruction that could call a method they didn't know the name of in advance
15:19 TimToady dynamic languages are so, well, dynamic...
15:20 Limbic_Region TimToady - but if Eclipse can actually make Java a succesful language, there is a lot to be said for statically typed languages that can predict behavior at compile time ;-)
15:20 TimToady there's also a lot to be said for not reinventing an existing language :)
15:20 pmurias masak: it's hard to check anything statically in Perl6
15:21 TimToady which is why we at least insist that the candidate list for multiple dispatch is static
15:21 Limbic_Region yeah - it would just be really nice if there was an IDE for perl 6 that really worked good given the amount of OO being baked in
15:21 masak pmurias: oh, you're right of course. I've come to thing of an 'under usual circumstances' condition being needed.
15:34 frankshaw left #perl6
15:35 frankshaw joined #perl6
15:35 HemanShaw joined #perl6
15:38 davef If Std is the standard grammar, if something passes uder std, but fails under rakudo, does that generally mean it's an implementation issue?
15:39 FCO joined #perl6
15:40 TimToady STD is pretty much only checking syntax, not semantics, so it could also be a semantic error that rakudo is just giving a dumb message for
15:42 TimToady but currently the best bet is usually a rakudobug or parrotbug :)
15:42 davef thanks
15:46 nihiliad joined #perl6
15:53 masak std: Statbuf
15:53 p6eval std 27506: OUTPUT«Undeclared name:␤      Statbuf used at 1 ␤ok 00:02 36m␤»
15:57 TimToady I don't particularaly like that name anyway
15:57 TimToady especially now that we have buf types that aren't related
15:58 masak nod.
15:58 TimToady likely to turn into Stat, or some such
15:59 TimToady but that seems like it could interfere with statistics
16:00 TimToady Fstat is too specific, maybe Rstat
16:03 masak "R" standing for...?
16:03 TimToady resource
16:03 masak yeuch.
16:03 TimToady or maybe we should unify with IO more that way ingy originally used IO
16:03 s1n TimToady: there's R, the statistics based programming environment :/
16:03 TimToady er, oops
16:04 TimToady I guess the fundamental question is how lazy IO('filename') is
16:04 TimToady and how hard to we work to prevent race conditions
16:04 TimToady *do
16:04 pmichaud Good morning, #perl6
16:04 s1n pmichaud: good morning
16:05 TimToady o/
16:05 * s1n fetches fresh coffee
16:05 masak morning, pm.
16:05 TimToady I've got some DP in my outdoor fridge...
16:05 TimToady funny how I think of the garage as outdoors
16:06 Psyche^ joined #perl6
16:06 TimToady well, out one door, anyway
16:09 nacho__ joined #perl6
16:11 TimToady I think I'm just gonna delete Statbuf and hope the IO role is sufficient for now
16:12 masak +1
16:17 pugs_svn r27507 | lwall++ | [S03] kill Statbuf type, unify with IO role/class somehow
16:19 amoc joined #perl6
16:26 payload joined #perl6
16:48 frew_ joined #perl6
17:10 SmokeMachine joined #perl6
17:25 pjcj_ joined #perl6
17:39 FurnaceBoy joined #perl6
17:42 icwiener joined #perl6
17:43 frew_ joined #perl6
17:47 * araujo playing around with rakudo
17:47 lambdabot araujo: You have 1 new message. '/msg lambdabot @messages' to read it.
17:47 araujo mmm....
17:50 r696 joined #perl6
18:01 * pmichaud reads backscroll
18:11 nacho__ joined #perl6
18:23 SmokeMachine joined #perl6
18:42 soupdragon joined #perl6
18:46 synthEEEE joined #perl6
18:53 eternaleye joined #perl6
19:16 payload joined #perl6
19:26 mikehh joined #perl6
19:32 araujo rakudo: my %h = { 'foo' => 'bar' }; for %h.keys -> $k { say "$k => %h{$k}"; }
19:32 p6eval rakudo 02d0ed: OUTPUT«foo => %hfoo␤»
19:32 araujo :(
19:37 eternaleye joined #perl6
19:57 tann joined #perl6
19:59 tann rakudo: my @a = 1,2; @a[0]:delete; say @a.perl;
19:59 p6eval rakudo 02d0ed: OUTPUT«Statement not terminated properly at line 2, near ":delete; s"␤in Main (src/gen_setting.pm:3340)␤»
19:59 tann rakudo: my @a = 1,2; @a[0].delete; say @a.perl;
19:59 p6eval rakudo 02d0ed: OUTPUT«Method 'delete' not found for invocant of class 'Int'␤»
20:00 tann rakudo: my @a = 1,2; @a.delete(0); say @a.perl;
20:00 p6eval rakudo 02d0ed: OUTPUT«Null PMC access in isa()␤in method Any::map (src/gen_setting.pm:191)␤called from method List::perl (src/gen_setting.pm:921)␤called from Main (/tmp/sBPHXZmDJA:2)␤»
20:03 tann std: my @a = 1,2; @a.delete(0);
20:03 p6eval std 27507: OUTPUT«ok 00:02 38m␤»
20:06 tann my @a = <a b c d e f>; @a.delete(2..4); say @a.perl;
20:06 tann rakudo: my @a = <a b c d e f>; @a.delete(2..4); say @a.perl;
20:06 p6eval rakudo 02d0ed: OUTPUT«Null PMC access in isa()␤in method Any::map (src/gen_setting.pm:191)␤called from method List::perl (src/gen_setting.pm:921)␤called from Main (/tmp/PvU9uofjsD:2)␤»
20:07 funky joined #perl6
20:07 funky hello
20:07 funky can anyone help me with this installation? http://pastebin.com/m27c668a
20:08 tann funky: try #perl5
20:10 funky ok
20:10 funky I already tried though
20:15 icwiener_ joined #perl6
20:15 tann funky: try to install Data::JavaScript::Anon first and pull the other again
20:16 funky I tried it too
20:16 tann did it install?
20:16 szabgab joined #perl6
20:17 funky no
20:18 tann what was the error?
20:18 funky http://pastebin.com/m13a05cbf
20:18 funky I was reproducing it
20:19 funky not very helpful though
20:19 tann that was lame
20:20 tann try to download the package onto your machine
20:20 funky I got it
20:20 tann untar it
20:20 funky how can I install it by hand ?
20:20 tann and then run perl Makefile.PL
20:20 tann then make && make test && make install
20:20 tann wget the package
20:21 funky ok
20:21 tann go to this http://search.cpan.org/~adam​k/Data-JavaScript-Anon-1.03/
20:21 tann click on download
20:22 tann or just hover your mouse over it and look at the url
20:22 tann then wget onto the box you want
20:23 funky yup yup
20:23 funky I already got it
20:24 funky no need for that exact detail
20:24 funky thank you anyway :)
20:24 funky I'm upgrading from squeeze to testing before
20:25 iblechbot joined #perl6
20:34 kate21de joined #perl6
20:39 funky solved!
20:39 funky thank you very much tann
20:39 tann funky: np
20:41 tann rakudo: my @a = 1,2; @a[0,1] = @a[1,0]; say @a.perl;
20:41 p6eval rakudo 02d0ed: OUTPUT«[2, 1]␤»
20:42 tann rakudo: my @a = 1, 2, 3, 4; @a[0, 3] = @a[3, 0]; say @a.perl;
20:42 p6eval rakudo 02d0ed: OUTPUT«[4, 2, 3, 1]␤»
20:43 tann rakudo: my @a = 1..4; @@a[0, 3] = @@a[3, 0]; say @a.perl;
20:43 p6eval rakudo 02d0ed: OUTPUT«Syntax error at line 2, near "@@a[0, 3] "␤in Main (src/gen_setting.pm:3340)␤»
20:48 tann rakudo my @a;   say @a == Nil ?? 'nil' !! 'fill';
20:48 tann rakudo: my @a;  say @a == Nil ?? 'nil' !! 'fill';
20:48 p6eval rakudo 02d0ed: OUTPUT«Use of type object as value␤nil␤»
20:49 StephenPollei rakudo: my @a;  say @a ~~ Nil ?? 'nil' !! 'fill';
20:49 p6eval rakudo 02d0ed: OUTPUT«fill␤»
20:49 tann rakudo: my @a; say @a ~~ Nil ?? 'nil' !! 'fill';
20:49 p6eval rakudo 02d0ed: OUTPUT«fill␤»
20:49 davef hi, is there any way to run std or rakudo in the irc without it being visible by everyone on the session?
20:49 StephenPollei /privmsg p6eval
20:50 davef is that for rakudo? what about std?
20:50 StephenPollei the bot does both and elf and I forget what all
20:51 davef so is it /privmsg p6eval std:  ...
20:52 StephenPollei /privmsg p6eval std: my @a; say @a ~~ Nil ?? 'nil' !! 'fill';
20:52 davef thanks
20:53 StephenPollei yes pretty much and then if your irc client is like mine you can just type directly to it
20:55 Su-Shee left #perl6
20:55 DemoFreak joined #perl6
21:00 tann rakudo: my @a = 1..4; say @a[3,0].perl
21:00 p6eval rakudo 02d0ed: OUTPUT«[4, 1]␤»
21:07 zamolxes joined #perl6
21:14 tann_ joined #perl6
21:16 tann_ rakudo:  sub foo(@a, $s) { say @a.perl; say $s }; my @a = 1..5; foo(@a, @a.pick);
21:16 p6eval rakudo 02d0ed: OUTPUT«[1, 2, 3, 4, 5]␤4␤»
21:17 tann_ rakudo: sub foo(@a, $s) { say @a.perl; say $s }; foo(1..5, 1..5.pick);
21:17 p6eval rakudo 02d0ed: OUTPUT«[1, 2, 3, 4, 5]␤1␤»
21:17 tann_ rakudo: sub foo(@a, $s) { say @a.perl; say $s }; foo(1, 2, 3, 4, 5, 1..5.pick);
21:17 p6eval rakudo 02d0ed: OUTPUT«too many arguments passed (6) - 2 params expected␤in sub foo (/tmp/UbyU8Cnyoz:1)␤called from Main (/tmp/UbyU8Cnyoz:2)␤»
21:18 desertm4x joined #perl6
21:21 eternaleye_ joined #perl6
21:24 frew_ joined #perl6
21:37 nacho__ joined #perl6
21:46 frankshaw joined #perl6
21:48 HemanShaw joined #perl6
21:48 frankshaw left #perl6
21:53 kane_ joined #perl6
22:06 cls_bsd joined #perl6
22:18 nihiliad left #perl6
22:18 nihiliad joined #perl6
22:30 Toushirou joined #perl6
22:32 khisanth__ joined #perl6
22:54 FCO joined #perl6
23:02 pmichaud Rakudo day tomorrow.
23:08 M_o_C joined #perl6
23:43 fridim_ joined #perl6
23:46 cognominal joined #perl6
23:50 Whiteknight joined #perl6
23:57 ssm joined #perl6

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

Perl 6 | Reference Documentation | Rakudo