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