»ö« 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! Set by sorear on 4 February 2011. |
|||
benabik | Ooh, language design arguments. :-D | 00:01 | |
00:02
Chillance left
00:04
Trashlord left
00:06
soh_cah_toa left
00:07
[Coke] left
00:09
[Coke] joined
00:13
soh_cah_toa joined
|
|||
colomon | sorear: just e-mailed you the complete trig patch. | 00:25 | |
00:25
kfo joined
|
|||
colomon | still needs some work on real inverse hyperbolic functions, current implementation is hacky. | 00:25 | |
now to patch roast... | 00:26 | ||
00:29
kfo_ left
|
|||
colomon | b: say True ?? "hello" !! "Goodbye" | 00:42 | |
p6eval | b 1b7dd1: OUTPUT«hello» | ||
sorear | rakudo: say tan pi/2 | 00:45 | |
p6eval | rakudo aed9fe: OUTPUT«557135115.020977» | ||
00:46
PacoLinux joined
|
|||
dalek | ecza: 08a7d84 | (Solomon Foster)++ | / (6 files): Significant expansion of the C# Complex class in Utils.cs. Complete implementation of an auto-generated set of trig functions. |
00:47 | |
colomon | sorear: does niecza not allow todo fudging? | 00:48 | |
sorear | colomon: correct | 00:49 | |
I don't actually quite know how it should work | 00:50 | ||
I'll research that later maybe? | |||
colomon | sure | ||
and I'll change them to skips for now | |||
dalek | ast: 46de8ad | (Solomon Foster)++ | S32-trig/generate-tests.pl: Update trig generator with fudging for Niecza. |
00:54 | |
ast: 4661e6b | (Solomon Foster)++ | S32-trig/ (13 files): Update generated trig files with fudging for Niecza. |
|||
japhb | Is there a way (other than string eval) to produce a role that closes over surrounding variables? | 00:59 | |
colomon | oooo, there's a make spectest target now. | 01:00 | |
japhb | e.g. my $foo = "blah"; my $role = role { method bar { $foo } }; | ||
01:06
REPLeffect left
01:19
REPLeffect joined
|
|||
colomon | sorear: whoops. forgot to implement atan2! | 01:23 | |
01:23
packetknife left
01:26
wolfman2000 joined
01:28
uasi joined
|
|||
colomon | sorear: you can turn on all the S32-trig tests except atan2.t | 01:32 | |
whee, sierpinski!! | 01:44 | ||
01:58
envi joined
01:59
frhodes left
|
|||
colomon | sorear: you out there atm? | 02:44 | |
I just defined static Func<Variable,Variable,Variable> atan2_d = atan2; and that seems to compile okay, but when I add method atan2($x) { Q:CgOp { (atan2 {self, $x}) } } to Cool, niecza's compile blows sky high. What am I doing wrong? | 02:47 | ||
02:48
flatwhatson left
02:50
envi left
|
|||
colomon | oh, should be atan2 {self} {$x} | 02:51 | |
02:56
envi joined
|
|||
sorear | japhb: role parameterization | 03:02 | |
colomon: I have just returned from dinner | |||
colomon | sorear: just sent you another patch | 03:03 | |
sorear | colomon: (atan2 {self} {$x}). It's modelled on lisp. | ||
{self, $x} should result in some kind of MethodNotFoundException | |||
colomon: Why did you give atan2 a default argument? | 03:04 | ||
colomon | sprec | ||
spec | |||
sorear | looks decent to me then. Which thing did you cargo-cult? | 03:05 | |
colomon | all the stuff with the a2.Fetch() ; GetNumber etc | ||
sorear | sorry, I mean where did you get it from. | ||
colomon | I dropped the HandleSpecial bit because I wasn't sure how to do it with two arguments | ||
oh, I started with the code for sin, I think | 03:06 | ||
sorear | add() contains an example of HandleSpecial used for two arguments | ||
but you don't really need it here | 03:07 | ||
colomon | ah, yeah, I did find mul later, looking for something else. didn't occur to me to grab the HandleSpecial from there. | ||
sorear | the purpose of HandleSpecial is to implement junctional autothreading | ||
colomon | ah, right | ||
sorear | since you're only calling (atan2) from inside a function with Any args, atan2 can never see a junction | ||
for add() and friends it's useful to avoid the cost of a function call and signature binding. not sure atan2 is the same | 03:08 | ||
dalek | ecza: 26ad592 | (Solomon Foster)++ | lib/ (2 files): First stab at implementing atan2. |
03:09 | |
colomon | yeah, I have no real feel on junctions other than as a simple shortcut in comparisons. :) | ||
sorear | karma colomon | ||
aloha | colomon has karma of 152. | ||
sorear | karma Colomon Foster | ||
aloha | Colomon Foster has karma of 0. | ||
sorear | karma Solomon Foster | ||
aloha | Solomon Foster has karma of 112. | ||
colomon | I have a (not so) secret identity | ||
sorear | (also have to avoid typing 'colophon:') | 03:10 | |
colomon: My command on junctions isn't the best either. The niecza implementation of them is several orders of magnitude faster than I expected it to be | 03:11 | ||
colomon | that's handy! | ||
sorear | $obj == 1 | 3 | 5 is not significantly slower than $obj == 1 || $obj == 3 || $obj == 5 | ||
colomon | btw, the GTK Sierpinski example Just Worked for me. That's terrific! | 03:12 | |
afk # bed | 03:21 | ||
03:23
newsbad_com left
03:29
newsbad_com joined
03:36
donri left
|
|||
ingy | hi TimToady | 03:56 | |
TimToady: I read over % more in detail | |||
TimToady: it's nice, but I still don't see how to allow for possible trailing comma | 03:57 | ||
04:00
soh_cah_toa left
|
|||
ingy | sb end | 04:02 | |
moritz: funny how you tried to talk me out of a+ ** to be a +** and now its a+ ** in a05, albeit a+ % | 04:05 | ||
japhb | Once I have the message string, how do I create the $?USAGE variable in Rakudo, and set it to my newly-minted message? | 04:15 | |
(from within the setting, of course) | 04:16 | ||
araujo | hello | 04:36 | |
japhb | o/ | 04:40 | |
05:05
REPLeffect left
05:13
djanatyn left,
djanatyn joined
05:18
REPLeffect joined
05:20
Tene left,
djanatyn left
05:21
bluescreen10 left
05:27
kaare_ joined
05:31
Tene joined,
Tene left,
Tene joined
05:34
flatwhatson joined
05:36
kaleem joined
05:44
flatwhatson left
05:50
kaleem left
05:52
mj41 joined
06:05
orafu left
06:06
orafu joined
06:07
risou_awy is now known as risou,
mj41 left
06:10
REPLeffect left
06:12
risou is now known as risou_awy
06:13
f00li5h left
|
|||
sorear | hello araujo | 06:17 | |
06:19
araujo left
06:23
REPLeffect joined
06:24
Woodi joined
|
|||
moritz | good morning | 06:41 | |
ingy: funny indeed | |||
Woodi | morning #perl6 | 06:45 | |
i got something like this: | |||
rakudo: class A { has %!c = { 'a' => 1, 'b' => 2 } ; for %!c.keys -> $name { say $name } } | 06:46 | ||
p6eval | rakudo aed9fe: OUTPUT«Can only use repr_get_attr_obj on a SixModelObject in <anon> at /tmp/6KlyczI8WZ:1 in <anon> at /tmp/6KlyczI8WZ:1 in <anon> at /tmp/6KlyczI8WZ:1» | ||
Woodi | and | ||
rakudo: class A { our %c = { 'a' => 1, 'b' => 2 } ; for %c.keys -> $name { say $name } } | |||
p6eval | rakudo aed9fe: OUTPUT«Method 'STORE' not found for invocant of class 'Any' in <anon> at /tmp/9HjmJPA6Ww:1 in <anon> at /tmp/9HjmJPA6Ww:1 in <anon> at /tmp/9HjmJPA6Ww:1» | ||
Woodi | hwhat should i use in nom ? works with star-07 | 06:47 | |
06:48
woosley joined
|
|||
moritz | Woodi: the problem is that attributes are tied to specific instances, but the class body (in which you try to access the attribute) is no | 06:49 | |
Woodi | our version works | ||
hmm | |||
moritz | Woodi: so put the code into a method, create an instance of the class, and call the method with the code | ||
Woodi | you mean 'for' ? | 06:50 | |
moritz | yes | ||
you'll notice that all examples of attribute usage use them in methods, not in the class body | 06:51 | ||
Woodi | it is intentional outside method becouse it generate methods :) should be BEGIN probably | ||
moritz | then it can't be in an attribute | ||
Woodi | ok | ||
so our should work ? | |||
moritz | yes | 06:52 | |
Woodi | b: class A { our %c = { 'a' => 1, 'b' => 2 } ; for %c.keys -> $name { say $name } } | ||
p6eval | b 1b7dd1: OUTPUT«ab» | ||
Woodi | oo | ||
hmm | |||
06:52
lue left
|
|||
Woodi | ok, so b is ok | 06:53 | |
in nom i got STORE problems... | |||
rakudo: class A { our %c = { 'a' => 1, 'b' => 2 } ;BEGIN { for %c.keys -> $name { say $name } } } | 06:57 | ||
p6eval | rakudo aed9fe: OUTPUT«===SORRY!===Method 'keys' not found for invocant of class 'Mu'» | ||
07:00
mj41 joined
07:04
SHODAN joined
|
|||
Woodi | today release of next Star ? | 07:04 | |
07:04
lue joined
07:08
senobmeht left
07:09
lue left
07:10
senobmeht joined
07:13
lue joined
|
|||
sorear -> sleep | 07:15 | ||
tomorrow: study nom's implementation of parametric roles | 07:16 | ||
snarkyboojum | Woodi: haven't heard about a date for next Star yet - devs are waiting to bed down nom first I believe | 07:21 | |
TiMBuS | is there a perl5 version of the cross operator? list::moreutils doesnt have one :/ | 07:24 | |
Woodi | perl6: my $a = "A\n"; lc $a; $a.chomp ; say $a; | ||
p6eval | pugs, rakudo aed9fe, niecza v9-50-g26ad592: OUTPUT«A» | ||
Woodi | perl6: my $a = "A\n"; lc $a; chomp $a; say $a; | ||
p6eval | pugs, rakudo aed9fe, niecza v9-50-g26ad592: OUTPUT«A» | ||
TiMBuS | Algorithm::Loops might have one... | 07:25 | |
snarkyboojum | perl6: my $a = "A\n"; say $a.chomp; | 07:31 | |
p6eval | pugs, rakudo aed9fe, niecza v9-50-g26ad592: OUTPUT«A» | ||
Woodi | perl6: my $a = "A\n"; $a.lc; $a.chomp; say $a; | 07:35 | |
p6eval | pugs, rakudo aed9fe, niecza v9-50-g26ad592: OUTPUT«A» | ||
Woodi | perl6: my $a = "A\n"; $a.chomp; say $a; | ||
p6eval | pugs, rakudo aed9fe, niecza v9-50-g26ad592: OUTPUT«A» | ||
Woodi | perl6: my $a = "A\n"; say $a.lc; | 07:36 | |
p6eval | pugs, rakudo aed9fe, niecza v9-50-g26ad592: OUTPUT«a» | ||
Woodi | perl6: my $a = "A\n"; say $a.lc; say $a; | ||
p6eval | pugs, rakudo aed9fe, niecza v9-50-g26ad592: OUTPUT«aA» | ||
Woodi | perl6: my $a = "A\n"; say $a.chomp; say $a; | 07:37 | |
p6eval | pugs, rakudo aed9fe, niecza v9-50-g26ad592: OUTPUT«AA» | ||
Woodi | it little strange but consistent :) | ||
moritz | not strange if you remember that Str and Int methods don't modify the invocant, but return a modified copy | 07:38 | |
you can do $a.=chomp if you want in-place modification | 07:39 | ||
Woodi | moritz: chomp at least was modyfing in-place and it was perfect | 07:41 | |
lc not | |||
07:51
mj41 left
07:55
lue left
08:03
lue joined
08:06
mj41 joined
08:09
lue left
08:18
im2ee joined
|
|||
im2ee | Hello! :) | 08:18 | |
moritz | good morning im2ee | 08:24 | |
perfectly inconsistent, yes | |||
08:28
risou_awy is now known as risou
08:32
cognominal joined
08:33
lue joined
08:36
masak joined
|
|||
masak | good morning, #perl6! | 08:36 | |
moritz | good am, ma<tab> | 08:38 | |
masak | ;) | ||
08:38
lue left
|
|||
moritz | you will love this one: | 08:39 | |
multi sub infix:«<=>»(Buf:D $a, Buf:D $b) { [||] $a.list Z<=> $b.list or $a.elems <=> $b.elems | |||
} | |||
08:41
araujo joined,
lue joined
|
|||
masak | ooh | 08:41 | |
moritz | thought so :-) | 08:42 | |
08:42
molaf joined
08:43
REPLeffect left
|
|||
moritz | I'm sure it's terribly inefficient in contemporary rakudo | 08:43 | |
but it's so beautiful that I'll keep it that way until somebody complains about speed :-) | 08:44 | ||
szabgab_ | guys, can I ask you for a quick but unrelated help. I am trying to run a poll and I need a quick feedback before I launch it | 08:45 | |
perlpolls.com/perl-news is the url, I'd appreciate your comments | |||
08:45
MayDaniel joined,
szabgab_ is now known as szabgab
08:46
lue left
|
|||
masak | looks ok. | 08:50 | |
from a sixer's perspective, it's more "Perl 5 news" than "Perl news", but I'm not sure the distinction matters much to the rest of the world. ;) | |||
szabgab | shall I add the planetsix? | 08:51 | |
masak | wouldn't hurt. | ||
szabgab | unfortunatelly I am not sure in that :( but I added as I think it is important | 08:54 | |
masak | hey, it's your poll. ;) | 08:56 | |
szabgab | masak: in any case, thanks for you quick feedback! | ||
masak | I'm not sure use.perl.org belongs there. | 08:57 | |
it's literally impossible to blog there nowadays. | |||
szabgab | this is the beginnng of those polls I mentioned almost a year ago | ||
I put it there as sort of a reality check | 08:58 | ||
masak | ok. | ||
szabgab | I am quite sure many people will still check it | ||
as happened a while ago | |||
but we'll see | |||
masak | I think a fair number of people would check "planet perl 6" if it were in that list. | ||
szabgab | it is already | ||
masak | \o/ | 08:59 | |
so it is. szabgab++ | |||
moritz: how come split gets a Str $delimiter variant, but comb doesn't get a Str $matcher variant? | 09:01 | ||
09:05
mj41 left
|
|||
masak | re the discussion about "the final release" yesterday. I'd *love* for there to be such a moment, where we put away our tools, wipe our hands and say "there. we did it." it's just -- from what I've seen of the world, it doesn't work that way. :/ | 09:06 | |
any 6.0.0 point will by necessity be arbitrary and thus a disappointment to some. | 09:07 | ||
Patterner | are those people paying you? | 09:08 | |
masak | so ingy claimed. | ||
see backlog. | 09:09 | ||
09:09
MayDaniel left
|
|||
Patterner | unless you have proof: ignore some. and continue the good work. | 09:09 | |
masak | aye. | 09:10 | |
though possibly I'll get the energy to blog about this. | |||
I was happy to see Rakudo gain speed. I was even happier about Rakudo Star. if we manage to make the jigsaw pieces fit, nom will be our awesomest product yet. | 09:11 | ||
09:12
MayDaniel joined
|
|||
masak | it just feels so skewed to be talking about failed 6.0.0 expectations in the middle of that. | 09:12 | |
masak continues the good work | 09:13 | ||
std: my $a = "HAI"; say "OH $a # comment" | 09:15 | ||
p6eval | std c22b2ee: OUTPUT«ok 00:01 121m» | ||
masak | nom: my $a = "HAI"; say "OH $a" | ||
p6eval | nom aed9fe: OUTPUT«OH HAI» | ||
masak | my $a = "HAI"; say "OH $a # comment" | ||
nom: my $a = "HAI"; say "OH $a # comment" | |||
p6eval | nom aed9fe: OUTPUT«===SORRY!===Confused at line 1, near "say \"OH $a"» | ||
masak submits rakudobug | |||
I think we've had this one before. | |||
b: my $a = "HAI"; say "OH $a # comment" | |||
p6eval | b 1b7dd1: OUTPUT«===SORRY!===Confused at line 22, near "say \"OH $a"» | ||
masak | oh, ok. | 09:16 | |
masak searches RT for this bug | |||
09:17
MayDaniel left
|
|||
masak | aye, here: rt.perl.org/rt3/Ticket/Display.html?id=78202 | 09:18 | |
some goof named masak already found that one a year ago. | 09:19 | ||
Woodi | masak: i do not think that Perl6 is spec only. it totally do not matter to user, especially outside Perl sphere. only implementations matter and spec is just one of design stage for them. they think that way. and now: if Perl6 spec is like ANSI specification will be + on top of the first | ||
so ingy problem was just name... | 09:20 | ||
masak | Woodi: no disagreement there. | ||
well, Perl 6 *is* a spec. maybe if he said that's what people had been paying for all along, and not the implementations too, that's why they revolted. | 09:21 | ||
but note that things like Hague grants are never on just the spec, but on Rakudo primarily and the spec secondarily. | |||
nom: my $a = "HAI"; say "OH $a \# comment" | 09:22 | ||
p6eval | nom aed9fe: OUTPUT«OH HAI # comment» | ||
masak | workaround ^^ | ||
09:31
lue joined
|
|||
Woodi | that is nice: Perl isn't a programming language. It's a life support system for CPAN. :) | 09:34 | |
szabgab | masak: btw I'd really like to have at least one interesting news item about Rakudo every week | ||
I'd put it in the Perl Weekly and hope to get more and more people paying attention | 09:35 | ||
masak | szabgab: that's a nice idea. I support it wholeheartedly. | 09:37 | |
Woodi | szabgab: there is new module Simple::Redis for perl6 on github. i was angry of no working db bindings available :) | ||
still in heavy development | |||
masak | Woodi++ | 09:38 | |
I hope to use that module soon. | |||
Woodi | pls give me know if you notice problems. and if module will help in something then pls too :) | 09:39 | |
09:39
woosley left
|
|||
moritz | Woodi: does my IO::Socket.recv patch from yesterday night make it more useful for you? | 09:40 | |
szabgab | Woodi: it would be much easier for me if you blogged about it :) and if that bog was aggregared on planet six | 09:41 | |
but if you give me a url I can link to Github as well | |||
Woodi | szabgab: link is: github.com/slunski/perl6-simple-redis | 09:43 | |
but still not decided where to put eventual blogs :) | 09:44 | ||
masak | blogs.perl.org is nice. | ||
and easy to start using. | |||
Woodi | will look | ||
szabgab | Woodi: why not write a blogging platform in Perl 6 :) | 09:45 | |
you could start by pre-generated html files and RSS feed so they are static for the reader | 09:46 | ||
Woodi | szabgab: agree, definitly someone should do that :) | ||
but as for me i am terrible programmer. on the other side i can start project or two :) | 09:47 | ||
just porting Net::DBus looks important :) | |||
szabgab | Oh I am a terrible programmer too | ||
I create bugs annoying enough for others to come in and fix them :) | 09:48 | ||
Woodi | if it works for you then maybe it is possible to follow :) | 09:49 | |
09:59
zby_home joined
10:04
Chat3240 joined
10:05
Chat3240 left,
risou is now known as risou_awy
10:06
risou_awy is now known as risou
10:12
lue left
10:16
molaf left
|
|||
dalek | ast: e9ba740 | moritz++ | S03-operators/buf.t: start to test comparison operators for Buf |
10:18 | |
kudo/nom: 6fd0773 | moritz++ | src/core/Buf.pm: comparison operators for Buf |
|||
masak | moritz: I'm thinking of spec'ing a Str $matcher form for comb. any objections? | 10:19 | |
10:20
djanatyn joined
|
|||
mberends | masak: I can't think os many cases where that would be used. | 10:20 | |
*of | |||
moritz | nom: say 'abc'.comb('b') | ||
p6eval | nom aed9fe: OUTPUT«No applicable candidates found to dispatch to for 'comb'. Available candidates are::(Str, Mu %_):(Str, Regex $pat, Any $limit, Any $match, Mu %_):(Cool, Mu %_):(Cool, Regex $matcher, Any $limit, Mu %_) in method comb at src/gen/CORE.setting:1559 in <anon> at … | ||
masak | mberends: I had one yesterday. | ||
moritz | nom: say 'abc'.match('b') | ||
p6eval | nom aed9fe: OUTPUT«b» | ||
masak | mberends: $string.comb("1").elems # count the number of 1s in string | 10:21 | |
moritz | nom: say "Lasst uns die Anzahl der a's zählen'.match('a', :g).elems | ||
p6eval | nom aed9fe: OUTPUT«===SORRY!===Confused at line 1, near "say \"Lasst"» | ||
moritz | nom: say "Lasst uns die Anzahl der a's zählen".match('a', :g).elems | ||
p6eval | nom aed9fe: OUTPUT«3» | ||
masak | that's all fine and good. | ||
moritz | masak: no objections | ||
masak | \o/ | ||
masak makes it so | 10:22 | ||
Woodi | nom: say "Lasst uns die Anzahl der a's zählen".match('a', :g).perl | ||
p6eval | nom aed9fe: OUTPUT«Array.new(a, a, a)» | ||
moritz | in nom I've just written a low-level Str.match(Str) that creates a Match object | ||
masak | Woodi: that looks like a faulty .perl output. | ||
why aren't the letters quoted? | 10:23 | ||
moritz | indeed | ||
masak submits rakudobug | |||
also, why Array.new rather than just [] ? | |||
moritz | because [] never flattens | ||
Woodi | nom: my $a = "Lasst uns die Anzahl der a's zählen"; $a.match('a', :g) ; $a.WHAT; | ||
p6eval | nom aed9fe: ( no output ) | ||
Woodi | nom: my $a = "Lasst uns die Anzahl der a's zählen"; $a.match('a', :g) ; say $a.WHAT; | ||
p6eval | nom aed9fe: OUTPUT«Str()» | 10:24 | |
Woodi | nom: my $a = "Lasst uns die Anzahl der a's zählen"; $b = $a.match('a', :g) ; say $b.WHAT; | ||
p6eval | nom aed9fe: OUTPUT«===SORRY!===Symbol '$b' not predeclared in <anonymous> (/tmp/MDZILoYUJ6:1)» | ||
Woodi | nom: my $a = "Lasst uns die Anzahl der a's zählen"; my $b = $a.match('a', :g) ; say $b.WHAT; | ||
p6eval | nom aed9fe: OUTPUT«Array()» | ||
Woodi | nom: my $a = "Lasst uns die Anzahl der a's zählen"; my $b = $a.count('a', :g) ; say $b; | 10:25 | |
p6eval | nom aed9fe: OUTPUT«Method 'count' not found for invocant of class 'Str' in <anon> at /tmp/eMq5STVE0D:1 in <anon> at /tmp/eMq5STVE0D:1» | ||
Woodi | what od .match ? | ||
s/od/do ? | |||
grrr | |||
ah, know | |||
moritz | nom: say 'abc'.match('a').WHAT | 10:26 | |
p6eval | nom aed9fe: OUTPUT«Match()» | ||
moritz | nom: say 'abc'.match('b').from | ||
Woodi | nom: my $a = "Lasst uns die Anzahl der a's zählen"; $a.match(/[ab]/, :g) ; say $a.WHAT; | ||
p6eval | nom aed9fe: OUTPUT«1» | ||
nom aed9fe: OUTPUT«Str()» | |||
Woodi | nom: my $a = "Lasst uns die Anzahl der a's zählen"; $a.match(/[ab]/, :g) ; say $a.perl; | ||
p6eval | nom aed9fe: OUTPUT«"Lasst uns die Anzahl der a's zählen"» | ||
10:26
Trashlord joined
|
|||
Woodi | nom: my $a = "Lasst uns die Anzahl der a's zählen"; my $b = $a.match(/[ab]/, :g) ; say $b.perl; | 10:26 | |
p6eval | nom aed9fe: OUTPUT«[]» | ||
moritz | Woodi: $a.match doesn't modify the string, so if you ignore the return value, there's no reason for matching at all | ||
ah, you found out too :-) | |||
char classes are written as <[ab]> in p6 | 10:27 | ||
moritz -> afk | |||
Woodi | nom: my $a = "Lasst uns die Anzahl der a's zählen"; $a.match(/<[ab]>/, :g) ; say $a.perl; | ||
p6eval | nom aed9fe: OUTPUT«"Lasst uns die Anzahl der a's zählen"» | ||
10:27
risou is now known as risou_awy
|
|||
Woodi | nom: my $a = "Lasst uns die Anzahl der a's zählen"; my $b = $a.match(/<[ab]>/, :g) ; say $b.perl; | 10:27 | |
p6eval | nom aed9fe: OUTPUT«[a, a, a]» | ||
10:27
lue joined
|
|||
Woodi | nom: my $a = "Lasst uns die Anzahl der a's zählen"; my $b = $a.match(/<[az]>/, :g) ; say $b.perl; | 10:28 | |
p6eval | nom aed9fe: OUTPUT«[a, z, a, a, z]» | ||
dalek | ecs: d7b5637 | masak++ | S32-setting-library/Str.pod: [S32/Str] added Str form to .comb In parallel with the Str form in .split -- it's nice to have the few times one needs it. Also, added the :match parameter mentioned in the text. |
10:29 | |
10:30
wamba joined
|
|||
masak | phenny: de en "Lasst uns die Anzahl der a's zählen"? | 10:33 | |
phenny | masak: "Let us count the number of a's" (de to en, translate.google.com) | ||
masak thought so | 10:34 | ||
moritz | masak: now I'd like to see tests :-) | ||
masak | moritz: I'm working on tests, though not those :) | ||
I'm 31% through pack.t | |||
moritz | wow | ||
masak | 230 tests running. | 10:35 | |
10:35
lue left
|
|||
moritz | are you implementing as you go along? | 10:35 | |
masak | heck, no. :P | ||
that would be *impressive*, though. | |||
no, I have my hands full with "what did they actually want to test here?" and "is this still relevant for us?" | 10:36 | ||
just deleted a bunch of 'p' template tests. | |||
szabgab | masak: and I did not had PErl 6 in the "what articles would you like to read" section either, now fixed that too | 10:38 | |
masak | szabgab: nice. | ||
szabgab | I hope to reach 1000 responses but I only have 4 days :) | ||
I'll start promoting it very heavily in a few hours from now | 10:39 | ||
10:39
pmurias joined
|
|||
masak | best of luck. | 10:40 | |
what about s! et al in pack/unpack. perldoc says 'forces native (short, long, int) sizes instead of fixed (16-/32-bit) sizes'. | 10:54 | ||
I'm thinking that's another thing that doesn't apply when you're on Parrot or CLR or JVM. | |||
any thoughts? | |||
mberends | masak: it's one of those 'can argue both ways' cases. Initially go minimalist, so drop 'em. | 10:59 | |
masak | aye. | 11:02 | |
mberends | masak: comments by moritz++ and colomon++ present a good case for a separate but related serialization/Storable spec. It would be worth collecting these kind of types to help set up that other spec, since it doesn't really exist yet apart from scattered mentions of native types in the Synopses. | 11:04 | |
11:07
molaf joined
|
|||
masak | aye. this is the thing that's related to the Compact structs in S09, right? | 11:08 | |
mberends reads | |||
masak | "(This is to be construed as a substitute for at least some of the current uses of C<pack>/C<unpack>.)" | ||
whether or not it is, it feels like there's a number of ideas here that need coordinating and nurturing. | 11:09 | ||
11:11
Kivutarrr joined
|
|||
mberends | yes. The C language bias in S09 should be softened to accommodate various platforms and implementations. It's interesting that jnthn++ is currently working hard on native types, and much of this arises in Niecza CLR Interop as well. | 11:14 | |
pmurias | mberends: what are the current problems with CLR Interop? | 11:17 | |
mberends | pmurias: there are issues #56 and #57 on github, sorear++ has done half a workaround for #56. | 11:18 | |
11:21
lue joined
|
|||
mberends | pmurias: I'm still exploring the CLR Interop territory, it's vast. I recently found (for the matchboxes puzzle) that Niecza has no pick or roll. I tried to use the System.Random class from Niecza and failed, that one has not been ticketed yet because there may some usual suspects still to try (I don't want to flood github issues with noise). | 11:22 | |
11:23
replore joined
11:25
lue left
|
|||
pmurias | mberends: would eval(:from<c#>,...) help with anything? | 11:33 | |
mberends | pmurias: thanks, I never thought of that! I'll give it a try :) | ||
pmurias | it's not implemented yet ;) | 11:34 | |
mberends | ok, tomorrow then ;) | ||
pmurias | just trying to determine if i should implement that ;) | ||
11:35
type joined
|
|||
type | o/ | 11:35 | |
hello masak | |||
mberends | \o type: strong or weak? | 11:36 | |
tadzik | duck! | ||
tadzik ducks | |||
11:36
Psyche^ joined
|
|||
type | not strong but strange | 11:36 | |
nom: > subset Even of Int where { $_ % 2 == 0 } Even() > my Even @a > @a=1..5 1 2 3 4 5 > my Int $x =1.3 Type check failed in assignment to '$x'; expected 'Int' but got 'Rat' > my Int @b > @b=(1,2.2,3) 1 2.2 3 | |||
p6eval | nom 6fd077: OUTPUT«===SORRY!===Confused at line 1, near "> subset E"» | ||
tadzik | type: 1.3 is not an Int, hence the fail | 11:37 | |
nom: say so 1.3 ~~ Int | |||
p6eval | nom 6fd077: OUTPUT«Bool::False» | ||
tadzik | it works for @b, because typed arrays are not yet implemented | ||
as in, the types are not checked | |||
type | thanks !! | 11:38 | |
tadzik | you're welcome, glad I could help | 11:39 | |
11:39
Patterner left,
Psyche^ is now known as Patterner,
wooden joined,
wooden left,
wooden joined
|
|||
masak | type: hi there! | 11:40 | |
mberends: I must've missed any C language bias in S09. to me it feels like the decisions about the actual memory layout belong in a repr somewhere. | 11:41 | ||
type | hi masak: tadzik gave me the answer. thanks!! | 11:42 | |
11:45
woosley joined,
bbkr left
|
|||
pmurias | mberends: would eval(:lang<C#>,...) be usefull to you? | 11:46 | |
11:46
bbkr joined
11:47
type left
|
|||
mberends | pmurias: It would be far from the first thing I would think of using. Without knowing the spec in enough details, I would also suspect that such code would be very unportable. It reminds of a Q:PIR() syntax that Rakudo used to have and happily got rid of. So the short answer is, probably not, except in desperate times. | 11:49 | |
(I've satisfied my need for random numbers with the seriously ugly now.to-posix[0].Str.comb.[*-1] %% 2) | 11:50 | ||
masak would love to see some Apocalypses fanfic | 11:51 | ||
a really good A09, for example :) | |||
pmurias | mberends: it's equaly unportable to other forms of C# interop | 11:55 | |
mberends | masak: "and so they went back to the bikeshed. It was blue, which jnthn always hated, but he'd been outvoted that last time they chose its color." | 11:56 | |
im2ee | Hmm, can i check if there is a client who is waiting to be accepted without accepting? (in IO::Socket) | 11:58 | |
tadzik | ...why would you need that? :) | 12:02 | |
ingy | o/ | ||
tadzik | as in, what is the problem you want to solve? | 12:03 | |
ingy: o/ | |||
im2ee | Hmm, tadzik im training perl6. I have some ideas and i want to try them out. :) | ||
tadzik | im2ee: I can see that, but why do you need to check if there's someone to accept()? | ||
12:03
drbean left
|
|||
tadzik | im2ee: you want a non-blocking IO, maybe? | 12:03 | |
im2ee | tadzik, yes, something like that. :) | 12:04 | |
mberends | pmurias: you're right. Interop spec will only become standardized after a number of styles have been tried and compared. Styles that isolate Perl code in one file and and C# code in another file would be preferred, however. | ||
im2ee | tadzik, in p6 there is no multi-threading, right? :) So i want to get around :) | ||
tadzik | im2ee: IO::Select has some non-blocking IO capabilities, but I don't know how to apply them to this particular case | ||
im2ee: maybe can_read() will return your socket if it has someone to accept()? | 12:05 | ||
bbl | |||
im2ee | tadzik, i want to make tcp server which can work with more than 1 clients. :) | ||
Woodi | im2ee: on server side: accept returns new socket for each connsction probably | 12:15 | |
and to switch betwin clients usually select-like is used | 12:16 | ||
12:20
drbean joined
|
|||
Woodi | do threads work in parrot ? | 12:21 | |
im2ee | tadzik, where i can find something more informations about IO::Select? :) | 12:24 | |
12:25
lue joined
|
|||
pmurias | mberends: i don't think there is much difference between using C# code and .net specific libraries | 12:26 | |
jnthn | mberends: wtf, blue is my fave color! :P | 12:27 | |
I mean, er, morning :) | |||
12:28
Kivutarrr left
|
|||
pmurias | we might end up with CPAN modules that expose the interface to say GTK on multiple platforms, but programs that use interop generally won't be portable | 12:28 | |
mberends | jnthn: morning blues, eh? good * anyways :) | ||
tadzik | im2ee: you can read the source :) | ||
im2ee: that's precisely what IO::Select is for :) | 12:29 | ||
pmurias | mberends: unless both implementations support interop with the same platform | ||
tadzik | Woodi: threads don't | ||
im2ee: I wrote IO::Select quite recently, but without any usecase for it. If you find something that sucks, tell me, and we'll think about making it better | |||
im2ee: it's supposed to be modelled after Perl 5's IO::Select | |||
12:30
lue left
|
|||
im2ee | tadzik, so, i can use can_read, yes? | 12:33 | |
tadzik | im2ee: I think so, yes | ||
mberends | pmurias: I agree there is not much difference. I would just prefer to keep the two languages separate, so that changes in one file affect only the Niecza compiler and changes in the other file affect only the C# compiler. Merging them I don't prefer, which makes me feel desperate. Note that asp.net opts for language separation too, with code-behind files. | 12:37 | |
12:39
lue joined
|
|||
im2ee | b: my @tab = <a b c>; for @tab.keys { @tab.delete($_) if $_ == 'a'; }; say @tab; | 12:44 | |
p6eval | b 1b7dd1: OUTPUT«Any()bc» | ||
im2ee | is there any function to clear array from Any()? :) | 12:45 | |
s/of/from/ | |||
tadzik | not that I know of | 12:46 | |
jnthn | Um, is delete meant to leave it behind? | ||
tadzik | maybe @tab.=grep($_) | ||
well, that'll clear it from false values | |||
jnthn | *.defined | ||
tadzik | jnthn: I wanted to left that as an excercise for the reader :) | ||
s/left/leave/ | |||
jnthn | oh, sorry :P | ||
im2ee | Thanks. :) | 12:47 | |
jnthn, why *.defined? Why not just .defined? :) | 12:50 | ||
.defined doesn't work, but why? :) | |||
tadzik | std: .defined | ||
p6eval | std c22b2ee: OUTPUT«ok 00:01 118m» | ||
tadzik | ek | ||
im2ee: .defined doesn't construct a block | 12:51 | ||
*.defined does | |||
.grep({ .defined }) would probably work | |||
im2ee | So, clear now. :) Thanks tadzik | ||
jnthn | im2ee: { .defined } would work. | 12:52 | |
*.defined is just a bit shorter...and generates better code too, iirc. | |||
im2ee | Great! :) | 12:53 | |
masak | im2ee: the reason a block is needed is that you don't want to call .defined *right now*, you want .grep to call it when it needs to. | 12:58 | |
im2ee: that whole idea is called a closure (or a callback), and I've written a blog post about it, if you're interested. strangelyconsistent.org/blog/speaki...-in-perl-6 | 13:00 | ||
im2ee | Hmm, right, sounds logical. :) Thanks masak | ||
masak | I might be biased, but I think it's a good read ;) | ||
im2ee | masak, i will read it. | 13:01 | |
masak, i have some other problems. | |||
masak, I want to write something like TCP server, which can work with more than 1 clients. | |||
masak, and i must to check if there is anybody who is waiting for accept. | 13:02 | ||
masak, can i do this without IO::Select ? :) | |||
masak | im2ee: sorry, I don't know enough about TCP/IP to help you. :/ | ||
im2ee: it sounds like you're sniffing around in the vicinity of asyncronous IO and event handling. Perl 6 is weak there at the moment. | 13:05 | ||
13:06
Chillance joined
|
|||
masak | hm, it'd be a really interesting exercise to write A09. it'd have to comment a lot on the appropriate RFC's... and in order to be historically believable, it couldn't mention the @a[*-1] syntax, which was developed afterwards... | 13:06 | |
13:07
larion joined,
larion left
|
|||
dalek | ecza: 493fbf9 | mberends++ | examples/gtk-sierpinski.pl: [examples/gtk-sierpinski.pl] refactor and tidy up source |
13:08 | |
tadzik | masak: fwiw, metacpan.org/module/IO::Select#EXAMPLE shows the case as an example of what can be solved using select(), so maybe it's doable in nom | 13:09 | |
masak | nom has select()? | 13:10 | |
tadzik | more-less | ||
github.com/tadzik/IO-Select/ | |||
masak | in that case, more or less wow. | ||
tadzik++ | |||
tadzik | I wanted to provoke Mojolicious guys | ||
masak | :) | ||
too bad you put it in a module, then! :P | 13:11 | ||
tadzik | they said "we'll port it once rakudo gets non-blocking IO". Few hours later I said "your turn" | ||
still waiting for their reaction :) | |||
13:11
drbean left
|
|||
tadzik | masak: I want it to be used in-field a bit before even thinking about making it core/speccing it | 13:11 | |
no one seems to have a view on how it should work like | |||
masak | nodnod | 13:12 | |
tadzik | so let's just use it and see what sucks | ||
Parrot was wondering for a few months "what interface should Select pmc have?" | |||
13:12
kcwu left
|
|||
tadzik | and after some discussion we decided "let's ship it and let users criticise it" | 13:12 | |
13:13
drbean joined,
f00li5h joined
|
|||
tadzik | IMHO, if this interface is good enough for CPAN, it's very likely it'll be good enough for us too | 13:13 | |
IO::Select is core since 5.00307 and I don't see anything that wants to replace it with something with a better interface | 13:14 | ||
I didn't look around much though :) | |||
masak | I like that kind of thinking. | ||
13:15
lue left
|
|||
tadzik | okay, back to sicp | 13:15 | |
13:18
risou_awy is now known as risou
13:21
pmurias left
|
|||
masak | tadzik: the book or the videos? | 13:23 | |
13:25
lue joined
13:26
snarkyboojum left
13:27
espadrine joined,
snarkyboojum joined
|
|||
cognominal | ingy, no Chartreuse hangover? | 13:27 | |
13:35
lue left
13:38
pmurias joined
|
|||
felher | nom: state $blar; | 13:39 | |
p6eval | nom 6fd077: OUTPUT«(signal SEGV)» | ||
jnthn | epic fel | 13:40 | |
felher | :) | ||
pmurias | in roast/S01-perl-5-integration/basic.t a p5 routine exposed to perl6 has wantarray | ||
masak submits rakudobug | |||
pmurias | with the way context work in Perl 6 now is there a way to make that work? | 13:41 | |
masak | pmurias: doesn't feel like it. | ||
13:41
envi left
|
|||
masak | or maybe Perl 6 callers always wants the same thing nowadays. | 13:41 | |
want* | |||
13:42
envi joined
|
|||
masak | haven't thought about it. | 13:42 | |
pmurias | it doesn't seem to be a thing that should be tested for in a basic test | ||
masak | nom: sub foo { state $blar = "OH HAI"; say $blar }; foo | 13:43 | |
p6eval | nom 6fd077: OUTPUT«OH HAI» | ||
jnthn | masak: It's some oddity in the mainline. | 13:44 | |
pmurias | should i take it out? | ||
jnthn | masak: Seen it before, evidently forgot to fix it. | ||
masak | pmurias: +1 | ||
jnthn | tickets++ | ||
pmurias | did blitzkost have tests of it's own? | 13:45 | |
13:45
woosley left
13:52
lue joined
13:56
zby_home_ joined,
zby_home left
14:00
lue left
14:02
grondilu joined
|
|||
grondilu | So can't I provide arguments to a sub that has been defined as 'sub foo { }'? I mean, prototyping is mandatory now? | 14:04 | |
please don't answer all at once :) | 14:05 | ||
benabik | You can get around it some by… sub foo(|$c) { }, IIRc | ||
Which declares a capture that grabs all the arguments. | |||
grondilu | well, yeah but that's 4 additional characters to type :( | 14:06 | |
masak | grondilu: you must like the Perl 5 parameter handling very much ;) | 14:07 | |
benabik | Someone has to. :-D | ||
grondilu | masak: I do indeed | ||
jnthn | grondilu: You have a lot of use cases where you want to take arguments and ignore them? | 14:08 | |
grondilu | I like the forth-like aspect of not having to worry about argument passing. | ||
benabik | sub foo { $^these + $^are + $^parameters } | ||
masak | grondilu: well, 5 (by my count) extra characters is the "tax" you have to pay in Perl 6 so that the rest of us can have sane argument handling. | ||
jnthn | 4 | 14:09 | |
grondilu | For simple functions I mean. Of course, prototyping is necessary for complex stuffs. | ||
jnthn | (|$) | ||
Don't need to name the variable you stick the capture in if you don't want it. | |||
masak | jnthn: yeahbut. | ||
grondilu | jnthn: cool | ||
masak | how will you extract the arguments from that? | ||
benabik | Why have a function that takes arguments that you can never get to? | ||
masak | exactly. | ||
benabik | grondilu: You can declare parameters inside your function. sub add { $^a + $^b } | 14:10 | |
grondilu | ? | ||
jnthn | Also note that | ||
rakudo: sub foo { say @_ }; foo; foo(1,2,3) | |||
p6eval | rakudo 6fd077: OUTPUT«1 2 3» | ||
grondilu doesn't know about $^ | |||
jnthn | If you mention @_ anywhere in your sub body, then it automatically generates a signature for you of (*@_) | ||
masak | rakudo: sub add { $^a + $^b }; say add 4, 5 | ||
p6eval | rakudo 6fd077: OUTPUT«9» | ||
grondilu | jnthn: even cooler | 14:11 | |
masak | jnthn: oh, I forgot about that! that should make grondilu very happy. | ||
benabik | jnthn: Does the same happen with %_? | ||
jnthn | Also note that if what you really want is a closure, Perl 6 doesn't require you to write "sub" | ||
benabik: Yes | |||
flussence | rakudo: sub add { my $a = shift; my $b = shift; }; say add(4, 5) | ||
p6eval | rakudo 6fd077: OUTPUT«Too many positional parameters passed; got 2 but expected 0 in sub add at /tmp/Hze8d7ImSG:1 in <anon> at /tmp/Hze8d7ImSG:1 in <anon> at /tmp/Hze8d7ImSG:1» | ||
flussence | rakudo: sub add { @_; my $a = shift; my $b = shift; }; say add(4, 5) | ||
p6eval | rakudo 6fd077: OUTPUT«No applicable candidates found to dispatch to for 'shift'. Available candidates are::(Positional @a) in sub shift at src/gen/CORE.setting:4222 in sub add at /tmp/iRtE0BPsUH:1 in <anon> at /tmp/iRtE0BPsUH:1 in <anon> at /tmp/iRtE0BPsUH:1» | ||
flussence | oh. | ||
jnthn | flussence: No implicit argumetns. | ||
*arguments | |||
flussence | rakudo: sub add { my $a = shift @_; my $b = shift @_; }; say add(4, 5) | 14:12 | |
p6eval | rakudo 6fd077: OUTPUT«5» | ||
flussence | close enough | ||
masak | algorithm fail ;) | ||
jnthn | Saturating add :P | ||
flussence | rakudo: sub add { [+]@_ }; say add(4, 5) | ||
p6eval | rakudo 6fd077: OUTPUT«2» | ||
flussence | :( | ||
benabik | rakudo: sub foo { $_ = @_; my $a = .shift; say $a }; foo 5 | ||
p6eval | rakudo 6fd077: OUTPUT«5» | ||
benabik | :-D | ||
grondilu | :) | 14:13 | |
flussence | rakudo: sub add { [+](|@_) }; say add(4, 5) | ||
p6eval | rakudo 6fd077: OUTPUT«Could not find sub &prefix:<|> in sub add at /tmp/AucDj7Fdd4:1 in <anon> at /tmp/AucDj7Fdd4:1 in <anon> at /tmp/AucDj7Fdd4:1» | ||
benabik | rakudo: sub add { [+] @_ }; say add(4, 5) | ||
jnthn | er, why on earth did [+] @_ not work... | ||
p6eval | rakudo 6fd077: OUTPUT«2» | ||
flussence | b: sub add { [+]@_ }; say add(4, 5) | ||
p6eval | b 1b7dd1: OUTPUT«9» | ||
masak | nom: sub add { [+](@_) }; say add 4, 5 | ||
p6eval | nom 6fd077: OUTPUT«2» | ||
benabik | nombug? | ||
masak submits rakudobug | |||
jnthn | nom: sub add(*@x) { [+] @x }; say add 4, 5 | ||
p6eval | nom 6fd077: OUTPUT«9» | ||
benabik | A bug in the implicit @_? | 14:15 | |
grondilu | raduko: sub add { [+]@_ }; say add 1, 1 | ||
rakudo: sub add { [+]@_ }; say add 1, 1 | |||
TimToady | std: sub add { [+]@_ }; say add(4, 5) | ||
p6eval | rakudo 6fd077: OUTPUT«2» | ||
std c22b2ee: OUTPUT«===SORRY!===Two terms in a row at /tmp/7tqKXg2sdR line 1:------> sub add { [+]⏏@_ }; say add(4, 5) expecting any of: POST bracketed infix infix or meta-infix postfix postfix_prefix_meta_operator | |||
..prefix_circumfix_meta_o… | |||
jnthn | benabik: Yeah, that's my guess | ||
TimToady | space required after a reduce | ||
grondilu | rakudo: sub add { [+] @_ }; say add 1, 1 | ||
masak | fairy nuff. | ||
p6eval | rakudo 6fd077: OUTPUT«2» | ||
grondilu | rakudo: sub add { [+] @_ }; say add 1, 42 | 14:16 | |
p6eval | rakudo 6fd077: OUTPUT«2» | ||
benabik | Two bugs! Parsing can @_ not working right in a reduce. | ||
s/can/and/, wtf keyboard? | |||
masak | aye. | 14:17 | |
flussence | b: sub add { [+] @_[0..*] }; say add(4, 5) | ||
jnthn | benabik: It's not reduce | ||
benabik: It's something about the binding. | |||
flussence | er... | ||
p6eval | b 1b7dd1: OUTPUT«(timeout)» | ||
TimToady | extra capture parens? | ||
jnthn | git stash | ||
er, wrong window | |||
flussence | rakudo: sub add { [+] @_[0..*] }; say add(4, 5) | ||
p6eval | rakudo 6fd077: OUTPUT«9» | ||
jnthn | TimToady: Almost certainly a failure to set a flatten flag or something like that. | 14:18 | |
masak removes all jnthn's changes and hides them | |||
TimToady | not marked as flatten | ||
flussence | well I've managed to break both rakudo branches today, that's an achievement :) | 14:19 | |
jnthn | TimToady: Forget exactly how it works. Do know that we're not telling the binder something we should be by looking at the code though... | ||
nom: ({ say [+] @^a })([1,2,3]) | 14:20 | ||
p6eval | nom 6fd077: OUTPUT«3» | ||
jnthn | nom: (sub (@a) { say [+] @a })([1,2,3]) | 14:21 | |
p6eval | nom 6fd077: OUTPUT«6» | ||
jnthn | Yeah, same issue there. | ||
Fixed locally, spectesting. | |||
14:22
envi left
|
|||
jnthn | At least this was easier to find than whatever's wrong in my explosive multi-dispatch patches. | 14:22 | |
14:22
donri joined
|
|||
grondilu | rakudo: { say [+]@_ }(42, 1) | 14:23 | |
p6eval | rakudo 6fd077: OUTPUT«2» | ||
grondilu | it does work on my machine | ||
pmichaud | good morning, #perl6 | 14:24 | |
jnthn | grondilu: Yes, I guess you're running from a released Rakudo. | ||
grondilu | "This is Rakudo Perl 6, version 2011.07 built on parrot 3.6.0 0" | ||
jnthn | grondilu: You just helped us find a regression in the current development branch. So, thanks! :-) | ||
o/ pmichaud | |||
grondilu | lol, glad to have helped :) | 14:25 | |
masak | grondilu++ | ||
grondilu is very enthusiastic about Perl and Perl6 | |||
I just love this language | |||
masak | we share your enthusiasm :) | ||
flussence | perl6: sub add { [+]@_ }; sub add2 { [+]@_[0..*] }; say add(4, 5); say add2(4, 5); #j/w | ||
p6eval | rakudo 6fd077: OUTPUT«29» | 14:26 | |
..niecza v9-51-g493fbf9: OUTPUT«===SORRY!===Two terms in a row at /tmp/HGOaEiD2Ua line 1:------> sub add { [+]⏏@_ }; sub add2 { [+]@_[0..*] }; say add(Parse failed» | |||
..pugs: OUTPUT«***  Unexpected "@_" expecting dot, ":", "(", term postfix, operator or "}" at /tmp/vWoyH1wAvI line 1, column 14» | |||
flussence | hm | ||
perl6: sub add { [+] @_ }; sub add2 { [+] @_[0..*] }; say add(4, 5); say add2(4, 5); | |||
p6eval | rakudo 6fd077: OUTPUT«29» | ||
..niecza v9-51-g493fbf9: OUTPUT«(timeout)9» | |||
..pugs: OUTPUT«99» | |||
flussence | oh wow, I broke niecza too | ||
dalek | kudo/nom: efe3f82 | jnthn++ | src/Perl6/Actions.pm: Fix bug with placeholder parameter binding of arrays. |
14:27 | |
14:31
lue joined
|
|||
grondilu | got to go. Keep on the good work guys! | 14:34 | |
14:34
grondilu left
14:46
whiteknight joined
14:47
lue left
14:50
satyavvd joined
|
|||
sorear | good * #perl6 | 14:51 | |
masak | * | ||
colomon | */ | ||
14:52
im2ee left
|
|||
pmurias | sorear: hi | 14:54 | |
sorear | pmurias: the .net platform does not come with a C# compiler, and bundling Mono.CSharp.dll would double the size of the niecza package | 14:56 | |
15:04
kaare_ left
15:06
im2ee joined
|
|||
pmurias | sorear: i'll work on more usefull thing for now then | 15:08 | |
sorear: does niecza work on .net? | |||
tadzik | masak: the book 'fcourse | ||
15:10
pmurias_ joined
|
|||
colomon just uttered the words "It seems like it's random whether or not it happens" and immediately launched valgrind on his $work bug from hell. | 15:10 | ||
masak | tadzik: nice! godspeed. | 15:12 | |
15:13
pmurias left
15:17
lue joined
15:26
lue left
|
|||
tadzik | seems that guile uses Rats for calculations as well | 15:26 | |
15:28
satyavvd left
15:29
MayDaniel joined
|
|||
masak | tadzik: Lisp people are pretty proud of their en.wikipedia.org/wiki/Numerical_tower | 15:30 | |
15:30
pmurias joined
15:31
MayDaniel left
|
|||
tadzik | I ended up writing my (define (numify x)) :) | 15:32 | |
15:32
birdwindupbird joined,
birdwindupbird left
15:33
pmurias_ left
15:36
mj41 joined
|
|||
pmichaud | general note: I'm still tuit deprived. Yesterday ended up not being a very good day. :-/ | 15:36 | |
s/not being/being not/ | 15:37 | ||
mberends | :( | ||
colomon | :( | ||
15:38
lue joined
|
|||
colomon has found his $work bug, which appears to be something colossally stupid he did nearly a decade ago... | 15:44 | ||
dalek | kudo/nom: c4c2e1d | jnthn++ | src/binder/bind. (2 files): Move/share a struct definition. |
15:45 | |
kudo/nom: 03afd02 | jnthn++ | src/binder/ (2 files): Switch junctional arguments check in multi-dispatcher over to being able to cope with natively typed arguments. |
|||
kudo/nom: 9e831e0 | jnthn++ | src/binder/multidispatch.c: Tweak the multi-dispatch candidate check to try and make it aware of native types. |
|||
pmichaud | afk again | ||
15:46
huf joined
|
|||
masak | pmichaud: :( | 15:48 | |
[Coke] yawns. | 15:50 | ||
mberends | masak: this was around the time I'd suggested for pugs and haskell exploration, primarily because I thought it stood a good chance of being possible for others too. I could also make other times. I'm now writing a GUI solution for your matchboxes puzzle, but am happy to look at pugs any time. | 15:55 | |
masak | mberends: cool. | 15:56 | |
mberends | masak: shall we look at pugs in, say, an hour? | ||
15:57
pmurias_ joined
|
|||
masak | mberends: hm. I was planning to go out for a run around that time. | 15:57 | |
mberends | masak: ok, what time suits you? | ||
masak | but sometime during the evening I think I could have some time to download Pugs and try to get it to run. | 15:58 | |
mberends: mostly I'd like to see you and [Coke] agree on a time that works for both of you. | |||
right now I'm going AFK for ~30 minutes. | |||
mberends | ok, me too | ||
15:59
pmurias left
16:03
lue left
|
|||
japhb has a lot to backlog ... anyone happen to know if my question last night about how to assign $?USAGE properly in the Rakudo setting got answered? (By the time I finish backlogging, the people who could answer will probably be gone :-/ ( | 16:10 | ||
16:13
pmurias joined
16:14
espadrine left,
im2ee left,
im2ee joined
16:16
pmurias_ left
16:19
lue joined,
envi joined
|
|||
dalek | kudo/nom: 8b7a2a5 | jnthn++ | src/binder/multidispatch.c: Get multi-dispatch cache to handle natively typed arguments. |
16:20 | |
japhb | jnthn++ is awake! | 16:21 | |
jnthn | japhb: I didn't answer it...but I probably could ;) | ||
japhb | jnthn, Once I have the message string, how do I create the $?USAGE variable in Rakudo, and set it to my newly-minted message? (In the setting, of course) | ||
jnthn | nom: say $?USAGE | ||
p6eval | nom 9e831e: OUTPUT«===SORRY!===Symbol '$?USAGE' not predeclared in <anonymous> (/tmp/7eqQXlAlF_:1)» | ||
japhb | jnthn, thx | ||
jnthn | japhb: Is it actually meant to live in the setting? | ||
Not just in the mainline of the user's program? | |||
jnthn had assumed it was the latter | 16:22 | ||
japhb | IIUC, the main helper generates it, and sets it ... in *some* scope ... such that the user's MAIN and USAGE can see it. But I don't know what that scope should be. | 16:23 | |
I meant "assigning it from within code that exists in the setting" | |||
jnthn | ah, here's the bit of S06... | 16:24 | |
This usage message is automatically generated from the signature (or | |||
signatures) of C<MAIN>. This message is generated at compile time, | |||
and hence is available at any later time as C<$?USAGE>. | |||
16:24
Maddingue joined
|
|||
japhb has been updating MAIN_HELPER() in src/core/Main.pm. | 16:25 | ||
jnthn | oh | ||
it does | |||
my $m = callframe(1).my<&MAIN>; | |||
japhb | right | ||
jnthn | In theory | ||
16:26
lue left
|
|||
jnthn | callframe(1).my<$?USAGE> = $the_message | 16:26 | |
However, you need to make sure a $?USAGE variable exists to stick the thing in | |||
That can probably be done by editing Actions.pm | |||
There's a | |||
if $unit.symbol('&MAIN') { | |||
Which adds the call to &MAIN_HELPER | 16:27 | ||
japhb | The current flow in my version is: 1. Fetch MAIN, 2. process cmdline args, 3. generate usage message, 4. attempt to dispatch to matching &MAIN, 5. Failing that, attempt to call &USAGE, 6. Failing that, print generated usage message and exit. | ||
jnthn | It could also add code to declare the variable. | ||
japhb | OK, understood so far. | ||
jnthn | Thing is, the spec implies that we figure out the usage message at compile time. | ||
Heh | 16:28 | ||
I wonder what happens if we add a .usage() method into Routine ;) | |||
So you can generate usage for anything <grin> | |||
japhb chuckles | |||
jnthn | Anyway, the beneift would be that the compiler could do | ||
my $message = $*ST.find_symbol('&MAIN').usage(); | 16:29 | ||
Then create a constant | |||
And bind it (again, at compile time) to $?USAGE | |||
:) | |||
(Just using the same static lexpad mechanism we use to install all other declarational things). | |||
That was, if somebody writes | |||
sub USAGE() { | 16:30 | ||
say "OH LOOK HERE'S SOME HELP"; | |||
say $?USAGE | |||
} | |||
Then it'll all work out. | |||
s/was/way/ | |||
(Essentially, you're running the code to generate the usage message at BEGIN time.) | |||
japhb | Ah, I thought all that was necessary for *that* to work was to "declare" $?USAGE in the compiler, and have it *assigned* in MAIN_HELPER ... because USAGE is called from MAIN_HELPER. Though I suppose | 16:31 | |
jnthn | Well, we could do that too. | ||
japhb | the mainline code could have called USAGE manually, and the user might be surprised it's not there, because MAIN_HELPER never got called | ||
jnthn | Right. | ||
Also | |||
We may need to twiddle the way we find &MAIN | |||
As this is also meant to work: | 16:32 | ||
class Foo { | |||
sub MAIN() { ... } | |||
} | |||
e.g. MAIN is allowed to be somewhere other than in the mainline. | |||
tadzik | wow, that's specced? | 16:33 | |
jnthn | I think the easiest way to do that is to have a :my $*MAIN; declared in comp_unit in the grammar | ||
japhb | oh. Hmmm. So how would the compiler know which MAIN to generate $?USAGE from at compile time? | ||
jnthn | And routine_def looks for if the thing is called MAIN when doing symbol installation and shoves a reference to it in $*MAIN | ||
tadzik: I thought so. | |||
tadzik: Or I seem to recall TimToady++ expecting it would work, at least. | |||
tadzik | I see | ||
jnthn | I guess that | 16:34 | |
class A { sub MAIN() { } } | |||
japhb | Would the compiler need to generate a $?USAGE for each comp_unit, and have them all separate? | ||
jnthn | class B { sub MAIN() { } } | ||
Would be an error. | |||
(Ambiguous MAIN) | |||
japhb: comp_unit is kinda top-level :) | |||
japhb | jnthn, I'm more worried about | ||
...hold, child hurt | |||
jnthn | ouch | ||
japhb | ah, more hurt pride than body | 16:35 | |
jnthn | ah, phew | ||
japhb | quite | ||
So: My reading of the spec was that every module might define a MAIN for self-testing or magic behavior, Python-style, but they also might be 'use'd into another module or even the mainline program, all of which might define their own MAIN. So it's only after all compiling is done and runtime begins (or according to spec, when runtime falls off the end of the "main" programs mainline, that MAIN is checked for and called. | 16:37 | ||
16:38
mj41 left
|
|||
japhb | But ... the mainline code could call USAGE manually. So when is the decision made about which MAIN the $?USAGE is set from | 16:38 | |
? | |||
jnthn | I don't think there's a problem (more) | ||
If $?USAGE is a lexical in the mainline, and there's one MAIN per compilation unit too, then MAIN_HELPER is going to see the correct lexical scope. | 16:39 | ||
e.g. it gets called from the lexical scope of the program; callframe looks 1 frame down, which will be the mainline with the correct $?USAGE in. | 16:40 | ||
japhb | Ah, OK. So each comp_unit gets a $?USAGE lexical. I can see that making perfect sense | ||
16:40
uasi left
|
|||
jnthn | Yes, I think so. | 16:40 | |
japhb | It also has the advantage that all modules will know the $?USAGE of their MAIN, even if they aren't the mainline. | 16:41 | |
jnthn | Yes. | 16:42 | |
oh noes, I'm out of curry paste | 16:44 | ||
shop, bbl & | |||
japhb | OK, so lessee. (thinking aloud) If as you suggest we add a .usage to Routine, I could do two branches in the code: if it's a proto, pull .usage from each candidate, and join with 'or' or somesuch; if its not a proto, generate the calling info from the signature. Hmmm, I wonder if I need to return back something more than a simple string, because | ||
jnthn | oh, can wait a moment actually... :) | ||
japhb | It may be desirable to have a top section of the summary and a bottom section explaining aliases and such. | ||
jnthn | Hmm...I was thinking a string would be enough for now. | ||
japhb | The current MAIN_HELPER code tries to do something like that, but I'm not sure yet whether to drop that and just return a string, or keep supporting it. | 16:45 | |
jnthn | If people want something much fancier that's what USAGE is for. | ||
japhb | jnthn, sure ... but the question is, would .usage need to return more complex information that USAGE needs? | ||
I guess we can play that by ear. :-) | |||
jnthn | Yeah, I think so. | ||
(play that by ear, that is) | 16:46 | ||
japhb | thx for all the answers | ||
jnthn | Welcome. Thanks for hacking on this :) | 16:47 | |
japhb | afk for a few & | 16:50 | |
jnthn | really going to shop & | ||
16:55
Trashlord left
16:56
wolfman2000 left
17:01
replore left
17:08
wamba left,
risou is now known as risou_awy,
risou_awy is now known as risou
17:10
ZapZ_ left
17:14
carlin left
17:15
carlin joined,
carlin left
17:16
carlin joined,
carlin left
17:17
lue joined,
carlin joined
17:21
lue left
17:24
risou is now known as risou_awy
17:32
envi left
17:36
daniel-s left
17:51
lue joined
|
|||
mberends | GUI solution for masak's matchboxes puzzle on Niecza: gist.github.com/1240895 | 17:53 | |
17:54
kaare_ joined
|
|||
colomon | mberends++ | 17:54 | |
mberends | sorear++ | 17:56 | |
17:56
lue left
18:11
cognominal left
|
|||
masak | mberends: wow -- looks cool! I wish I could run it. | 18:11 | |
18:12
cognominal joined
|
|||
mberends | masak: try installing another Ubuntu or Debian guest VM, when you have time | 18:12 | |
18:16
cognominal_ joined
18:19
cognominal left
18:20
colomon left
18:21
lue joined
18:24
soh_cah_toa joined
18:27
colomon joined
|
|||
masak | mberends: will do. | 18:32 | |
mberends | masak: ok. I looked into audreyt's github repo list, and there is a pugs repo that looks unchanged since 2006 and a Pugs.hs that seems to be actively maintained. We probably need the latter. | 18:34 | |
18:37
cognominal_ left,
cognominal_ joined
|
|||
masak | nod. | 18:38 | |
I concluded the same. | |||
Tene | jnthn: you might also consider changing the spec, and divorcing "Run this when the module is loaded" from "Run this when this file is passed as the first argument to a perl interpreter" | 18:41 | |
Perhaps both of those are aliased to the same code by default. | |||
MAIN vs LOAD or something | 18:42 | ||
18:43
pmurias_ joined
18:45
pmurias left
|
|||
jnthn | Tene: Hmm, interesting thought. | 18:55 | |
jlaire | compiling pugs on this laptop is taking a while... :) | 19:11 | |
Pugs.hs on github seems to match the pugs package on hackage | 19:14 | ||
so it's definitely the right one | |||
benabik | Looks like audreyt tried compiling it yesterday and discovered some updates were needed. | 19:15 | |
jlaire | hmm, I should update my ghc | 19:16 | |
benabik | Looks like the Haskell Platform release has been somewhat delayed. | 19:17 | |
19:17
thou joined
|
|||
jlaire | I've never tried the platform | 19:18 | |
benabik | It's GHC + cabal + useful libraries. Something like: Platform : GHC :: Star : Rakudo | ||
mberends | according to pugs/README ghc 6.10 is sufficient, I'm using Ubuntu's 6.12.3 but not getting very far yet. | 19:19 | |
benabik | The webpage says the next release is July 2011, so I'm guessing there's a delay, but I don't see any mailing list or discussion links. | ||
jlaire | yeah, but installing ghc and libraries separately has been very painless for me | ||
I have GHC 7.0.3 | 19:20 | ||
benabik | It's been convenient for me, lacking a proper package manager. :-/ | ||
jlaire | :/ | ||
fortunately for me, haskell is very well supported on arch linux | |||
19:21
pmurias joined
|
|||
mberends | 'cabal install HTTP zlib' went very well, now trying 'cabal install Pugs' | 19:22 | |
19:23
pmurias_ left
19:26
wallberg joined
19:30
furura joined
|
|||
mberends | hmm, Pugs install failed because terminfo failed to install, and terminfo failed because curses.h was not found. Installing libncurses5-dev in hope.. | 19:31 | |
benabik | Down the dependency rabbit hole. | ||
jlaire | real 35m22.509s | 19:34 | |
works for me | |||
mberends | jlaire: is that with cabal or make? | 19:35 | |
jlaire | mberends: cabal | ||
I ran 'cabal install' in Pugs.hs/Pugs | |||
and have a working pugs repl now | 19:36 | ||
mberends: what platform are you on? | |||
mberends | jlaire: here too, Ubuntu 11.04 x86. cabal seems to ignore the current directory and build everything in ~/.cabal, which is unsuitable for hacking. | ||
jlaire | :S | 19:37 | |
masak | I was just wondering whether that might happen. | 19:38 | |
19:38
abercrombie joined
|
|||
masak | cabal is nice and all... for end users. | 19:38 | |
19:39
packetknife joined
|
|||
mberends | error [37 of 89] ... src/Pugs/AST/Internals/Instances.hs:216:9 No instance for (Typeable Unique) ... | 19:39 | |
masak | aww | ||
mberends | since Pugs obvious builds on some platforms, I hereby deem this platform unusable. :( | 19:40 | |
masak | wait, but that's a *compile* error. | ||
jlaire | might be differences between old/new ghc or base libraries | ||
masak | shouldn't that depend more on the compiler than on the platform? | ||
jlaire | yep | 19:41 | |
but installing up-to-date haskell environment is easier on some platforms than others | |||
mberends | base libs, most likely. There was a 'base 3.0 deprecated' warning during the building of deps. | ||
benabik | Pugs.hs master says "build-depends: base >= 4" | 19:42 | |
mberends thinks 'cabal upgrade base' | 19:43 | ||
jlaire | why does it start compiling with unsatisfied dependencies :? | ||
masak | mberends++ # explorer | 19:44 | |
benabik | That is what's on github. Perhaps it's not what cabal is using. | 19:51 | |
jlaire | cabal uses *.cabal in the current directory | ||
masak | I thought that was the point of the Pugs.hs repo. | 19:52 | |
jlaire | if you say just 'cabal install' | ||
benabik | I said perhaps… Haven't used cabal myself. | ||
mberends | cabal download Pugs 6.2.13-20110925, that is only a few hours old | 19:53 | |
19:53
Chat4236 joined
|
|||
dalek | Heuristic branch merge: pushed 121 commits to rakudo/optimizer by jnthn | 19:54 | |
Chat4236 | hey | ||
masak | Chat4236: hi! | ||
Chat4236: I see you're a Chatmosphere user. welcome. | |||
Chat4236 | hey | 19:55 | |
masak | Chat4236: this is a very friendly, accomodating channel. we like visitors. but I should warn you: it's about Perl 6. | ||
Chat4236 | thnx | ||
masak | there, you have been warned. | ||
Chat4236 | perl 6? | 19:56 | |
wats dat? | |||
masak | Chat4236: Chatmosphere users often miss this fact, and embarass themselves by asking "where are the chicks" and similar things. | ||
Chat4236: it's a programming language, like Python or C. | |||
Chat4236 | kBoy gets into bed :* with a girl and notice her clean shaved vagina:O .n asks 'baal kyon nahi hain'.=-? she replies-'tu sex karne aaya hai ya kangi ??':x | ||
hehe | 19:57 | ||
masak | ok, that would be an example of inappropriate behavior. | ||
mberends | Chat4236: we don't want that kind of chat here | ||
Chat4236 | k | ||
19:57
Chat4236 left
|
|||
flussence | good thing you got the first word in. My first instinct would be to disembowel such people with a blunt object... | 19:57 | |
benabik | Why do Chatmosphere users keep showing up here? | ||
tadzik | a frying pan | ||
benabik: a Chatmosphere dev hates us | |||
masak | tadzik: oh? | 19:58 | |
tadzik | masak: just a guess | ||
jnthn | Good theory :) | ||
masak | I thought it was just randomizing channels on freenode. | ||
jnthn | "How can I make Perl 6 take even longer?" "oooh...I know..." | ||
flussence | more likely it was written by someone with no clue how IRC works, so they just have a "random server/channel" option | ||
masak | right. | ||
benabik | flussence: The chatmosphere.org website has a big "Random selection of chatrooms" on the front page, so it seems you're likely correct. | 19:59 | |
"On the home screen on the app there is a random list of popular chatrooms." | |||
benabik sighs. | |||
20:00
SHODAN left
|
|||
flussence | ) # fixing that quit message | 20:01 | |
20:02
saaki left
|
|||
flussence | .oO( and now I've broken it for people who hide quit messages... ) |
20:02 | |
masak | "Hi Chatmosphere. We'd like you to exclude our channel from your random channel selection. Neither we nor your users enjoy the others' company." | 20:04 | |
benabik | masak++ | 20:05 | |
soh_cah_toa | ok, i have to ask b/c it's bothering the heck outta me: why do i always see people using .oO(blah blah blah)? what in the world is that? | 20:09 | |
masak | soh_cah_toa: thought bubbles. | ||
soh_cah_toa: like in comics. | |||
mberends has no options left except 'cabal install cabal-install', to *upgrade* from the existing Ubuntu-supplied cabal-install | 20:10 | ||
masak | :) | ||
20:11
mj41 joined
20:12
fridim_ joined
|
|||
soh_cah_toa | ah, i see | 20:13 | |
mberends | failed. 'cabal install base' dies with Distribution/Client/Dependency/TopDown.hs:169:37-73: Non-exhaustive patterns in lambda, and 'cabal upgrade base' dies with fromFlag NoFlag. Use fromFlagOrDefault, about which StackOverflow basically said 'ur Linux is doin it rong'. This is the end of the road for GHC 6.x on Ubuntu. | 20:15 | |
20:15
lue left
|
|||
pmurias | is Ada95 a sensible language to learn? | 20:17 | |
benabik | Ada? | ||
tadzik | nqp: my @a := []; @a.push(2); @a.push(7); say(@a[-1]) # intentional? | ||
p6eval | nqp: OUTPUT«7» | ||
tadzik | that's not really Perl6-y | ||
benabik | 95? | ||
pmurias | we have a parrallel ai algorithm course in uni which uses Ada95 | ||
soh_cah_toa | wow | 20:18 | |
i would expect common lisp or scheme for a course like that | |||
jlaire | if the focus is on algorithms, ada is fine imo | ||
weird choice tho | |||
soh_cah_toa | nopaste.snit.ch/81994 | 20:21 | |
i could use some advice on that. i'm trying to test that my module exports it's subroutines properly | |||
mberends | pmurias: gnat, the GNU Ada compiler, is very actively maintained, which suggests a lot of use as well, so it seems a good idea. Ada support real-time processing too. Main Ada site: www.adaic.org/ | 20:22 | |
benabik | I _think_ that use and export just make the names visible, not add them to the namespace. | ||
*current namespace | |||
20:22
lue joined
|
|||
im2ee | Good night! :) | 20:23 | |
ingy | cognominal_: strangely no Chartreuse hangover! | ||
20:23
im2ee left
|
|||
cognominal_ | :) | 20:24 | |
20:24
packetknife left
20:25
soh_cah_toa_ joined
|
|||
soh_cah_toa_ hates his laptop battery | 20:25 | ||
anyway... | |||
20:26
soh_cah_toa left
20:27
mkramer1 joined,
soh_cah_toa_ is now known as soh_cah_toa
|
|||
soh_cah_toa | so 'use' doesn't import subs into the current namespace? that's...weird | 20:28 | |
then i guess the keyword 'export' is kinda inappropriate as it does not actually "export" anything | |||
jnthn | Import in Perl 6 is lexical. | ||
benabik | It exports it into the lexical scope, but not the class it's in. I think. | 20:29 | |
20:29
mkramer left
|
|||
soh_cah_toa | hm... | 20:29 | |
jnthn | sub foo is export { } # adds foo to the export list | ||
benabik | Which is really useful, because you don't want your classes sprouting a bunch of methods just because your library decided to export some stuff. | ||
jnthn | use module_with_foo_in; # imports everything in the default export list into the current lexpad. | ||
benabik | jnthn: But if you're inside a class, that doesn't mean they're imported into the class, right? | 20:30 | |
jnthn | benabik: I don't get "imported into the class" | ||
benabik: Note that writing a sub in a class doesn't put it in the method list. Importing something inside a class body doesn't make it a method either. | 20:31 | ||
benabik | jnthn: From soh_cah_toa's example: class A { use Foo::Bar; #`{exports baz} } | ||
jnthn: Is there an A::baz after that? | |||
20:31
kaare_ left
|
|||
jnthn | No, because the import is lexical (my scoped) | 20:31 | |
There's a way to make it import into the package instead, however. | |||
We don't implement that in Rakudo yet; S11 does have it. I forget the exact syntax. | 20:32 | ||
benabik | our use? | ||
jnthn | No, I don't think it's that. :) | ||
Though could be interesting | |||
has use Foo; # adds all the imported things as methods...omgz :) | |||
Yeah, maybe too "interesting" :) | |||
benabik | perlcabal.org/syn/S11.html#Compile-...mportation | 20:33 | |
jnthn | Anyway, the syntax is something you write after use. | ||
benabik | use Sense :EXPORT | ||
jnthn | No, that's not going to give an A::baz, iiuc | 20:34 | |
use Foo::Baz :OUR<&baz> maybe | |||
But you'd think there would be a way to say "bring 'em all in as our-scoped things" | |||
benabik | Oh, that would cause A to export baz. Buh, confusing. | ||
soh_cah_toa | unless i'm misunderstanding something, doesn't that fact that 'use' is lexical imply that `package A { use Foo::Bar }` should have foobar() imported into it? | ||
package A creates a lexical scope, right? | |||
jnthn | Every pair of curlies implies a lexical scope | 20:35 | |
soh_cah_toa | package A { ... } yes | ||
jnthn | To be clear though | ||
soh_cah_toa | right | ||
jnthn | rakudo: module Foo { sub x() { say 42 } }; Foo::x() | ||
p6eval | rakudo 8b7a2a: OUTPUT«Could not find symbol 'Foo::&x' in <anon> at /tmp/MI25wdfyl3:1 in <anon> at /tmp/MI25wdfyl3:1» | ||
jnthn | rakudo: module Foo { our sub x() { say 42 } }; Foo::x() | ||
p6eval | rakudo 8b7a2a: OUTPUT«42» | ||
jnthn | In the first case, x is my-scoped (lexical). In the second, it's also installed into the package Foo | 20:36 | |
soh_cah_toa | so i need to change the sub definition to 'our sub foobar is export { ... }' then? | ||
jnthn | Not unless you want to be able to import it also. | ||
sorear | good * #perl6 | 20:37 | |
soh_cah_toa | ugh, this is confusing | ||
benabik | o/ sorear | ||
jnthn | If you just want it visibile thorugh a fully qualified name (like Foo::x) you just need to makr it "our" | ||
soh_cah_toa | what i want is Foo::Bar to export a bunch of subs but i also want to be able to test that it's doing so | ||
benabik | soh_cah_toa: { use Foo::Bar; #`{ do tests here} } | 20:38 | |
Instead of { use Foo::Bar } #`{tests here} | |||
mberends emerges from the cabal dependency rabbit-hole, ragged and defeated | 20:39 | ||
20:39
lue left
|
|||
soh_cah_toa | how do i fully qualify a sub from the "default" namespace though? w/o a fqn, it's interpreted as a call | 20:41 | |
i don't know the default namespace name | |||
::foobar perhaps? | |||
sorear | ping jnthn | 20:42 | |
jnthn | Do you mean | ||
sorear | soh_cah_toa: GLOBAL::foobar | ||
soh_cah_toa | ok | ||
jnthn | rakudo: module Foo { our sub x() { } }; &Foo::x # if you want a ref, not a call | ||
p6eval | rakudo 8b7a2a: ( no output ) | ||
jnthn | sorear: pong | ||
benabik | soh_cah_toa: Following on jnthn's example { use Foo; &x } (if x was exported) | 20:43 | |
soh_cah_toa | nopaste.snit.ch/81995 | ||
that does not pass | |||
sorear | jnthn: I am attempting to figure out how role parametricity is implemented in nom | ||
jnthn | soh_cah_toa: Sorry if I'm misunderstanding a bunch of your questions. I'm a little tiredish today... | ||
soh_cah_toa | :) that's alright | ||
jnthn | sorear: OK. | ||
sorear | jnthn: in particular, in role Foo[$x] { method bar() { $x } }, how does &bar come to close over $x? | ||
I've run out of obvious places to check | 20:44 | ||
jnthn | sorear: It's just a closure clone. | ||
sorear: See specialize_with in...ParametricRoleHOW iirc. | |||
benabik | soh_cah_toa: Try ok(defined &eq_irc) | ||
sorear was looking for RoleHOW | |||
jnthn | src/Perl6/Metamodel | 20:45 | |
sorear: No, there's not one "RoleHOW". | |||
sorear | looking | ||
jnthn | Been there, done that. :) | ||
sorear: See *RoleHOW.pm | |||
Also GenericHOW.pm | |||
soh_cah_toa | benabik: yeah, that works. thanks | ||
jnthn | Also *Applier.pm | ||
20:47
mberends left
|
|||
sorear grumbles at the unachievable elegance of this | 20:47 | ||
jnthn | sorear: There's 7 or 8 things in Metamodel:: that are related to making roles work in all their glory. If I can offer you any "don't make the same mistakes I've done over the years" style advice, it'd be don't conflate things that are different. | 20:48 | |
By that I mean | 20:49 | ||
role Foo[::T] { }; class C does Foo { } | |||
So, how many forms can this show up in? | |||
Foo - well, clearly this isn't actually the "real role" itself because we can also declare a role Foo[::T1, ::T2] { } | 20:50 | ||
So it must be some kinda "grouping" thing | |||
benabik | jnthn: Does that make T ~~ C in Foo? | ||
jnthn | But we have to be able to know which one we're talking about composition time. | ||
benabik: No | |||
So we're already up to two "forms" | 20:51 | ||
Now consider that when we compose it into the class we need a specialized form. | |||
felher | Whats the preferred way to get the indicies of elements in an array that match some condition? Like grep, just for indicies. @array.kv.map: {$^k if $^v ~~ condition};? | ||
jnthn | With the generic bits - including ::?CLASS - reified. | ||
That's a third | |||
Then, just to ice the cake, Foo[Int] is also something we can talk about first class. | |||
But it's not the same as the fully specialized thing because we haven't got the information we need to specialize ::?CLASS yet. | 20:52 | ||
So it's a forth form. | |||
I call these four ParametricGroup, Parametric, Concrete and Curried. | 20:53 | ||
benabik | If you have a Foo[::T], what does class Bar does Foo mean? I'd think you'd have to give it a parameter. | ||
jnthn | benabik: er, darn | ||
:) | |||
benabik: It means "compile time error" | |||
I mean class Bar does foo[Int] { } or so | 20:54 | ||
Sorry. | |||
*Foo[Int] | |||
benabik | jnthn: That was why I was asking about T ~~ C in your example. ;-) Glad to know I hadn't missed something. | ||
jnthn | nom: role R[::T] { }; class C does R { } | ||
p6eval | nom 8b7a2a: OUTPUT«===SORRY!===None of the parametric role variants for 'R' matched the arguments supplied.No applicable candidates found to dispatch to for '_block1377'. Available candidates are::(Mu, Mu)» | ||
jnthn | Hmm...some error awezomization needed in the second part of that. | ||
But the first line of the eror is kinda spot on. | 20:55 | ||
OK, time for me to get a beer and hack on the optimizer for a little bit. | |||
This will probably screw up my sleep tonight, but given I slept 12 hours last night I'm done for anyway. :/ | 20:56 | ||
sorear | heh same here ... | 20:57 | |
benabik | nom: role R[::T] { }; class C does R[int] { } # curious... | 20:58 | |
p6eval | nom 8b7a2a: ( no output ) | ||
benabik | \o/ | ||
jnthn | Oh my :) | ||
It's not going to handle that so cleverly as you may wish though, I suspect. | |||
benabik | jnthn: Fair enough. :-D | 20:59 | |
jnthn | I mean, it'll work | ||
But under the hood it's probably going to box/unbox in places it maybe shouldn't. | |||
Fixing that is a...research problem.:) | |||
jnthn holds out a research problem to sorear++ to see if he bites :) | |||
I wonder if we can do anything insane on the CLR to get its generics support to do some of the lifting on that front... | 21:00 | ||
Figuring out the details makes my brain want to run off and hide though. :) | 21:01 | ||
And on the JVM it's back to square one since their generics are type erased. | |||
benabik | And handle native types via boxing anyway | 21:02 | |
jnthn | Well, that's what passing a native type to a role will do. | ||
In Rakudo today I mean. | |||
It'd be great fun to improve/fix that some day. | 21:03 | ||
21:03
Kivutarrr joined
21:06
newsbad_com left
21:07
newsbad_com joined
21:11
Kivutarrr left
|
|||
sorear | jnthn: What problem are you holding out? R[int]? | 21:15 | |
jnthn: What is type pretence | 21:17 | ||
jnthn: What is the difference between new_type and new? | 21:18 | ||
jnthn | sorear: R[int], yes :) | 21:21 | |
sorear: Type pretence is how a role behaves like it's Any | |||
Even thought that doesn't really "make sense" | |||
new - what you expect. A new meta-object. | |||
new_type - makes a type object (and thus an s-table) | |||
We pretty much never call .new from the outside. | 21:22 | ||
Always new_type | |||
21:34
pmurias left
|
|||
soh_cah_toa | perl6: sub foobar(Str:D $str) { say "$str is defined" }; foobar('qux') | 21:37 | |
p6eval | niecza v9-51-g493fbf9: OUTPUT«===SORRY!===In parameter declaration, typename 'Str:D' must be predeclared (or marked as declarative with :: prefix) at /tmp/hRdGoq8gOh line 1:------> sub foobar(Str:D⏏ $str) { say "$str is defined" }; foobarParse f… | ||
..pugs, rakudo 8b7a2a: OUTPUT«qux is defined» | |||
sorear | pugs? really? | 21:38 | |
soh_cah_toa | aw darn, 2011.07 gives me "Invalid typename in parameter declaration" when i use :D or :U | ||
nom is taking too long, i'm getting antsy ;) | 21:39 | ||
jnthn | soh_cah_toa: Yes, implementing that in nom :) | ||
21:39
zby_home_ left
|
|||
jnthn | *implemented | 21:39 | |
soh_cah_toa: Yeah, I know...we're getting there. | |||
21:39
mj41 left
|
|||
soh_cah_toa | it's getting annoying b/c that also means i need to stay w/ parrot 3.6.0 | 21:40 | |
if i just install nom/HEAD, can i use 3.8.0? | 21:41 | ||
benabik | Parrot 3.8.0 works on Rakudo HEAD. Parrot HEAD works with nqp/kill-useless-defaults and rakudo/HEAD (last I tried) | 21:42 | |
soh_cah_toa | new rakudo branch = old nom branch, right? | 21:43 | |
i know something like that got changed a while ago | |||
jnthn | soh_cah_toa: nom is the current branch | ||
soh_cah_toa: If you git clone Rakudo today, you get the nom branch | |||
(master is just a convention) | |||
soh_cah_toa | so what branch am i on if i 'git checkout nom'? | 21:44 | |
jnthn | ...nom? :) | ||
soh_cah_toa | and if i 'git checkout master' i'm also on nom? | ||
jnthn | soh_cah_toa: No, you get "branch doesn't exist" or some such | ||
21:45
cognominal___ joined
|
|||
soh_cah_toa | nope, i can go to master just fine | 21:45 | |
jnthn | Oh? | ||
:S | |||
soh_cah_toa | git branch -v | ||
master d7f45ff Cool.eval | |||
jnthn | huh. | ||
That sounds...kinda odd. | |||
soh_cah_toa | and that's after rebasing | ||
jnthn | I wonder if somebody accidentally pushed to master. | 21:46 | |
benabik | soh_cah_toa: Did you just clone it, or have you had it for a while? | ||
sorear | jnthn: git pull won't delete branches | ||
jnthn | sorear: oh. | ||
soh_cah_toa | i've had it for a while | ||
jnthn | ah | ||
OK. | |||
soh_cah_toa | i gotta re-clone? | ||
jnthn | sorear: Makes sense... | ||
benabik | Also, master appears to still exist in rakudo.it | ||
git | |||
sorear | soh_cah_toa: no, just don't check out master anymore | ||
check out b or nom | |||
21:48
cognominal_ left
21:49
espadrine joined
|
|||
soh_cah_toa | bleh...this "nom = master but master = DNE except for soh_cah_toa's machine" business is crazy | 21:49 | |
i'm checking out nom | |||
installing | |||
i dont' care | |||
:P | |||
benabik | 1) Your local branches don't have to correspond to anything remote. 2) master does exist in rakudo.git, but it's not the default branch. | 21:51 | |
soh_cah_toa | ok | ||
benabik | nom = HEAD | ||
sorear | jnthn: now I'm wondering a bit about ze archetypes business... | 21:52 | |
jnthn | sorear: heh, I shoulda gotten around to writing the blog post about those... | ||
sorear: See slides on my talk from YAPC this year | |||
ingy | seen TimToady | ||
aloha | TimToady was last seen in #perl6 7 hours 34 mins ago saying "not marked as flatten". | ||
jnthn | sorear: I put the best description I did so far for archetypes in there. | 21:53 | |
sorear | jnthn: link? | ||
jnthn | jnthn.net/papers/2011-yapceu-rakudo.pdf | ||
sorear | thanks | ||
benabik | jnthn: The book from that presentation is one of my textbooks this year. | 21:54 | |
masak | "inheritalizable". | ||
benabik | (Types and Programming Languages) | ||
jnthn | benabik: It's very nice. :) | ||
Enjoy :) | |||
masak | benabik: it was the book that made audreyt begin Pugs. | ||
jnthn | masak: Derivational morphology. :p | 21:55 | |
masak | jnthn: "yesish" :) | ||
jnthn | Oh stop yesishing. | 21:56 | |
masak | ok, so. which implementation will be the first to support infix:<%> in regexes? | ||
Niecza, or Rakudo? | |||
tadzik | yapsi | ||
jnthn | yapsi | ||
masak | hah! | ||
tadzik | jnthn: high five! | 21:57 | |
Erm, high six i mean | |||
jnthn | \o/ | ||
masak | yapsi doesn't even have regexes yet. | ||
but I'm glad you still remember Yapsi. it hasn't had a release in a while. | |||
dangerous with implementations with low bus numbers... | |||
sorear | nqp: BEGIN { say(5) } | 22:12 | |
p6eval | nqp: OUTPUT«Confused at line 1, near "BEGIN { sa"current instr.: 'nqp;HLL;Grammar;panic' pc 23698 (src/stage2/gen/NQPHLL.pir:6757) (src/stage2/gen/NQPHLL.pm:329)» | ||
masak | confused from the very beginning! | ||
sorear holds the most important difference of niecza to be the lack of a nqp/rakudo like split | 22:13 | ||
tadzik | . o O ( sorear uses confusion! It's super-effective! ) | ||
masak .oO( 9 out of every 10 sorears recommend confusion ) | 22:14 | ||
jnthn | Not sure nqp is going to survive it out the year without learning about BEGIN, fwiw. | 22:15 | |
(I'm not thrilled about making it do so, but I suspect I may need it at some point.) | 22:16 | ||
We'll see. | |||
sorear | jnthn: if nqp does learn BEGIN, how will box operators know what type to use? | ||
jnthn | sorear: Confused :) | 22:17 | |
sorear: I think I'm missing something. | |||
sorear | niecza's kernel keeps a bunch of globals like Kernel.StrMO; this seems the main obstacle to a more nom-like runtime/compile split | ||
jnthn: does/will nqp have anything like perl6_set_parcel_type ? | |||
will nqp have any ops that need to find NQPMu or something like that? | 22:18 | ||
jnthn | sorear: I'm really not sure yet. Note that NQP on Parrot uses Parrot PMCs to break some circularities. | 22:19 | |
sorear: And when I did NQP on CLR, I ran into...fun...on things like that. | |||
I can't remember exactly what happened. | |||
I must have had to deal with it somehow. | |||
Ask me again when I get somewhere with the nqpclr update/refactor. :) | 22:20 | ||
sorear | What does $method.insantiate_generic call? | 22:21 | |
jnthn | Routine's instantiate_generic method. | ||
sorear | What file is RoutineHOW defined in? | ||
jnthn | ? | 22:22 | |
22:22
wallberg left
|
|||
jnthn | There's no RoutineHOW | 22:22 | |
Routine is just a class. | |||
Routine is partially set up in BOOTSTRAP.pm | |||
And partially in src/core/Routine.pm. | 22:23 | ||
masak | routines aren't type-y things like classes and roles and enums. that's why there's no RoutineHOW. | 22:24 | |
jnthn | That's a good way of looking at it. | 22:25 | |
22:32
PacoLinux_ left
22:35
static_perl joined
|
|||
sorear | jnthn: is create_lexical_capture_fixup responsible for role Foo[$x] { method bar { $x } } working? | 22:36 | |
22:36
aloha joined
|
|||
jnthn | sorear: Yeah. | 22:36 | |
sorear: er | |||
wait | |||
I think actually no | |||
No, it's not that. It's fixing up the role's outer pointer at fixup time. | |||
*role body's outer pointer | 22:37 | ||
sorear | jnthn: I'm still trying to find what *is* responsible... | ||
jnthn | sorear: instantiate_generic on Routine | 22:38 | |
sorear: It calls self.clone() or some such | |||
sorear: That includes capturing the outer pointer. | |||
Since we just ran the body block, those were all capture_lex'd correctly. | 22:39 | ||
sorear still thinks that is the most eewsome thing in Parrot | 22:40 | ||
dalek | kudo/optimizer: 8db01ef | jnthn++ | src/binder/multidispatch. (2 files): First sketch of algorithm for considering multiple dispatches at compile time. |
22:41 | |
benabik | sorear: capture_lex? | ||
22:42
replore_ joined
|
|||
masak | good night, channel. | 22:42 | |
tadzik | gnightmasak | 22:43 | |
ha, made it! | |||
masak | :P | ||
jnthn | night masak! | ||
lol me too | |||
tadzik | bet he's waiting for us today | ||
masak | tadzik: and no, I don't backlog to see who replied. not until the next morning :P | ||
tadzik | ;P | ||
jnthn | bwaha :) | ||
22:43
masak left
|
|||
jnthn | ok, how the heck do I write this analyser up... | 22:43 | |
tadzik | haha, watch this | ||
22:43
replore_ left
|
|||
tadzik | GOOD MORNING MASAK! | 22:43 | |
jnthn | s/write/wire | 22:44 | |
flussence | sorear: did you see this earlier? irclog.perlgeek.de/perl6/2011-09-25#i_4477224 | 22:47 | |
sorear | flussence: yes | 22:48 | |
flussence | I'm guessing that's just some NYI laziness? | ||
sorear | it's building a list of @_[0] through @_[Inf] | 22:50 | |
jnthn | That's gonna take a while, even at Niecza's speed :) | 22:51 | |
oh noes, my beer bottle is empty :( | 22:52 | ||
benabik | The horror! | ||
jnthn | Thankfully the fridge can help. | 22:54 | |
sorear | I find x ** -100..100 to be a very troubling pattern | ||
jnthn | sorear: Context? | 22:55 | |
(sorry if it should be obvious...) | |||
sorear | jnthn: Regexes | ||
jnthn | Oh. | ||
:) | |||
sorear | I'm reading the S05 patches because of masak | ||
jnthn | Er, -100? :) | ||
sorear | Yes, -100 | ||
it's in S05! | 22:56 | ||
benabik | Apparently has been for a while. | ||
flussence | ow, I think I vaguely remember what negative numbers mean and it's not pretty... | 22:57 | |
flussence reads spec | |||
jnthn | Oh. My. Whoa. | ||
Yeah, I didn't remember that was there :) | |||
sorear | I think it's bad for exactly the same reason p5ish @foo[-1] is bad | ||
it creates a semantic discontinuity | 22:58 | ||
niecza: say ?/ ^ x++ <[xy]> / for < y xy xxx > | 23:00 | ||
p6eval | niecza v9-51-g493fbf9: OUTPUT«===SORRY!===STD parses + as a quantmod but there is nothing at all in S05 to explain what it should _do_ at /tmp/ov8M5SKk2r line 1:------> say ?/ ^ x++⏏ <[xy]> / for < y xy xxx >Unhandled exception: Check failed … | ||
sorear | yay fixed | ||
jnthn | sorear++ for underlying do | 23:01 | |
:D | |||
*underlining | |||
sorear | I think that's your client's doing. | 23:03 | |
jnthn | oh. :) | ||
irssi | |||
What did you do? | |||
sorear | prefix and suffix _ | ||
flussence | dwfm :/ | ||
jnthn | Oh. | ||
I thought you'd done something curious with ANSI escape codes :P | 23:04 | ||
sorear | rakudo: say '_' ~ 'foo' ~ '_' | ||
p6eval | rakudo 8b7a2a: OUTPUT«_foo_» | ||
flussence | I think it's probably an option somewhere in irssi... | ||
jnthn | That doesn't do it. | ||
sorear | rakudo: say ' _' ~ 'foo' ~ '_ ' | ||
p6eval | rakudo 8b7a2a: OUTPUT« _foo_ » | ||
jnthn | That does. | ||
flussence | (I think there's an ANSI code to do it, too...) | ||
(an irc client-compatible one, that is) | |||
jnthn | Yeah, I learned a little about ANSI codes when writing Grammar::Debugger. | ||
I had to go and find a patched version of the Windows terminal that supported them. | 23:05 | ||
23:05
molaf_ joined
|
|||
jnthn | So I could actually run the demo. | 23:05 | |
tadzik | was Term::ANSIColor not sufficient>? | ||
jnthn | tadzik: I used Term::ANSIColor | ||
tadzik | I know, that's why I'm asking :) | ||
jnthn | tadzik: The problem is that the default terminal program Windows ships with does not support ANSI color codes | ||
tadzik: It's not the module's fault. | |||
tadzik | ah, true | ||
yeah, I'm aware of that | |||
jnthn | I looked around for a way to fix it but failed. | 23:06 | |
However, there *must* be one | |||
tadzik | how did you solve that? Different terminal emulator? | ||
jnthn | Yeah. | ||
But latest version of msys git gives me the colors in the out-the-box terminal. | |||
I dunno what they're doing. | |||
Unless they're using various Windows-specific console APIs. | |||
flussence | the thing I don't like about terminal colour codes is that they're customisable, and there's no way for a program to figure out what palette you're using. | 23:07 | |
jnthn | (msysgit folks)++ anyway...they've given me an almost completely trouble-free git experience on Windows. | ||
23:08
static_perl left
|
|||
sorear | phernny: tell TimToady My current reading of S05 tells me that % is a quantmod, and since you may only have one quantmod, this means there is no shorter way to say [ :r x+ % ',' ]. Is that correct? | 23:08 | |
23:08
Trashlord joined
|
|||
sorear | phenny: tell TimToady My current reading of S05 tells me that % is a quantmod, and since you may only have one quantmod, this means there is no shorter way to say [ :r x+ % ',' ]. Is that correct? | 23:08 | |
phenny | sorear: I'll pass that on when TimToady is around. | ||
23:09
molaf left,
bonifatio joined
23:10
aloha left
23:11
aloha joined
23:22
Chillance left
23:26
bonifatio left
23:27
espadrine left
23:30
soh_cah_toa left
23:36
soh_cah_toa joined
23:52
soh_cah_toa_ joined
23:54
soh_cah_toa left
|