pugscode.org/ planetsix.perl.org/ feather.perl6.nl/syn/ perlcabal.org/svn/pugs/log github.com/rakudo/rakudo | nopaste: sial.org/pbot/perl6 | evalbot: "perl6: say 3;" | irclog: irc.pugscode.org/ | Rakudo.org www.perlfoundation.org/perl6/index.cgi?smop perl.net.au/wiki/Elf |~300 days 'til Xmas Set by mncharity1 on 25 February 2009. |
|||
00:01
mberends left
00:04
Ariens_Hyperion left
00:38
alester joined
00:41
meteorjay joined,
nihiliad left
00:46
alester left
00:59
Eevee joined
|
|||
pugs_svn | r25634 | putter++ | [elfparse] Starting to sketch in more efficient rx ratcheting support. | 01:00 | |
01:05
DemoFreak left
01:40
nihiliad joined
|
|||
frooh | rakudo: sqrt(9) | 01:46 | |
p6eval | rakudo d3f407: RESULT«3» | ||
frooh | rakudo: sqrt(5) | ||
p6eval | rakudo d3f407: RESULT«2.23606797749979» | ||
01:46
Whiteknight left
|
|||
frooh | rakudo: my $bar = sub ($foo) { $foo }; | 01:49 | |
p6eval | rakudo d3f407: RESULT«{ ... }» | ||
frooh | rakudo: my $bar = sub ($foo) { $foo }; $bar->(1); | ||
p6eval | rakudo d3f407: OUTPUT«Statement not terminated properly at line 1, near "->(1);"current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
frooh | rakudo: my $bar = sub ($foo) { $foo }; $bar(1); | ||
p6eval | rakudo d3f407: RESULT«1» | ||
frooh | rakudo: for my $f 1..4 { say $f } | 01:52 | |
p6eval | rakudo d3f407: OUTPUT«Redeclaration of variable $fStatement not terminated properly at line 1, near "1..4 { say"current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
frooh | rakudo: for my $f, 1..4 { say $f } | ||
p6eval | rakudo d3f407: OUTPUT«Use of uninitialized valueUse of uninitialized valueUse of uninitialized valueUse of uninitialized valueUse of uninitialized value» | ||
pmichaud | bacek: I know that chain implies &&. I'm saying I don't like the current factoring. | 01:55 | |
frooh | how do I do a for loop in perl 6? | 01:57 | |
(or where in the fine manual can I find out :-) | |||
TimToady | S04 | ||
rakudo: for 1..4 -> $f { say $f } | |||
p6eval | rakudo d3f407: OUTPUT«1234» | 01:58 | |
TimToady | $f is a formal parameter to the block in p6 | ||
frooh | ah | ||
I was searching for =item for | |||
rakudo: '5' =~ /\d+$/ | 02:02 | ||
p6eval | rakudo d3f407: OUTPUT«Unable to set lvalue on PAST::Val nodecurrent instr.: 'parrot;PAST;Val;lvalue' pc 566 (src/PAST/Node.pir:161)» | ||
frooh | rakudo: '5' ~~ /\d+$/ | ||
p6eval | rakudo d3f407: RESULT«Method 'perl' not found for invocant of class 'Match'current instr.: 'parrot;P6metaclass;dispatch' pc 320 (src/classes/ClassHOW.pir:161)» | ||
frooh | rakudo: if '5' ~~ /\d+$/ { say 'matches' } | ||
p6eval | rakudo d3f407: OUTPUT«matches» | ||
frooh | rakudo: if 'frew' ~~ /\d+$/ { say 'matches' } | ||
p6eval | rakudo d3f407: RESULT«Method 'perl' not found for invocant of class 'Match'current instr.: 'parrot;P6metaclass;dispatch' pc 320 (src/classes/ClassHOW.pir:161)» | ||
frooh | rakudo: if my $f = 'frew' { say $f } | 02:03 | |
p6eval | rakudo d3f407: OUTPUT«frew» | ||
02:03
xinming_ joined
|
|||
frooh | when rakudo tells me "No applicable methods" is there any way I can find out what line it's talking about? | 02:11 | |
ok, actually the issue is coming from doing this: | 02:15 | ||
if my $f = %odt{$token} { $f(...) } | |||
I tried replacing $ with & | 02:16 | ||
still no good | |||
02:17
xinming left
|
|||
frooh | oh weird | 02:18 | |
so I had an issue in the function | |||
I had this: | |||
push(@stack, pop(@stack) + pop(@stack)); | 02:19 | ||
I know that's no idiomatic perl6 | |||
but is it wrong/ | 02:20 | ||
02:31
mikehh left
02:32
mikehh joined
|
|||
TimToady | std: push(@stack, pop(@stack) + pop(@stack)); | 02:33 | |
p6eval | std 25634: OUTPUT«Potential difficulties: Variable @stack is not predeclared at /tmp/mLVas1R668 line 1:------> push(@stack, pop(@stack) + pop(@stack)); Variable @stack is not predeclared at /tmp/mLVas1R668 line 1:------> push(@stack, pop(@stack) + pop(@stack)); | ||
..... | |||
TimToady | std: my @stack; push(@stack, pop(@stack) + pop(@stack)); | 02:34 | |
p6eval | std 25634: OUTPUT«ok 00:02 34m» | ||
frooh | rakudo: my @stack = [1, 2]; push(@stack, pop(@stack) + pop(@stack)); | 02:35 | |
p6eval | rakudo d3f407: OUTPUT«No applicable methods.current instr.: '_block14' pc 141 (EVAL_16:52)» | ||
TimToady | rakudo: my @stack := [1,2]; push(@stack, pop(@stack) + pop(@stack)); | 02:36 | |
p6eval | rakudo d3f407: OUTPUT«No applicable methods.current instr.: '_block14' pc 127 (EVAL_16:50)» | ||
TimToady | rakudo: my @stack := [1,2]; push(@stack, @stack.pop + @stack.pop); | 02:37 | |
p6eval | rakudo d3f407: RESULT«1» | ||
TimToady | rakudo: my @stack := [1,2]; push(@stack, @stack.pop + @stack.pop); say @stack[0] | ||
p6eval | rakudo d3f407: OUTPUT«3» | ||
TimToady | you either have to use := [] or = () | 02:38 | |
frooh | I replaced all of them with @foo.bar, but it's still a bug right? | ||
well, @stack is defined by push'es | |||
TimToady | in theory pop(@stack) ought to work | ||
frooh | ok | ||
just making sure | |||
TimToady | the push as a function seems to work | ||
frooh | it works fine when I use the method syntax, which I prefer anyway, I was just curious | 02:39 | |
TimToady | rakudo: my @stack = (1,2); say pop(@stack) | ||
p6eval | rakudo d3f407: OUTPUT«2» | ||
frooh | also, what exactly is the diff between := = [] and () ? | ||
TimToady | seems to work in isolation | ||
binding vs assignment | |||
[] creates a single scalar containing an array | |||
frooh | so = value, := reference? | ||
TimToady | if you assign that, you end up with only one element that happens to be an array | 02:40 | |
yes, basically | |||
frooh | interesting | ||
Tene_ | rakudo: my $a = 5; my $b := $a $b++; say $a | ||
p6eval | rakudo d3f407: OUTPUT«Statement not terminated properly at line 1, near "$b++; say "current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
Tene_ | rakudo: my $a = 5; my $b := $a; $b++; say $a | 02:41 | |
p6eval | rakudo d3f407: OUTPUT«6» | ||
TimToady | decommuting & | ||
Tene_ decommuting too! | |||
In 9 minutes. | |||
frooh | my $f = [1,2,3]; | 02:42 | |
rakduo: my $f = [1,2,3]; $f | |||
rakudo: my $f = [1,2,3]; $f | |||
p6eval | rakudo d3f407: RESULT«[1, 2, 3]» | ||
frooh | rakudo: my $f := [1,2,3]; $f | ||
p6eval | rakudo d3f407: RESULT«[1, 2, 3]» | ||
frooh has trouble seeing the difference. | 02:43 | ||
rakudo: my $f = (1,2,3); $f | |||
p6eval | rakudo d3f407: RESULT«[1, 2, 3]» | ||
frooh | rakudo: my @f = (1,2,3); $f | ||
p6eval | rakudo d3f407: OUTPUT«Scope not found for PAST::Var '$f' in current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:102)» | ||
frooh | rakudo: my @f = (1,2,3); @f | ||
p6eval | rakudo d3f407: RESULT«[1, 2, 3]» | ||
frooh | rakudo: my @f := (1,2,3); @f | ||
p6eval | rakudo d3f407: RESULT«[1, 2, 3]» | ||
02:48
Chillance left
|
|||
frooh | pugs: 1 - 2 | 02:54 | |
p6eval | pugs: RESULT«-1» | ||
frooh | pugs: 1 R- 2 | ||
p6eval | pugs: OUTPUT«***  Unexpected "R" expecting operator at /tmp/XSe9w7YqD2 line 1, column 3» | ||
frooh | pugs: 1 R/ 2 | 02:55 | |
p6eval | pugs: OUTPUT«***  Unexpected "R" expecting operator at /tmp/DgcfqjC3D4 line 1, column 3» | ||
frooh | pugs: 1 R== 2 | ||
p6eval | pugs: OUTPUT«***  Unexpected "R" expecting operator at /tmp/Z5RZqbEJBq line 1, column 3» | ||
02:56
Sepheebear left,
edenc left,
broquaint left
02:58
broquaint joined,
edenc joined
03:15
Sepheebear joined,
Sepheebear left
03:16
Sepheebear joined
03:37
Sepheebear left
03:42
aindilis` joined
|
|||
frooh | sub f(Int $i) { say $i }; f(2); f('2'); | 03:49 | |
rakudo: sub f(Int $i) { say $i }; f(2); f('2'); | |||
p6eval | rakudo d3f407: OUTPUT«2Parameter type check failed for $i in call to fcurrent instr.: 'die' pc 16347 (src/builtins/control.pir:204)» | ||
frooh | rakudo: sub f(Int $i) { say $i }; f(2); f(+'2'); | ||
p6eval | rakudo d3f407: OUTPUT«2Parameter type check failed for $i in call to fcurrent instr.: 'die' pc 16347 (src/builtins/control.pir:204)» | ||
frooh | rakudo: sub f(Int $i) { say $i }; f(2); f((+'2')); | 03:50 | |
p6eval | rakudo d3f407: OUTPUT«2Parameter type check failed for $i in call to fcurrent instr.: 'die' pc 16347 (src/builtins/control.pir:204)» | ||
frooh | rakudo: sub f(Int $i) { say $i }; f(2); | ||
p6eval | rakudo d3f407: OUTPUT«2» | ||
frooh | rakudo: 5 | ||
p6eval | rakudo d3f407: RESULT«5» | ||
frooh | rakudo: '5' | ||
p6eval | rakudo d3f407: RESULT«"5"» | ||
frooh | rakudo: +'5' | ||
p6eval | rakudo d3f407: RESULT«5» | ||
frooh | hmmm | ||
rakudo: ~5 | |||
p6eval | rakudo d3f407: RESULT«"5"» | ||
frooh | rakudo: sub f(Int $i) { say $i }; f(+'2'); | 03:51 | |
p6eval | rakudo d3f407: OUTPUT«Parameter type check failed for $i in call to fcurrent instr.: 'die' pc 16347 (src/builtins/control.pir:204)» | ||
frooh | rakudo: sub f(Int $i) { say $i }; my $foo = '2'; f(+$foo); | ||
p6eval | rakudo d3f407: OUTPUT«Parameter type check failed for $i in call to fcurrent instr.: 'die' pc 16347 (src/builtins/control.pir:204)» | ||
frooh | rakudo: sub f(Int $i) { say $i }; my $foo = +'2'; f($foo); | ||
p6eval | rakudo d3f407: OUTPUT«Parameter type check failed for $i in call to fcurrent instr.: 'die' pc 16347 (src/builtins/control.pir:204)» | ||
frooh | :-( | ||
meppl | good night | 03:55 | |
03:56
aindilis left
|
|||
frooh | also: for @*ARGS -> $arg doesn't seem to work | 03:56 | |
03:58
japhb joined
03:59
meppl left
|
|||
pmichaud | frooh: Rakudo currently sees +'2' as being a Num, not an Int. | 04:01 | |
I'm not exactly certain how to resolve that one yet. | |||
frooh | huh | 04:02 | |
well, I guess that makes sense | |||
but can't it say, "dude, this Num really *is* an Int!" | |||
(I presume it can't or it would :-) | |||
any idea about the @*ARGS thing? | |||
pmichaud | as I said, I'm not exactly certain how to resolve that one yet. Currently our prefix:<+> returns a Num. | 04:03 | |
I guess we could work on getting prefix:<+> to return an Int if the string doesn't include a decimal point. | |||
frooh | yeah, I'm just joking, I think returning a num makes more sense anyway | ||
pmichaud | it's a bit complicated on the parrot internals side for that. | ||
frooh | maybe I could do (+'f').int | 04:04 | |
er | |||
'5' | |||
pmichaud | looking at @*ARGS now | ||
looks like it works to me: | 04:06 | ||
$ cat x.pl | |||
for @*ARGS -> $arg { $arg.say } | |||
$ ./perl6 x.pl a b c | |||
a | |||
b | |||
c | |||
frooh | weird... | ||
lemme look again | |||
unless there is a really recent fix for rakudo (I built tongiht) it's busted here still | 04:07 | ||
exact same code | |||
pmichaud | can you pastebin/nopaste what you're testing? | ||
what output are you getting? | 04:08 | ||
frooh | Statement not terminated properly at line 10, near "-> $arg { " | ||
pmichaud | it's not even parsing? that's odd. | ||
frooh | lemme comment out the rest of the code | ||
pmichaud | oh, so it's not the _exact_ same code :_) | ||
I suspect the error is whatever follows the for loop body | |||
frooh | weird | ||
well | 04:09 | ||
it's BEFORE the for loop | |||
it's a sub | |||
pmichaud | oh | ||
yes, that's a known bug in Rakudo. | |||
you need a semi after that sub. | |||
frooh | really? | ||
what is it exactly? | |||
pmichaud | otherwise Rakudo sees it as "sub xyz { } for ... " | ||
frooh | oh | ||
hih | |||
pmichaud | and thinks that the 'for' is a statement modifier. | ||
I guess I better fix that tomorrow. | |||
frooh | so do sub xyz semi { ... }? | 04:10 | |
it's not a huge deal | |||
pmichaud | (even if it ends up being an ugly-ish fix. | ||
it needs to be: sub xyz { ... }; for @*ARGS -> $arg { ... } | |||
with the semicolon after the closing brace of the sub. | |||
frooh | ahhh | ||
git it | |||
pmichaud | that's a problem that trips up a lot of folks, and we really need to fix it somehow. | 04:11 | |
frooh | got* | ||
pmichaud | so, it's on my list for tomorrow. | ||
rakudo: sub foo(Int $x) { $x.say }; foo('5'.int); | |||
p6eval | rakudo d3f407: OUTPUT«5» | ||
pmichaud | no + needed. | ||
frooh | got it | 04:12 | |
04:12
Tene joined
|
|||
frooh | so would it be worth it for me to learn pir to try to help or would it be better to try to help with the setting? | 04:12 | |
pmichaud | I think helping with setting is what most people will find most useful. | ||
or most enjoyable. | |||
frooh | cool | ||
well, that's definately true | |||
but I don't mind doing stuff that no one else wants to do | 04:13 | ||
anything to make perl6 come sooner :-) | |||
pmichaud | the PIR really is intended to be reserved for things that can't easily be done in Perl 6. | ||
frooh | what exactly is the PGE that people keep talking about? | 04:14 | |
pmichaud | it's Rakudo's (and Parrot's) regular expression engine. | ||
It's the thing that handles regex matching, as well as the parsing of Perl 6 code itself. | |||
frooh | got it | ||
pmichaud | there should be an entry for it in docs/glossary.pod | ||
frooh | ahh | 04:15 | |
pmichaud | oh, there's not! That's a bug. | ||
frooh | haha | ||
niec | |||
nice* | |||
dalek | kudo: c1f3976 | pmichaud++ | docs/glossary.pod: Add entry for PGE to glossary.pod (frooh++) |
04:18 | |
04:19
tony_ joined
|
|||
frooh reads glossary.pod | 04:19 | ||
so does rakudo actually use STD.pm? or is it just a validator/ | 04:21 | ||
pmichaud | rakudo doesn't use STD.pm yet. | 04:22 | |
frooh | but it will at some point? | ||
pmichaud | PGE isn't sophisticated enough yet to parse STD.pm | ||
frooh | ah, got it | ||
pmichaud | the goal is to have Rakudo and other implementations converge on STD.pm, yes. | ||
frooh | yeah, I didn't know if that meant use STD.pm itself or just something like it | ||
pmichaud | whatever we end up with undoubtedly be very close to STD.pm, if not STD.pm itself. | 04:23 | |
it might end up being STD.pm with a couple of patches. | |||
frooh | also: how about the Setting? is it the goal that implementations can reuse that too? | ||
04:23
idemal joined
|
|||
pmichaud | I don't know to what extent Perl 6 will have a "standard setting" (more) | 04:23 | |
there are some functions (primitives) that likely cannot be expressed in Perl 6 | 04:24 | ||
(more) | |||
04:24
Tene_ left
|
|||
pmichaud | and things that are primitives on one platform might be fairly complex on other platforms | 04:24 | |
frooh | that makes sense | ||
pmichaud | so, we may have a standard setting library that says "this is a reference for implementations", but individual implementations may want or need to use a slightly different internal implementation (that gives the same semantics). | 04:25 | |
frooh | yeah. But the ability to change out settings (or add them) is part of the spec right? | 04:26 | |
TimToady | std: sub foo {...} for 1..10 -> {...} | ||
pmichaud | but yes, I'd like for Rakudo to be providing some settings that other implementations can re-use. | ||
p6eval | std 25634: OUTPUT«############# PARSE FAILED #############Unexpected block in infix position (two terms in a row, or previous statement missing semicolon?) at /tmp/3BssYYhSx3 line 1:------> sub foo {...} for 1..10 -> {...} expecting any of: infix or meta-infix infix | ||
..stopper ... | |||
pmichaud | TimToady: you may have answered this already, but should prefix:<+> be smart enough to return an Int for things like +'5' and a Num for +'5.0' ? | 04:27 | |
TimToady | thinking... | 04:29 | |
pmichaud | or is there a "generic num/intify" that we should be doing on Str ? | ||
TimToady | perhaps it returns a Rat :) | 04:30 | |
pmichaud | if the answer isn't yet specced, I don't need it right now; was just curious if I had overlooked something (I'll have to leave very shortly) | 04:31 | |
TimToady | not specced yet | ||
pmichaud | but I know that sub foo(Int $x) { ... }; foo(+'5') trips up a lot of folks. | ||
in some sense I think it might be good if we say that such cases require an explicit .int on the argument | 04:32 | ||
frooh | rakudo: +'5/7' | ||
p6eval | rakudo c1f397: RESULT«5» | ||
frooh | rakudo: +'5+7i' | ||
TimToady | on the other hand, if Int does the Num role, it's fine to return an Int for a Num return type | ||
p6eval | rakudo c1f397: RESULT«5» | 04:33 | |
frooh | rakudo: +'5.7' | ||
pmichaud | but if Int does Num, then foo(2.3) would seem to match? | ||
p6eval | rakudo c1f397: RESULT«5.7» | ||
pmichaud | or is my too-tired brain thinking of that backwards again? | 04:34 | |
TimToady | but it matches Num more closely | ||
frooh | pmichaud: I agree, foo(2.3) should at least give a warning, right? | ||
2.3 isn't an Int, and foo only takes Int's... | 04:35 | ||
TimToady | maybe they both do Numeric | ||
or maybe + just doesn't commit to a specific return type | |||
pmichaud | well, I was headed that way, but there's also the case of | ||
frooh want's + to be * for numeric coersions :-) | 04:36 | ||
pmichaud | foo('3' * 2) | ||
so it's not just prefix:<+> that we have to consider. | |||
TimToady | well, AnyAny would convert to IntInt in that case | 04:37 | |
which seems okay | |||
pmichaud | I don't understand that last part | ||
TimToady | infix:<*>:(Any,Any) converts via +$x * +$y | 04:38 | |
which would make two integers and call infix:<*>:(Int,Int) | |||
pmichaud | okay. | ||
TimToady | unless we short circuit the strings with extra candidates, but it doesn't seem necessary | 04:39 | |
pmichaud | right. | ||
so then prefix:<+> does become the generic "make me a number" operator. | |||
TimToady | basically, if people rely on the Any cases they get slowed down, so there some motivation to cast explicitly | ||
pmichaud | I wasn't looking for a guaranteed return type for prefix:<+>; I was more asking if it was possible that prefix:<+>(Str) could choose to return a Num or an Int based on the conversion. | 04:40 | |
TimToady | yes, + can just make the most specific type it can, I suspect | ||
frooh | hurray! | ||
TimToady | even something to be said for Rat in some cases | 04:41 | |
pmichaud | agreed. | ||
frooh | what about Complex? | ||
or is that just going too far? | |||
;-) | |||
pmichaud | it's not too far, it's just too complex. :-) :-) | ||
TimToady | esp if the string is '355/113' | ||
well, if the string is 1+.2i, what're you gonna do, truncate it? | 04:42 | ||
pmichaud | where do we draw the line between numify and eval? ;-) | ||
TimToady | we guarantee to recognize radix numbers in strings too... | 04:43 | |
frooh | user defined types? | ||
pmichaud | yes. Somehow I see it as being "numify a term" as opposed to "numify an expression" | ||
TimToady | starting to sound like a longest-token problem | ||
parse this string with term:* and ... | 04:44 | ||
pmichaud | so far Rakudo's string-to-num converter follows the parsing for <number> | ||
TimToady | but can other types add term: rules, I wonder... | 04:45 | |
pmichaud | (which includes the radix numbers) | ||
TimToady | or maybe we need a number: category | ||
pmichaud | anyway, you've given me the short-term answer for prefix:<+>, so I'm good with that for now. | ||
TimToady | wouldn't be difficult to arrange | ||
pmichaud | number: might be very nice | ||
could be much cleaner for dealing with the complexes and rats | 04:46 | ||
rakudo: say +( ~ ( 3+.1i ) ); | |||
p6eval | rakudo c1f397: OUTPUT«3» | ||
pmichaud | rakudo: say ~(3+.1i) # just checking | 04:47 | |
p6eval | rakudo c1f397: OUTPUT«3+0.1i» | ||
pmichaud | might also help with parsing things like "Inf" and "NaN" | 04:48 | |
TimToady | indeed | ||
I love it when a plan comes together :) | |||
pmichaud | token number:NaN { <sym> >> } | 04:50 | |
token number:Inf { <sym> >> } | |||
helps to resolve the "Inf" versus "Info" issue, too. | |||
TimToady | assuming we require $ too | ||
pmichaud | rakudo: say 2 + (Inf)i; # just curious | 04:52 | |
p6eval | rakudo c1f397: OUTPUT«NaNInfi» | ||
TimToady | probably we want to short-circuit normal ints and nums, and only revert to parse on fancy stuff | ||
but that depends on the overhead of regex setup | 04:53 | ||
frooh | is the type for a function Sub? | ||
pmichaud | depends on the function :-) | ||
frooh | haha | ||
anonymous subroutine? | |||
TimToady | with or without the "sub"? | 04:54 | |
they're different | |||
frooh | good question.. | ||
I don't know... | |||
let's say without for now | |||
Block? | |||
TimToady | pugs: (sub {}).WHAT | ||
p6eval | pugs: RESULT«::Sub» | ||
TimToady | pugs: ({}).WHAT | ||
p6eval | pugs: RESULT«::Hash» | ||
frooh | haha | ||
TimToady | pugs: ({;}).WHAT | ||
p6eval | pugs: RESULT«::Block» | 04:55 | |
frooh | is there something that would work for both? | ||
TimToady | Code | ||
frooh | awesome | ||
that's what I would guess | |||
TimToady | rakudo: {;} ~~ Code | 04:56 | |
p6eval | rakudo c1f397: RESULT«1» | ||
TimToady | rakudo: sub {;} ~~ Code | ||
p6eval | rakudo c1f397: RESULT«1» | ||
pmichaud | rakudo: {} ~~ Code | ||
p6eval | rakudo c1f397: RESULT«0» | ||
pmichaud | ...although why that returns "0" and not "" or "False" is beyond me. | 04:57 | |
TimToady | because it's a Hash | ||
pmichaud | there's a lot of places where people keep using 0/1 instead of True/False | ||
TimToady | oh, wait | ||
pmichaud | (in the rakudo code base) | ||
TimToady | the value of False is 0 | ||
pmichaud | rakudo: 3 == 4 | 04:58 | |
TimToady | current spec only gets the name via .perl or .name | ||
p6eval | rakudo c1f397: RESULT«Bool::False» | ||
pmichaud | so, infix:<==> is returning "false" | ||
frooh | rakudo: my $foo = "{3==4}"; | ||
p6eval | rakudo c1f397: RESULT«"0"» | ||
pmichaud | I suspect that Code.ACCEPTS() in Rakudo is returning 0/1 | ||
I'll have to crack some more whips over those coders :-) | 04:59 | ||
but right now my wife is cracking a whip at me, so I best go. :-) | |||
frooh | pmichaud: thanks for the help on bug avoidance :-) | ||
TimToady | so we should probably generally only see 0 or 1 on output, unless it's .perled | 05:00 | |
last week it was stringifying to False, but I decided that was inconsistent with the native type behavior | 05:01 | ||
False should never turn into '' though | 05:02 | ||
that's a p5ism | |||
frooh is excited about perl6 | |||
is there a way to get the signature from a function? | |||
like, &sub.signature? | |||
TimToady | try it | 05:03 | |
05:03
nihiliad left
|
|||
frooh | rakudo: sub (Int $f, Code $b) { say $f }.signature | 05:03 | |
p6eval | rakudo c1f397: OUTPUT«Statement not terminated properly at line 1, near ".signature"current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
frooh | rakudo: sub (Int $f, Code $b) { say $f; }.signature | ||
p6eval | rakudo c1f397: OUTPUT«Statement not terminated properly at line 1, near ".signature"current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
frooh | rakudo: sub foo (Int $f, Code $b) { say $f; }.signature | ||
p6eval | rakudo c1f397: OUTPUT«Statement not terminated properly at line 1, near ".signature"current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
frooh | rakudo: sub foo (Int $f, Code $b) { say $f; }.sig | ||
p6eval | rakudo c1f397: OUTPUT«Statement not terminated properly at line 1, near ".sig"current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
frooh | no? | 05:04 | |
05:04
NoirSoldats joined
|
|||
TimToady | not sure rakudo returns a value from a named declaration | 05:04 | |
frooh | the first few were anon | ||
TimToady | rakudo: sub (Int $f, Code $b) { say $f; }.sig | ||
p6eval | rakudo c1f397: OUTPUT«Statement not terminated properly at line 1, near ".sig"current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
TimToady | rakudo: &push.signature | ||
p6eval | rakudo c1f397: OUTPUT«Null PMC access in find_method()current instr.: '_block14' pc 74 (EVAL_10:41)» | ||
TimToady | rakudo: &push.sig | 05:05 | |
p6eval | rakudo c1f397: OUTPUT«Null PMC access in find_method()current instr.: '_block14' pc 74 (EVAL_10:41)» | ||
TimToady | ah well | ||
frooh | ok | ||
TimToady | pugs: &push.sig | ||
p6eval | pugs: OUTPUT«*** No such method in class Sub: "&sig" at /tmp/SRL4Uz7B7t line 1, column 1 - line 2, column 1» | ||
frooh | so it doesn't work for now | ||
TimToady | pugs: &push.signature | ||
p6eval | pugs: RESULT«:($?1 is rw is ref, @?1 is copy)» | ||
TimToady | there you go | ||
frooh | but could I theoretically do this: | ||
sub (&foo.sig) {...} ? | |||
TimToady | no | 05:06 | |
frooh | er | ||
signature* | |||
TimToady | you can't eval expressions as parameters | ||
frooh | is there a way I could do that? | ||
because it would be cool | |||
TimToady | what are you expecting it to mean? | 05:07 | |
frooh | I want to make a function from another function that has the same signature | ||
I could of course use a slurpy thing, but that loses accuracy | |||
TimToady | what would be the use of that? | ||
frooh | to make a generalized cache closure thing... | 05:08 | |
frooh is going through Higher-Order Perl with perl6 | |||
TimToady | you can do smart matching on signatures | ||
frooh | although I guess with perl6 you could just do &foo.wrap | ||
TimToady | so there's probably a way to do it | ||
frooh | I'll just use a slurp for now since that works | 05:09 | |
05:18
tony_ is now known as FIRERILL
05:19
FIRERILL is now known as firedrillll
05:21
alester joined
05:25
bacek left
|
|||
frooh | will perl6 support prototype based OO? | 05:26 | |
skids | You mean multi-dispatch? | 05:29 | |
frooh | uhh | ||
no, like, classless OO | 05:30 | ||
sorry, I should have been more clear | |||
TimToady | yes, smop is proto-based | 05:32 | |
frooh | smop? | ||
super mega object prototypes? | |||
TimToady | the thing ruoso and pmurias have been working on for most of the last year | ||
Simple Matter Of Programming :) | 05:33 | ||
frooh | but regular class based OO is also supported right? | ||
TimToady | yes | 05:34 | |
frooh | can we use both at the same time? like make a class that inherits from a...smop object? | ||
TimToady | either can be modeled on the other | ||
frooh | awesome... | 05:35 | |
TimToady | all depends on how you set up the responder interfaces | ||
frooh | I don't know what that means exactly, but I am excited anyway? | ||
TimToady | this is all swept under the carpet of the object's .HOW metaobject | 05:36 | |
frooh | rakudo: my $f = 2; $f.HOW; | ||
TimToady | which decides how to be an object | ||
p6eval | rakudo c1f397: OUTPUT«get_bool() not implemented in class 'P6metaclass'current instr.: 'parrot;PCT;HLLCompiler;command_line' pc 1502 (src/PCT/HLLCompiler.pir:790)» | ||
TimToady | strange error, but you see it's in the metaclass | 05:37 | |
frooh | yeah | ||
rakudo: my @f = (1,2); @f.HOW; | |||
p6eval | rakudo c1f397: OUTPUT«get_bool() not implemented in class 'P6metaclass'current instr.: 'parrot;PCT;HLLCompiler;command_line' pc 1502 (src/PCT/HLLCompiler.pir:790)» | ||
frooh | eh, same, but still | ||
TimToady | rakudo: [].HOW.methods | 05:38 | |
p6eval | rakudo c1f397: OUTPUT«Could not locate a method 'methods' to invoke on class 'P6metaclass'.current instr.: 'die' pc 16347 (src/builtins/control.pir:204)» | ||
frooh | TimToady: I love how perl lets me do things that are crazy | 05:39 | |
thanks again | |||
and perl6 will be even better | |||
TimToady | we surely hope so | ||
alester | ok, I think rakudo.org is kinda looking decent. | 05:42 | |
frooh | alester: if you want any input I think the *'s next to username and password might be a little redundant | 05:43 | |
alester | frooh: That is waaaaaay far down on my list of things to think, but thank you. | 05:44 | |
frooh | alester: yeah, I don't blame you. | ||
alester | hey, the nav links only show up if I log in as admin | 05:45 | |
frooh | yeah, all I have is Recent posts | ||
skids | rakudo: sub foo ($a, *@@s) { $a.perl.say; @@s.perl.say; }; foo(1) <== 1,2,3; | 05:54 | |
p6eval | rakudo c1f397: OUTPUT«Unable to parse multisig; couldn't find final ')' at line 1, near "@s) { $a.p"current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
skids | pugs: sub foo ($a, *@@s) { $a.perl.say; @@s.perl.say; }; foo(1) <== 1,2,3; | ||
p6eval | pugs: OUTPUT«*** No compatible multi variant found: "&foo" at /tmp/zm9P4pVytW line 1, column 52-68» | ||
skids | Is that supposed to work eventually? Or does *@@slurp preclude other params? | 05:57 | |
alester | ok how about now frooh | 05:58 | |
frooh | nope | ||
hust Search and Recent Posts | 05:59 | ||
just* | |||
alester | nope what? | ||
what were you expecting? | |||
frooh | I figured you had more links | ||
sorry | |||
alester | you don't have blog posts in the right column? | ||
syndicate? | |||
search? | |||
frooh | oh, yeah, those are there | 06:00 | |
you said nav links before... | |||
so I thought you meant the Navigation panel on the left | |||
oh | |||
sorry | |||
yeah | |||
that's blank | |||
Syndicate has only an RSS icon | |||
Search is there | |||
alester | ok | ||
frooh | Recent blog posts is there | 06:01 | |
TimToady | std: sub foo ($a, *@@s) { $a.perl.say; @@s.perl.say; }; foo(1) <== 1,2,3; | 06:02 | |
p6eval | std 25634: OUTPUT«ok 00:02 35m» | ||
pugs_svn | r25635 | lwall++ | [STD] fix ruoso++'s little nested package bug | 06:17 | |
skids | std: multi sub foo ($a, *@s where { .elems > 1 }) {...} | 06:20 | |
p6eval | std 25635: OUTPUT«ok 00:02 34m» | ||
alester | wowI think I have found the theem I love | ||
TimToady | std: module Foo { our sub bar($arg) { say $arg; }; module Bla { our sub bar() { say "ok 1"; } } }; say "1..2"; Foo::Bla::bar(); Foo::bar("ok 2\n"); | 06:23 | |
p6eval | std 25635: OUTPUT«Undeclared names: Foo::Bla::bar used at 1  Foo::bar used at 1 ok 00:04 35m» | ||
TimToady becomes professional thumb twiddler | 06:24 | ||
06:25
alester left
06:27
mberends joined
|
|||
TimToady | std: module Foo { our sub bar($arg) { say $arg; }; module Bla { our sub bar() { say "ok 1"; } } }; say "1..2"; Foo::Bla::bar(); Foo::bar("ok 2\n"); | 06:28 | |
p6eval | std 25635: OUTPUT«Undeclared names: Foo::Bla::bar used at 1  Foo::bar used at 1 ok 00:04 35m» | ||
TimToady | I don't understand why std changes its revision number out of sync with clobbering lex... | 06:29 | |
std: module Foo { our sub bar($arg) { say $arg; }; module Bla { our sub bar() { say "ok 1"; } } }; say "1..2"; Foo::Bla::bar(); Foo::bar("ok 2\n"); | 06:31 | ||
p6eval | std 25635: OUTPUT«Undeclared names: Foo::Bla::bar used at 1  Foo::bar used at 1 ok 00:04 35m» | ||
TimToady | std: module Foo { our sub bar($arg) { say $arg; }; module Bla { our sub bar() { say "ok 1"; } } }; say "1..2"; Foo::Bla::bar(); Foo::bar("ok 2\n"); | 06:36 | |
p6eval | std 25635: OUTPUT«Undeclared names: Foo::Bla::bar used at 1  Foo::bar used at 1 ok 00:06 39m» | ||
06:50
Maghnus_ joined
06:54
bacek joined
|
|||
TimToady | std: module Foo { our sub bar($arg) { say $arg; }; module Bla { our sub bar() { say "ok 1"; } } }; say "1..2"; Foo::Bla::bar(); Foo::bar("ok 2\n"); | 06:56 | |
p6eval | std 25635: OUTPUT«ok 00:04 35m» | ||
TimToady | 'bout time... | ||
07:02
abra joined
07:07
Maghnus left,
Maghnus_ is now known as Maghnus
|
|||
mberends | TimToady: and what changed? clobbered lex without bumping std revision? | 07:08 | |
lambdabot | mberends: You have 1 new message. '/msg lambdabot @messages' to read it. | ||
07:18
aindilis` left
07:20
szabgab left,
mikehh left,
mikehh joined
07:22
kanru joined
|
|||
mberends | @tell masak your further changes to the proto script look very good - I am very pleased with the result | 07:24 | |
lambdabot | Consider it noted. | ||
TimToady | I imagine some cron job woke up and rm'd lex/ | 07:25 | |
mberends | :) | ||
dalek | kudo: 9e24621 | (Stephen Weeks)++ | src/parser/actions.pm: Fix exception handlers to not catch control exceptions. |
07:38 | |
pugs_svn | r25636 | lwall++ | [STD] added number category so we can use <number> for prefix:<+> extensibility | 07:50 | |
TimToady | @tell ruoso addition of number category to STD may or may not break mildew | 07:51 | |
lambdabot | Consider it noted. | ||
TimToady | @tell pmurias addition of number category to STD may or may not break mildew | 07:52 | |
lambdabot | Consider it noted. | ||
08:11
firedrillll left
08:16
justatheory left
08:27
DemoFreak joined
08:35
masak joined
|
|||
mberends | masak: a very fine morning to you | 08:35 | |
masak | mberends: and an excellent on to you, sir. | ||
lambdabot | masak: You have 1 new message. '/msg lambdabot @messages' to read it. | ||
masak | @massage | ||
lambdabot | mberends said 1h 11m 44s ago: your further changes to the proto script look very good - I am very pleased with the result | ||
mberends | masak++ | 08:36 | |
masak | mberends: but wait -- there's more. | ||
mberends | ooh | ||
masak | I have hacked up a configuration-file thing. | ||
not quite ready yet, but give me 5-10 minutes, and I'll push it. | |||
I was offline when I wrote it, so I need to test it first. | |||
mberends | ok | 08:37 | |
masak digs in | |||
heh, there ought to be a way to identify 'checkpoints' in all the massive output we're suppressing, and turn those into little dots of progress in the proto output. :) | 08:56 | ||
that sounds too good not to attempt. | |||
...later. | |||
mberends likes dotty progress bars | 08:57 | ||
08:58
szabgab joined
|
|||
masak | and we'll take the chance to vertically align the 'completed' messages. | 08:58 | |
pretty++ | |||
mberends | not only pretty, problems will stand out visibly | 09:00 | |
masak | how so? | 09:01 | |
masak gets a build failure when removing the 'rakudo dir' conf pair from the config file | 09:03 | ||
hm. | |||
mberends | generally, if verbose output is scrappy, we do not read it closely, but if it is tidy, the unexpected attracts the eye. a bit like the rationale for consistent source code indentation. | ||
09:03
c9s_ joined,
c9s left
|
|||
mberends | RAKUDO_DIR points to the Test.pm file | 09:03 | |
masak | mberends: ah. but the only info you get from the dots is how quickly each step is going, not what the steps are. | ||
09:04
c9s_ left
|
|||
masak | mberends: that did not compute. :) | 09:04 | |
mberends: oh, well. I'll push what I have, since it works in the default case. | |||
09:04
c9s joined
|
|||
masak | and then I'll fix the problem I just found. | 09:04 | |
mberends | ok. I'll pull that before spending most of the day offline | 09:05 | |
masak | pushed. | 09:06 | |
please deconnect your $PARROT_DIR and try it. | |||
mberends | sorry, that RAKUDO_DIR remark concerned Configure and Makefile. pulled. | 09:09 | |
masak | I sure hope it works for you. I find the new setup very nice to work with. | 09:10 | |
things are a bit inconsistent in 'proto' and 'installer', however. | |||
consider it 'release early'. | |||
mberends must get YAML::Syck, not a desirable dependency for a bootstrapper. isn't the required functionality simple enough to inline in proto? | 09:12 | ||
masak | I'm of two minds about that. | ||
one the one hand, I agree fully about the dep. | |||
no deps at all would be swell. | 09:13 | ||
on the other hand, I don't think we should be reinventing configuration formats. | |||
or attempting our own YAML parsing. | |||
09:13
lisppaste3 left
|
|||
mberends is up for the challenge of YAML parsing (lite) | 09:14 | ||
masak | mberends: give it a go then. | 09:15 | |
maybe we should aim for a very limited subset of it. | |||
right now we're only serializing a hash, after all. | |||
mberends | agreed, will do during offline time | ||
masak | excellent. | 09:16 | |
please take into account all kinds of escaping that might occur. | |||
colons, newlines, quotes, possibly other things. | |||
mberends | right. but we mainly have to read just what we previously wrote. | 09:17 | |
masak | aye. | ||
still, we don't want to be caught misparsing correct YAML. | 09:18 | ||
better to throw an error on things we recognize but explicitly don't handle. | |||
mberends | aye | ||
masak tries to install Parrot-inside-Rakudo | 09:25 | ||
09:29
abra left
09:33
duke_leto joined
09:35
mikehh left
|
|||
mberends | parrot-inside-rakudo works well for me, and jnthn++ and pmichaud++ seem to have nailed the double-free bug in the fake executable too | 09:37 | |
masak | aye. | 09:38 | |
'faktecutable' should probably be a setting value too. | 09:39 | ||
perhaps even the default. | |||
mberends | masak: an important question similar to one I asked eric256 several months ago: do you approve of proto/projects/lib and proto/projects/bin directories, to act as unification nodes for diverse projects? I would deeply appreciate a 'yes'. | 09:40 | |
masak | I've fixed the 'Rakudo dir not defined' issue, so if the Rakudo dir is not set, it now sets it and re-saves the config file. I'll push in a minute. | ||
mberends: unh. | 09:41 | ||
mberends: so you're talking about copying stuff out of their native git directories? | |||
mberends | yes. each project's Makefile.in says what to copy in the 'install' target | 09:42 | |
masak | at present, I'm very reluctant to such an idea. | ||
mberends | ok | 09:43 | |
masak | proto's goal, in my eyes, is to keep the stricture of the projects, while still alleviating much of the pain of having many lib/ dirs | ||
basically, your PERL6LIB changes around a lot when you install new Perl 6 projects, but proto keeps the tabs and tells you what to set it to. | 09:45 | ||
mberends | the PERL6LIB growth and maintenance is what I don't like | 09:46 | |
masak | that's what proto'll take care of for you. | ||
but szabgab has expressed similar misgivings, so I'm not all made up on this point. | 09:47 | ||
by the way, one reason I added the config.proto and the 'Proto projects directory' setting, is so that I'll go dogfooding very soon. | |||
I'll also want the 'update' subcommand, so I'll have a one-stop way to update all my installed Perl 6 projects. :) | 09:48 | ||
mberends | and even update rakudo | ||
masak | mberends: yes, but remember that the default will be 'released rakudo' | 09:49 | |
hm, I'll add that setting too. | |||
...which means that we'll leave git as our primary way to get Rakudo. | |||
mberends | there is lots of recent debate about what 'release' etc means. To me, it has to mean 'not broken according to *all* testing' | 09:50 | |
masak | aye. | ||
that's what we want. | |||
and if it;s proto's default, hopefully Perl 6 projects will have to align to that default. :) | 09:51 | ||
specifically November, which uses many bleeding-edge features. | |||
mberends | I like the fact that the debate is beginning to look at expanding testing to beyond the spectests into some modules or projects. Some of our stuff would be good candidates. | 09:52 | |
masak | indeed. | ||
I know pmichaud and others have (at times) been wary not to break November when doing great merges. | |||
09:53
protorom joined
|
|||
masak | that has helped a lot, I believe. | 09:53 | |
at least that's the impression I get from the few occasion where such care has not been taken. :P | |||
mberends | we shall need 100+ november scale test cases eventually | ||
masak | November has a fair amount of tests. | ||
mberends plans to expand Pod::Parser and its tests soon | 09:54 | ||
masak | but the fact of the matter is, that as deficiencies in the spectest suite are discovered through November, they usually get assimilated into the spectest suite. | ||
masak will keep expanding SVG though TDD | |||
mberends | pmichaud wants spectest to remain as concise (and fast) as possible, but seemed interested in broader testing. When announcing Perl 6, TimToady said CPAN would be the ultimate test suite ;) | 09:57 | |
masak | mberends: one thing I'm lacking in the config.proto file right now is comments. I'd like to at least be able to give the allowed values for ever setting. so I think custom generation of the config.proto file is a good idea. | ||
mberends | yes. good feature. | 09:58 | |
masak adds the settings 'Parrot revision', 'Rakudo revision' (both with possible values 'bleeding' and 'release'), 'Test when building', and 'Test failure policy' | 10:00 | ||
10:00
mikehh joined
|
|||
masak | currently the defaults are 'bleeding', 'bleeding', 'no', and 'die', respectively. | 10:00 | |
but the first two should eventually be 'release, and 'release'. | 10:01 | ||
hm, config.proto file versioning -- good idea or bad? | 10:02 | ||
maybe duck typing is enough? :) | |||
masak tentatively goes with date versioning | |||
ISO 8601. | 10:03 | ||
please stop me if I'm overdesigning. | |||
10:03
szabgab left
10:04
ejs joined
|
|||
mberends goes with dates too, assuming ISO 8601 means YMD ordering | 10:04 | ||
masak | 2009-02-28. | 10:05 | |
mberends | my favo[u]rite! | ||
masak | :) | ||
YAML::Syck ASCII sorts the keys of the serialized hash. | 10:06 | ||
I'm not sure if I like that. | |||
would be nicer if they came in insertion order, methinks. | |||
10:06
szabgab joined
|
|||
protorom | hi guys, just trying to install parrot-0.9.0 on OS-X and Configure.pl seems to be failing - no parrot_config gets produced :-( | 10:06 | |
during the tests I get the error: dyld: lazy symbol binding failed: Symbol not found: _rl_get_keymap | 10:07 | ||
masak | protorom: could you nopaste the output you're seeing? | ||
protorom | nopaste? | ||
masak | sial.org/pbot/perl6 | ||
:) | |||
see above URL. | 10:08 | ||
mberends | Some hashes do preserve order, despite being hashes. We can probably use arrays and grep/map them instead. | ||
protorom | coming up... | ||
masak | mberends: aye, as long as it's easy to add settings when constructing the $config_info variable, I'm fine with it. | 10:09 | |
protorom | heres the output: sial.org/pbot/35283 | ||
szabgab | masak, and he is using the released tarball | 10:10 | |
masak | szabgab: aye. | ||
protorom: I'm on OS X too. I'll try the tarball and see if I get the same. | 10:11 | ||
I think it has worked before, here. | |||
masak needs to go soon | |||
szabgab | masak, I am getting him to download the svn | ||
protorom | that was the tarball :-( I'm just checking out the svn repo now | ||
masak | goodie. | 10:12 | |
but the tarball should work, too. | |||
mberends | masak: I need to go soon too. Can you send out a draft config.proto file? | 10:13 | |
masak | just a minute. | 10:15 | |
pushed. | 10:16 | ||
it's all yours. | |||
mberends: during the day, I might sketch out an 'update' subcommand, if that's ok. | 10:17 | ||
I'll be mostly mucking around in 'installer'. | |||
(and in a branch) | |||
mberends | very ok. pulled. hopefully see you later | 10:18 | |
masak | not today, I fear. | ||
but very possibly tomorrow. | |||
mberends | ok | 10:19 | |
masak | thanks for great work on proto so far -- and see you tomorrow. | ||
protorom | masak: still getting the same problem. do you know which version worked for you? | ||
masak | protorom: the tarball, several times, I think. | ||
10:19
mberends left
|
|||
masak | protorom: now might be a good time to file a Parrot Trac ticket. | 10:20 | |
protorom: or to ask on #parrot on irc.perl.org | |||
masak waves | |||
10:20
masak left
|
|||
protorom | ok - thanks | 10:21 | |
szabgab | rakudo: my %h = ("a" => 2, "b" => 1); for %h.kv -> $k, $v { say "$k, $v" } | 10:26 | |
p6eval | rakudo 9e2462: OUTPUT«a, 2b, 1» | ||
szabgab | rakudo: my %h = ("a" => 2, "b" => 1); for %h.kv.sort(:by keys) -> $k, $v { say "$k, $v" } | 10:27 | |
p6eval | rakudo 9e2462: OUTPUT«Statement not terminated properly at line 1, near "(:by keys)"current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
szabgab | how do I sort that ? | ||
wayland76 | rakudo: my %h = ("a" => 2, "b" => 1); for %h.kv.sort :by keys -> $k, $v { say "$k, $v" } | 10:31 | |
p6eval | rakudo 9e2462: OUTPUT«Statement not terminated properly at line 1, near ":by keys -"current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
wayland76 | rakudo: my %h = ("a" => 2, "b" => 1); for %h.kv.sort -> $k, $v { say "$k, $v" } | 10:34 | |
p6eval | rakudo 9e2462: OUTPUT«a, b1, 2» | ||
wayland76 | rakudo: my %h = ("a" => 2, "b" => 1); for %h.kv.sort { $b <=> $a } -> $k, $v { say "$k, $v" } | ||
p6eval | rakudo 9e2462: OUTPUT«Statement not terminated properly at line 1, near "-> $k, $v "current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
wayland76 | rakudo: my %h = ("a" => 2, "b" => 1); for %h.kv.sort({ $b <=> $a }) -> $k, $v { say "$k, $v" } | 10:35 | |
p6eval | rakudo 9e2462: OUTPUT«Scope not found for PAST::Var '$b' in current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:102)» | ||
wayland76 | rakudo: my %h = ("a" => 2, "b" => 1); for %h.kv.sort({ $^b <=> $^a }) -> $k, $v { say "$k, $v" } | ||
p6eval | rakudo 9e2462: OUTPUT«2, 1a, b» | ||
wayland76 | rakudo: my %h = ("a" => 2, "b" => 1); for %h.kv.sort({ $^b.key <=> $^a.key }) -> $k, $v { say "$k, $v" } | 10:38 | |
p6eval | rakudo 9e2462: OUTPUT«Method 'key' not found for invocant of class 'Str'current instr.: 'parrot;P6metaclass;dispatch' pc 320 (src/classes/ClassHOW.pir:161)» | ||
szabgab | wayland76, thanks | ||
wayland76 | But I haven't answered the question yet :) | ||
10:39
duke_leto left
|
|||
szabgab | oh you have an answer :-) | 10:39 | |
cool | |||
wayland76 | I don't have one yet, but I'm getting closer :) | ||
szabgab | great | ||
10:40
pmurias joined
|
|||
wayland76 | rakudo: my %h = ("a" => 2, "b" => 1); for %h.p.sort({ $^b.key <=> $^a.key }) -> $k, $v { say "$k, $v" } | 10:41 | |
p6eval | rakudo 9e2462: OUTPUT«Method 'p' not found for invocant of class 'Perl6Hash'current instr.: 'parrot;P6metaclass;dispatch' pc 320 (src/classes/ClassHOW.pir:161)» | ||
wayland76 | rakudo: my %h = ("a" => 2, "b" => 1); for %h.pairs.sort({ $^b.key <=> $^a.key }) -> $k, $v { say "$k, $v" } | ||
p6eval | rakudo 9e2462: OUTPUT«a 2, b 1» | ||
wayland76 | rakudo: my %h = ("a" => 2, "b" => 1); for %h.pairs.sort({ $^b.key cmp $^a.key }) -> $k, $v { say "$k, $v" } | ||
p6eval | rakudo 9e2462: OUTPUT«b 1, a 2» | ||
wayland76 | Ok, that's the answer | 10:42 | |
Does that work for you? | |||
pmurias | TimToady: "echo 123 > file;perl viv file" prints --- '123' and it doesn't work for other simple programs too | 10:43 | |
lambdabot | pmurias: You have 1 new message. '/msg lambdabot @messages' to read it. | ||
wayland76 | rakudo: my %h = ("a" => 2, "b" => 1); for %h.pairs.sort({ $^b.value cmp $^a.value }) -> $k, $v { say "$k, $v" } | ||
p6eval | rakudo 9e2462: OUTPUT«a 2, b 1» | ||
wayland76 | rakudo: my %h = ("a" => 2, "b" => 1); for %h.pairs.sort({ .key }) -> $k, $v { say "$k, $v" } | ||
p6eval | rakudo 9e2462: OUTPUT«a 2, b 1» | ||
wayland76 | rakudo: my %h = ("a" => 2, "b" => 1); for %h.pairs.sort({ .value }) -> $k, $v { say "$k, $v" } | ||
p6eval | rakudo 9e2462: OUTPUT«b 1, a 2» | ||
wayland76 | Cool :) | ||
szabgab: That might be a shorter answer :) | 10:44 | ||
szabgab | wayland76++ | 10:45 | |
will it be wayland77 now ? | |||
wayland76 | Well, that would mean that I was younger, and that could be useful :) | ||
After all, youth is wasted on the young :) | 10:46 | ||
(I was born in '76) | |||
rakudo: my %h = ("a" => 2, "b" => 1); for %h.sort({ .key }) -> $k, $v { say "$k, $v" } | |||
p6eval | rakudo 9e2462: OUTPUT«a 2, b 1» | ||
wayland76 | rakudo: my %h = ("a" => 2, "b" => 1); for %h.sort({ .value }) -> $k, $v { say "$k, $v" } | 10:47 | |
p6eval | rakudo 9e2462: OUTPUT«b 1, a 2» | ||
wayland76 | ...and shorter :) | ||
10:47
misfotto joined
|
|||
wayland76 | szabgab: Btw, I have the specs on my computer, and I searched them with ack (which is grep but better), and first I searched for "sort", and read that section | 10:48 | |
...and then I searched for .kv, and read the bits in S02. Of course, I already knew I wanted to ensure I was getting 2 Pairs instead of 4 Scalars, so that helped :) | 10:50 | ||
Anyway, I have work to do. & | |||
10:56
misfotto left,
kidd joined
|
|||
kidd | hi guys. I'm trying to do my first perl6 scripts, and I can't find a way to execute external processes with system nor ``. I haven't found any docs about that. Pointers to documentation are really welcome | 11:11 | |
11:16
pmurias left
|
|||
wayland76 | perlcabal.org/syn/ | 11:26 | |
That link documents how Perl6 is *supposed* to work | |||
That way the guys writing code know what to write | |||
It seems to imply that `` works as always | 11:27 | ||
and that an alternative could be qqx/$cmd $arg1/ | |||
Or, if you don't want interpolation, qx{cmd arg} | 11:28 | ||
kidd | oh, then I must be doing something wrong... I'll keep reading. thanks for the pointers wayland76 | ||
wayland76 | The relevant document is the one called S02 | ||
szabgab | kidd, go over this szabgab.com/perl6.html and let me anything that is not clear | ||
let me "know" ... | |||
wayland76 | Which you get to from the "Synopsis" link next to "2 Bits and Pieces" | ||
I hate it when I a word out :) | 11:29 | ||
11:29
protorom left
|
|||
wayland76 | rakudo: print `echo hi` | 11:29 | |
p6eval | rakudo 9e2462: OUTPUT«print requires an argument at line 1, near " `echo hi`"current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
wayland76 | rakudo: print qx/echo hi/ | 11:30 | |
p6eval | rakudo 9e2462: OUTPUT«Statement not terminated properly at line 1, near "/"current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
wayland76 | rakudo: print qx/echo hi/; | ||
p6eval | rakudo 9e2462: OUTPUT«Statement not terminated properly at line 1, near "/;"current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
wayland76 | rakudo: print qx"echo hi"; | ||
p6eval | rakudo 9e2462: OUTPUT«Statement not terminated properly at line 1, near "\"echo hi\";"current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
wayland76 | rakudo: print qq"echo hi"; | ||
p6eval | rakudo 9e2462: OUTPUT«echo hi» | ||
wayland76 | Well, I guess the sandboxing must work :) | 11:31 | |
Anyway, bedtime for me & | |||
kidd | gnight | ||
bacek | @tell pmichaud I've made single version of REDUCEMETAOP. github.com/bacek/rakudo/blob/84c89c...assign.pir But I don't like it... It's too complex | 11:34 | |
lambdabot | Consider it noted. | ||
bacek | @tell pmichaud and chained version is not short-circuiting anymore... | 11:37 | |
lambdabot | Consider it noted. | ||
11:37
szabgab left
11:40
rindolf joined
11:55
hercynium joined
11:57
AzureStone left
12:09
AzureStone joined
12:13
rindolf left
12:14
ejs left
12:28
meppl joined
12:41
c9s left,
c9s joined
12:53
riffraff joined
13:36
rindolf joined
14:03
ZuLuuuuuu joined
14:08
ZuLuuuuuu left
14:10
Whiteknight joined,
aindilis joined
14:34
jan_ left
14:35
jan_ joined
14:52
hercynium left
14:58
brunoV joined
15:04
pmurias joined
15:08
jhorwitz joined
15:11
rindolf left
15:24
kanru left
15:35
kanru joined
15:37
kidd left
15:40
rindolf joined
15:43
kanru2 joined
15:55
cibs joined
16:00
hercynium joined
16:08
kanru left
16:11
Ariens_Hyperion joined
16:13
SamB left
16:16
abra joined
16:17
SamB joined
16:22
Kimtaro joined
16:28
nihiliad joined
|
|||
dalek | kudo: 57a0cf4 | pmichaud++ | docs/spectest-progress.csv: spectest-progress.csv update: 315 files, 7084 passing, 0 failing |
16:35 | |
kudo: f7a7bf4 | pmichaud++ | tools/test_summary.pl: We no longer need the "[rakudo]:" part of the commit message. |
|||
16:40
justatheory joined,
Kimtaro_ joined,
Whiteknight left
16:41
Kimtaro_ left
16:42
aindilis` joined
16:53
riffraff left
16:56
aindilis left
16:58
Kimtaro left
17:03
Tene_ joined
17:05
duke_leto joined
17:07
duke_leto left
17:13
rindolf left
17:16
Tene left
|
|||
pugs_svn | r25637 | putter++ | [elfparse] Sketch in more ratcheting (subrules). | 17:21 | |
17:26
mikehh left
17:29
pmurias left
17:38
meppl left
17:42
justatheory left
17:51
cognominal left
17:53
meppl joined
17:56
Kimtaro joined,
simcop2387 left
17:58
cognominal joined
18:05
mikehh joined
18:08
protorom joined
18:14
simcop2387 joined
18:15
Southen_ joined
18:20
Psyche^ joined
|
|||
protorom | rakudo: help | 18:20 | |
p6eval | rakudo f7a7bf: OUTPUT«Could not find non-existent sub helpcurrent instr.: '_block14' pc 53 (EVAL_16:38)» | ||
18:22
rindolf joined
18:30
Patterner left,
Psyche^ is now known as Patterner
18:32
rindolf left
18:33
Southen left
18:45
abra left
18:49
protorom_ joined,
rindolf joined
19:07
protorom left
19:12
mberends joined
19:14
mberends left,
mberends joined,
mberends_ joined,
mberends_ left,
mberends left
19:28
protorom_ left
|
|||
dalek | kudo: d4c266b | pmichaud++ | src/parser/actions.pm: Revert "Fix exception handlers to not catch control exceptions." which was causing numerous spectests to fail. |
19:47 | |
19:49
protorom joined
19:50
aindilis` left
|
|||
skids | point of confusion -- when we get %h{...}:exists, will we still have %h.exists(...)? | 19:50 | |
pmichaud | I think the .exists(...) form goes away. | ||
lambdabot | pmichaud: You have 3 new messages. '/msg lambdabot @messages' to read them. | ||
skids | I'm looking for a definite answer, since that might have been people overinterpreting the demise of sub exists/exists(%h{...}). | 19:52 | |
pmichaud | neither ".exists" nor ".delete" appear in the synopses. | 19:53 | |
nor is there any mention of a subcall form. To me, that'd be pretty good evidence that it's only :exists and :delete. | 19:54 | ||
skids | Where is the notation of "method :name" documented? | 19:55 | |
pmichaud | I think that's pseudo-notation. | ||
skids | Ahh, ahh, aHH no pseudo-notation allowed :-) | 19:56 | |
pmichaud | i.e., I think that's a bit more made-up, unless it's meant to be a longname form somehow. | ||
I haven't been following the syntactic details on that very closely. | |||
otoh, .exists does appear in the spectests | 19:57 | ||
so.... I dunno. | |||
pmichaud checks the svn revision history. | |||
skids | Yeah my personal hypothesis until I find a definitive source is that the idea that .exists and .delete are going away as methods is a snowballing rumor. | 19:58 | |
pmichaud | argggh, I can't seem to review the log that far back. | 19:59 | |
the message at groups.google.com/group/perl.perl6....d89f7115f1 says | 20:03 | ||
Note also that existence and deletion are now simply adverbs on subscript | |||
operators. | |||
20:04
pmurias joined
|
|||
pmichaud | and S12 used to have a "%hash.:exists{...}" form, which is now gone. | 20:04 | |
(as shown in that same message) | 20:05 | ||
so, I'm pretty sure the method forms are no more -- they're just adverbs on subscripts. | 20:07 | ||
skids | Well, that explains where the idea of "method :name" might have come from. | ||
pmichaud | one thing that does concern me about S29/S32 is that they still show .grep, .join, etc as being methods on List and not Any | 20:08 | |
skids | To me that seems maybe reading a bit too much into it (and besides, when we implement something like them will be needed at least internal to the class, because we don't want a flag switch run every time in postcircumfix:<{ }>. | ||
pmichaud | flag switch? That's what mmd is for. | 20:09 | |
skids | The only reason to ditch the method form IMO would be if there's no way to elegantly reconcile .delete(), .delete, and zen slices. | ||
Sorry I was mentally bactracking :-) | 20:12 | ||
pmichaud | anyway, a message to p6l is probably in order then. | 20:16 | |
skids | I'm not subbed there, I just can't handle mls these days. | 20:17 | |
20:21
mikehh left
20:23
pmurias left
|
|||
skids | By the way since you're around -- is there supposed to be a way to add multis on top of stuff that's written in PIR yet? Doing so naively didn't work for me. | 20:24 | |
20:24
protorom left
|
|||
pmichaud | there's not a way to do that yet, no. | 20:26 | |
it's one of the reasons where moving things from PIR into settings/ | |||
s/where/we're/ | |||
skids | In that case, maybe an example of a q:PIR in settings by someone who really knows what they are doing might help encourage things. | 20:27 | |
pmichaud | sure -- I just haven't had a chance to write that yet. I spent most of the week working on getting our first release out. | ||
skids | s/settings/setting/ | ||
pmichaud | (our first non-Parrot release, that is.) | ||
skids | :-) I know we take and take and take... :-) | ||
20:30
viklund joined
20:32
justatheory joined
|
|||
skids | Speaking of MMD, I was looking into what future multidim stuff might look like to optimize common cases and having a few convenience methods for where {...} might make things less ugly. like .dims instead of .shape.elems which might do too much math, and something that quickly checks whether all slices are .elems == 1 to pick out single value accesses. I guess that's far down the road though. | 20:42 | |
20:45
mikehh joined
|
|||
diakopter | hm, ./viv doesn't seem to work the same as it once did | 20:48 | |
pmichaud | std: if(3) { say 'hello'; } | 20:50 | |
p6eval | std 25637: OUTPUT«############# PARSE FAILED #############if() interpreted as function call at line 1 ; please use whitespace instead of parensUnexpected block in infix position (two terms in a row) at /tmp/eUeZz8RwQD line 1:------> if(3) { say 'hello'; } expecting any of: | ||
..in... | |||
diakopter | if (3) { say 'hello' } | 20:51 | |
std: if (3) { say 'hello' } | |||
p6eval | std 25637: OUTPUT«ok 00:02 34m» | ||
diakopter | ./viv doesn't give an ast anymore ? | ||
20:52
protorom joined
20:53
PZt left
|
|||
diakopter | std: sub if($a) { $a }; if (3) { say if(3) }; | 21:03 | |
p6eval | std 25637: OUTPUT«ok 00:02 36m» | ||
pmichaud | std: say 'hello' if(3); | 21:07 | |
p6eval | std 25637: OUTPUT«############# PARSE FAILED #############Syntax error (two terms in a row?) at /tmp/6pLyiRgJ2t line 1:------> say 'hello' if(3); expecting nofunFAILED 00:02 34m» | ||
diakopter | TimToady: around? I removed ->item from line 67 of viv and it spits out the ast again, although it doesn't read from stdin | 21:16 | |
21:21
Whiteknight joined
21:27
brunoV left
|
|||
dalek | kudo: 0bb4da5 | pmichaud++ | src/parser/grammar.pg: Slight STD convergence -- switch "rule statement" to "token statement" |
21:30 | |
kudo: dd9b61c | pmichaud++ | src/parser/grammar.pg: Some more parsing fixes. * change some {{-tests to use <?{{...}}> instead. |
|||
21:32
rindolf left
21:40
wayland76 left
21:44
SamB left
21:46
protorom left,
SamB joined
|
|||
skids | rakudo: multi sub f (%h where { .{'a'} == 1 }) { say "OH HAI" }; multi sub f (%h where { .{'a'} != 1 }) { say "O NOES" }; my %c = <a 1 b 2>; f(%c); | 21:57 | |
p6eval | rakudo dd9b61: OUTPUT«Method 'postcircumfix:{ }' not found for invocant of class 'Str'current instr.: 'postcircumfix:{ }' pc 3797 (src/classes/Associative.pir:77)» | ||
pmichaud | that's kinda weird. | 21:59 | |
skids | rakudo: multi sub f (%h where { %^j{'a'} == 1 }) { say "OH HAI" }; multi sub f (%h where { %^j{'a'} != 1 }) { say "O NOES" }; my %c = <a 1 b 2>; f(%c); | ||
p6eval | rakudo dd9b61: OUTPUT«Non-Associative argument for %j in call to _block30current instr.: 'die' pc 16347 (src/builtins/control.pir:204)» | ||
pmichaud | rakudo: multi sub f (%h where { .PARROT.say }) { say "OH HAI" }; my %c = <a 1 b 2>; f(%c); | 22:00 | |
p6eval | rakudo dd9b61: OUTPUT«OH HAI» | ||
skids | Actually the first one differs from what I get at the cl. | ||
pmichaud | rakudo: multi sub f (%h where { .PARROT.say }) { say "OH HAI" }; my %c = <a 1 b 2>; %c.PARROT.say; f(%c); | ||
p6eval | rakudo dd9b61: OUTPUT«Perl6HashOH HAI» | ||
pmichaud | rakudo: multi sub f (%h is rw where { .PARROT.say }) { say "OH HAI" }; my %c = <a 1 b 2>; %c.PARROT.say; f(%c); | 22:01 | |
p6eval | rakudo dd9b61: OUTPUT«Perl6HashOH HAI» | ||
skids | There I get "Could not find non-existent sub a" when using .{} | ||
pmichaud | rakudo: multi sub f (%h is rw where { .PARROT.say }) { say %h.perl }; my %c = <a 1 b 2>; f(%c); | ||
p6eval | rakudo dd9b61: OUTPUT«{"a" => "1", "b" => "2"}» | ||
pmichaud | rakudo: multi sub f (%h where { .PARROT.say }) { say %h.PARROT }; my %c = <a 1 b 2>; f(%c); | ||
p6eval | rakudo dd9b61: OUTPUT«ObjectRef->Perl6Hash» | ||
pmichaud | I suspect a problem with the where invocation. | 22:02 | |
rakudo: multi sub f (%h where { +$_ == 2 }) { say %h.PARROT }; my %c = <a 1 b 2>; f(%c); | |||
p6eval | rakudo dd9b61: OUTPUT«ObjectRef->Perl6Hash» | ||
pmichaud | rakudo: multi sub f (%h where { +$_ == 3 }) { say %h.PARROT }; my %c = <a 1 b 2>; f(%c); | ||
p6eval | rakudo dd9b61: OUTPUT«ObjectRef->Perl6Hash» | ||
pmichaud | yes, the where clause looks like it's having trouble there. | 22:03 | |
22:06
szabgab joined
22:23
eternaleye joined
|
|||
pmichaud | std: sub f() { say 'foo' } if; | 22:25 | |
p6eval | std 25637: OUTPUT«Undeclared routine: if used at 1 ok 00:02 34m» | ||
pmichaud | std: sub f() { say 'foo' } if | 22:26 | |
p6eval | std 25637: OUTPUT«Undeclared routine: if used at 1 ok 00:02 34m» | ||
22:26
jhorwitz left
|
|||
skids | So what is the class that is "something that is not a List" for MMD-on-return-value purposes? | 22:29 | |
22:43
viklund left,
ZuLuuuuuu joined
23:01
aindilis joined
23:09
aindilis left,
aindilis joined
|
|||
skids kinda wonders what's up with Hash::reverse, both in the Synopsis and as it has been copied there, the setting. | 23:14 | ||
I could understand gather for %hash.kv -> $k, $v { take $v, $k; } for use to reverse hash explosions in List::reverse but... | 23:16 | ||
with the value to key aliasing if someone wants that it shouldn't be called reverse | 23:17 | ||
s/that/the thing that is now implemented/ | |||
dalek | kudo: 36314e0 | pmichaud++ | src/parser/grammar.pg: Refactor check for curly brace statement terminator. |
23:18 | |
kudo: 1e22a68 | pmichaud++ | src/parser/grammar.pg: Fix RT #57876 -- if/while/unless/for/etc on line following closing brace |
|||
pmichaud | skids: I think that .reverse needs a substantial re-think. | 23:34 | |
I commented on this last year -- just a sec. | |||
groups.google.com/group/perl.perl6....8c5d9509fd | 23:36 | ||
skids | Well, whatever is done in that respect, surely what we have now is dead wrong. | 23:41 | |
rakudo: my %f = <a 2 b 2 c 3>; %f.reverse.say | 23:42 | ||
p6eval | rakudo 1e22a6: OUTPUT«2 b3 c» | ||
23:49
ZuLuuuuuu left
|
|||
skids | Yeah looking at this, hashes explode to pairs, in no particular order, unless fully flattened. Since they have no guaranteed order between calls, reversing them makes no sense. And you have sort.reverse using List's reverse if you really need it. So Hash should not export reverse. | 23:53 | |
Though it might be nice to have a less-computationally-intense-than-sort method that keeps order intact between modifications of the underlying data. | 23:54 | ||
That is, so long as it isn;t modified. | |||
pmichaud | there might be some discussion about that in S09. | 23:55 | |
I could potentially see method reverse() { self.kv.reverse; } | 23:56 | ||
so that %hash.reverse doesn't end up being the same as @(%hash).reverse | 23:57 |