Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-06-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:04 snarkyboojum joined #perl6
00:20 synth joined #perl6
00:23 bacek joined #perl6
00:30 payload joined #perl6
00:38 JDlugosz_ joined #perl6
00:40 Meldrake_ joined #perl6
00:47 pugs_svn r27056 | jdlugosz++ | [S03] reword example due to prefix = no longer existing.  Presumably the effect still applies if you were to have one, even though it is no longer a built-in operator.
00:50 flexibeast joined #perl6
00:51 frew|work joined #perl6
01:08 viirya joined #perl6
01:10 Sunbeam joined #Perl6
01:13 Xomas joined #perl6
01:38 mycelium joined #perl6
01:40 wayland76 joined #perl6
01:56 ssm joined #perl6
01:58 frew|work joined #perl6
02:03 Meldrake joined #perl6
02:15 eternaleye joined #perl6
02:16 justatheory joined #perl6
02:21 viirya joined #perl6
02:32 cookys joined #perl6
02:37 felipe joined #perl6
02:48 viirya joined #perl6
02:49 dukeleto joined #perl6
02:57 sitaram joined #perl6
02:59 xinming_ joined #perl6
03:03 sjohnson_ left #perl6
03:04 DJ-DONGDOT joined #perl6
03:11 molaf_x joined #perl6
03:20 donaldh joined #perl6
03:22 viirya joined #perl6
03:27 japhb joined #perl6
03:41 frew|work joined #perl6
03:45 s1n joined #perl6
03:53 cookys joined #perl6
03:55 meppuru joined #perl6
04:18 frew|work joined #perl6
04:36 pmichaud I've just updated the "ins" branch in the Rakudo repository -- it attempts to build Rakudo from an installed parrot instead of the build copy.  I could use testing of the branch, especially on Mac/Win platforms.
04:36 lambdabot pmichaud: You have 1 new message. '/msg lambdabot @messages' to read it.
04:36 pmichaud If anyone can do a quick test and report back any problems (I expect them), that would be great.
04:36 pmichaud (1) clone rakudo repo
04:37 pmichaud (2) git checkout -b ins
04:37 pmichaud (3) perl Configure.pl --gen-parrot
04:37 pmichaud (4) make
04:38 pmichaud Oops, (2) above should be
04:38 pmichaud (2) git checkout --track -b ins origin/ins
04:38 sitaram pmichaud: git checkout -b ins mirrors "master".  Do you mean we should checkout a tracking branch for origin/ins?
04:38 sitaram oh ok  thanks
04:38 sitaram just saw that amend
04:39 pmichaud yes; still learning git branch commands here :-)
04:39 sitaram aaargh... I'm behind a proxy; will have to do this at home later (no idea how to make SVN work over an HTTP proxy...)
04:40 sitaram sorry
04:40 sitaram pmichaud: in recent gits, "git checkout -t origin/ins" will infer that you want a local branch called ins to track the remote one
04:41 pmichaud sitaram: very good to know, thanks!
04:42 sitaram you're welcome!
04:52 sitaram pmichaud: ok, faked the ssl bit using socat and a tunnel and a fake entry in /etc/hosts; trying the make now... (my machine is not exactly the fastest :/)
04:53 sitaram /usr/bin/ld: cannot open output file dynext/perl6_group.so: No such file or directory
04:53 sitaram hmmm
04:54 pmichaud might need another git pull
04:54 pmichaud I just pushed about 3 more updates.
04:55 pmichaud (I'm trying it on a separate system as well, and finding all of the pieces I missed.)
05:03 dukeleto joined #perl6
05:12 amoc joined #perl6
05:18 pugs_svn r27057 | masak++ | [S03] supplied a missing "
05:19 meppuru good night
05:26 sitaram trying... (was away for a while)
05:29 sitaram succeeded... no errors in make
05:32 masak joined #perl6
05:33 masak morning, metacamels.
05:37 mberends masak, morning!
05:37 masak o/
05:37 masak I'll only be here a while.
05:37 masak excursion day at work today.
05:38 mberends I'm moving .nl -> .uk, so mainly afk for the next week or two
05:39 masak mberends: oh! moving is always a lot of work. best of luck with that.
05:39 mberends :)
05:40 masak rakudo: class H is Hash {}; my H $h .= new; $h{"foo"} = 1; $h<bar baz> = 2, 3; say $h.perl
05:40 p6eval rakudo 86aeaf: OUTPUT«{"foo" => 1, "bar" => 2, "baz" => 3}␤»
05:40 masak man, Rakudo is frighteningly good these days.
05:40 masak subclassing core classes! I so expected that to fail somehow...
05:41 masak hm, but let's say I want to embed a hash as an attribute instead, only exposing the 'exists' and 'delete' methods... how would I write that?
05:43 mberends you can probably not remove methods.
05:43 mberends you could break 'em with neutered overrides
05:43 masak no, but that's not what I want. I want to keep the hash as a private attribute.
05:43 masak and then just delegate those two methods somehow.
05:43 masak like, with a keyword of some sort.
05:44 pmichaud handles
05:44 masak yes...
05:44 mberends is 'handles' implemented fully?
05:44 * masak is slowly setting up the trap
05:44 masak please show me how... :)
05:44 eternaleye joined #perl6
05:44 pmichaud I don't know about fully, but I think it's implemented somewhat.
05:44 mberends couldn't get it working in Temporal :(
05:45 pmichaud class Foo { has %.h handles <exists deletes>; ... }
05:45 pmichaud er, "delete"
05:45 masak rakudo: class Foo { has %!h handles <exists delete> }
05:45 p6eval rakudo 86aeaf: OUTPUT«The use of a %hash with the handles trait verb is reserved␤in Main (/tmp/jtfUb4FG87:2)␤»
05:45 masak and bam.
05:46 pmichaud I have no clue.
05:46 masak it's in S12. :/
05:46 pmichaud right, but jnthn++ is the guy who implements "handles"  :-)
05:46 masak this is probably my least favourite misfeature of Perl 6 as it stands.
05:46 masak pmichaud: ok, I'll talk to him. :)
05:47 masak maybe he can explain why delegation to hashes sucks.
05:47 pmichaud ("handles" is all about delegation, so I'm.... delegating :-)
05:47 masak 哈哈
05:49 pmichaud there's always....
05:50 pmichaud class Foo { has %!h; method exists(*@_) { %!h.(@_) } ... }
05:50 pmichaud class Foo { has %!h; method exists(*@_) { %!h.exists(@_) } ... }
05:50 masak yes, there is.
05:50 masak just looking for a reason why I should jump through hoops here, and not Perl 6.
05:51 pmichaud well, figure out a way to resolve the conjecture in S12  :-)
05:51 pmichaud although that still means you're the one jumping through the hoop, instead of TimToady++ and/or jnthn++  :-P
05:51 pmichaud (yes, I'm being far less than helpful this evening)
05:51 masak pmichaud: well, it's a diffent-level hoop, so that's ok.
05:51 pmichaud oh!  Maybe
05:52 pmichaud class Foo { has Hash $!h handles <delete exists>; ... }
05:52 masak it's on the caring-about-Perl-6 level, not the writing-simple-programs level.
05:52 masak pmichaud: that one still counts as jumping through a hoop...
05:53 pmichaud just because the sigil is a $ instead of a % ?
05:53 sri_kraih joined #perl6
05:54 masak pmichaud: yes! it's me bending to the strange wishes of a Perl 6 conjecture.
05:54 pmichaud ah, okay.
05:54 pmichaud (yes, I'm being far less than helpful this morning)
05:54 masak pmichaud: what if I wanted to type the values, for example? then it'd be logical to write 'Dog %h'.
05:54 pmichaud my Hash of Dog $!h
05:55 masak ah, ok.
05:55 masak but still...
05:55 pmichaud yes, but still...
05:56 masak rakudo: say "abc" ~~ m ☃.(.).☄
05:56 p6eval rakudo 86aeaf: OUTPUT«abc␤»
05:56 masak did somebody report that one?
05:56 pmichaud I don't know if it got rakudobugged.
05:56 pmichaud it did get mentioned during the design meeting
05:56 pmichaud I think my statement was
05:56 * masak rakudobugs
05:57 pmichaud "What in the world are you doing to the regex engine?!?"
05:57 masak :)
05:57 masak in a very spaced-out way, a snowman and a meteor are kinda symmetric.
05:57 masak but maybe not in the required way...
05:58 pmichaud rakudo: say "abc" ~~ m ☃.(.).☄;  say 'ok';
05:58 p6eval rakudo 86aeaf: OUTPUT«abc␤ok␤»
05:58 pmichaud rakudo:  say q☃.(.).☄;
05:58 p6eval rakudo 86aeaf: OUTPUT«Statement not terminated properly at line 2, near "\u2603.(.).\u2604;"␤in Main (src/gen_setting.pm:0)␤»
05:59 pmichaud rakudo: say "abc" ~~ m ☃.(.).☄;  say $0;
05:59 p6eval rakudo 86aeaf: OUTPUT«abc␤b␤»
05:59 pmichaud looks like it must be something in the regex parser
06:13 justatheory joined #perl6
06:13 amoc_ joined #perl6
06:26 xinming_ joined #perl6
06:40 sitaram left #perl6
06:48 eternaleye_ joined #perl6
06:57 dakkar joined #perl6
06:59 mj41 joined #perl6
07:11 DemoFreak joined #perl6
07:22 donaldh joined #perl6
07:23 dukeleto joined #perl6
07:24 agentzh joined #perl6
07:35 viklund joined #perl6
07:38 synthEEEE joined #perl6
07:42 synth^3 joined #perl6
07:57 barney joined #perl6
07:57 amoc joined #perl6
07:59 jferrero joined #perl6
08:06 synth joined #perl6
08:09 Sark23 hi
08:09 Sark23 what mean with for @words -> $w { %res{$w}++ } ?
08:09 Sark23 @words is a array ?
08:09 lambdabot Unknown command, try @list
08:09 Sark23 rakudo: for @words -> $w { %res{$w}++ }
08:09 p6eval rakudo 86aeaf: OUTPUT«Symbol '@words' not predeclared in <anonymous> (/tmp/LrGzIDVlCb:2)␤in Main (src/gen_setting.pm:3225)␤»
08:20 pmurias joined #perl6
08:24 Sark23 rakudo: my $word="test";(^$word.chars).map: {substr(my $tmp = $word,$_,1)='';$tmp};
08:24 p6eval rakudo 86aeaf: OUTPUT«No applicable methods.␤in method Any::map (/tmp/sVA9Xk03YT:2)␤called from Main (/tmp/sVA9Xk03YT:2)␤»
08:34 viklund_ Sark23: Yes @words is an array
08:35 viklund_ rakudo: my %res; my @words = <foo bar baz foo>; for @words -> $w { %res{$w}++ }; %res.perl.say
08:35 p6eval rakudo 86aeaf: OUTPUT«{"foo" => 2, "bar" => 1, "baz" => 1}␤»
08:37 Sark23 ok thank you
08:37 Sark23 but what mean perl6 with (^$word.chars).map: {substr(my $tmp = $word,$_,1)='';$tmp}
08:38 Sark23 word.chars are length of token and substr from 0 to length and set all = '' ?
08:38 viklund_ Sark23: I'm not sure, where did you find it?
08:39 Sark23 http://www.riffraff.info/2007/5/20/a-spell-corrector-in-perl6-part-3
08:39 Sark23 under sub deleteion
08:39 Sark23 ./deleteion/deletion/
08:43 viklund_ I'm curious how that method is called, I find the ^ confusing
08:44 viklund_ but that code is 2 years old
08:44 viklund_ my guess is that a lot of things have changed since then
08:44 viklund_ or rather, I know that a lot of things have changed since then
08:45 Sark23 ok thanks
08:45 viklund_ ahh, right
08:45 viklund_ it's starting to dawn on me now
08:50 Grrrr joined #perl6
08:51 viklund_ Sark23: substr doesn't work in rakudo right now but that code is trying to generate a list of words where each word has one character removed
08:52 viklund_ so delete("test") -> ( "est", "tst", "tet", "tes" )
08:53 viklund_ (^$word.chars): The ^ means create the list upto arg. ^3 -> (0,1,2)
08:53 viklund_ so the number is $_ in the map, ie the position of the character to remove
08:56 DanielC joined #perl6
08:56 DanielC moin
08:56 viklund_ DanielC: o/
08:57 DanielC o/
08:57 viklund_ did you manage to call the md5 from rakudo y-day?
08:57 DanielC viklund_: I am this || close. But for some reason sprintf doesn't seem to work inside Q:PIR
08:57 viklund_ hrmpf
08:57 DanielC http://pastebin.com/m40db8f
08:58 viklund_ but it works as pure-pir?
08:58 DanielC yeah
08:58 DanielC If we can get that little script to work (pastebin) we are set.
08:58 DanielC I left a message for pmichaud with lambdabot.
08:58 DanielC I believe he's the one who implemented Q:PIR
09:00 viklund_ ok
09:00 DanielC I use sprintf to convert the list of integers into a hex string. If worse comes to worse, I could do the same thing by hand, but it would be a bit ugly.
09:00 viklund_ can't you return it to rakudo and do it in perl6?
09:00 DanielC yeah
09:00 viklund_ then you don't have to do it by hand at least ;)
09:01 DanielC oh, you mean the stream of integers.
09:01 viklund_ yes
09:01 DanielC Uhmm... I haven't thought of that.
09:01 kate21de joined #perl6
09:01 DanielC maybe
09:02 DanielC I'll need to think about that.
09:02 viklund_ but I wonder how you return a FixedPMCArray...
09:02 DanielC yeah
09:02 DanielC If I could do that, that would be enough.
09:03 viklund_ its simple!
09:03 viklund_ heureka
09:03 DanielC http://pastebin.com/m6c84e4dd
09:03 DanielC That is the code as it stands today.
09:03 viklund_ ok
09:03 DanielC That's what we need to fix.
09:04 DanielC How do you return a FixedPMCArray ?
09:04 viklund_ my @r = Q:PIR { $P0 = new 'FixedPMCArray' \n ... %r = $P0 };
09:04 viklund_ that works
09:04 DanielC cool
09:04 hanekomu joined #perl6
09:04 viklund_ I need to go afk for a while
09:04 DanielC ok
09:04 DanielC I'll try to get the thing working.
09:06 barney DanielC: You could also return $S0, and do the splitting in Perl6
09:06 DanielC barney: That's a good idea.
09:07 DanielC I'll do that.
09:15 DanielC http://pastebin.com/m7fa6e223 <-- I'm doing something wrong with my sprintf statement, but I don't know what.
09:16 DanielC If you run this, you see that all the integers look ok, but the sprintf seems to return nothing.
09:17 DanielC I'm an idiot.
09:17 DanielC .= is wrong.
09:19 DanielC http://pastebin.com/m13d015b0  <--- YAY!!! It works!
09:19 DanielC barney: Thanks for the idea. It's way easier to manipulate the string in Perl 6 than in PIR :-)
09:22 payload feed operators (<==, ==>) aren't implemented, right?
09:22 DanielC I just used a sample text from Wikipedia to confirm that the md5 function does the right thing. Yay.
09:22 clintongormley joined #perl6
09:22 Matt-W Good morning #perl6
09:23 DanielC moin
09:23 Matt-W rakudo: my @a = 1, 2, 3, 4; my @b; @b <== @a; say @b.perl;
09:23 p6eval rakudo 86aeaf: OUTPUT«No applicable methods.␤in Main (/tmp/xkDi0OCWpq:2)␤»
09:23 Matt-W something isn't :)
09:23 Matt-W or I'm doing it wrong, that's always a possibility
09:24 Matt-W should've had some breakfast
09:24 jnthn no, feeds ops not implemented.
09:27 Sark23 thx viklund
09:33 DanielC jnthn: Is there a place to get a list of builtins that are not implemented yet?
09:33 jnthn Not a complete one.
09:34 DanielC I was thinking, if some hypothetical person wanted to try their luck at implementing a builtin, where would they go?
09:34 jnthn Probably S32, or the test suite.
09:35 DanielC ok
09:35 DanielC Look for a test that fails and implement it.
09:36 jnthn Well, or that we ain't running
09:36 DanielC ok
09:36 jnthn A lot of built-ins have test scripts.
09:43 lichtkind joined #perl6
09:47 snarkyboojum joined #perl6
09:49 lichtkind mberends: hi
09:50 DanielC @seen mberends
09:50 lambdabot mberends is in #perl6. I last heard mberends speak 4h 5m 27s ago.
09:51 pmurias joined #perl6
10:05 araujo joined #perl6
10:20 kane__ joined #perl6
10:23 agentzh joined #perl6
10:30 amoc joined #perl6
10:33 jnthn_ joined #perl6
10:36 ujwalic joined #perl6
10:38 snarkyboojum_ joined #perl6
10:44 barney in NQP: should  $( $<statement_list> )  now be written as  $<statement_list>.ast ?
10:46 jnthn barney: Yes
10:48 barney Tnx,    I'm just resyncing actions.pm in Pipp with actions.pm in Rakudo
10:59 amoc joined #perl6
11:03 DanielC @seen masak
11:03 lambdabot I saw masak leaving #perl6 4h 48m 52s ago, and .
11:03 sjohnson 4hello
11:03 DanielC hi
11:04 DanielC I miss masak and mberends. I have code I want to show them :-)
11:04 DanielC working code++
11:06 sjohnson oh he will be around
11:06 payload joined #perl6
11:07 DanielC I have written a nice digest function for masak's November wiki, and I have made progress on the module management library that mberends and I are working on.
11:08 zamolxes joined #perl6
11:08 DanielC Currently November stores passwords in plain text because they don't have a digest function. So I wrote one that uses embedded PIR.
11:09 sjohnson a digest function for his perl 6 readers' digest blog?
11:09 DanielC MD5, SHA1, SHA256, etc
11:09 DanielC hash
11:10 * DanielC would love to see a Perl 6 Readers Digest magazine
11:10 sjohnson what about CRC32 digest
11:10 DanielC Nope, not that one.
11:10 DanielC CRC is meant to detect errors, not to encrypt passwords.
11:11 DanielC You want a one-way trapdoor function.
11:11 sjohnson DanielC: it was used to encrypt passwords in the BBS days
11:11 sjohnson and in the PKZIP days too
11:11 sjohnson obviously a very poor choice, but you can't say it was never used to do that
11:11 DanielC Bad idea.
11:12 DanielC Did I say it was never used for that?
11:12 sjohnson "04:10:50       DanielC | CRC is meant to detect errors, not to encrypt passwords"
11:12 DanielC and that is correct.
11:12 DanielC CRC is meant to detect errors, not to encrypt passwords.
11:12 DanielC That doesn't mean that people won't misuse it
11:12 sjohnson well, who is to say that was its original intention only?
11:13 DanielC But passwords is not what CRC was designed for.
11:13 Sunbeam joined #Perl6
11:13 DanielC sjohnson: Do you know what CRC stands for?
11:13 sjohnson yes
11:13 DanielC Doesn't that give you a hint of what it's for?
11:13 sjohnson cyclic redunancy check
11:14 sjohnson im just saying, there may be a chance, that back in the day, the people who designed that also maybe thought it was good enough to digest passwords too,
11:14 sjohnson that's all i am saying
11:14 DanielC CRC was meant to detect errors in data transmission. Never to be a one-way trapdoor function.
11:14 sjohnson i dont know if it's true or not, but i am reserving jugement
11:14 DanielC sigh
11:15 DanielC CRC is an error-detecting code.
11:15 sjohnson SHA's are used for hashing passwords in some cases, right?
11:15 DanielC SHA was designed as a cryptographic hash function, yes.
11:15 sjohnson SHA's are also used to check that files weren't changed as well, right?
11:15 sjohnson ie, sha1sum -c
11:16 * clintongormley recommends ROT13 for ultimate password protection!
11:16 DanielC You can use them for that, that's a popular use.
11:16 DanielC But their design is as a one-way trapdoor function.
11:16 DanielC The SHA family would be a bit expensive if all you want to do is check for errors, but today CPU power is cheap, so why not.
11:17 sjohnson well, i know why CRC was made and what it is used for, you dont have to explaint that to me, that i understand
11:17 sjohnson i am just curious if people that designed also thought 'hey, this is good enough for passwords too'
11:17 sjohnson that's all, i just want the proof, that they agreed or disagreed with that 1 statement
11:17 DanielC You don't seem to. You said you were "reserving judgment" as to whether CRC was designed to hash passwords or not.
11:18 sjohnson that's right
11:19 * clintongormley locks sjohnson and DanielC in a room together, to fight it out
11:19 sjohnson just because it stands for "Cyclic Redunancy Check"
11:19 sjohnson is not solid proof
11:19 DanielC CRC was designed to be fast, easy to implement, and suitable for detecting accidental error. Making a one-way trapdoor function was not a design goal. You can read the RFC if you like.
11:20 DanielC The publication paper that introduced CRC says that it is for error detection.
11:20 sjohnson ok, that is what i wanted to know
11:20 DanielC The IEEE paper that made it a standard said the same.
11:20 DanielC sigh
11:21 sjohnson what's wrong
11:21 sjohnson you keep sighing
11:21 DanielC Just that it took so long to convince you, nevermind.
11:22 donaldh joined #perl6
11:22 DanielC CRC is basically just polynomial division.
11:22 * barney used CRC for sanity checking DNA sequences
11:23 DanielC barney: What do you do for a living? Are you a bioinformatics guy?
11:23 sjohnson well, sorry to annoy you then
11:23 cmv joined #perl6
11:23 sjohnson but i liked hearing what you had to say afterall
11:23 DanielC ok
11:23 sjohnson i just wasn't sure if at the time they thought "hey! this can be used for passwords!" like bill gates thought that "they'll never need more than 640k of ram!"
11:23 DanielC I'm glad I siad something worth hearing.
11:24 DanielC s/siad/said/
11:24 barney DanielC: I used to work in a bininformatics company, doing freelancing now
11:24 sjohnson DanielC: you see what i mean though, right? just my curiosity?
11:25 DanielC sjohnson: sure
11:25 sjohnson i will take your word for it, that no, in no way, did they intend that use
11:25 * viklund_ always encrypts his files with ROT13 - twice!
11:25 sjohnson viklund_: use caesar instead
11:25 DanielC barney: I hear Perl is very big in bioinformatics.
11:25 viklund_ DanielC: I can give you commit rights to November
11:25 sjohnson rot13 is too easy to crack
11:25 DanielC viklund_!!!!
11:25 DanielC viklund_: Good to see you. I have the digest program!
11:26 Matt-W rot13 twice is really convenient
11:26 Matt-W it's my favourite encryption mechanism
11:26 Matt-W for ease of use, you just can't beat it
11:26 viklund_ yes, it's the best
11:26 DanielC viklund_: You'll love it. Look:  http://pastebin.com/m18d1263c
11:26 viklund_ nice, pluggable!
11:27 * viklund_ reads the Q:PIR with joy
11:28 viklund_ what does comb do again?
11:28 DanielC array
11:29 viklund_ rakudo: my $t="asdf"; $t.comb.perl.say
11:29 DanielC rakudo: "hello".comb.perl.say
11:29 p6eval rakudo 86aeaf: OUTPUT«["a", "s", "d", "f"]␤»
11:29 p6eval rakudo 86aeaf: OUTPUT«["h", "e", "l", "l", "o"]␤»
11:29 viklund_ ah
11:29 viklund_ how is comb different from split?
11:29 DanielC they are opposites
11:29 DanielC With split you say what parts you want to remove, and with comb you say what parts you want to keep.
11:29 viklund_ rakudo: my $t="asdf"; $t.split.perl.say
11:29 p6eval rakudo 86aeaf: OUTPUT«No applicable candidates found to dispatch to for 'split'␤in Main (/tmp/5F7YMHMUuJ:2)␤»
11:30 viklund_ ahh
11:30 viklund_ rakudo: my $t="asdf"; $t.comb('as'.perl.say
11:30 p6eval rakudo 86aeaf: OUTPUT«Statement not terminated properly at line 2, near "('as'.perl"␤in Main (src/gen_setting.pm:0)␤»
11:30 viklund_ rakudo: my $t="asdf"; $t.comb('as').perl.say
11:30 p6eval rakudo 86aeaf: OUTPUT«No applicable candidates found to dispatch to for 'comb'␤in Main (/tmp/XQ7QmJXWc6:2)␤»
11:30 viklund_ rakudo: my $t="asdf"; $t.comb(/a|s/).perl.say
11:30 p6eval rakudo 86aeaf: OUTPUT«["a", "s"]␤»
11:30 viklund_ rakudo: my $t="asdf"; $t.comb(<a s>).perl.say
11:30 p6eval rakudo 86aeaf: OUTPUT«No applicable candidates found to dispatch to for 'comb'␤in Main (/tmp/FV1CkRkn2v:2)␤»
11:30 DanielC rakudo: "1a2b3c".comb(/\d/).perl.say
11:30 p6eval rakudo 86aeaf: OUTPUT«["1", "2", "3"]␤»
11:30 viklund_ oh well..
11:30 viklund_ nice
11:31 viklund_ and now is the time to add that to November.pm ;)
11:31 DanielC :-)
11:31 viklund_ DanielC: what's your github ID?
11:31 DanielC DanielC I think.
11:31 DanielC How do I check?
11:31 * DanielC goes to github
11:31 viklund_ log on to github?
11:32 DanielC dcarrera
11:32 DanielC That was going to be my next guess :-)
11:32 viklund_ now you can commit to November ;)
11:33 DanielC thanks :)
11:34 viklund_ if you want to, you can update the log_in method in November.pm to use the digest function, there are some commented lines that describes how it should be done.
11:34 viklund_ It's more or less copied from how it would be in p5
11:34 viklund_ welcome aboard
11:35 flexibeast joined #perl6
11:35 DanielC thanks
11:36 DanielC I'll edit November.pm later today.
11:36 viklund_ please do
11:37 viklund_ and you can also join the channel #november-wiki if you want to
11:37 DanielC How many people in that channel?
11:38 DanielC Are all those people working on November?
11:38 viklund_ not really
11:38 Matt-W web.pm is also discussed there
11:38 Matt-W which is definitely a related topic
11:39 Molaf joined #perl6
11:39 viklund_ thanks Matt-W
11:40 Matt-W it's why I was there for a bit :)
11:46 viklund DanielC: that digest function looks so simple, it's really nice
11:46 DanielC :-D
11:47 clintongormley so is all the MD5 etc stuff available via Parrot?
11:47 DanielC yup!
11:47 DanielC Parrot gets them through OpenSSL
11:47 DanielC So it's very fast.
11:48 clintongormley ok - very nice
11:48 clintongormley i'm guessing that SMOPS won't support PIR
11:48 clintongormley which means that libraries that use it are Parrot only
11:48 DanielC yeah
11:49 clintongormley that's a bit sad
11:49 DanielC yeah
11:49 Matt-W it's an inevitable consequence of having multiple implementations
11:49 clintongormley so either module authors need to have different backends
11:49 clintongormley or SMOPS needs to understand PIR as well, which is unlikely to happen
11:50 DanielC I can't imagine how SMOPS could understand PIR.
11:50 Matt-W it's really much the same thing as platform-specific C backends for Perl 5 modules
11:50 DanielC y
11:50 Matt-W PIR is just part of the platform if you're running on Rakudo Perl
11:50 clintongormley yes
11:51 clintongormley but in XS, unless you're calling (eg) a Win32 C library, your C code would be pretty much the same across OSes, no?
11:51 * viklund reads about the swedish bloggosspehere, Hume ans Spinoza...
11:51 * clintongormley says this knowing very little about C
11:51 Matt-W that entirely depends what you're calling
11:51 Matt-W and what you're planning on running it on
11:52 Matt-W most of the POSIX API is available in most places
11:52 Matt-W but most other things are rather less reliable
11:52 clintongormley ok
11:52 Matt-W and you don't need t ocall out to POSIX anyway, Perl provides most of that for you :)
11:52 DanielC clintongormley: Maybe it is possible for SMOP to support PIR if the user also has Parrot installed. Kind of like saying that you can use XS if you have a C compiler.
11:54 Matt-W It might be possible for it to embed parrot I suppose
11:56 payload hmm, maybe one can translate PIR to Perl 6 so it is useable in SMOP ^^
11:56 DanielC payload: That may not be feasible in the general case.
11:57 Matt-W rakudo: my $a = 'aa'; $a.=uc; $a.say;
11:57 p6eval rakudo 86aeaf: OUTPUT«AA␤»
11:57 DanielC payload: How would you translate "$P1 = loadlib 'digest_group'" to Perl ?
11:57 Matt-W How indeed would you translate to Perl a bunch of PIR designed to expose functions to Perl which Perl doesn't have?
11:58 DanielC Exactly.
11:59 payload i use a bigger smiley next time ^^ ;) ;-)
11:59 DanielC Ah... that's what that was.
12:00 DanielC I didn't realize ^^ was a smiley. I was wondering what it meant.
12:01 Matt-W there seems to be a set of horizontal smileys which I've never learned
12:01 payload it's a japanese smiley
12:01 Matt-W but which are common in some groups
12:01 Matt-W oooh
12:01 Matt-W that makes a lot of sense
12:01 DanielC ^.^
12:01 payload yes, with nose
12:01 Matt-W that fits with who uses them elsewhere
12:02 payload ^·^   with a middle dot
12:03 mizioumt joined #perl6
12:03 DanielC <:-)    dumb questions smiley
12:04 DanielC d:-)  Baseball cap.
12:04 DanielC &:-)   Bad hair day.
12:04 DanielC O:-)   Angel.
12:05 clintongormley damn - i just deleted a subversion branch which i meant to merge
12:05 clintongormley any ideas how i can reverse the delete without having to check out all branches first?
12:05 DanielC dunno
12:20 mberends DanielC, hi! your file-read-and-digest code is great!
12:20 DanielC mberends is here!
12:20 DanielC hi
12:21 DanielC Ok, you saw the code. :-)
12:21 mberends sorry, afk a lot because of relocation :(
12:21 DanielC np  moving house?
12:22 mberends yup, to London
12:22 Matt-W hmm
12:22 Matt-W never fancied living there myself
12:22 Matt-W was offered an interview for a good perl job once, but... london
12:23 mberends yes, I know, but needs must
12:24 mberends commuting to @jobs will be easier
12:24 mberends the air feels like it has 2% less oxygen than over the rest of the country
12:24 DanielC I went to London once. I thought it was an interesting city.
12:25 skids_ joined #perl6
12:30 clintongormley i lived in london for 5 years - and i go there once a month
12:30 clintongormley i enjoy being there, but the irritation of being subject to the transport in london makes me never want to live there again
12:30 clintongormley not to put a damper on your move, mberends :)
12:31 mberends DanielC, so I'm here in between other tasks. There is a Makefile and PIR driven test framework almost ready to commit
12:31 DanielC mberends: Sounds good.
12:32 mberends clintongormley, been there an suffered the transport hassles quite often. I think I'll join the hated brigade of cyclists...
12:33 clintongormley cycling in london is good - just beware of the trucks
12:33 DanielC If half the people used bicycles the traffic problems would be cut in half.
12:33 clintongormley what area of london are you in? and where will yo ube working?
12:33 Matt-W I quite like it to visit
12:33 Matt-W but I can't imagine living there
12:33 DanielC Drivers in London shouldn't get mad at cyclists. Would they rather you have a car?
12:34 mberends living initially in Bermondsey, working in The City and all about
12:35 clintongormley ahhh - easy bicycle commute then
12:35 clintongormley nice
12:35 mberends I'd like to look at Barbican in a year or two
12:35 clintongormley i used to cycle through hyde park every day - good for the soul
12:35 mberends very nice
12:36 clintongormley especially at 8am on a frosty winter morning
12:36 clintongormley very pretty, and deserted
12:37 Matt-W I like hyde park
12:37 Matt-W last time I was in london I spent quite some time enjoying it
12:37 Matt-W and then I nearly missed my train :)
12:37 Matt-W it is a dangerous place for that
12:37 clintongormley heh
12:37 Matt-W I got lost in some memories of other times there
12:38 mberends Southwark Park will be close by, It's smaller though.
12:38 Matt-W still a park :)
12:39 mberends :) with a fountain, a bandstand, large lawns, it should be very pleasant when it's sunny
12:40 Matt-W :)
12:40 Matt-W sounds good
12:40 Matt-W where're you moving from?
12:42 mberends Vught, NL. about 30 mins by car from the Belgian border. Great place, but lots of time spent travelling to customers
12:42 mberends also near Eindhoven, of PSV (football) fame
12:43 Matt-W well london will be a bit different then :)
12:43 Matt-W although london's a bit different to everywhere
12:43 Matt-W nowhere seems quite like it
12:44 mberends indeed, and it helps that I rather like the diversity of London
12:45 mberends well, gotta do @stuff(); afk &
12:45 pmurias joined #perl6
12:45 Matt-W oh it definitely has good points
12:47 spage joined #perl6
12:48 pmurias re SMOP supporting pir it shouldn't be very hard if you embed parrot, smop already has an initial p5 embedding support
12:54 payload joined #perl6
12:55 [particle]1 std: "x().!"
12:55 p6eval std 27057:  ( no output )
12:56 [particle] std: "x().'!'"
12:56 p6eval std 27057:  ( no output )
12:56 [particle] std: "x().\"!\""
12:56 p6eval std 27057: OUTPUT«ok 00:04 36m␤»
12:56 [particle] ...okay...
13:00 meppl joined #perl6
13:14 FurnaceBoy joined #perl6
13:19 rjh CRC is not designed to be secure
13:20 rjh but it is tasty!
13:24 viklund_ DanielC: do you know if there's a list of parrot-libs with descriptions somewhere?
13:25 viklund_ like the md5 lib
13:25 viklund_ (or digest really)
13:40 Molaf joined #perl6
13:43 snarkyboojum joined #perl6
13:46 AzureStone joined #perl6
13:48 decasm joined #perl6
13:50 alanhaggai joined #perl6
14:04 TimToady [particle]: if you're expecting x() to start an interpolation, it won't
14:04 [particle] i'm not
14:04 TimToady std: "x().!"
14:04 p6eval std 27057: OUTPUT«ok 00:04 36m␤»
14:05 jnthn rakudo: say "x().!"
14:05 p6eval rakudo 86aeaf: OUTPUT«x().!␤»
14:05 jnthn IIUC, that's the correct output - nothing to interpolate.
14:05 alanhaggai_ joined #perl6
14:05 TimToady yes, the only thing that changed recently is "$foo."
14:05 [particle] what does (no output) mean as a response from std?
14:06 zamolxes joined #perl6
14:06 TimToady it means it's recompiling, usually
14:06 [particle] ah, well there you go.  i expected "ok ..." and got no output
14:07 davidad joined #perl6
14:07 [particle] i was mainly making sure that the quoting of methods inside quotes behaved as advertised
14:07 TimToady it should make a new one in a new directory and then rename the whole directory, i think
14:07 davidad joined #perl6
14:07 davidad joined #perl6
14:08 TimToady but it doesn't even try any methods in your examples
14:08 TimToady std: "&x().!"
14:08 p6eval std 27057: OUTPUT«ok 00:04 49m␤»
14:09 [particle] std: "x().\"!\""
14:09 p6eval std 27057: OUTPUT«ok 00:04 36m␤»
14:09 TimToady just a string
14:09 TimToady never sees the . as a potential method call
14:09 TimToady std: "$x."
14:09 p6eval std 27057: OUTPUT«Potential difficulties:␤  Variable $x is not predeclared at /tmp/cJLGl1pbIG line 1:␤------> [32m"$x[31m."[0m␤ok 00:04 36m␤»
14:10 TimToady that one used to try . as a method call
14:10 [particle] oh, duh.
14:10 [particle] i read your two most recent spec commits and conflated them
14:10 TimToady std: "$x."!""
14:10 p6eval std 27057: OUTPUT«Potential difficulties:␤  Variable $x is not predeclared at /tmp/E7o4Qc0GS6 line 1:␤------> [32m"$x[31m."!""[0m␤ok 00:04 36m␤»
14:10 TimToady std: "$x."!"()"
14:10 p6eval std 27057: OUTPUT«Potential difficulties:␤  Variable $x is not predeclared at /tmp/h5qHnTV3MK line 1:␤------> [32m"$x[31m."!"()"[0m␤ok 00:04 36m␤»
14:10 [particle] assumed $x.'!' syntax applied to "$x."
14:10 DanielC viklund_: I just looked at parrot/src/dynpc
14:11 [particle] that's what happens with first-thing-in-the-morning-spec-reading
14:11 viklund_ DanielC: thx
14:11 TimToady well, if it doesn't find a trailing () it'll throw it out anyway
14:11 TimToady and just interpolate the $x
14:12 TimToady but it just used to get very confused on "$x." in trying to find that last ()
14:12 [particle] std: $x().{'!'}
14:12 p6eval std 27057: OUTPUT«Potential difficulties:␤  Variable $x is not predeclared at /tmp/OrEhR6R2AW line 1:␤------> [32m$x[31m().{'!'}[0m␤ok 00:02 36m␤»
14:12 [particle] std: &x().{'!'}
14:12 p6eval std 27057: OUTPUT«ok 00:03 49m␤»
14:12 Meldrake_ joined #perl6
14:13 TimToady std: &x()."!"
14:13 p6eval std 27057:  ( no output )
14:13 TimToady recompiling again, I think
14:13 [particle] yeah, that's annoying.
14:14 rjh hmm, i always assumed 'no output' meant 'not ok'
14:14 [particle] std: &x().'!'
14:14 p6eval std 27057: OUTPUT«ok 00:03 49m␤»
14:14 [particle] std: &x()."!"
14:14 p6eval std 27057: OUTPUT«ok 00:04 49m␤»
14:15 TimToady both of those are fine outside of quotes
14:15 TimToady and fine inside of quotes as long as you add another ()
14:16 TimToady the recent change only disallowed whitespace inside "&x()."a method"()"
14:17 TimToady so it backtracks and sees "&x()." as the quote
14:17 TimToady this should blow up:
14:17 TimToady std: "&x()."a method"()"
14:17 p6eval std 27057: OUTPUT«##### PARSE FAILED #####␤Syntax error (two terms in a row?) at /tmp/EbgJkZIZqT line 1:␤------> [32m"&x()."[31ma method"()"[0m␤    expecting any of:␤      POST␤   infix or meta-infix␤        infix stopper␤    postfix␤        postfix_prefix_meta_operator␤       standard stopper␤
14:17 p6eval ..statement modifier loop␤  termin…
14:18 TimToady std: "&x().'a method'()"
14:18 p6eval std 27057:  ( no output )
14:18 TimToady that's also okay
14:19 TimToady std: "&x().'a method'()"
14:19 p6eval std 27057:  ( no output )
14:20 TimToady std: "&x().'a method'()"
14:21 p6eval std 27057: OUTPUT«ok 00:04 49m␤»
14:21 masak joined #perl6
14:22 viklund_ hello masak
14:22 masak viklund_: hi.
14:23 justatheory joined #perl6
14:24 masak DanielC++ # sub digest
14:25 DanielC :-D
14:25 sitaram joined #perl6
14:25 DanielC masak: I was hoping you could help me write a 'Digest' module.
14:25 masak DanielC: sure.
14:26 * TimToady wonders what a Perl 6 Word Power page would look like
14:26 DanielC masak: Because the digest sub uses Parrot, I was thinking that the use statement should be "use Digest:from<Parrot>" or similar. But I have no idea how to do that.
14:26 masak DanielC: I've never seen someone do that in actual code.
14:27 DanielC Me neither.
14:27 masak DanielC: it's a nice thought, but don't expect it to work out-of-the-box.
14:27 DanielC I guess Rakudo doesn't implement it yet...
14:27 masak guess not.
14:27 masak it probably parses but ignores it.
14:27 masak (I think.)
14:27 DanielC Ok, let's just do a regular Digest module and worry about the :from later.
14:28 pmichaud good morning #perl6
14:28 DanielC o/ pmichaud
14:28 Matt-W wouldn't use Digest:from<Parrot> be for a module written in pure PIR?
14:28 Matt-W rather than a Perl 6 module which happens to use some inline PIR
14:29 DanielC Matt-W: How about a module that *requires* PIR?
14:29 jnthn I'd think so.
14:29 Matt-W is it Perl 6 using PIR though
14:30 Matt-W it's still a Perl 6 module
14:30 masak mornin', pm.
14:30 DanielC But it won't work on SMOP
14:30 Matt-W what it does inside isn't the concern of the person using it
14:30 Matt-W no, but that's not the concern of the person using it either
14:30 masak DanielC: making a module is as easy as putting a .pm file in a lib/ directory.
14:31 * viklund_ is thinking about writing his own hex repr -> unicode converter
14:31 masak DanielC: but a nice extra touch is probably to begin it with 'module Digest' and then export the digest sub.
14:31 DanielC How do you export?
14:31 masak DanielC: have a look at Tags.pm in the Web.pm repo.
14:32 [particle] sub digest is export {...};
14:32 DanielC thanks
14:32 Meldrake_ joined #perl6
14:33 DanielC http://pastebin.com/m1e3e8c9b  <-- that simple?
14:33 masak maybe even 'is export(:DEFAULT)'...
14:33 masak DanielC: no, the 'is export' comes after the params, I think...
14:33 rjh please don't export things by default
14:33 * viklund_ is feeling shifty...
14:33 icwiener joined #perl6
14:34 [particle] that's a perl 5 argument :P
14:34 DanielC masak: Ok. Should I upload it to the November wiki? viklund_ gave me access.
14:34 masak DanielC: I'd like that, thanks.
14:34 viklund_ DanielC++
14:34 masak DanielC: be sure to add yourself to the AUTHORS file while you're at it.
14:34 rjh ooh, nice
14:35 DanielC :)
14:35 DanielC yay, I'm an author now.
14:35 pmichaud_ joined #perl6
14:35 pmichaud_ once again my connection to freenode has been severed
14:36 pmichaud ....and restored
14:36 Matt-W :(
14:36 pmichaud I'm still looking for folks who can try out the new build system in the 'ins' branch of rakudo
14:37 Matt-W ooh
14:37 Matt-W new toys to play with?
14:37 Matt-W where do I sign up?
14:37 pmichaud they're still potentially broken toys
14:37 pmichaud s/potentially/likely/
14:37 alester joined #perl6
14:37 Matt-W I'll put it in a different place to my normal rakudo
14:38 payload joined #perl6
14:38 Matt-W oh wait
14:38 DanielC masak: I just did "git push". I sorted the AUTHORS file alphabetically. I hope that's ok.
14:38 Matt-W git branches
14:38 pmichaud instructions for building the branch at http://gist.github.com/127925
14:38 Matt-W different
14:39 * viklund_ checks new stuff in November
14:39 masak DanielC: perfectly ok. it should have been already, actually.
14:40 Matt-W pmichaud: first thing I notice is error messages in Configure.pl saying it can't find gmake
14:40 Matt-W pmichaud: although it carries on and compiles parrot
14:41 pmichaud Matt-W: what platform are you on...?
14:41 Matt-W ...which then, apparently, isn't there
14:41 Matt-W Ubuntu Jaunty
14:41 pmichaud that's odd.
14:41 pmichaud why would it be looking for gmake?
14:41 Matt-W I've got GNU make, but they don't provide a gmake alias
14:41 Matt-W I don't know
14:42 viklund_ afk -> out in the sun
14:42 masak DanielC: oh, you sorted them by first name instead of last name. :) sure, why not.
14:42 DanielC masak: I would be happy to sort by last name too if you like.
14:42 masak DanielC: that's the way it was until you edited the file. :P
14:42 DanielC sorry!
14:42 masak doesn't matter. at all.
14:43 Matt-W pmichaud: second thing to notice is that it behaves if I realclean it myself before running Configure. Put it down to switching branches, perhaps.
14:43 masak I'm fine either way.
14:43 DanielC I didn't notice that because the names are written <firstname> <lastname>
14:43 masak aye.
14:43 pmichaud oh yes, a realclean is probably in order
14:43 DanielC So way I saw them, it looked random.
14:43 masak probably better this way, then.
14:43 * Matt-W waits for Parrot to build
14:43 masak anyway, thanks for the module!
14:43 pmichaud It should work fairly well on Jaunty (that's what I'm running)
14:43 DanielC We can write the names as <lastname>, <firstname>  That's very common.
14:43 Matt-W heh I hope it does then
14:43 pmichaud I'm curious about Win and Mac systems
14:44 pmichaud I really should see about setting up a Win environment for me to test with
14:44 masak DanielC: if you create your own repository for it, we can make a dependency in November.
14:44 Matt-W I could get it up and running on windows 7 RC at some point, but the only dev environment on there at the moment is Visual C#
14:44 Matt-W pmichaud: hmm no help, I get
14:44 Matt-W Reading configuration information from parrot/install/bin/parrot_config ...
14:44 Matt-W Parrot revision r39503 required (currently r0)
14:44 Matt-W To automatically checkout (svn) and build a copy of parrot r39503,
14:44 Matt-W try re-running Configure.pl with the '--gen-parrot' option.
14:44 Matt-W Or, use the '--parrot-config' option to explicitly specify
14:44 Matt-W the location of parrot_config to be used to build Rakudo Perl.
14:44 masak but it might be nice to get the module to do some actual work first...
14:44 DanielC masak: Someone should make a place to store Perl 6 modules. It's not good to have them scattered around the way they are today.
14:45 Matt-W sorry, should've nopasted that
14:45 pmichaud Matt-W: what do you get with    parrot/install/bin/parrot_config --dump
14:45 pmichaud (I'm expecting segfault)
14:45 Matt-W pmichaud: a large pile of key-value pairs
14:45 Matt-W no segfault
14:45 pmichaud weeeeird
14:46 pmichaud may try Configure.pl --gen-parrot again?
14:46 pmichaud *maybe
14:46 * Matt-W tries that
14:46 Matt-W it's definitely building it
14:46 pmichaud it shouldn't try to rebuild parrot a second time
14:46 masak DanielC: yes, like a central Perl 6 archive network of some kind.
14:47 DanielC :-)
14:47 DanielC it should be comprehensive too.
14:47 Matt-W pmichaud: it seems to have cleaned it as its first action
14:47 masak DanielC: oh, right.
14:47 pmichaud cleaned Parrot?
14:47 Matt-W looked like it
14:47 Matt-W it went by rather fast
14:47 pmichaud that's possible.
14:47 DanielC masak: Now, seriously, we do need a place to put Perl 6 modules until "CPAN6" shows up.
14:47 masak DanielC: you'll have to excuse me if I don't sit around for that happening, but instead using github as an intermediary. :)
14:47 Matt-W pmichaud: and again, it thinks I have parrot r0
14:47 pmichaud DanielC: the perl6 repo awaits
14:48 DanielC pmichaud: ???
14:48 masak DanielC: the nice thing about having a separate repo for Digest.pm is that other projects can then use it too.
14:48 pmichaud DanielC: I freely create repos in the perl6 account on github
14:48 DanielC masak: ok
14:48 pmichaud (and give out commit bits)
14:48 Matt-W pmichaud: parrot_config is saying "revision => '0'"
14:49 pmichaud .....I wonder why '0' ?
14:49 DanielC pmichaud: Great. Do you want to make a repo for Digest.pm or a general repo like "modules" or "cpan6" ?
14:49 pmichaud DanielC: I can go either way
14:49 pmichaud probably easier to have a Digest.pm repo for now
14:49 pmichaud or we could do "modules"
14:50 pmichaud or "libraries"
14:50 DanielC Ok. I was about to say "modules" because it seems odd to have a repo for just one file.
14:50 pmichaud or something like that
14:50 Matt-W I've got a whole repo for Form.pm
14:50 Matt-W of course, that comes with its tests
14:50 Matt-W and its support modules
14:50 pmichaud definitely _not_ cpan6, that seems like placing a very large match next to a very large container of flammable material
14:50 * Matt-W gets a fire blanket
14:50 DanielC pmichaud: indeed
14:51 DanielC pmichaud: "modules" is nice.
14:52 viklund joined #perl6
14:52 DanielC I think it'll help to have the Perl 6 modules in one place.
14:53 nihiliad joined #perl6
14:53 pmichaud created
14:53 pmichaud added "dcarrera" as collaborator
14:53 DanielC yay
14:55 Matt-W pmichaud: configure.pl needs better error handling. I just threw away my parrot, tree and then it realised I didn't have svn installed, but carried on with some other stuff afterwards even though I asked for --gen-parrot.
14:55 pmichaud Matt-W: any chance you have some other parrot installed somewhere?
14:55 Matt-W pmichaud: not a tiny weeny little chance
14:55 pmichaud so, that means a big one?  ;-)
14:55 Matt-W less chance than the chance that the sun went nova thirty seconds ago
14:55 masak DanielC: this sounds a bit like perl6-examples. what's the difference?
14:56 DanielC masak: It's for modules, not examples.
14:56 viklund lol
14:56 DanielC As in.. usable modules, with the .pm extension and all, and maybe tests.
14:56 masak mberends: maybe you should move your modules to 'modules', then. :)
14:56 Matt-W 'maybe' tests?
14:56 viklund perl6-tests?
14:56 Matt-W there must be tests!
14:56 masak please no.
14:56 DanielC Matt-W: Ok, definitely tests :)
14:57 pmichaud Matt-W: it carried on with some other stuff?  Seems like it couldn't have gotten far without parrot installed
14:57 DanielC Matt-W: Maybe you can help me with that?
14:57 TimToady maybe the sun could carry on with some other stuff
14:57 pmichaud so if you threw away your parrot, it had to have found a parrot somewhere
14:57 Matt-W pmichaud: it didn't get far, but it didn't stop straight away
14:57 Matt-W argh
14:57 Matt-W it just built parrot
14:57 Matt-W now it can't find parrot_config!
14:57 pmichaud ....but
14:57 pmichaud but
14:57 pmichaud how is it getting parrot if you don't have svn installed?
14:57 viklund perl6-obfu?
14:57 DanielC pmichaud: Digest.pm is now in perl6/modules
14:57 Matt-W I installed it :)
14:58 pmichaud ah
14:58 pmichaud I'm still confused, but okay.
14:58 Matt-W I'm confused too
14:58 Matt-W let me make sure everything's all clean and tidy and try again
14:59 DanielC Matt-W / masak: I don't know how to do tests. Is there a program you use? Can I get some guidance?
14:59 masak DanielC: take a look at November or Druid or Form.
14:59 DanielC ok
14:59 masak no special program. just write your tests in t/.
15:00 masak I did write a couple of Test:: modules though.
15:00 masak Test::InputOutput and Test::Ix.
15:00 masak mberends++ wrote Test::Difference
15:03 Matt-W I just use Test.pm from rakudo
15:03 Matt-W what does Test::Ix do?
15:03 masak yes, that's often enough.
15:03 masak Matt-W: hang on, I'll show you.
15:03 masak Matt-W: http://github.com/masak/druid/blob/master/t/01-game-rules.t
15:04 masak Matt-W: Test::Ix provides the count-tests and run-tests subs. they traverse the array and count/run the tests.
15:07 Matt-W pmichaud: okay, it was my fault
15:08 Matt-W pmichaud: rakudo's building now
15:08 Matt-W masak: so it uses the strings to construct subroutine names to run
15:09 Matt-W masak: I like the look o fthat
15:09 Matt-W pmichaud: build successful
15:09 masak Matt-W: yes, it's quite handy.
15:09 Matt-W pmichaud: however, it doesn't start up
15:09 masak Matt-W: and it encourages a nice workflow, too. write an index of the tests, have the subs generated for you, fill in the subs with content.
15:10 Matt-W masak: oh it can generate the subs for you too?
15:10 masak yes, there's a script in the bin/ folder in the Druid repo that does that.
15:11 pmichaud "it doesn't start up"?
15:11 pmichaud as in, ./perl6 doesn't work?
15:14 Matt-W oh yes, that works
15:14 Matt-W if I try and invoke it from another directory though
15:14 Matt-W it doesn't work then
15:14 molaf_x joined #perl6
15:14 pmichaud oh, I'm not too surprised that it will now fail from other dirs
15:15 pmichaud I'm not entirely sure how to fix that, either.
15:15 Matt-W pmichaud: http://gist.github.com/127965
15:15 pmichaud right
15:16 DanielC masak: I have no idea how the stuff inside november/t works
15:16 viklund DanielC: are you familiar with TAP?
15:16 pmichaud okay, that tells me it's working on your system
15:16 pmichaud "make test" should pass, at any rate.
15:17 DanielC viklund: What is TAP and what do you eat it with?
15:17 viklund its the Test Anything Protocol, it's whats used for tests in p5 and in p6
15:17 Matt-W pmichaud: not quite
15:17 Matt-W t/01-sanity/07-isa.................FAILED tests 1, 3                          Failed 2/3 tests, 33.33% okay
15:18 DanielC viklund: Is there a simple tutorial, like "TAP for dummies"?
15:18 viklund http://en.wikipedia.org/wiki/Test_Anything_Protocol
15:19 viklund http://search.cpan.org/~petdance/TAP-1.00/TAP.pm
15:19 DanielC *click*
15:19 Matt-W DanielC: note that you don't have to worry about most of the details, the Test modules and prove handle most of the work for you
15:19 meppl joined #perl6
15:19 viklund rakudos Test.pm helps in printing "ok 1" and "not ok 1" ans so forth
15:20 DanielC Matt-W: I feel like a deer on headlights. This TAP stuff is all Greek to me. The tests for my module should be easy. Just try to hash a sample text for each algorithm...
15:20 masak DanielC: really fast tutorial: you call 'plan 5', or however many tests you want to run. then you call the 'ok' sub five (or whatever) times. 'ok' takes a boolean as its first argument.
15:20 donaldh joined #perl6
15:21 masak DanielC: if the boolean is True, the test succeeds.
15:21 Matt-W DanielC: if you find November's test code too complicated, Form's is pretty simple
15:21 Matt-W and may serve as a good starting point
15:21 viklund ok( hash("string") eq '3478987c87d8e')
15:21 masak DanielC: 'ok' also has a number of handy synonyms (all found in Test.pm), such as 'is'.
15:21 DanielC Matt-W: I'll look at Form. Where can I find it?
15:21 Matt-W github.com/mattw/form
15:21 DanielC viklund: I need even more elementary help than that. How do I even run the test? Do I need to download Test.pm from somewhere? etc.
15:22 Matt-W Test.pm comes with rakudo
15:22 DanielC ah!
15:22 Matt-W a lot of projects have a test target in their makefiles
15:22 DanielC Ok, I feel better already.
15:22 Matt-W Form's uses a tool called prove, which comes with Perl I believe
15:22 Matt-W prove understands the output of things it runs which speak TAP, and gives you an overview of the results
15:23 Matt-W or you can just run the scripts directly
15:23 Matt-W .t scripts are nothing particularly special, they're just Perl 6 scripts (in Form's case)
15:23 DanielC I'll start with the simplest thing possible. I assume that means running directly.
15:23 Matt-W it's usually a good start, I find
15:23 DanielC Do you run them with "perl6 foo.t" ?
15:23 Matt-W it's what I tend to do when I get a failing test
15:24 Matt-W especially because I often start sticking more output statements in the test script to see what's really going on
15:24 Matt-W yes
15:24 Matt-W just like you would if it was .pl
15:24 Matt-W rakudo doesn't care
15:24 DanielC Does Rakudo already know that Digest.pm must be in ../lib/Digest.pm ?
15:25 viklund no
15:25 viklund add that to PERL6LIB
15:25 pmichaud that may change soon, once we can start to have "installed Rakudo"
15:25 pmichaud then we can look at having a place to stick the modules :-)
15:25 Matt-W pmichaud: did you pick up that I got rakudo make test failures
15:25 pmichaud Matt-W: yes.  I'm trying a fresh checkout on my machine.
15:26 masak pmichaud: that'd be great.
15:26 Matt-W pmichaud: great
15:29 DanielC Ok, now I just need to know how to tell Rakudo to look in ../lib/Digest.pm
15:29 DanielC Other than that, I think I'm ready for my first test.
15:29 viklund set the shell env var PERL6LIB=../lib
15:29 DanielC ok
15:30 DanielC Can't find ./Test in @*INC
15:30 DanielC :-(
15:30 DanielC http://pastebin.com/m4ca7fb23  <-- this is my test
15:31 viklund hmm
15:31 viklund masak?
15:31 masak viklund: sorry, what was the question?
15:32 DanielC perl6 -e '@*INC.perl.say'  =>  ["../lib", "."]
15:32 viklund DanielC needs help
15:32 masak fwiw, I've had @*INC troubles lately too.
15:32 masak DanielC: what platform are you on?
15:32 DanielC Ubuntu Linux.
15:32 masak ok. should be fine then.
15:32 masak DanielC: did you use export?
15:32 viklund try adding the rakudo dir to PERL6LIB too
15:33 DanielC export PERL6LIB=../lib
15:33 viklund PERL6LIB=rakudodir:../lib
15:33 masak seems that should work. strange.
15:33 DanielC yay!
15:34 DanielC With the new PERL6LIB it works.
15:34 masak viklund++
15:35 Meldrake_ joined #perl6
15:43 DanielC Yay! I have tests.
15:43 DanielC The last line says:  # Looks like you planned  tests, but ran 11
15:43 DanielC Is that normal? The "but" confused me a bit.
15:43 masak DanielC: then you probably didn't have a 'plan' call in the beginning.
15:44 DanielC ah
15:44 DanielC how do I add a plan call?
15:44 masak DanielC: add 'plan 21' in the beginning.
15:44 masak after 'use Test'
15:44 masak it's just a normal sub call.
15:44 DanielC Whoo hoo!
15:44 masak it tells Test.pm how many tests you expect to run in the test file.
15:45 DanielC Thanks for the help. Now I have my very first Perl 6 test suite.
15:46 DanielC "git push"
15:46 DanielC Btw, I added shortcut functions:  Digest::sha1($text)
15:48 masak DanielC: excellent. both the test suite and the shortcuts. DanielC++
15:55 clkao joined #perl6
16:00 viklund_ rakudo: "1a1a1".split(1).perl.say;say "Just bit me"
16:00 p6eval rakudo 86aeaf: OUTPUT«["", "a", "a", ""]␤Just bit me␤»
16:01 amoc i don't know this is issue but: say "ㄱ".."ㅎ"; seems to make rakudo drop in infinite loop.
16:01 viklund_ is there a better way than:
16:01 viklund_ rakudo: "1a1a1".split(1).grep({$^w}).perl.say
16:01 p6eval rakudo 86aeaf: OUTPUT«["a", "a"]␤»
16:01 viklund_ to get rid of null elems?
16:02 DanielC null elems?
16:02 DanielC What are those?
16:02 viklund_ ""
16:02 DanielC ah
16:02 viklund_ empty strings in this case...
16:02 DanielC hm
16:03 DanielC rakudo: "1a1a1".split(1).grep(/./).perl.say
16:03 p6eval rakudo 86aeaf: OUTPUT«["a", "a"]␤»
16:03 masak amoc: care to report a rakudobug?
16:03 viklund_ I was more thinking of telling split something
16:03 DanielC yeah
16:03 DanielC I don't know, I'm thinking...
16:04 DanielC No idea.
16:04 viklund_ oh, well, grep works...
16:04 DanielC Ok... so /^/ matches the beginning of a line... is there some regex that says "not the beginning of a line"?
16:05 DanielC rakudo: "1a1a1".split(/\b1/).perl.say
16:05 p6eval rakudo 86aeaf: OUTPUT«["", "a1a1"]␤»
16:05 DanielC hm
16:05 * DanielC was hoping that b meant "word boundary"
16:05 viklund_ it does
16:05 masak pmichaud: is <foo=bar> implemented in PGE?
16:05 amoc masak: er.. i was not sure it is okay or real problem to report.
16:05 viklund_ that's what you split on
16:06 DanielC Ok, so I guess "a1" is considered a single word.
16:06 masak amoc: it sounds like one.
16:06 masak DanielC: words are \S+, so yes.
16:06 DanielC rakudo: "1a1a1".comb(/<alpha>/)
16:06 p6eval rakudo 86aeaf:  ( no output )
16:06 DanielC rakudo: "1a1a1".comb(/<alpha>/).perl.say
16:06 p6eval rakudo 86aeaf: OUTPUT«[Match.new(␤ # WARNING: this is not working perl code␤ # and for debugging purposes only␤ ast  => "a",␤ Str => "a",␤ from => 1,␤ to   => 2,␤ named => {␤  'alpha' => Match.new(␤    ast  => "a",␤    Str => "a",␤    from => 1,␤    to   => 2,␤   ),␤ },␤), Match.new(␤ # WARNING:
16:06 p6eval ..this is…
16:06 DanielC ??
16:07 masak ¿¿
16:07 DanielC rakudo: "1a1a1".comb(/<[a-z]>/).perl.say
16:07 p6eval rakudo 86aeaf: OUTPUT«perl6regex parse error: Unescaped '-' in charlist (use '..' or '\-') at offset 27, found '-'␤in Main (src/gen_setting.pm:0)␤»
16:07 DanielC come on!
16:07 DanielC rakudo: "1a1a1".comb(/a/).perl.say
16:07 p6eval rakudo 86aeaf: OUTPUT«["a", "a"]␤»
16:07 masak rakudo: "1a1a1".comb(/<alpha>/)>>.Str.perl.say
16:07 p6eval rakudo 86aeaf: OUTPUT«["a", "a"]␤»
16:07 viklund_ yes well I could do it like this:
16:08 DanielC ok
16:08 hanekomu_ joined #perl6
16:08 mberends DanielC, I have a backlog in my backlogging, but managed to push an initial 'make test'. it may 'make PARROT_DIR=something test' to work for you. and there's a significant "cheat" to be removed ;)
16:08 DanielC "git pull"
16:09 viklund_ rakudo: "%E2%98%BB".comb(/(<alpha>|\d)+/)>>.Str.perl.say
16:09 p6eval rakudo 86aeaf: OUTPUT«["E2", "98", "BB"]␤»
16:09 viklund_ it feels saner to split on '%'
16:09 viklund_ rakudo: "%E2%98%BB".split('%').grep({$^w}).perl.say;
16:09 p6eval rakudo 86aeaf: OUTPUT«["E2", "98", "BB"]␤»
16:10 viklund_ either way works though
16:10 mberends DanielC, after the initial steps are there any changes you would like to make to our roadmap?
16:11 DanielC "make test" seems to work.
16:11 mberends cool
16:11 * DanielC reads the roamap
16:11 DanielC I can't think of any changes to the roadmap.
16:11 DanielC Ok, (3) is obsolete.
16:11 mberends ok
16:12 DanielC (3) could be replaced with MD5
16:12 mberends md5 makes much more sense
16:12 DanielC It's way faster too, since it uses the OpenSSL implementation.
16:13 rjh let's use SHA512!
16:13 DanielC :-)
16:14 * masak goes home to secure food
16:15 mberends could you look into 03-checksum.t and figure out why the call to md5() dies? (near the "cheat"). it cannot find the MD5 class, and has stumped me so far.
16:15 DanielC mberends: The roadmap looks good. I hope you know how to o the parrot hashtable thing.
16:15 DanielC ok
16:16 DanielC mberends: I don't know if the function can understand hex values.
16:17 DanielC 0x7fffffff
16:17 mberends DanielC, if the docs make sense, we create a hash pmc, insert module names as key and array pmcs as values into it, and freeze that to a file
16:17 mberends we can try the 16 million whatever number, but the err was about class MD5
16:18 mberends the file being 'digested' is way shorter anyway
16:19 DanielC The test works on my computer.  :-P
16:20 DanielC ok 2 - md5 of storage-format.html
16:20 mberends it's great that you're getting into the TAP mindset, and great that chromatic++ ported Test::More to PIR
16:20 mberends without cheating?
16:20 DanielC Without cheating.
16:20 DanielC What's the error on your computer?
16:21 mberends well done! then something is wrong here... dunno
16:21 mberends chatting from another computer atm
16:21 DanielC afk
16:23 StephenPollei sha512 is probably overkill , sha224 or skein might be nice though depending on what its needs are
16:25 DanielC StephenPollei: It's just to detect errors. MD5 is more than enough.
16:27 StephenPollei sure than crc32 , crc64, or crc128 might be ok as well then, depends on how much probability of detection and how robust
16:27 DanielC Any CRC would do fine. The reason we pick MD5 is that Parrot comes with it, through the OpenSSL library, so it's very fast.
16:28 rjh md5 seems to be more standard for consistency checks
16:28 DanielC The OpenSSL MD5 is faster than a CRC implemented in Parrot.
16:28 rjh even if crc is sufficient
16:28 rjh for secure hashing, i wouldn't be comfortable with anything less than sha224
16:28 rjh but that's another issue
16:30 DanielC "secure hashing" is an overly broad term. If you want collision resistance, SHA256 or better would be a good idea (what's the point of using sha224 anyways?). For pre-image resistance, SHA1 and even MD5 are just fine.
16:30 rjh isn't 224 just 256 with some bits chopped off?
16:30 StephenPollei I thought there was another small break in sha recently
16:30 DanielC rjh: Pretty much.
16:30 rjh yeah, no idea why that exists
16:31 DanielC rjh: For compatibility with some systems that can't handle more than 224 bits. :-P
16:31 Psyche^ joined #perl6
16:32 StephenPollei long term skein or whatever wins the nist contest
16:33 rjh StephenPollei: the nist contest doesn't end until 2012 or something
16:34 rjh sha256 looks decent though
16:34 DanielC I like Whirlpool mostly because it is different from the SHA family.
16:34 DanielC MD5* SHA* are all basically the same construction.
16:34 StephenPollei yes thats why I said long term not short or medium .. I think Bruce Schneier's and others skein sounded neat though, but I haven't really looked to deep into it
16:35 DanielC One thing I like about the NIST contest is that it creates an opportunity for people to experiment with other ways to do hashes.
16:35 rjh with the symmetric contest we got Rjindael and Twofish
16:35 DanielC y
16:35 rjh both quite different to DES
16:35 rjh ahem
16:36 DanielC Well... but in the case of symmetric algorithms, at least there was already a lot of research on how to make those.
16:36 DanielC We don't have anywhere near the same research for hashes.
16:36 rjh That's true, hence the contest
16:36 leedo a ruby friend of mine just did this, thought someone here might be interested
16:36 leedo http://gist.github.com/128037
16:37 DanielC leedo: Your friend just took it from my blog.
16:37 DanielC leedo: See the last line in the file.
16:37 rjh read down for ruby version
16:37 StephenPollei true thats also why its a good idea that they let things simmer until 2012 , in analyzing the new hashes they might come up with new breaking methods
16:37 DanielC ah
16:37 leedo DanielC: he ported it to ruby for comparison
16:37 DanielC leedo: ah!!
16:38 DanielC Well, I'm glad someone looked at my blog and thought it was interesting.
16:38 leedo yeah, i was intrigued by the new regex stuff
16:39 DanielC The Perl grammar is more clean.
16:39 rjh not a good advertisement for ruby in this case, though - using regexes, and not having true lexicals
16:39 DanielC But the Ruby port is amazingly similar.
16:39 DanielC Ruby++
16:40 DanielC I don't expect Ruby to have everything in Perl 6, just as I don't expect Perl 5 to have everything in Ruby... Languages evolve...
16:40 rjh The regex approach looks primitive in comparison
16:41 DanielC rjh: It does.
16:41 DanielC As I said... languages evolve.
16:41 DanielC Perl 5 looks primitive next to Ruby.
16:41 rjh yeah
16:41 rjh but it's a good sign
16:41 DanielC Ruby got the best parts out of Perl 5, and Perl 6 got the best pars out of Ruby.
16:41 DanielC yeah, that too
16:41 DanielC It suggests that Perl 6 is going in a good direction.
16:42 * rjh wonders what a perl 5 implementation would look like
16:42 rjh there's no scan, you'd have to use //g
16:43 DanielC The Ruby version looks a bit fragile, because he uses \* instead of <ws>
16:43 DanielC uses \s*
16:43 rjh ruby's re parser is unicode-aware, though
16:43 DanielC That could do something unexpected.
16:43 DanielC No, that's not what I mean.
16:43 rjh oh, is <ws> more intelligent?
16:44 DanielC 22 <-- \s* would match in between the 2's but <ws> would not.
16:44 DanielC <ws> does not match inside a word.
16:44 DanielC So yes, <ws> is smarter.
16:44 rjh yes
16:44 rjh i'd like to see the same approach with infix notation
16:45 rjh Perl 6 would be a lot stronger there
16:45 DanielC Do what with infix?
16:45 rjh (2 + 2) * 3 etc. rather than RPN
16:45 DanielC ah
16:45 DanielC That would be interesting.
16:56 d4l3k_ joined #perl6
16:58 M_o_C joined #perl6
17:00 Molaf joined #perl6
17:00 dalek joined #perl6
17:13 charsbar joined #perl6
17:13 DanielC rakudo: class F { has ($.position, $.alive = true); }
17:13 p6eval rakudo 86aeaf: OUTPUT«Unable to parse declarator; couldn't find final ')' at line 2, near "= true); }"␤in Main (src/gen_setting.pm:0)␤»
17:13 DanielC :-(
17:14 DanielC rakudo: class F { has ($.foo, $.bar is rw); }
17:14 p6eval rakudo 86aeaf:  ( no output )
17:14 DanielC rakudo: class F { has ($.foo, $.bar = 1); }
17:14 p6eval rakudo 86aeaf:  ( no output )
17:14 DanielC rakudo: class F { has ($.foo, $.bar = true); }
17:14 p6eval rakudo 86aeaf: OUTPUT«Unable to parse declarator; couldn't find final ')' at line 2, near "= true); }"␤in Main (src/gen_setting.pm:0)␤»
17:14 DanielC rakudo: true
17:14 p6eval rakudo 86aeaf: OUTPUT«Syntax error at line 2, near "true"␤in Main (src/gen_setting.pm:0)␤»
17:15 DanielC rakudo: True
17:15 p6eval rakudo 86aeaf:  ( no output )
17:15 DanielC rakudo: class F { has ($.foo, $.bar = True); }
17:15 p6eval rakudo 86aeaf:  ( no output )
17:15 DanielC :-)
17:17 charsbar_ joined #perl6
17:18 sri_kraih joined #perl6
17:19 jnthn_ joined #perl6
17:19 PerlJam joined #perl6
17:20 dalek joined #perl6
17:21 Chillance joined #perl6
17:22 * viklund_ is confused
17:23 viklund_ someone here who has battled with UTF8 conversions?
17:23 pmichaud joined #perl6
17:27 sbp viklund_: what's the problem?
17:27 sri_kraih joined #perl6
17:31 viklund_ I'm trying to decode urlencoded unicode into unicode
17:32 viklund_ I get %E2%98%BB and that should become ☻
17:32 viklund_ I manage to do that, but when I mix 3 byte and 2 byte characters, something blows up
17:33 viklund_ I get: ☻  � � �
17:33 viklund_ (the last three should be "å ä ö")
17:34 viklund_ but if I decode the urlencoded å ä ö by itself it works...
17:55 Molaf joined #perl6
17:56 viklund_ can I force a string into utf8 in rakudo?
17:56 mizioumt left #perl6
17:57 StephenPollei maybe you have to convert a buf8 into utf8 Str .. no clue how
17:59 StephenPollei http://perlcabal.org/syn/ 15Unicode(TBD)
17:59 viklund_ rakudo: say "åäö ☻"
17:59 p6eval rakudo 86aeaf: OUTPUT«åäö ☻␤»
17:59 viklund_ hmm
18:00 viklund_ maybe my terminal is breaking stuff as well
18:01 viklund_ no
18:01 StephenPollei http://perlcabal.org/syn/S02.html A Str is a Unicode string object.
18:02 StephenPollei I don't know how much of the Str stuff is implemented , I know that StrPos and StrLen don't seem to exist
18:04 StephenPollei rakudo: my StrPos $foo;
18:04 p6eval rakudo 86aeaf: OUTPUT«Malformed declaration at line 2, near "StrPos $fo"␤in Main (src/gen_setting.pm:0)␤»
18:04 StephenPollei rakudo: my StrLen $foo;
18:04 p6eval rakudo 86aeaf: OUTPUT«Malformed declaration at line 2, near "StrLen $fo"␤in Main (src/gen_setting.pm:0)␤»
18:07 viklund_ oh well
18:09 pmichaud rakudo still (incorrectly) uses ints for StrPos and StrLen
18:10 pmichaud the most likely "correct" solution will be to convert %e2%98%bb into an int, and then use .chr on the int to produce the character
18:11 pmichaud last week I put a query to parrot-dev asking how to convert a fixed 8-bit to a utf8 encoding, but no response yet.
18:11 viklund_ ;(
18:11 viklund_ it's not so easy as to convert %e2%98%bb into an int...
18:12 viklund_ it's the bytes for the unicode chr that is shown there, not the unicode codepoint...
18:12 viklund_ the codepoint is, ehm
18:13 pmichaud its the bytes for the *utf8* char that is there
18:13 viklund_ maybe
18:13 viklund_ yes
18:13 viklund_ maybe I'm confused
18:14 viklund_ you mean:
18:14 viklund_ rakudo: say :16("e298bb")
18:14 p6eval rakudo 86aeaf: OUTPUT«14850235␤»
18:14 viklund_ rakudo: say chr(:16("e298bb"))
18:14 p6eval rakudo 86aeaf: OUTPUT«Invalid character for UTF-8 encoding␤in method Any::chr (src/gen_setting.pm:174)␤called from Main (/tmp/ux3duSGugt:2)␤»
18:15 viklund_ and not
18:15 viklund_ rakudo: say chr(:16("263B"))
18:15 p6eval rakudo 86aeaf: OUTPUT«☻␤»
18:15 viklund_ I'm not sure about the terminology here
18:15 pmichaud the code point for the above would be     (0xe2 +& 0x0f) +< 12 +  (0x98 & 0x3f) +< 6 + (0xbb & 0x3f)
18:15 viklund_ yes
18:15 pmichaud rakudo: say (0xe2 +& 0x0f) +< 12 +  (0x98 & 0x3f) +< 6 + (0xbb & 0x3f)
18:15 p6eval rakudo 86aeaf: OUTPUT«get_integer() not implemented in class 'Junction'␤in Main (/tmp/oaNUggRGYk:2)␤»
18:16 pmichaud rakudo: say (0xe2 +& 0x0f) +< 12 +  (0x98 +& 0x3f) +< 6 + (0xbb +& 0x3f)
18:16 p6eval rakudo 86aeaf: OUTPUT«9787␤»
18:16 viklund_ yep, and that's what I feed into chr
18:16 pmichaud rakudo:  say sprintf("%04x", 9787);
18:16 p6eval rakudo 86aeaf: OUTPUT«263b␤»
18:16 pmichaud rakudo:  say chr(9787);
18:16 p6eval rakudo 86aeaf: OUTPUT«☻␤»
18:17 viklund_ but, say å, thats %C3%A5
18:17 viklund_ which becomes
18:17 pmichaud rakudo:  say (0xc3 +& 0x1f) +< 6 + (0xa5 & 0x3f)
18:17 p6eval rakudo 86aeaf: OUTPUT«Junction()<0xb6c41020>␤»
18:18 pmichaud rakudo:  say (0xc3 +& 0x1f) +< 6 + (0xa5 +& 0x3f)
18:18 p6eval rakudo 86aeaf: OUTPUT«229␤»
18:18 viklund_ ty
18:18 pmichaud rakudo:  say chr(229)
18:18 p6eval rakudo 86aeaf: OUTPUT«å␤»
18:19 viklund_ rakudo: say chr(229), chr(9787)
18:19 p6eval rakudo 86aeaf: OUTPUT«å☻␤»
18:19 viklund_ rakudo: say chr(229) ~ chr(9787)
18:19 p6eval rakudo 86aeaf: OUTPUT«\xE5☻␤»
18:19 viklund_ That's my problem!
18:19 lichtkind mberends: ping
18:19 pmichaud ah, that looks like a parrot bug.
18:19 pmichaud Looks to me like parrot has trouble concatenating latin-1 and utf-8 strings.
18:20 viklund_ rakudo: say join('', chr(229), chr(9787))
18:20 p6eval rakudo 86aeaf: OUTPUT«\xE5☻␤»
18:21 viklund_ pmichaud: is there anyway I can work around this in rakudo now?
18:23 pmichaud viklund_: looking
18:23 viklund_ thanks
18:24 pmichaud it's a definite parrot bug.  I don't have an easy workaround at the moment.
18:24 viklund_ sigh
18:25 viklund_ maybe if I say it to a file and then slurp it ;)
18:25 viklund_ s/say/print/
18:25 pmichaud the problem is that Parrot is coming up with an invalid utf8 string
18:26 pmichaud it's coming up with the byte sequence   e5 e2 98 bb
18:26 viklund_ in the 2 byte case?
18:26 pmichaud it should instead be   c3 a5 e2 98 bb
18:26 viklund_ ah, and the e5 is latin-1?
18:26 pmichaud yes.
18:28 viklund_ writing to a file and the reading the file seems to work though ;)
18:28 viklund_ for catenating
18:28 viklund_ rakudo: my $fh = open("/tmp/funny", :w); $fh.say(chr(229), chr(9787));$fh.close();my $s = slurp("/tmp/funny"); say $s
18:28 pmichaud oh, that might work
18:28 p6eval rakudo 86aeaf: OUTPUT«operation not permitted in safe mode␤in Main (lib/Safe.pm:25)␤»
18:28 viklund_ oh well
18:28 viklund_ it does
18:28 pmichaud because output knows how to convert latin-1 to utf-8
18:28 pmichaud it's string concatenation that gets confused
18:29 viklund_ yep, so that's what I'll do for November
18:29 viklund_ finally we can have utf8 working
18:29 StephenPollei ouch thats ugly work around
18:29 viklund_ StephenPollei: you should have seen my recursion wokraround ;)
18:30 viklund_ last summer recursion didn't work properly in rakudo (vars became shared between recursive calls)
18:30 StephenPollei I am full of fear
18:30 pmichaud I'm posting a bug report to parrot -- it may get resolved quickly.  I'll also mark it high priority for Rakudo.
18:30 StephenPollei so did you just make and handle your own stack?
18:31 viklund_ StephenPollei: no, I had the entire sub in a string
18:31 viklund_ which I evaled before each call to get a new sub ;)
18:31 viklund_ and new vars
18:31 viklund_ pmichaud: great
18:32 payload joined #perl6
18:32 viklund_ this was the first time I did bitwise stuff
18:36 buubot joined #perl6
18:37 jnthn joined #perl6
18:37 PerlJam joined #perl6
18:39 synth joined #perl6
18:43 mberends lichtkind: pong
18:44 lichtkind mberends: what we wanne to today? (tm)
18:46 lichtkind mberends: i mean do
18:46 mberends lichtkind, not sure. my time in-chat will be limited during the next two weeks, but I may be able to hammer away at something offline.
18:47 lichtkind mberends: good want you write more on tablets or tutorial?
18:48 mberends the most interesting subject would be 5-to-6 comparison or migration, because that is planned for my talk in Lisbon
18:51 mberends the documentation inside v6.pm (for Perl 5) is very sparse. Are there any references apart from "the source code"?
18:51 icwiener_ joined #perl6
18:56 lichtkind mberends: so you maybe flessh out appendix D: DElta
18:56 lichtkind i take care of november
18:57 mberends lichtkind: ok, that's a fine plan for this evening
19:02 lichtkind mberends: i just yesterday recogniced that you (finished Appendix A) ++
19:03 lichtkind mberends: there was lot to do but C is now also ready
19:05 mberends lichtkind: ok, will have to look at it in about an hour
19:08 charsbar joined #perl6
19:16 jantore joined #perl6
19:17 phenny joined #perl6
19:19 DanielC joined #perl6
19:20 donaldh joined #perl6
19:21 DanielC rakudo: my $a = F.new(); class F {  }
19:21 p6eval rakudo 86aeaf: OUTPUT«invoke() not implemented in class 'F'␤in Main (/tmp/5tbwEi6BNz:2)␤»
19:21 DanielC Is it right that you have to define a class before you use it?
19:21 DanielC You don't have to define functions at the top of the file.
19:24 charsbar_ joined #perl6
19:28 mberends DanielC, it's right that you have to define the class first
19:28 DanielC Why is that? I don't have to define functions first.
19:30 mberends this is a guess, but it could be that predeclare is the Right Way, and forward referencing to subs is a concession to P5 compatibility.
19:31 DanielC But Perl's motto is not "The Right Way to Do It"
19:31 mberends my guess could be very wrong
19:31 StephenPollei rakudo: sub foo() { ... }
19:31 p6eval rakudo 86aeaf:  ( no output )
19:31 viklund perl6 is a little more strict than p5 though
19:32 DanielC AFAIK, only when there is a good reason.
19:32 StephenPollei TIMTOWTDI
19:35 * mberends is sure TimToady++ would have given the RIght Answer
19:36 StephenPollei rakudo: foo(); sub foo() { say 'blah' }
19:36 TimToady sub defs don't change subsequent parsing, while type defs do
19:36 p6eval rakudo 86aeaf: OUTPUT«blah␤»
19:36 TimToady and you can't change parsing retroactively
19:37 DanielC Ok. That's a good answer.
19:37 DanielC I guess it'd be a bit much to ask Perl to change parsing retroactively.
19:37 TimToady where value names like "pi" also count as "parsing like types"
19:38 TimToady rakudo: say pi +1
19:38 StephenPollei rakudo:  my Sub $foo = { say 'blah' }
19:38 p6eval rakudo 86aeaf: OUTPUT«4.14159265358979␤»
19:38 p6eval rakudo 86aeaf: OUTPUT«Type mismatch in assignment; expected something matching type Sub but got something of type Block()␤in Main (/tmp/DDLc7E8qfr:2)␤»
19:38 TimToady pi is not a listop
19:40 TimToady so really it's more like "types parse like values"
19:41 StephenPollei rakudo:  my Sub &foo = &bar; foo(); sub bar() { say 'blah' }
19:41 p6eval rakudo 86aeaf: OUTPUT«Cannot handle typed variables with sigil & at line 2, near "= &bar; fo"␤in Main (src/gen_setting.pm:1743)␤»
19:41 StephenPollei rakudo:  my &foo = &bar; foo(); sub bar() { say 'blah' }
19:41 p6eval rakudo 86aeaf: OUTPUT«blah␤»
19:42 DanielC cool
19:42 viklund ... but strange
19:43 StephenPollei I think my Sub &foo = &bar; should also work .. I'll add it to some test
19:49 StephenPollei rakudo:  my $foo = &bar; foo(); sub bar() { say 'blah' }
19:49 p6eval rakudo 86aeaf: OUTPUT«Could not find non-existent sub foo␤»
19:52 StephenPollei rakudo:  sub bar() { say 'blah' }; my $foo = &bar; foo();
19:52 p6eval rakudo 86aeaf: OUTPUT«Could not find non-existent sub foo␤»
19:52 DanielC rakudo:  my $foo = &bar; $foo(); sub bar() { say 'blah' }
19:52 p6eval rakudo 86aeaf: OUTPUT«blah␤»
19:53 StephenPollei rakudo:  sub bar() { say 'blah' }; my &foo = &bar; foo();
19:53 p6eval rakudo 86aeaf: OUTPUT«blah␤»
19:53 DanielC You need the $
19:53 DanielC rakudo:  my $foo = &bar; $foo(); sub bar() { say 'blah' }
19:53 p6eval rakudo 86aeaf: OUTPUT«blah␤»
19:54 StephenPollei rakudo:  sub bar() { say 'blah' }; my $foo = &bar; foo();
19:54 p6eval rakudo 86aeaf: OUTPUT«Could not find non-existent sub foo␤»
19:54 StephenPollei sometimes I need $ sometimes &
19:55 DanielC rakudo:  sub bar() { say 'blah' }; my $foo = &bar; $foo();
19:55 p6eval rakudo 86aeaf: OUTPUT«blah␤»
19:55 DanielC If you do '&foo = &bar' you need the &
19:55 DanielC If you do '$foo = &bar' you need the $
19:55 TimToady rakudo: constant foo = &bar; foo(); sub bar { say 'blah' }
19:55 p6eval rakudo 86aeaf: OUTPUT«blah␤»
19:55 DanielC cool too
19:56 TimToady put that one in your pipe and smoke it :)
19:56 StephenPollei I quess I never do need the &
19:57 DanielC yeah
19:57 StephenPollei rakudo:  sub bar() { say 'blah' }; my &foo = &bar; foo();
19:57 p6eval rakudo 86aeaf: OUTPUT«blah␤»
19:57 DanielC &foo = &bar; foo();   ...  $foo = &bar; $foo()
19:57 StephenPollei rakudo:  sub bar() { say 'blah' }; my $foo = &bar; foo();
19:57 p6eval rakudo 86aeaf: OUTPUT«Could not find non-existent sub foo␤»
19:57 StephenPollei except there
19:57 DanielC put a $ there!
19:57 DanielC rakudo:  sub bar() { say 'blah' }; my $foo = &bar; $foo();
19:58 p6eval rakudo 86aeaf: OUTPUT«blah␤»
19:58 StephenPollei rakudo:  sub bar() { say 'blah' }; my $foo = $bar; foo();
19:58 DanielC &foo = &bar; foo();   ...  $foo = &bar; $foo()
19:58 p6eval rakudo 86aeaf: OUTPUT«Symbol '$bar' not predeclared in <anonymous> (/tmp/WT4AAfzBha:2)␤in Main (src/gen_setting.pm:3225)␤»
19:58 DanielC &foo = &bar; foo();   ...  $foo = &bar; $foo()
19:58 DanielC see?
19:58 pmichaud_ joined #perl6
19:58 DanielC It actually makes sense. In $foo the $ is part of the variable name.
19:59 jnthn joined #perl6
19:59 dalek joined #perl6
19:59 TimToady it is in the &foo variable too, but that's only when you're thinking of it as a noun
19:59 TimToady foo() is special verb syntax that knows how to look up the noun form
20:00 StephenPollei ok
20:01 * japhb watches perl5 crash spectacularly, rather like a plane losing a wing ....  Somehow it's nice to see that it's not just the bleeding edge that feels this pain.  (Misery loves company?)
20:01 pmichaud joined #perl6
20:02 japhb Unfortunately, the perl5 process in question was trying to get me an updated Parrot, so that's less fun.
20:03 StephenPollei so my Sub &foo would always be wrong, it would always need to be my Sub $foo ; and be called with $foo()
20:03 DanielC jnthn: ping?
20:04 kidd_ joined #perl6
20:04 pmichaud I think jnthn may be on vacation by now.
20:04 DanielC ok
20:04 DanielC Any other Parrot experts here?
20:05 DanielC You know that Parrot uses OpenSSL to provide the hash functions.
20:05 pmichaud depends on which part of Parrot you're needing expertise in.
20:05 DanielC I was just wondering if it'd be hard to make it also provide AES and RSA which also come with OpenSSL.
20:05 DanielC I was looking at the code just now, but I couldn't figure it out.
20:05 pmichaud I don't know when Parrot started linking with OpenSSL
20:06 pmichaud I think that's relatively recent.
20:06 DanielC ok
20:06 DanielC I'm glad that it does though. It made it much easier to get a hash function into Rakudo.
20:07 DanielC bye bye pmichau
20:09 StephenPollei rakudo: sub isa(Object $var,$type) {    $var.isa($type);} ; my Role $cino; isa($cino, Role);
20:09 p6eval rakudo 86aeaf: OUTPUT«Method 'isa' not found for invocant of class ''␤»
20:09 StephenPollei rakudo: sub isa(Object $var,$type) {    $var.isa($type);} ; my Str $c; isa($c, Str);
20:09 p6eval rakudo 86aeaf:  ( no output )
20:12 TimToady StephenPollei: my Sub &foo is fine as long as you expect foo to *return* a Sub object
20:12 pugs_svn r27058 | stephenpollei++ | added another test for Sub
20:13 StephenPollei OK thanks TimToady I think I cleaned up my thinking errors on that
20:13 StephenPollei I need to reread the http://perlcabal.org/syn/ again
20:14 TimToady after which I need to rewrite them again :)
20:14 StephenPollei rakudo:  my Sub &foo = &bar; foo(); sub bar() { say 'blah' }
20:14 p6eval rakudo 86aeaf: OUTPUT«Cannot handle typed variables with sigil & at line 2, near "= &bar; fo"␤in Main (src/gen_setting.pm:1743)␤»
20:14 StephenPollei so that might really be a bug then
20:15 StephenPollei rakudo:  my Sub &foo = &bar; foo(); sub bar() { return baz;} ; sub baz() { say 'blah' }
20:15 p6eval rakudo 86aeaf: OUTPUT«Cannot handle typed variables with sigil & at line 2, near "= &bar; fo"␤in Main (src/gen_setting.pm:1743)␤»
20:16 TimToady I suspect so
20:18 StephenPollei rakudo:  my  $foo = &bar; $$foo(); sub bar() { return baz;} ; sub baz() { say 'blah' }
20:18 p6eval rakudo 86aeaf: OUTPUT«Symbol '$$foo' not predeclared in <anonymous> (/tmp/GdozHyQagV:2)␤»
20:19 StephenPollei rakudo:  my  $foo = &bar; $($foo()); sub bar() { return baz;} ; sub baz() { say 'blah' }
20:19 p6eval rakudo 86aeaf: OUTPUT«blah␤»
20:21 StephenPollei rakudo:  sub baz() { say 'blah' }; sub bar() { return baz;} ; my  $foo = &bar; $($foo());
20:21 p6eval rakudo 86aeaf: OUTPUT«blah␤»
20:21 StephenPollei rakudo:  sub baz() { say 'blah' }; sub bar() { return baz;} ; my  Sub &foo = &bar; $foo();
20:21 p6eval rakudo 86aeaf: OUTPUT«Cannot handle typed variables with sigil & at line 2, near "= &bar; $f"␤in Main (src/gen_setting.pm:1743)␤»
20:35 sjohnson1 joined #perl6
20:39 StephenPollei non-instantiable Roles ... Integral so does that Role do?
20:51 pmurias DanielC:
20:51 pmurias sorry
20:51 pmichaud joined #perl6
20:51 DanielC np
20:53 StephenPollei http://svn.pugscode.org seems to be down
20:53 pmichaud I think it's the connectivity between feather and the outside world
20:53 pmichaud I've been seeing it go up and down a fair bit yesterday and today
20:53 StephenPollei oh ok
20:53 pmichaud feather itself (which hosts svn.pugscode.org) seems to be fine
20:53 pmichaud (when it can be reached)
20:54 StephenPollei yes I didn't do traceroute or ping, so I didn't narrow were the packets were dropping
20:54 d4l3k_ joined #perl6
20:55 pugs_svn r27059 | stephenpollei++ | added Callable and Integral and Sub with &
20:56 jnthn joined #perl6
20:56 PerlJam joined #perl6
20:57 pmichaud_ joined #perl6
21:05 jnthn Time for me to go rest before an early flight tomorrow. Back in two weeks.
21:05 mberends jnthn, bon voyage
21:08 kane_ joined #perl6
21:09 jnthn mberends: thanks! :-)
21:25 jnthn BTW, I won't be reading a whole two weeks of backlog when I return. ;-) So if there's important stuff, please email or /msg me.
21:26 jnthn OK, gone.
21:26 jnthn o/
21:26 viklund o/
21:27 payload joined #perl6
21:33 Whiteknight joined #perl6
21:37 hanekomu joined #perl6
21:39 kane__ joined #perl6
21:40 DanielC Is Perl 6 going to have list comprehensions by any chance?  You know, like  f xs ys = [ x + y | x <- xs, y <- ys, even x, odd y, prime x+y ]
21:53 pmichaud DanielC: yes -- See S04.  Search for "list comprehension"  :-)
21:53 DanielC really?
21:53 * DanielC looks
21:54 DanielC website is slow...
21:54 pmichaud I think feather is disconnected again
21:54 pmichaud but here:
21:54 pmichaud @names = (-> $name, $num { "$name.$num" } for 'a'..'zzz' X 1..100);
21:54 pmichaud or even
21:55 pmichaud @names = ({ "$^name.$^num" } for 'a'..'zzz' X 1..100);
21:55 DanielC It took me a few moments, but I figured out what that does.
21:55 pmichaud @primesquares = ($_ if prime($_) for 1..100) [**] 2;
21:55 eternaleye joined #perl6
21:56 pmichaud although that one looks wrong to me -- I think it should be  >>**>>
21:56 pmichaud since [**] is a reduction operator
21:57 DanielC @sum = ({$^x + $^y} if prime ( ??? ) for @xs X @ys)
21:57 lambdabot Maybe you meant: bug run src
21:58 DanielC Say I want to check that $^x + $^y is prime.
21:59 pugs_svn joined #perl6
21:59 pmichaud THAT's what I've been missing/looking for
21:59 DanielC rakudo: my @xs = <1 2 3>; my @ys = <2 4 6>; ( @xs X @ys).perl.say
21:59 pmichaud I wish I had a metaoperator that says  "return this value if this condition is true for this value"
21:59 p6eval rakudo 86aeaf: OUTPUT«["1", "2", "1", "4", "1", "6", "2", "2", "2", "4", "2", "6", "3", "2", "3", "4", "3", "6"]␤»
21:59 pmichaud i.e., something that could do
22:00 pmichaud foo($x) && $x
22:00 pmichaud but without having to recalculate $x
22:00 DanielC y
22:00 pmichaud in particular, it would mean that I could do
22:01 pmichaud well, maybe not
22:01 DanielC rakudo: my @xs = <1 2 3>; my @ys = <2 4 6>; ( @xs Z @ys).perl.say
22:01 pmichaud it's close
22:01 p6eval rakudo 86aeaf: OUTPUT«["1", "2", "2", "4", "3", "6"]␤»
22:01 DanielC :(
22:01 pmichaud what's wrong with those?
22:01 DanielC I want to get a list of pairs.
22:02 pmichaud you're too attached to the notion of pairs
22:02 pmichaud watch
22:02 pmichaud put another way -- those are pairs
22:02 DanielC Then you could do "if prime($_[0] + $_[1])" for example
22:02 DanielC watch what? Did you type something?
22:02 pmichaud (still typing)
22:02 DanielC sorry
22:03 viklund rakudo: for <1 2 3 > X <a b c> -> $x, $y { say "$x: $y" }
22:03 p6eval rakudo 86aeaf: OUTPUT«1: a␤1: b␤1: c␤2: a␤2: b␤2: c␤3: a␤3: b␤3: c␤»
22:03 pmichaud rakudo:   my @xs = <1 2 3>;  my @ys = <2 4 6>;   ($^x+$^y).say for @xs Z @ys;
22:03 p6eval rakudo 86aeaf: OUTPUT«too few arguments passed (0) - 2 params expected␤in Main (/tmp/UvWiG8ajB9:0)␤»
22:03 pmichaud rakudo:   my @xs = <1 2 3>;  my @ys = <2 4 6>;   { ($^x+$^y).say } for @xs Z @ys;
22:03 p6eval rakudo 86aeaf: OUTPUT«3␤6␤9␤»
22:03 DanielC viklund: Yeah, but that's definitely not a list comprehension. It's a regular for loop.
22:04 pmichaud what are you looking for as a difference?
22:04 viklund yes, but am I looking at pairs or a list?
22:04 viklund pmichaud: nice ;)
22:04 DanielC pmichaud: Your example works, but how do you use that with the 'if prime( ... )' filter?
22:05 pmichaud I don't know, that's the piece that is kinda missing
22:05 DanielC yeah
22:05 teco000 joined #perl6
22:05 DanielC In any case, these examples look complex enough that in real life I would probably just use map and grep.
22:05 pmichaud but Perl 6 knows how to do "take things n at a time" without them having to be actually set up as lists-of-lists
22:06 DanielC take n at a time++
22:06 DanielC That's a feature I need to get used to.
22:06 pmichaud so   @xs Z @ys  can still be processed 2-at-a-time without them actually having to be [[1, 2], [2, 4], [4, 6]]
22:06 pmichaud same for @xs X @ys
22:06 DanielC It's different from what you would do in, say, Haskell. Which explains my attachment to pairs :)
22:07 pmichaud (all that said, -- in reality they really are lists-of-lists, but Rakudo has trouble with those at the moment)
22:07 teco000 left #perl6
22:08 decasm left #perl6
22:11 DanielC Perl 6 is supposed to be very malleable. So in principle could someone add list comprehensions that look more like the Haskell ones?
22:12 bacek joined #perl6
22:12 DanielC e.g. [ { $^x + $^y } | @xs X @ys, even $^x, odd $^y ]
22:12 DanielC or whatever
22:13 DanielC That might be asking for too much though.
22:13 dalek joined #perl6
22:14 DanielC A pre-processor could turn that into a map+grep.
22:15 DanielC map {$^x+$^y}, (@xs X @ys).grep({ (even $^x) && (even $^y) })
22:16 DanielC ah... but grep wont work on pairs, will it?
22:16 pmichaud_ joined #perl6
22:16 DanielC s/pairs/two elements at a time/
22:17 jnthn joined #perl6
22:17 DanielC Well, I guess even Perl 6 has limits.
22:17 PerlJam joined #perl6
22:17 aindilis joined #perl6
22:18 viklund grep on pairs? that's an idea
22:18 viklund rakudo: <a b d d>.grep({$^a ~~ $^b}).perl.say
22:18 p6eval rakudo 86aeaf: OUTPUT«too few arguments passed (1) - 2 params expected␤in method Any::»
22:19 viklund rakudo: <a b d d>.grep({$^a ~~ 'd'}).perl.say
22:19 p6eval rakudo 86aeaf: OUTPUT«["d", "d"]␤»
22:19 viklund oh well...
22:19 bacek <a b d d>.map({$^a ~~ $^b}).grep.perl.say
22:19 bacek rakudo: <a b d d>.map({$^a ~~ $^b}).grep.perl.say
22:19 p6eval rakudo 86aeaf: OUTPUT«No applicable candidates found to dispatch to for 'grep'␤in Main (/tmp/6mJQSFAwk0:2)»
22:20 bacek hmmm
22:20 viklund rakudo: <a b d d>.map({$^a ~~ $^b}).grep({$^fjonkor}).perl.say
22:20 p6eval rakudo 86aeaf: OUTPUT«[Bool::True]␤»
22:20 bacek rakudo: <a b d d>.map({$^a ~~ $^b}).grep({ ?$_ }).perl.say
22:20 p6eval rakudo 86aeaf: OUTPUT«[Bool::True]␤»
22:20 bacek rakudo: <a b d d c c e f>.map({$^a ~~ $^b}).grep({ ?$_ }).perl.say
22:20 p6eval rakudo 86aeaf: OUTPUT«[Bool::True, Bool::True]␤»
22:21 bacek here we go
22:22 bacek rakudo: say gather for <a b d d> -> $a, $b { take $^a if $a ~~ $b }
22:23 p6eval rakudo 86aeaf: OUTPUT«Cannot use placeholder var in block with signature. at line 2, near " if $a ~~ "␤in Main (src/gen_setting.pm:1966)␤»
22:23 bacek rakudo: say gather for <a b d d> -> $a, $b { take $a if $a ~~ $b }
22:23 p6eval rakudo 86aeaf: OUTPUT«d␤»
22:23 sjohnson1 hello friends
22:23 viklund ;)
22:23 DanielC rakudo: <1 1 2 3 3 1>.map({[$^a, $^b]}).grep({ $_[0] % 2 == 0 and $_[1] % 2 == 1 }).perl.say
22:23 p6eval rakudo 86aeaf: OUTPUT«Method 'postcircumfix:[ ]' not found for invocant of class 'Str'␤»
22:24 DanielC rakudo: <1 1 2 3 3 1>.map({[$^a, $^b]}).grep({ @^a[0] % 2 == 0 }).perl.say
22:24 p6eval rakudo 86aeaf: OUTPUT«Parameter type check failed; expected something matching Positional() but got something of type Str() for @a in call to _block71␤in method Any::grep (/tmp/g72RVudL5E:2)␤called from Main (/tmp/g72RVudL5E:2)␤»
22:24 DanielC ggrrrr
22:25 DanielC rakudo: <1 1 2 3 3 1>.map({[$^a, $^b]}).grep({ $^a[0] % 2 == 0 }).perl.say
22:26 p6eval rakudo 86aeaf: OUTPUT«Method 'postcircumfix:[ ]' not found for invocant of class 'Str'␤»
22:26 DanielC rakudo: <1 1 2 3 3 1>.map({[$^a, $^b]}).perl.say
22:26 p6eval rakudo 86aeaf: OUTPUT«[["1", "1"], ["2", "3"], ["3", "1"]]␤»
22:26 DanielC oh well, I give up
22:26 sjohnson1 just gotta show that interpretor who's boss
22:28 DanielC By the looks of it, the compiler is boss.
22:30 pmichaud rakudo: <1 1 2 3 3 1>.map({[^$a, $^b]})>>.say
22:30 p6eval rakudo 86aeaf: OUTPUT«Symbol '$a' not predeclared in <anonymous> (/tmp/nUx6yyHehR:2)␤in Main (src/gen_setting.pm:3225)␤»
22:31 pmichaud rakudo: <1 1 2 3 3 1>.map({[$^a, $^b]})>>.say
22:31 p6eval rakudo 86aeaf: OUTPUT«1 1␤2 3␤3 1␤»
22:31 pmichaud rakudo: <1 1 2 3 3 1>.map({[$^a, $^b]})>>.perl>>.say
22:31 p6eval rakudo 86aeaf: OUTPUT«["1", "1"]␤["2", "3"]␤["3", "1"]␤»
22:32 pmichaud rakudo: <1 1 2 3 3 1>.map({[$^a, $^b]}).grep( { ($^a)[0] % 2 } ).perl.say
22:32 p6eval rakudo 86aeaf: OUTPUT«Method 'postcircumfix:[ ]' not found for invocant of class 'Str'␤»
22:32 pmichaud rakudo: <1 1 2 3 3 1>.map({[$^a, $^b]}).grep( { ($^a.perl.say } )
22:32 p6eval rakudo 86aeaf: OUTPUT«Unable to parse block; couldn't find final '}' at line 2, near "($^a.perl."␤in Main (src/gen_setting.pm:0)␤»
22:32 pmichaud rakudo: <1 1 2 3 3 1>.map({[$^a, $^b]}).grep( { $^a.perl.say } )
22:32 p6eval rakudo 86aeaf: OUTPUT«"1"␤"2"␤"3"␤»
22:33 pmichaud that's odd.
22:33 pmichaud I suspect a bug in the grep implementation
22:33 pmichaud rakudo: <1 1 2 3 3 1>.map({[$^a, $^b]}).map( { $^a.perl.say } )
22:33 p6eval rakudo 86aeaf: OUTPUT«["1", "1"]␤["2", "3"]␤["3", "1"]␤»
22:34 pmichaud that's more of what I'd expect.
22:34 pmichaud My bet is that the grep implementation is imposing a list context somewhere that it shouldn't.
22:34 DanielC :-(
22:35 jonathanturner joined #perl6
22:40 amoc joined #perl6
22:42 TimToady rakudo: say (-> $x, $y { [$x, $y] if $x % 2 and not $y % 2 }) for ^5 X ^5
22:42 p6eval rakudo 86aeaf: OUTPUT«_block64␤_block64␤_block64␤_block64␤_block64␤_block64␤_block64␤_block64␤_block64␤_block64␤_block64␤_block64␤_block64␤_block64␤_block64␤_block64␤»
22:42 TimToady cool!
22:42 sjohnson1 heh
22:42 DanielC rakudo: say ((-> $x, $y { [$x, $y] if $x % 2 and not $y % 2 }) for ^5 X ^5).perl
22:42 p6eval rakudo 86aeaf: OUTPUT«Perl6Iterator.new()␤»
22:43 DanielC :-P
22:43 TimToady what I wrote is specced to work as a list comprehension, but rakudo's not quite there yet
22:43 TimToady say (42 if 0).perl
22:44 TimToady rakudo: say (42 if 0).perl
22:44 p6eval rakudo 86aeaf: OUTPUT«[]␤»
22:44 TimToady should be Nil, methinks
22:45 TimToady rakudo: say do for ^5 X ^5 -> $x, $y { [$x, $y] if $x % 2 and not $y % 2 }
22:45 p6eval rakudo 86aeaf: OUTPUT«-1␤»
22:45 TimToady that's also specced to work
22:46 DanielC Though Rakudo can't show the full output, it looks like the list comprehension worked, because the output has 16 blocks instead of 25.
22:46 TimToady rakudo: say gather for ^5 X ^5 -> $x, $y { take [$x, $y] if $x % 2 and not $y % 2 }
22:46 p6eval rakudo 86aeaf: OUTPUT«1 01 21 43 03 23 4␤»
22:47 TimToady that's the workaround currently
22:47 pmichaud 17:42 <@TimToady> rakudo: say (-> $x, $y { [$x, $y] if $x % 2 and not $y % 2 }) for ^5 X ^5
22:48 pmichaud shouldn't the "for" be inside the parens?
22:48 TimToady ah, yes
22:48 pmichaud rakudo thinks the "for" is modifying "say"
22:48 pmichaud I guessing rakudo can't handle it inside the parens yet either
22:48 TimToady rakudo: say (-> $x, $y { [$x, $y] if $x % 2 and not $y % 2 } for ^5 X ^5)
22:48 p6eval rakudo 86aeaf: OUTPUT«-1␤»
22:48 pmichaud but wanted to make sure I wasn't completely off.
22:49 pmichaud rakudo doesn't know how to make loops return arrays of values yet
22:49 pmichaud it always returns the last one
22:50 pmichaud and any number of other oddities
22:51 TimToady DanielC: anyway, the intent is to get list comprehensions to fall nicely out of existing syntax, not introduce it as a special case
22:51 DanielC That would be nice.
22:51 TimToady *cough* python *cough* haskell *cough*
22:51 DanielC ?
22:51 pmichaud rakudo:  say (42 if 0).WHAT;
22:52 p6eval rakudo 86aeaf: OUTPUT«List()␤»
22:52 pmichaud I thought I had fixed that already.
22:52 pmichaud rakudo:  say (42 if 0).PARROT;
22:52 p6eval rakudo 86aeaf: OUTPUT«List␤»
22:52 DanielC Ok, list comprehensions are a special case in Python, but I think they are fairly central to Haskell. Then again, I'm no expert at either language.
22:52 DanielC I like Haskell. I don't like Python.
22:52 TimToady say Nil.perl
22:52 TimToady rakudo: say Nil.perl
22:52 p6eval rakudo 86aeaf: OUTPUT«Nil␤»
22:52 TimToady rakudo: say ().perl
22:53 p6eval rakudo 86aeaf: OUTPUT«[]␤»
22:53 TimToady the whole point of Nil is to name ()...
22:53 pmichaud I'm sure I haven't fixed that one yet... but should be easily fixable.
22:56 pmichaud my $a = (1,2);   # a capture (list)
22:56 pmichaud my $a = (1);    # also a capture, but optimized to an item
22:56 pmichaud my $a = ();   # what's this?
22:58 sjohnson1 python = Snake++
22:58 TimToady it's an empty capture, also known as Nil
22:59 pmichaud okay, that confuses me a bit
23:00 pmichaud okay, I'm less confused.  It's an empty list that complains if used like an item.
23:00 TimToady Nil only acts undef if you try to use .[0]
23:00 TimToady yes
23:00 pmichaud so:   my $a = ();   say +$a;   # carps
23:01 TimToady rakudo: say +()
23:01 p6eval rakudo 86aeaf: OUTPUT«0␤»
23:01 pmichaud rakudo:  sub foo { return; };   say +foo();
23:01 p6eval rakudo 86aeaf: OUTPUT«Use of uninitialized value␤0␤»
23:02 pmichaud I'm converting () to return Nil now.
23:02 TimToady is foo returning a () capture?
23:02 pmichaud foo is returning Nil :-)
23:02 pmichaud rakudo:  sub foo { return; };   say foo().WHAT;
23:02 sjohnson1 joined #perl6
23:02 p6eval rakudo 86aeaf: OUTPUT«Nil()␤»
23:02 pmichaud rakudo was just translating ()  into an empty list
23:02 TimToady I'd think that 0 is the right answer to +()
23:02 pmichaud and not a failure?
23:03 TimToady but maybe I'm thinking of it wrong
23:03 pmichaud i.e., no carp?
23:03 pmichaud my question would then be.... when would Nil carp about being used in item context?
23:03 TimToady rakudo: say +(0,0,0)
23:03 p6eval rakudo 86aeaf: OUTPUT«3␤»
23:03 pmichaud i.e., what makes Nil different from an empty capture?
23:03 TimToady when you do .[0]
23:04 pmichaud in particular (more)
23:04 pmichaud sub foo { return; }
23:04 TimToady they should behave identically
23:04 pmichaud my $a = foo();   my $b = ();    # do these differ?
23:04 TimToady no
23:04 pmichaud so:
23:05 pmichaud my $a = foo();   say 3 + $a;   # no carping
23:05 pmichaud (this was the case that I think caused us to introduce Nil in the first place)
23:07 TimToady well, then probably +() ought to carp as well
23:08 pmichaud fwiw, I'm fine with either answer; just wanting to resolve the internal conflict of "those don't match!"  :-)
23:08 pmichaud I think +() carping is likely to be okay.
23:08 snarkyboojum joined #perl6
23:09 TimToady I just don't quite understand how the I-want-a-value-ness of + differs from that of $a=
23:10 pmichaud I tend to think of it in terms of undefness
23:10 pmichaud clearly we want to assign undef things to scalars like $a
23:10 pmichaud it's when we try to use them for their values that we throw exceptions
23:11 TimToady my Any $a = () vs sub infix:<+> (Any:D, Any:D)
23:11 pmichaud I've been thinking of Nil as a special form of undef that interpolates as an empty list in list context
23:12 TimToady which still leads me back toward thinking parameters default to :D, while my sigs don't
23:12 pmichaud I hadn't been thinking of () as being Nil, though.
23:12 pmichaud that feels right somehow
23:12 pmichaud something nags at me about it, though.
23:13 TimToady It's more of a value like pi than a type like Object
23:14 pmichaud also, is   my Any $a = ()   a sig or an assignment?
23:14 TimToady but we need it undefined if params distinguish
23:14 pmichaud last I checked, it parsed as assignment
23:15 TimToady parses as (my Any $a) = () with expectation that semantic analysis looks for declarators on the left and special-casees them
23:15 pmichaud ah
23:15 pmichaud it still leaves the question of the non-decl case though:
23:15 pmichaud my $a;  $a = ();   # different?
23:15 pmichaud family wants me to take them to dinner now, so I will read backscroll later
23:16 TimToady $a is still Any, not Any:D
23:17 TimToady rakudo: say ().defined
23:17 p6eval rakudo 86aeaf: OUTPUT«1␤»
23:17 TimToady rakudo: say Nil.defined
23:17 p6eval rakudo 86aeaf: OUTPUT«0␤»
23:17 TimToady in that case I think () wants to become more like Nil
23:19 viklund pmichaud: is take doing some string concatenation??
23:20 TimToady it's not supposed to
23:20 TimToady pmichaud++ is off to dinner
23:20 viklund ahh right
23:20 donaldh joined #perl6
23:21 viklund_ rakudo: my @s = gather { take chr(229); take chr(9787) }; say @s.perl
23:21 p6eval rakudo 86aeaf: OUTPUT«["\xE5", "☻"]␤»
23:21 viklund_ rakudo: my @s = gather { take chr(229); take chr(9787) }; say @
23:21 viklund_ rakudo: my @s = gather { take chr(229); take chr(9787) }; say @s
23:21 p6eval rakudo 86aeaf: OUTPUT«say requires an argument at line 2, near " @"␤in Main (src/gen_setting.pm:2416)␤»
23:21 p6eval rakudo 86aeaf: OUTPUT«å☻␤»
23:21 viklund_ it isn't
23:21 TimToady it's supposed to return a capture to be incorporated into gather's CoC
23:21 viklund_ viklund: your error is elsewhere...
23:22 viklund_ Capture of Captures??
23:22 TimToady yes
23:22 TimToady or LoL, if we rename capture to list
23:22 TimToady which will result in LoLCoDe
23:22 viklund_ ehm...
23:23 sjohnson1 LOLCODE is hilarious
23:24 sjohnson1 i honestly laughed very loudly when i read about it on its official site
23:26 DemoFreak joined #perl6
23:30 amoc joined #perl6
23:30 japhb Tene,pmichaud: I *think* I've got parrot compiler export working ... but when I try it from Rakudo, I found that 'use OpenGL :from<Parrot>;' never calls Perl6::Compiler::import().  I'm assuming it should.  Where do I find the :from<> code, so I can figure out what went wrong?
23:32 kate21de1 joined #perl6
23:34 sjohnson1 raise your hand if you're sick and tired of having to code things in PHP at work
23:34 * sjohnson1 raises his hand
23:35 japhb Oh, hmmm, src/builtins/eval.pir perhaps.  Looks like it tries to do the import from another HLL by itself.
23:35 * japhb investigates further.
23:37 japhb Personally, I'm getting really tired of having to code Perl 5 at work.  Hence my reason for working on Perl 6.  :-)
23:42 sjohnson1 japhb: me too in some cases
23:42 sjohnson1 relying on String::Strip to quicly do things, then changing systems, is driving me nuts
23:42 sjohnson1 StripLTSpace I use a lot
23:42 sjohnson1 but would much rather use $string.trim in P6
23:42 sjohnson1 which would yield me greater happiness
23:47 lisppaste3 joined #perl6
23:51 synth joined #perl6
23:55 silug joined #perl6
23:59 lichtkind joined #perl6
23:59 DemoFreak joined #perl6

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

Perl 6 | Reference Documentation | Rakudo