»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend! | Rakudo Star Released! Set by diakopter on 6 September 2010. |
|||
dnl | too close to call | 00:02 | |
tadzik | what's the opposite of Str.ord? | 00:05 | |
flussence | something.chr? | 00:06 | |
tadzik | yes, thanks flussence | ||
flussence | educated guess, it's called that in most languages I'm aware of :) | ||
tadzik | Forgot that :) | 00:07 | |
flussence | (weird, I can't find .ord in the specs...) | 00:09 | |
oh, there it is. | |||
S29 | |||
00:16
sftp left
00:34
kensanata left
00:39
Chat5895 joined,
wamba left
|
|||
Chat5895 | heyyyyy im new here | 00:40 | |
who wanna chat | |||
00:41
LionMadeOfLions left
|
|||
diakopter | Chat5895: this is a room to discuss the programming language Perl 6 | 00:41 | |
00:41
dduncan joined,
dduncan left
|
|||
Chat5895 | ok what about it | 00:41 | |
diakopter | Chat5895: is that why you joined this room? :) | 00:43 | |
Chat5895 | i guess | 00:44 | |
00:48
jhuni joined
00:50
Chat5895 left
|
|||
diakopter | oh, Chatmosphere, how I love thee | 00:51 | |
flussence | now I'm wondering if we're somehow at the top of /list ... | ||
araujo | it is just that perl6 is attractive even for non-programmers | 00:52 | |
flussence | hmm, apparently that IP is some sort of proxy, I thought these /Chat\d{4}/ were all the same person... | 00:54 | |
00:59
QinGW joined
01:00
orafu left
01:02
darth_grantius joined
01:13
__david__ joined
01:22
plobsing joined
01:31
rgrau_ left
01:42
patspam1 joined
01:43
patspam left
01:58
dnl left
01:59
florz left,
florz joined
02:01
molaf_ joined
02:02
dnl joined
02:04
Chat2688 joined
02:05
molaf left,
Chat2688 left
02:06
dnl- joined
02:07
dnl left
02:09
whiteknight left
02:17
risou joined
02:31
takadonet1 joined
|
|||
takadonet1 | yo | 02:31 | |
02:35
agentzh joined
|
|||
takadonet1 | agentzh: yo | 02:38 | |
02:39
dnl- left
|
|||
agentzh | takadonet1: hiya | 02:39 | |
takadonet1 | agentzh: how are you sir? | 02:40 | |
agentzh | takadonet1: enjoying jemplate in our product ;) | ||
takadonet1: and lots of nginx/lua/c hacking on its server side :) | |||
02:41
dnl joined,
perlygatekeeper left
|
|||
agentzh | takadonet1: looking forward to rewriting all of our DSL compilers with Perl 6. | 02:41 | |
takadonet1: currently implemented by Perl 5 + Parse::RecDescent + Moose ;) | |||
takadonet1 | agentzh: nice. Planning to rewrite bioperl6 :) | ||
i mean 5 * | 02:42 | ||
agentzh | great :D | ||
takadonet1 | 5 to 6 | ||
agentzh | for now the biggest bottleneck is rakudo's performance. Waiting for more optimizations :D | 02:43 | |
takadonet1 | agentzh: ya same boat so starting to port some of the most used perl 5 module on cpan to pass the time | 02:44 | |
agentzh | *nod* | ||
02:59
Chat1591 joined
|
|||
Chat1591 | yo | 03:00 | |
03:00
Chat1591 left
|
|||
diakopter | ok. you crackberry jokers are getting to me | 03:00 | |
and I can say that as someone who carries one myself | 03:01 | ||
03:01
perlygatekeeper joined
03:03
__david__ left,
molaf_ left
03:06
LionMadeOfLions joined
03:12
alester left
03:16
molaf_ joined
03:19
takadonet1 left
03:35
araujo left
03:41
__david__ joined
03:42
__david__ left
03:50
wooden left
04:03
bbkr left
04:11
justatheory joined
04:14
am0c^ joined,
satyavvd joined
04:35
jaldhar left
04:47
colomon left
04:53
bbkr joined
04:54
colomon joined
04:58
darth_grantius left,
bbkr left
04:59
dnl left
05:01
bbkr joined
05:08
\xF0 left,
JimmyZ joined
05:18
jaldhar joined
05:25
justatheory left
05:50
Helios joined
06:03
ingy left,
ingy joined
06:08
patspam1 left,
meppl joined
|
|||
sorear | good * #perl6 | 06:11 | |
06:18
TiMBuS left,
TiMBuS joined
06:24
xabbu42 joined
06:31
colomon left
06:32
fudanchii joined
06:36
kanishka left
06:37
LionMadeOfLions left
06:44
wtw joined
06:46
cjk101010 joined
06:47
jhuni left
06:54
_kaare joined
07:09
am0c joined
07:20
REPLeffect left
07:29
JimmyZ left
07:34
REPLeffect joined
08:11
_kaare left
08:23
daxim joined
|
|||
sorear | dalek? | 08:32 | |
08:45
whiteknight joined
|
|||
sorear out | 08:46 | ||
08:47
Mantis[] joined,
wallberg joined
08:48
Mantis[] left
08:59
tadzik left
09:06
LionMadeOfLions joined
|
|||
daxim | are perl6 grammars powerful enough to do matching on unordered sets of characters? I'm sure it already does a fine job on ordered sets of characters == strings | 09:11 | |
hypothetic example with made-up syntax so you can see what sort of problems I want to achieve: say 'full house' if @poker_hand =~ set_match('these{2}', 'those{3}') | |||
moritz_ | daxim: I think regexes/grammars are a poor tool for that job | 09:20 | |
daxim | so I feared. what's this which I need called, then? it would also need to include backtracking | 09:21 | |
moritz_ has no idea | 09:22 | ||
Juerd | daxim: What is "back" in an unordered set? | 09:39 | |
09:39
whiteknight left
|
|||
daxim | I'll illustrate with a more complex example. backtracking is necessary when things can be combinated in several possible ways | 09:40 | |
bag = <4 4 4 5 5 5 6 6 6 7 7 7>; match: triplets{4} | triplets{1} series_of_3{3} | 09:44 | ||
note the second part of the conjunction has two solutions | 09:45 | ||
Juerd | That bag seems ordered | 09:48 | |
Why would you need all solutions? In poker only the highest hand counts | |||
All other matches are irrelevant | 09:49 | ||
daxim | I need them to see which one is highest. (it's not poker) | ||
Juerd | I guess the @poker_hand fooled me | 09:50 | |
10:00
icwiener joined
10:06
colomon joined
10:07
fudanchii left,
fudanchii joined,
fudanchii left
10:09
QinGW left
10:18
icwiener left
|
|||
satyavvd | Range.roll() not implemented yet? | 10:22 | |
moritz_ | rakudo: say (1..5).roll(3) | 10:24 | |
p6eval | rakudo 5f5bae: OUTPUT«315» | ||
10:24
am0c left
|
|||
moritz_ | seems rather implemented to me | 10:24 | |
satyavvd | ok will get latest rakudo... | 10:26 | |
10:28
leprevost joined
10:36
timbunce joined
10:39
kensanata joined
10:41
icwiener joined
10:55
colomon left
10:56
Bzek_ left
11:07
wamba joined,
wamba left,
boggytwo joined,
wamba joined
11:17
nymacro joined,
tadzik joined
11:18
Raynes left
11:19
Chillance joined
11:28
nymacro left
11:29
nymacro joined,
Raynes joined
11:33
araujo joined
11:38
Raynes left
11:40
agentzh left,
jaldhar left
11:41
jaldhar joined
11:43
constant left
11:47
Raynes joined
11:48
satyavvd left,
broquaint left
|
|||
takadonet | hey everyone | 12:03 | |
12:07
icwiener left,
icwiener joined
|
|||
tadzik | hey takadonet | 12:12 | |
takadonet | tadzik: hey | 12:13 | |
12:19
colomon joined
|
|||
takadonet | colomon: morning | 12:19 | |
colomon | o/ | 12:20 | |
12:33
tadzik left
12:34
icwiener_ joined,
Guest21983 joined
12:36
tadzik joined
12:38
icwiener left
12:41
LionMadeOfLions left
12:52
oyse joined,
molaf_ left,
oyse left
12:55
tadzik left
13:06
orafu joined
13:08
dnl joined
13:10
MayDaniel joined
|
|||
dnl | "evolution is a myth!" - sincerely, your tea party | 13:14 | |
13:14
MayDaniel left
|
|||
takadonet | dnl: ... | 13:14 | |
dnl | they really think so | 13:15 | |
moritz_ | sadly you don't have to meet certain requirements on intelligence or education to hold high political positions :( | 13:17 | |
jnthn | It'd not be such a problem if more voters cared for such qualifications, though. | 13:19 | |
flussence | USian politics as a whole scares the crap out of me. | ||
13:20
constant joined,
constant left,
constant joined
13:21
Patterner left
|
|||
moritz_ | same here | 13:21 | |
13:23
tzhs joined
|
|||
takadonet | just love how they spend about 4 billion dollars on ads for the mid term election | 13:24 | |
13:24
jedai left
|
|||
jnthn | Same, but to be fair, I sorta suspect some of the US folks find European politics scary too. :-) | 13:24 | |
flussence | they would've spent more, but they're still using 32-bit computers :) | ||
jnthn | lol | ||
moritz_ | :-) | 13:25 | |
just read in my news feed a comment (translated) "America is not like Europe would like it to be" | 13:26 | ||
13:26
sftp joined
13:28
tzhs left
|
|||
takadonet | I should not talk about how bad the states are.... Our science minister in Canada does not believe in evolution | 13:28 | |
moritz_ | ouch. | 13:30 | |
in Bavaria we had a minister for education who sent her children to a private school :-) (not quite as bad, but still amusing) | 13:31 | ||
jnthn | When I was a kid I used to assume that the ministers for a particular thing had some background in that area. | ||
takadonet | jnthn: sometimes | ||
jnthn | takadonet: Far less than one would hope, it seems. | 13:32 | |
takadonet | jnthn: indeed | ||
13:33
bluescreen joined
|
|||
bluescreen | yt? | 13:33 | |
13:33
Psyche^ joined,
Psyche^ is now known as Patterner
|
|||
bluescreen | Patterner? | 13:33 | |
hehe | |||
13:33
bluescreen is now known as Guest38267
|
|||
jnthn | .oO( Somebody who patterns, clearly. ) |
13:35 | |
moritz_ | do the patterns match? | 13:36 | |
colomon | well, the one in Rebma is backwards... | 13:39 | |
;) | |||
13:42
jferrero joined
|
|||
flussence | ooh, I just figured out link($filehandle, 'filename') works in p5... (perldoc is a bit misleadingly worded there) | 13:43 | |
13:49
broquaint joined
|
|||
mathw | o/ | 13:54 | |
colomon | \o | 13:55 | |
13:58
rgrau_ joined
13:59
spq1 joined
14:00
tzhs joined
14:07
xabbu42 left
|
|||
Util | To swap two scalars in Perl 6: ($a, $b) = ($b, $a); | 14:08 | |
14:08
nymacro left
|
|||
Util | How best to swap two arrays? | 14:08 | |
frettled | rakudo: my @a = 1, 2; my @b = 3, 4; (@a, @b) = (@b, @a); say @a.perl; | 14:09 | |
p6eval | rakudo 5f5bae: OUTPUT«[3, 4, 1, 2]» | ||
frettled | hmm. | 14:10 | |
frettled feels stupid. | 14:11 | ||
14:12
wamba left,
clkao left,
exodist left,
dukeleto left,
nadim left,
pothos left,
Lorn left,
jasonmay left,
avuserow left,
cxreg left,
flatwhatson left,
patch left,
diakopter left
|
|||
colomon | rakudo: sub swap($a is rw, $b is rw) { ($a, $b) = ($b, $a); }; my @a = 1, 2; my @b = 3, 4; swap(@a, @b); say @a.perl | 14:12 | |
p6eval | rakudo 5f5bae: OUTPUT«[3, 4, 1, 2]» | ||
colomon | :\ | ||
jnthn | ...that looks wrong. | 14:13 | |
flussence | that looks p5ey... | ||
Util | rakudo: my @a = <a b c>; my @b = <x y z>; my ($a, $b) = map {[@($_)]}, @a, @b; [:$a, :$b].perl.say; | 14:14 | |
p6eval | rakudo 5f5bae: OUTPUT«["a" => ["a"], "b" => ["b"]]» | ||
Util | ??? | ||
flussence | rakudo: sub swap($a is rw, $b is rw) { my $tmp := $a; $b := $a; $a := $tmp; }; my @a = 1, 2; my @b = 3, 4; swap(@a, @b); say @a.perl | 14:15 | |
p6eval | rakudo 5f5bae: OUTPUT«(timeout)» | ||
flussence | :/ | ||
trying to be too clever. | 14:16 | ||
14:16
jedai joined
|
|||
moritz_ | rakudo: sub swap($a is rw, $b is rw) { say $a.perl; say $b.perl; ($a, $b) = ($b, $a); say $a.perl; say $b.perl}; my @a = 1, 2; my @b = 3, 4; swap(@a, @b); | 14:18 | |
p6eval | rakudo 5f5bae: OUTPUT«[1, 2][3, 4][3, 4, 1, 2][]» | ||
jnthn | Oh | 14:19 | |
It can't really work with is rw I guess | |||
moritz_ | looks like $a := @a doesn't really make $a a scalar | ||
jnthn | It can't with is rw | ||
Siknce that implies is parcel | 14:20 | ||
Which implies "don't apply any context" | |||
Since if you apply context, you just lost the original value. | |||
frettled | It apperas that we're essentially stuck with using a temporary variable. | 14:27 | |
rakudo: my @a=1,2; my @b=3,4; say @a.perl; say @b.perl; my @c=@a; @a=@b; @b=@c; say @a.perl; say @b.perl; | 14:28 | ||
p6eval | rakudo 5f5bae: OUTPUT«[1, 2][3, 4][3, 4][1, 2]» | ||
jnthn | my (@a, @b) := @b, @a; # modulo the re-declaration error, that'd do it. | ||
rakudo: my @a; my @a; say "alive" | |||
p6eval | rakudo 5f5bae: OUTPUT«===SORRY!===Redeclaration of symbol @a at line 22, near "; say \"ali"» | ||
jnthn | damn, it's an error, not a warning. | ||
frettled | Maybe we'll have to use MONKEY_GROPING. | 14:29 | |
Util | Thanks, all | 14:32 | |
My *real* question is: How can you do `@a Z+ @b` when you don't know which array is larger? | |||
I want to treat mis-matched lengths as if there were zero-filled on the right. | |||
@a Z+ @b ignore extra elements. | |||
@a <<+>> @b pads the short array by repeating the start of the short array. | |||
( @a, * ) repeats the last element. | 14:33 | ||
colomon | @a, 0 Z+ @b, 0 | ||
flussence | Look at the source for :samespace :) | ||
Util | ( @a, ( 0 xx *) ) Z+ ( @b, ( 0 xx *) ) is infinite. | ||
colomon | (is that implemented yet?) | ||
Util | ( @a, ( 0 xx *) ) Z+ @b requires you to swap @a and @b when @a is longer, | ||
which is why I wanted to know about swapping arrays. | |||
( @a, ( 0 xx (+@b - +@a )) ) Z+ ( @b, ( 0 xx (+@a - +@b) ) ) does work, | |||
colomon | @a, 0, * Z+ @b, 0, * | ||
Util | but I am hopefully that something shorter can be invented. | ||
14:33
wamba joined,
clkao joined,
exodist joined,
dukeleto joined,
nadim joined,
pothos joined,
Lorn joined,
jasonmay joined,
avuserow joined,
cxreg joined,
flatwhatson joined,
patch joined,
diakopter joined
|
|||
colomon | also infinite. | 14:33 | |
hmmm. | |||
14:34
plobsing left,
Guest38267 left
14:36
Guest38267 joined
|
|||
moritz_ | (@a, 0 xx * Z+ @b, 0 xx *)[^(@a max @b)] | 14:36 | |
colomon | both arrays have to be finite for this to work. | 14:37 | |
(I mean, in general, not just in moritz_++'s solution) | 14:38 | ||
colomon must not yield to temptation to define a new meta-op... | 14:40 | ||
14:40
wallberg left
14:41
isBEKaml_ joined
|
|||
moritz_ | the E (for Extend) meta op | 14:41 | |
EZ+ | |||
isBEKaml_ | hi, #perl6! :) | ||
jnthn | Can't wait to use the serialized extending cross meta-operator. | 14:42 | |
isBEKaml_ | Extending cross metaop? EX= ? | 14:43 | |
Util | moritz's solution works if I change (@a max @b) to (+@a max +b). Since the list is lazy, it is OK to be infinite if we tell it how many elements to take. | ||
moritz_ | isBEKaml_: you forgot the Serialized (S) part | ||
isBEKaml_ | moritz_: wow, that'd make it something. ;) | 14:44 | |
jnthn | ;) | ||
colomon | Util: with +@a max +@b, neither list can be lazy | 14:45 | |
unless ... | |||
rakudo: my @a = 1..*; say +@a | |||
p6eval | rakudo 5f5bae: OUTPUT«-9223372036854775808» | ||
colomon | rakudo: my @a = 1...*; say +@a | ||
p6eval | rakudo 5f5bae: OUTPUT«(timeout)» | 14:46 | |
Util | my @a and @b are not lazy. I meant that the generated (0 xx *) lists are lazy. | ||
colomon | ah, yes. | ||
Util | colomon: but I see that I misunderstood your statement: "both arrays have to be finite for this to work" | ||
14:46
justatheory joined
|
|||
isBEKaml_ | rakudo: my @a = 1..*; say @a; | 14:47 | |
p6eval | rakudo 5f5bae: | 14:48 | |
..OUTPUT«(timeout)101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130… | |||
isBEKaml_ | well, I didn't expect this (attempting to shoot myself) :D | ||
hugme: hug rakudo | 14:49 | ||
hugme hugs rakudo | |||
14:53
isBEKaml_ left
14:56
ggoebel left
|
|||
bbkr | rakudo: say Whatever ~~ *; say * ~~ Whatever; # why in first case I get "Bool::True" and in second I get "1" ? | 14:57 | |
p6eval | rakudo 5f5bae: OUTPUT«Bool::True1» | ||
15:00
mkramer left
|
|||
colomon | we had a similar case yesterday, something wrong in an ACCEPTS somewhere, I suspect. | 15:00 | |
15:00
mkramer joined
|
|||
moritz_ | bbkr: rakudobug | 15:00 | |
rakudo: say 1 ~~ Int | |||
p6eval | rakudo 5f5bae: OUTPUT«1» | ||
moritz_ | rakudo: say 1 ~~ 1 | ||
p6eval | rakudo 5f5bae: OUTPUT«Bool::True» | ||
moritz_ | same difference | ||
15:01
ggoebel joined
|
|||
bbkr | moritz_: thanks. i assume it's already reported | 15:01 | |
moritz_ | rt.perl.org/rt3/Ticket/Display.html?id=78748 | ||
15:03
justatheory left
|
|||
moritz_ | masak++. Of course. | 15:04 | |
colomon | not sure if this is the source of the problem, but it looks to me like ConcreteRole.ACCEPTS and Role.ACCEPTS are both wrong in this way. | 15:05 | |
rakudo: say 1 ~~ Numeric | |||
p6eval | rakudo 5f5bae: OUTPUT«1» | ||
colomon | yup | ||
bbkr | rakudo: say Bool.so # how about this one? *.so should always give output as Bool value, compare to "Int.so" for example | 15:06 | |
p6eval | rakudo 5f5bae: OUTPUT«Bool()» | ||
15:06
LionMadeOfLions joined
|
|||
moritz_ | well, it is a Bool value :-) | 15:07 | |
colomon | rakudo | ||
rakudo: say Int.so | |||
p6eval | rakudo 5f5bae: OUTPUT«Bool::False» | ||
15:07
zby left
|
|||
bbkr | hmm, from my spec understanding you should get Bool::False or Bool::True values from .so operator, not Bool class | 15:08 | |
moritz_ | then it should be False | ||
15:08
zby joined
|
|||
bbkr | indeed. should I report? | 15:08 | |
15:08
rgrau_ left
|
|||
moritz_ | or fix :-) | 15:09 | |
rakudo: say Bool.Bool | |||
p6eval | rakudo 5f5bae: OUTPUT«Bool()» | ||
moritz_ | augment class Bool does Abstraction { method Bool { self } | 15:10 | |
should probably be self ?? True !! False | |||
15:11
patspam joined
|
|||
colomon | huh. | 15:12 | |
15:12
risou left
|
|||
colomon | does that imply that, say Real.Numeric should be { self // 0 } ? | 15:12 | |
moritz_ | hm. Maybe. Not sure | 15:13 | |
it's something I'd like to hear TimToady's opinion on | |||
colomon | yeah. | ||
it seems to me the answer should be the same in either case. | 15:14 | ||
moritz_ | or maybe .so shouldn't blindly dispatch to .Bool | 15:16 | |
15:16
nymacro joined
|
|||
colomon | yeah, hmmm. | 15:17 | |
15:19
risou joined
|
|||
jnthn | I suspect part of the issue there is the circularity saw. | 15:21 | |
Bool needs ConcreteRole to exist/work. | 15:22 | ||
So doesn't exist at that point. | |||
We could make it look up Bool::True and Bool::False and fudge in some fake values until we get to the right point in the bootstrap I guess. | |||
15:26
icwiener_ left
15:29
cjk101010 left
15:37
Bonzor432 joined
15:44
Bonzor432 left
15:47
tzhs left
15:51
wamba left
15:54
tadzik joined
|
|||
tadzik | ~~ | 15:56 | |
15:58
leprevost left
|
|||
colomon | jnthn: huh | 16:00 | |
could we .wrap the methods once Bool has been defined, or something like that? | |||
jnthn | no | ||
Better to replace the thing in the namespace. | 16:01 | ||
*packAGFE | |||
*package | |||
Then it looks up the correct thing from there on. | |||
16:03
justatheory joined
|
|||
colomon | replace the method entirely, you mean? | 16:04 | |
16:05
Guest38267 left
|
|||
jnthn | no | 16:05 | |
replace what's installed at Bool::True | |||
e.g. put a 1 there | |||
then once Bool is set up, Bool::True is installed there | 16:06 | ||
colomon | ah. | ||
jnthn | So all call from then on find that. | ||
16:07
sftp_ joined,
sftp left
|
|||
TimToady | rakudo: my @a = 1,2; my @b = 3,4; (@a,@b) := (@b,@a); say ~@b | 16:08 | |
p6eval | rakudo 5f5bae: OUTPUT«3 4» | ||
TimToady | rakudo: my @a = 1,2; my @b = 3,4; (@a,@b) := @b,@a; say ~@b | 16:09 | |
p6eval | rakudo 5f5bae: OUTPUT«3 4» | ||
TimToady | hmm | ||
jnthn | rakudo: my @a = 1,2; my @b = 3,4; (@a,@b) := @b,@a; say ~@a | ||
p6eval | rakudo 5f5bae: OUTPUT«1 2» | ||
TimToady | looks like the bind has turned into a no-op somehow | ||
jnthn | wonder if parcel binding works. | ||
yeah | |||
that's not good. | |||
decommute & | |||
16:12
sftp_ left
16:13
sftp_ joined,
risou left,
risou_ joined
16:16
MayDaniel joined
16:19
justatheory left
16:28
icwiener joined
16:33
Guest21983 left
16:38
Ross joined
16:40
Ross left,
Ross joined,
Ross left,
Ross joined
16:55
daxim left
16:56
sftp_ left
16:58
bluescreen joined,
bluescreen is now known as Guest96007
17:00
sftp joined
17:10
Trashlord left
17:11
impious joined
|
|||
takadonet | soo quiet..... | 17:14 | |
TimToady | shh | 17:16 | |
colomon | too quiet. ;) | ||
takadonet | still working on that text::Wraps module! | ||
colomon | \o/ | ||
takadonet | i figure out how the p5 modules does it and well.... it's weird | ||
17:20
wamba joined
17:23
sftp left,
sftp joined
17:26
meppl left
|
|||
tadzik | I had the same feeling with File::Find | 17:26 | |
17:27
timbunce left
17:29
icwiener left
17:30
Trashlord joined
17:31
icwiener joined
17:33
sftp left,
sftp_ joined,
timbunce joined,
nymacro left
17:34
am0c^ left
17:35
plainhao joined
17:37
molaf joined
17:38
Guest96007 left
|
|||
diakopter | 17:45 | ||
tadzik | |||
takadonet | ? | ||
17:46
jferrero left
|
|||
diakopter | freenode was confused about my nick | 17:46 | |
17:49
cdarroch joined,
cdarroch left,
cdarroch joined
17:53
Guest96007 joined
17:54
sftp joined,
sftp_ left
|
|||
PacoLinux | there is no version of Song 99 Bottles of Beer in perl6 ? -> www.99-bottles-of-beer.net/ | 17:55 | |
17:58
masak joined
|
|||
masak | oh hai from Austria! \o/ | 17:59 | |
masak digs into some fervent November blogging | 18:03 | ||
colomon | rakudo: say "5 bottles", *.pred ... 1; | 18:05 | |
p6eval | rakudo 5f5bae: OUTPUT«(timeout)5 bottler5 bottleq5 bottlep5 bottleo5 bottlen5 bottlem5 bottlel5 bottlek5 bottlej5 bottlei5 bottleh5 bottleg5 bottlef5 bottlee5 bottled5 bottlec5 bottleb5 bottlea5 bottldz5 bottldy5 bottldx5 bottldw5 bottldv5 bottldu5 bottldt5 bottlds5 bottldr5 bottldq5 bottldp5 | ||
..bottldo5 b… | |||
Tene | heh | 18:06 | |
colomon | :\ | ||
masak | rakudo: .say for map { $_ ~ " bottles" }, 5 ... 1 | ||
p6eval | rakudo 5f5bae: OUTPUT«No candidates found to invoke for method 'map' on object of type 'Array'; available candidates have signatures::(Mu : █; *%_) in 'map' at line 1797:CORE.setting in main program body at line 22:/tmp/h95RVOWKSj» | ||
masak | rakudo: .say for map { $_ ~ " bottles" }, (5 ... 1) | ||
p6eval | rakudo 5f5bae: OUTPUT«5 bottles4 bottles3 bottles2 bottles1 bottles» | 18:07 | |
masak | rakudo: .say for map { $_ ~ " bottles" }, reverse 5..1 | ||
p6eval | rakudo 5f5bae: ( no output ) | ||
masak | rakudo: .say for map { $_ ~ " bottles" }, reverse 1..5 | ||
p6eval | rakudo 5f5bae: OUTPUT«5 bottles4 bottles3 bottles2 bottles1 bottles» | ||
colomon | rakudo: say "5 bottles", { .subst(/\d+/, { $_ - 1}); } ... * == 1 ; | 18:09 | |
p6eval | rakudo 5f5bae: OUTPUT«5 bottles4 bottles3 bottles2 bottles1 bottles» | ||
colomon | rakudo: say "5 bottles\n", { .subst(/\d+/, { $_ - 1}); } ... * == 1 ; | ||
p6eval | rakudo 5f5bae: OUTPUT«5 bottles4 bottles3 bottles2 bottles1 bottles» | ||
Tene | So, who's volunteering to port Lingua::EN::Inflect? | ||
;) | 18:10 | ||
colomon | it looks surprisingly complicated | 18:11 | |
Tene | Surprisingly? Are you new to English? ;) | 18:12 | |
colomon | No, just surprised at the scope of the module. Damian++ | ||
Trashlord | wait, what? | 18:14 | |
oh, right | |||
18:30
nadim left
|
|||
TimToady | PacoLinux: see rosettacode.org/wiki/99_Bottles_of_Beer | 18:32 | |
18:32
nadim joined
|
|||
colomon | TimToady++ | 18:34 | |
shortcircuit | TimToady: For line 3 of that example, the expression ('Take one down, pass it around' xx 99) is placed in the array. Is the expression evaluated before or after the assignment? | 18:35 | |
IOW, does @actions contain two members, or 100? | |||
colomon | before | 18:36 | |
18:37
timbunce left
|
|||
TimToady | xx is lazy but list assignment is not, unless it knows that there are an infinite number of things on the right | 18:37 | |
shortcircuit | Is it possible to trick the array assignment into being lazy, even though the number of elements would be finite? | 18:38 | |
shortcircuit is thinking about memory optimization cases. | |||
TimToady | sure, use := instead | ||
shortcircuit | Cool | ||
moritz_ | TimToady: what should Bool.Bool return? Bool or Bool::False? | ||
TimToady: and what about Bool.so? | |||
shortcircuit | Oh, God, I just had some awesome program loop behaviors come to mind using xx, := and function calls. | 18:39 | |
shortcircuit sheds a tear | |||
It's beautiful... | |||
18:39
tadzik left
|
|||
TimToady | moritz_: do you mean Bool as a value, or anything of type Bool? | 18:39 | |
moritz_ | TimToady: I mean the type object | 18:40 | |
TimToady | type objects are false | ||
moritz_ | so Bool.Bool returns False? | ||
masak | blog post! strangelyconsistent.org/blog/novemb...mprovement | ||
TimToady | I'd think so | ||
masak | makes sense to me. | ||
TimToady | certainly .so returns true or false | ||
18:41
LionMadeOfLions left
|
|||
TimToady | .Bool is just type conversion, arguably, and actual testing of the truthiness is something below that | 18:41 | |
colomon | likewise, should Int.Real return 0? | 18:42 | |
masak | premiere & | ||
18:42
masak left
|
|||
TimToady | I don't know how you convert to a role | 18:42 | |
that doesn't make sense to me | |||
moritz_ | prefix:<+> also coerces to role (Numeric) | 18:43 | |
18:43
timbunce joined
|
|||
colomon | errr.... .Numeric is pretty fundamental now. | 18:43 | |
TimToady | it does, but Numeric has to handle that specially | 18:44 | |
moritz_ | I'd think it means "coerce to a type that implements that role" | ||
colomon | what moritz_ said. | ||
TimToady | so Int.Real can return Int, meseemeht | ||
*th | |||
colomon | so +Int should be Int? | 18:45 | |
rakudo: say +Int | 18:46 | ||
p6eval | rakudo 5f5bae: OUTPUT«Int()» | ||
18:48
Guest96007 left
18:50
timbunce left
19:00
Guest96007 joined
19:03
molaf_ joined
19:05
molaf left
19:10
ggoebel left
19:16
ggoebel joined
19:19
justatheory joined
19:22
molaf_ left
19:24
risou_ left
19:31
wtw left
19:32
Ross left
19:34
jaldhar left
19:36
ggoebel left
19:38
Ross joined
19:41
ggoebel joined
19:46
ggoebel left
19:48
meppl joined
19:52
takadonet left
19:57
ggoebel joined
|
|||
TimToady | phone? | 20:00 | |
pmichaud | calling now | 20:03 | |
sjohnson calls TimToady | |||
20:06
patspam left
|
|||
jasonmay | phone..? p6 superhero hotline? | 20:19 | |
diakopter | weekly sixperl chat; minutes/transcript was posted once upon a time to use.perl.org | 20:20 | |
last I saw was from May | 20:22 | ||
jasonmay | oh cool | 20:25 | |
20:27
saaki left
20:31
MayDaniel left
|
|||
dukeleto | It would be nice if the perl 6 talk minutes were publicly viewable. | 20:32 | |
diakopter | I'm sure it takes work to transcribe them then work to make consensus on sanitizing/clarifying them :D | 20:33 | |
20:41
skangas joined
20:46
saaki joined
21:06
LionMadeOfLions joined
21:09
Guest96007 left
21:26
ggoebel left
21:29
plainhao left
21:32
stkowski joined
21:34
wamba left
|
|||
PerlJam | diakopter: If one of the participants would record the conversation, transcription/condensation/clarification/etc could be out sourced | 21:35 | |
diakopter | I'm sure they are recorded | ||
chromatic historically transcribed, afaicg | 21:36 | ||
21:37
whiteknight joined
21:38
justatheory left
|
|||
PerlJam | I'm not sure they are recorded. | 21:38 | |
diakopter | oh | ||
21:42
spq1 left
|
|||
lue | ohayo ツ | 21:46 | |
21:47
justatheory joined
21:52
y3llow_ joined
21:53
pothos_ joined
21:54
REPLeffect left,
pothos left
21:55
ggoebel joined,
y3llow left,
pothos_ left,
y3llow_ is now known as y3llow,
pothos joined
21:56
icwiener left
22:04
ggoebel left
22:05
justatheory left
22:08
ggoebel joined,
sftp left
22:09
sftp joined
22:10
REPLeffect joined
22:14
REPLeffect left
22:15
justatheory joined
22:16
REPLeffect joined
22:19
Ross left
22:21
REPLeffect left
22:34
alester joined,
donaldh joined
22:37
xabbu42 joined,
justatheory left,
REPLeffect joined
|
|||
donaldh | jnthn: Hi, I'm experimenting with Zavolaj | 22:37 | |
jnthn: It's really nice, but I've reached some limits. | 22:38 | ||
jnthn | donaldh: Yes, it has some. | ||
donaldh: Especially the lack of a way to handle structs. That's something that I can can be improved once the Parrot NCI GSOC work lands in master. | 22:39 | ||
donaldh | jnthn: I'm using it with the parrot gsoc_nci branch at the moment. | ||
Sqlite3 makes extensive use of out params, typically opaque. | 22:40 | ||
jnthn | Ah, OK. There's not handling for that just yet. | ||
donaldh | So I'm trying to figure out a way of implementing the V nci parameter type | ||
:D | 22:41 | ||
jnthn thinks for a moment how that could look | |||
donaldh | in PIR I use UnManagedStruct | ||
And V writes a pointer into UnManagedStruct | 22:42 | ||
Is there any equivalent type I can use in Rakudo? | 22:43 | ||
22:43
REPLeffect left
|
|||
donaldh | Or a wrapper for UnManagedStruct? | 22:43 | |
jnthn | Maybe a wrapper for UnManagedStruct is the way to go (more) | 22:44 | |
Maybe it wants some "placeholder" style thing like OpaquePointer | 22:45 | ||
e.g. OpaquePointerOut or some such | |||
donaldh | Yes, I was thinking that way too. | ||
22:45
REPLeffect joined
|
|||
jnthn | And the scalar that gets passed in gets assigned to. | 22:45 | |
Oh | 22:46 | ||
donaldh | Only it doesn't remain OpaquePointerOut for long. It becomes an in param to the next call. | ||
jnthn | True... | ||
Note that OpaquePointer isn't actually used as a class ever. | |||
donaldh | I see that. Just a type. | ||
jnthn | It's only used by the NCI sig generator. | ||
22:47
am0c joined
|
|||
donaldh | There is a general problem with out params that parrot never used to handle very well. | 22:47 | |
I'm not sure if it's better because I haven't looked recently. | 22:48 | ||
jnthn | *nod* | ||
donaldh admits that 'V' wasn my invention. | |||
_was_ | |||
jnthn | :-) | ||
Yeah, I'm just pondering how to neatly map it to something in Zavolaj. | |||
$c is just a capture, so you can get the scalar out of it and assign to it just fine. | 22:49 | ||
I wonder if the way to do it is to not just call with |$c, but instead if there are out parameters (just use a "flag type" like OpaquePointer) it creates and passes in an unmangedstruct to get the pointer. | 22:50 | ||
donaldh | I'm staring at your method Bool that does some unmanaged magic, but not quite understanding it ;- | ||
jnthn | Reading the defined v-table method in the appropriate PMC should be revealing on that one. | 22:51 | |
I forget exactly what it does off-hand... | |||
donaldh | ah | ||
thanks for the pointer. | |||
donaldh is learning fast here. | |||
22:52
stkowski left
|
|||
jnthn | Wow. !update-desc-to-index is evil! | 22:52 | |
22:52
risou joined
|
|||
donaldh | ^^ nice symmetry to that last statement | 22:53 | |
jnthn | ;-) | ||
My feeling is that you'll need to do something in the trait_mod with $c though | 22:54 | ||
e.g. re-build the argument list when there's out pointers. | |||
And slot the unmanaged struct to populate in there. | 22:55 | ||
Assigning it to the passed in scalar container. | |||
(Maybe call !STORE directly) | |||
Zavolaj does some evil stuff, but mostly to keep the evil out of everything else that's using it. :-) | 22:56 | ||
donaldh | You've just said about 5 higher order things that I barely understand right now ;0 | ||
jnthn | Oops, sorry. :-) | ||
donaldh | heh | ||
jnthn | Do you understand what's going on between lines 104 and 113? | 22:57 | |
donaldh | I'll go play with this and maybe come and bug you with questions. | ||
jnthn | That's the area I expect you'll need to make changes. | ||
donaldh | I don't right now [lines ...] but it's a good learning exercise for me. | 22:58 | |
jnthn | I should explain at least one thing 'cus it's...bizzare. :-) | ||
22:58
wamba joined
|
|||
donaldh | k | 22:59 | |
22:59
wamba left
|
|||
jnthn | In Rakudo when you write a sub foo, the thing that gets installed in the lexpad (or package, or whatever) isn't actually the Parrot Sub PMC. | 22:59 | |
It's a wrapper object around one. | |||
donaldh | wow, I remember that from way back. | 23:00 | |
jnthn | The attribute in the wrapper containing that Parrot sub is in the $!do | ||
pir::setattribute__vPsP($r, '$!do' ... | |||
23:00
REPLeffect left
|
|||
jnthn | That is just saying "oh, we'll throw out the sub body and replace it with something that does an NCI call instead" | 23:00 | |
23:01
justatheory joined
|
|||
donaldh | Gotcha. | 23:01 | |
jnthn | Just thought it was worth demistifying that bit. :-) | 23:02 | |
What follows is not so bad once you go through it piece by piece. | |||
donaldh | Am I right in saying that pir::descalarref__PP is just a dereferencing step? | 23:03 | |
23:03
wamba joined
|
|||
jnthn | Yes. Decontainerization. | 23:04 | |
23:06
justatheory left
|
|||
donaldh | is that roughly equivalent to .param pmc ref \n ref = deref ref | 23:06 | |
I used to do this in Rakudo: $dbHandle = q:PIR { %r = new 'UnManagedStruct' }; | 23:08 | ||
And: $dbHandle = q:PIR { %r = new 'UnManagedStruct' }; | |||
Ooops: my $s = Sqlite3::sqlite3_open($db, deref($dbHandle)); | |||
nopaste? | 23:10 | ||
jnthn | donaldh: Roughly. | 23:12 | |
donaldh: It's a specialized op | |||
That knows about Rakudo's container types | |||
But semantically it's a lot like deref. | |||
donaldh | Okay, thanks | ||
23:13
justatheory joined
23:14
REPLeffect joined
|
|||
donaldh | Thanks jnthn++ I'll go play, but very time challenged just now so it might be a while. | 23:14 | |
23:14
alester left
|
|||
jnthn | donaldh: No worries. Have fun, when you get to it. :-) | 23:15 | |
donaldh: Oh, do you have a Zavolaj commit bit? | |||
23:15
xabbu42 left
|
|||
donaldh | jnthn: nope | 23:15 | |
jnthn | github id? | ||
donaldh | [email@hidden.address] | ||
sorry donaldh | 23:16 | ||
23:16
kensanata left
|
|||
jnthn | donaldh: You're added. | 23:16 | |
donaldh | thanks! | 23:17 | |
jnthn | donaldh: I'm happy to code-review and then merge through the fork queue if you prefer to do things that way, but if you're confident, go ahead and commit. :-) | ||
Please do check that e.g. MiniDBI still works, though. | |||
There's not really a test suite for Zavolaj yet. :( | |||
23:17
ggoebel left
|
|||
jnthn | Though things that use it (like MiniDBI) do have one. :-) | 23:18 | |
"Test suite through proxy." ;-) | |||
23:18
REPLeffect left
|
|||
donaldh | Nice :-) | 23:19 | |
23:19
justatheory left
|
|||
donaldh | This may all lead me to hacking on MiniDBI for Sqlite3 support. | 23:19 | |
jnthn: thanks again and goodnight. | 23:20 | ||
23:20
xabbu42 joined,
ggoebel joined
|
|||
jnthn | donaldh: Excellent | 23:21 | |
night :-) | |||
lue | rakudo: $a = "hello;world"; say $a.split(';').perl | 23:22 | |
p6eval | rakudo 142d22: OUTPUT«===SORRY!===Symbol '$a' not predeclared in <anonymous> (/tmp/sO3fKMsLUK:22)» | ||
lue | rakudo: my $a = "hello;world"; say $a.split(';').perl | ||
p6eval | rakudo 142d22: OUTPUT«("hello", "world")» | ||
lue | rakudo: my $a = 3;say $a; | 23:23 | |
p6eval | rakudo 142d22: OUTPUT«3» | ||
23:23
donaldh left
23:25
sftp left
|
|||
araujo | pastie.org/1270943 | 23:25 | |
though it follows the smalltalk infix operators (messages) rules | |||
:P | |||
23:28
sftp joined
23:31
REPLeffect joined
23:32
wamba left,
meppl left
|
|||
lue | how do I access certain characters of a string again? | 23:34 | |
(something like $a[0]) | |||
rakudo: my $a = "hello"; say $a[0] | 23:39 | ||
p6eval | rakudo 142d22: OUTPUT«hello» | ||
23:40
xabbu42 left
|
|||
Util | rakudo: my $s = "abcdef"; $s.substr(1,3).say; # Starting at position 1 (0-based), return 3 characters | 23:41 | |
p6eval | rakudo 142d22: OUTPUT«bcd» | ||
Util | lue: using substr, either as a function or as a method. Method demonstrated above. | 23:43 | |
rakudo: my $s = "abcdef"; print substr( $s, 1,3 ); # function version | 23:44 | ||
p6eval | rakudo 142d22: OUTPUT«bcd» | ||
lue | How would I remove the last character of a string? | 23:45 | |
flussence | .chop? | ||
23:46
risou left
|
|||
Util | flussence: yes, but the chop method does not mutate its argument (unlike in Perl5); it returns the chopped string. | 23:51 | |
So the answer is $s = $s.chop , which can be shortened to $s .= chop; | |||
rakudo: my $s = "abcdef"; $s .= chop; $s.say | |||
p6eval | rakudo 142d22: OUTPUT«abcde» | ||
23:52
justatheory joined
|
|||
Util | The old "chop" semantics live on as "p5chop": | 23:53 | |
rakudo: my $s = "abcdef"; p5chop $s; $s.say | |||
p6eval | rakudo 142d22: OUTPUT«abcde» | ||
23:54
Limbic_Region joined
23:55
justatheory left
|