»ö« | perl6-projects.org/ | nopaste: sial.org/pbot/perl6 | evalbot: 'perl6: say 3;' | irclog: irc.pugscode.org/ | UTF-8 is your friend! Set by Tene on 14 May 2009. |
|||
00:01
ruoso joined
00:28
frew|work joined,
frew|work is now known as frioux
00:47
bacek joined
00:52
FurnaceBoy left,
payload left,
payload joined
01:08
JDlugosz joined
|
|||
JDlugosz | anybody around? | 01:09 | |
01:12
alester joined
|
|||
ruoso | JDlugosz, I just replied your mail | 01:15 | |
JDlugosz | Thanks, I just saw it arrive. (pass by reference) | 01:16 | |
ruoso | JDlugosz, was it helpful? | 01:20 | |
01:20
ihrd joined
|
|||
JDlugosz | not looked yet... in the middle of a paragraph. | 01:21 | |
Writing is actually a difficult job. | |||
I should go to fiction; less worry about getting things right. | 01:22 | ||
ruoso is a social scientist... has an idea on how hard that job can be... | |||
01:22
molaf_xx joined,
molaf_x left
|
|||
JDlugosz | How do you get the italic effect for speaking in the 3rd person? | 01:23 | |
ruoso | /me something | ||
DanielC likes to refer to himself in the third person | 01:24 | ||
ruoso | and the actual formatting depends on the client... I don't see italic for actions | ||
(btw, you call that an "action") | |||
JDlugosz wonders what a social scientist is doing with Perl | |||
ruoso | I was a Perl programmer before becoming a social scientist | 01:25 | |
JDlugosz | Reading your note... | ||
ruoso | it was Perl that drove me away from computer science... | ||
JDlugosz | I agree that the capture contains the lvalue, e.g. the scalar bound to $a. | ||
01:25
ihrd left
|
|||
DanielC | ruoso: Perl drove you away from computer science? | 01:25 | |
JDlugosz | But in order to make the parameter read-only, it must do something more. Just binding to the same thing would be "rw". | 01:26 | |
ruoso | JDlugosz, it can simply be a lazy proxy that refuses to change the original value | ||
DanielC, yeah... but that's a long story... | |||
DanielC | k | 01:27 | |
JDlugosz | Yes, I go into that in great detail in my writup. | ||
ruoso | JDlugosz, lazy proxies are everywhere in Perl 6 | ||
JDlugosz | But, it needs to be done. It may be optimized somehow, but semantically it is another object, a read-only proxy that sits in front of that scalar. | ||
ruoso | even %a<b><c> requires lazy proxies | 01:28 | |
in order to avoid premature autovivification | |||
JDlugosz | rw doesn't enclose immutables... it demands an lvalue. | ||
ruoso | if the parameter is not an lvalue, it will create oen | ||
JDlugosz | ref might be defined to enclose immutables, but I argue for something different. | 01:29 | |
ruoso | rakudo: sub foo($a is rw) { $a += 1; say $a }; foo(1); | ||
p6eval | rakudo 77f9d7: OUTPUT«2» | ||
ruoso | rakudo: sub foo($a is rw) { $a += 1; say $a }; my $b = 1; foo($b); say $b; | ||
p6eval | rakudo 77f9d7: OUTPUT«22» | ||
JDlugosz | The discussion last summer, in some depth, determined that rw demands an existing lvalue, and ref is soft and will take what you give it. | ||
ruoso | rakudo: sub foo($a is ref) { $a += 1; say $a }; foo(1); | 01:30 | |
p6eval | rakudo 77f9d7: OUTPUT«Cannot assign to readonly variable.in sub foo (/tmp/pZxZF7RCSe:2)called from Main (/tmp/pZxZF7RCSe:2)» | ||
ruoso | JDlugosz, well... from what I recall, it will provide you an lvalue if an immutable was sent... but the spec knows | 01:31 | |
ruoso sleep & | 01:33 | ||
JDlugosz | "This [rw] requires a mutable object or container as an argument." S06. | 01:34 | |
"... or binding proxy ..." | |||
"... otherwise the signature fails to bind." | |||
binding proxy is my paraphrase. | |||
That is really necessary for mmd to distinguish rw from not. | 01:35 | ||
Otherwise, the rw would always match and silently not update the caller. | |||
01:36
agentzh left
|
|||
JDlugosz | It appears that rakudo is being generous, and you seem to be mixing up ref and rw (more or less). | 01:36 | |
01:36
agentzh joined
|
|||
TimToady | rw causes autoviv | 01:36 | |
JDlugosz | Yes, autoviv. | ||
I do recall that that was a major point of rw vs ref: the latter doesn't. | 01:37 | ||
01:37
mycelium joined
|
|||
JDlugosz | Oh, does the rw parameter itself cause the autoviviation to take place THEN, or does it delay until actually written to? | 01:38 | |
Tim? | |||
That's something I'm diagramming now, so I'd like to know for sure shortly, if it's not to much trouble. | |||
TimToady | at binding, I've always thought | ||
JDlugosz | OK, and with ref, it delays until used? That works out naturally. | 01:39 | |
TimToady | but a partial but ultimately unsuccessful binding shouldn't, I guess | ||
ref just passes the pointer willy nilly | |||
JDlugosz | partial and unsuccessful? Like @a[10][2][3] not able to create the nested elements... so it MUST leave @a unchanged? | 01:40 | |
TimToady | but I suppose if you pass in an autovivifiable object, it can still autoviv internally | ||
JDlugosz | The attempt is noted and when fails, elimiates the signature from consideration and tries again without? | ||
TimToady | as in ($x is rw, NoMatch $y) can't bind $x, autoviv, and then fail to bind $y | 01:41 | |
JDlugosz | ...internally? I don't follow. | ||
TimToady | ($x is ref) { ... foo($x) }; sub foo ($y is rw) {...} | 01:42 | |
JDlugosz | Is the general idea being that autovivication is part of a "transaction" and binding is all or nothing? | ||
TimToady | yes, it's a sort of commit action to decide to autoviv, I expect | ||
JDlugosz | last example: of course. No different from $x=5 directly. | 01:43 | |
TimToady | right | ||
I see autovivifiable values as essentially the same as WHENCE values, Foo{...} | 01:44 | ||
just the ... happens to know how to tweak the outer container | |||
JDlugosz | as I recall, the WHENCE is just the programmable/specifiyable way to autovivify. | ||
TimToady | it's a lazy initializer, to be used only after know when (autoviv) or where (BUILD) to init | 01:45 | |
*after we | |||
JDlugosz | Have you seen my pretty pictures? | ||
TimToady | some of them, but been pretty distracted recently by family health issues | 01:46 | |
JDlugosz | Sorry to hear that. My own health issues doesn't affect my ability to type. | ||
01:47
xinming_ is now known as xinming
|
|||
JDlugosz | I was also wondering, and posted to the mailing list, why the default passing is a read-only reference rather than pass-by-value. | 01:47 | |
01:47
Whiteknight left
|
|||
JDlugosz | The "feature" of modifying along a different access route is something I would warn people against, not tout as a feature. And it interferes with optimizations. | 01:47 | |
Also, I think the invocant should be by-value. You DO NOT want to change the object out from under you in the middle of a method. | 01:48 | ||
TimToady | the intent is to substitute pass-by-value where appropriate via optimization, or pass-by-ref where it can be determined that nothing can change it | ||
and mainly I wanted the default to be different from C++, where you have to put const everywhere | |||
JDlugosz | It is difficult to tell. If you pass a global, or pass the same object in two parameters, the function must assume the worst. | 01:49 | |
Every access must be a full read, and can't assume the contianer has not been assigned to somehow. It's like volatile in C++. | |||
TimToady | yes, well, we try encourage good style by making excessive mutability painful. :) | 01:50 | |
JDlugosz | Older attempts in C/C++ (noalias) and new stuff in C9x (restrict), and features in FORTRAN, all give ways to say there are no extra aliases. | ||
Ah... you don't want to force copying a contiainer like a large array. | 01:51 | ||
TimToady | our approach is mostly the Doctor-it-hurts-well-then-don't-do-that | ||
JDlugosz | I think that must be key to it. | 01:52 | |
TimToady | we're okay with enforcing things that can be enforced easily | ||
but like C, if you write sloppy code, you can get hurt | |||
JDlugosz | get hurt? | ||
TimToady | as in C if you depend on order of side effects when you shouldn't | 01:53 | |
I always loved the Ada spec | |||
JDlugosz | I think the Perl implementation should not assume things that are not part of the spec, like lack of aliasing. It must assume things will be aliased, because they might. | ||
TimToady | the technical term for "get hurt" was "erroneous" | ||
JDlugosz always thought a debug build should randomize order of operations and stuff, to stress the code. | |||
TimToady | "if you do this, the compiler is not required to tell you it's wrong, but it is." | ||
tough love :) | 01:54 | ||
JDlugosz | Changing the container by another path, when you have a readonly alias to it, is not wrong. It is a test case. | ||
TimToady | I don't have proof, but I suspect it's the only way to have a multi-paradimatic language while preserving the sanity of both the implementors and the users | ||
JDlugosz | it? | 01:55 | |
TimToady | declaring some things as erroneous | ||
you can tighten up the typing, driving the user's insane | |||
JDlugosz | and you assume that one of those groups has sanity to preserve. | ||
TimToady | or you can tighten up the analysis, driving the implementors insane | ||
anyway, the default of readonly on params is intended to give options to the implementors | 01:56 | ||
and that will probably involve declaring some things to be unspecced | 01:57 | ||
JDlugosz | Hmm, I wonder about the meaning of "erronious". It can't be "doesn't do what I said" because you are defining what you (incorrectly) said to not mean what you thought it did. | ||
TimToady | or erroneous | ||
JDlugosz | Hmm, I wonder if compiled code will end up using pessimism techniques to fall back from optomized version after checking assumptions. | 01:58 | |
TimToady | usually in Ada it means that semantic inconsistencies cannot be guaranteed to be detected | 01:59 | |
well, there's a lot of work in that direction with tracemonkey and such | |||
and we speculated a lot on it during early design | |||
JDlugosz | Remember our thread on perlmonks about "undefined behavior". | ||
TimToady | but we're not trying to rely on it | ||
JDlugosz | I think that in Perl 6, which is not a to-the-metal language like C, you should not be able to trash memory even when "wrong". | 02:00 | |
TimToady | "this is defined to be undefined" :) | ||
JDlugosz | But that's an implementor's choice to make, I suppose. | ||
But still, semantic decisions can be made that allow for more fail-safety. | 02:01 | ||
TimToady | "If you do this, you might regret it, and this document might be your only warning." | ||
JDlugosz | In particular, "wrong" behavior is still within the object model of the high-level language. | ||
TimToady | sure, we try to be failsoft when practical | ||
JDlugosz | Maybe use a symbol for "defined to be undefined". A symbol with no defined meaning. <G> | 02:02 | |
TimToady | but failsoft in one spot can induce other failures elsewhere, so it's an undecidable problem in the abstract | ||
JDlugosz | Right; essentially a random peturbance to the information model, even if it is still a well-formed information model. | ||
TimToady | "If you do this, you should expect your rocket land in your vegetable garden." | ||
*to land | 02:03 | ||
JDlugosz | Code assuming things were as-it-left-it will be wrong. | ||
TimToady | each paradigm has a different approach to consistency, I think | ||
and sometimes they fight a bit | |||
JDlugosz | "... will reformat your hard drive." and log a bug that it doesn't, but only crashes, but never resolve that bug. | ||
Khisanth | hmm isn't leaving something unspeccedd pretty much the same as saying "don't do this"? :) | ||
JDlugosz | Khisanth: that's the game. | 02:04 | |
TimToady | well, there's no way to write n! relationships when n is large | ||
JDlugosz | But, it also leaves room for additonal specifications to apply. Eg the compiler's own docs. | ||
TimToady | we aren't entirely sure how Perl 7 will end up looking, but the big point about Perl 6 is to make it sufficiently malleable to get where need to go easily | 02:05 | |
so we can fix things that go wrong in the design with the most localized language tweak possible without breaking things that work | 02:06 | ||
JDlugosz | E.g. whether the next generation decides to add "by value" or add traits to denote aliasing or lack of, it will be backward compatable and not a major change to the language. | ||
TimToady | that's the hope | ||
declaring the use of a particular version is (we hope) nailing down the API forever | 02:07 | ||
JDlugosz | modules... | ||
TimToady | and Perl itself | ||
JDlugosz | Thanks for the guidance. I hope to have some serious docs with illustrations real soon now. | 02:08 | |
TimToady | thanks | 02:10 | |
02:19
Marake joined
02:24
beggars joined
02:41
DanielC left
03:08
Chillance left
03:20
donaldh left,
donaldh joined
03:30
skids_ left
03:31
araujo left
03:32
meppl left
03:35
xinming_ joined
03:41
araujo joined
03:47
xinming left
03:49
alester left
05:12
frioux left,
eternaleye_ joined
05:16
kate21de joined
05:18
justatheory left
05:21
eternaleye_ left
05:31
eternaleye left
05:41
ejs0 joined
05:47
eternaleye joined
05:49
nihiliad left
05:54
meppl joined
06:04
eternaleye_ joined
06:05
eternaleye left
06:10
eternaleye_ left
06:23
ZuLuuuuuu joined
06:55
cottoo joined,
beggars left
06:56
cottoo left
07:14
dakkar joined
07:18
barney joined
07:20
donaldh left
07:21
donaldh joined
07:33
chronniff joined,
viklund joined
07:37
clintongormley joined
07:41
bejuryu joined
|
|||
Matt-W | Morning | 07:43 | |
chronniff | no, not the morning!!! gotta be up in 2 1/2 hours | 07:48 | |
Matt-W | I've already been up for two and a half hours... | 07:52 | |
sjohnson | how's it goin | 07:53 | |
07:54
raig joined
|
|||
chronniff | miserable | 07:56 | |
viklund | Good morning! | ||
chronniff | ha | 07:57 | |
viklund | ha | ||
chronniff | oh great, my intel f****ing intel jaunty driver is swapping out everything, because I minimized a terminal no less, wonderful!!! | 07:59 | |
gotta shutdown later | |||
07:59
chronniff left
08:01
ejs joined
|
|||
moritz_ | good morning | 08:01 | |
viklund: any objections to naming the subs in JSON::Tiny from-json and to-json (with dashes instead of underscores)? | 08:02 | ||
08:02
rindolf joined
08:04
kate21de1 joined
|
|||
Matt-W | sjohnson: it's going far too pollen-y | 08:05 | |
moritz_ | rakudo: say "a\tb\n".trans("\n" => '\\n', "\t" => '\\t'); | 08:08 | |
p6eval | rakudo 77f9d7: OUTPUT«a\b\» | 08:09 | |
moritz_ | rakudo: say "a\tb\n".trans(("\n" => '\\n', "\t" => '\\t')); | ||
p6eval | rakudo 77f9d7: OUTPUT«a\b\» | ||
moritz_ | rakudo: say "a\tb\n" | ||
p6eval | rakudo 77f9d7: OUTPUT«a b» | ||
08:10
ejs1 joined
|
|||
moritz_ | rakudo: say "a\tb\n".trans(("\n" => 'N', "\t" => 'T')); | 08:10 | |
p6eval | rakudo 77f9d7: OUTPUT«aTbN» | ||
moritz_ | rakudo: say "a\tb\n".trans(("\n" => '\n', "\t" => '\t')); | ||
p6eval | rakudo 77f9d7: OUTPUT«a\b\» | ||
Matt-W | moritz_: that looks wrong | ||
moritz_ | rakudo: say "a\tb\n".trans(("\n" => 'NN', "\t" => 'TT')); | ||
p6eval | rakudo 77f9d7: OUTPUT«aTbN» | ||
moritz_ | Matt-W: it does indeed | ||
Matt-W | aaah | ||
moritz_ | it takes only the first replacement char | 08:11 | |
Matt-W | then it looks rather less wrong :) | ||
although slightly irritating | |||
08:11
cognominal joined
|
|||
moritz_ | no, it's wrong that it only takes the first | 08:11 | |
I tried to describe the current behaviour | |||
Matt-W | I could easily imagine it specced to do that, but I don't see why it would be | 08:12 | |
moritz_ | TimToady is sane, occasionally | ||
Matt-W | heh | 08:15 | |
a lot of the time, actually | |||
it may not always be immediately obvious | |||
viklund | moritz_: none at all | 08:16 | |
I would have used hyphens if it wasn't for old habit | 08:17 | ||
08:17
ejs left
|
|||
viklund loves wikipedia (en.wikipedia.org/wiki/Hyphen) | 08:18 | ||
08:19
kate21de left
08:30
finanalyst joined
|
|||
moritz_ | viklund: I'll also rename 04-generate_json.t to 04-roundtrip.t, because that's what the test really does | 08:32 | |
08:33
viklund left
|
|||
finanalyst | rakudo: say (map {$_}, -1..3).perl; say (map {$_}, 3..-1).perl | 08:34 | |
p6eval | rakudo 77f9d7: OUTPUT«[-1, 0, 1, 2, 3][]» | ||
finanalyst | Is this a bug in Rakudo, or does the spec have something to say about downward moving ranges? | 08:35 | |
moritz_ | finanalyst: it works as designed | 08:36 | |
you'd do that with 3..-1 :by(-1), but that's not yet implemented | |||
finanalyst | ah. i tried :by(-1) but it failed on me locally. thanx for the help | ||
moritz_ | you're welcome | 08:37 | |
rakudo: say "\n\t".trans(["\n", "\t"] => ['\n', '\t']) | 08:41 | ||
p6eval | rakudo 77f9d7: OUTPUT«\n\t» | ||
Matt-W | interesting | ||
finanalyst | rakudo: say (map {$^a + $^b}, ((0 .. 4) Z (2 .. 6))).max | 08:42 | |
p6eval | rakudo 77f9d7: OUTPUT«10» | ||
finanalyst | say max { $^a + $^b },((0 .. 4) Z (2 .. 6)) | ||
rakudo: say max { $^a + $^b },((0 .. 4) Z (2 .. 6)) | |||
p6eval | rakudo 77f9d7: OUTPUT«0» | ||
moritz_ | rakudo: say "a" ~~ /<ascii>/ | 08:44 | |
p6eval | rakudo 77f9d7: OUTPUT«Unable to find regex 'ascii'Null PMC access in invoke()in regex PGE::Grammar::_block50 (/tmp/nYtjG8I98x:1)called from Main (/tmp/nYtjG8I98x:2)» | ||
moritz_ | rakudo: say "a" ~~ /<ASCII>/ | ||
p6eval | rakudo 77f9d7: OUTPUT«Unable to find regex 'ASCII'Null PMC access in invoke()in regex PGE::Grammar::_block50 (/tmp/OJ6CtM4ZfZ:1)called from Main (/tmp/OJ6CtM4ZfZ:2)» | ||
moritz_ | rakudo: say ord("\c[127]") | 08:46 | |
p6eval | rakudo 77f9d7: OUTPUT«127» | ||
moritz_ | rakudo: say ord("\c127") | ||
p6eval | rakudo 77f9d7: OUTPUT«127» | ||
moritz_ | rakudo: say hex(3) | 08:47 | |
p6eval | rakudo 77f9d7: OUTPUT«Could not find non-existent sub hex» | ||
08:48
viklund joined
|
|||
viklund | moritz_: yes, good, that's a better name, to_json can produce invalid json need to fix that somehow | 08:49 | |
moritz_ | viklund: I just implemented \n escapes etc. | ||
viklund | nice | 08:50 | |
moritz_ | rakudo: /<-[\c0..\c127]>/ | ||
p6eval | rakudo 77f9d7: ( no output ) | ||
viklund | btw, hex is spelled :16() in p6 | ||
moritz_ | rakudo: say :16(33) | ||
viklund | rakudo: say :16(24) | ||
p6eval | rakudo 77f9d7: OUTPUT«51» | 08:51 | |
rakudo 77f9d7: OUTPUT«36» | |||
viklund | ;) | ||
rakudo: say :23(24) | |||
moritz_ | no, that's the other direcction | ||
p6eval | rakudo 77f9d7: OUTPUT«50» | ||
moritz_ | oh wait | ||
it's the same direction as hex() in perl 5 does | |||
viklund | yes | ||
moritz_ | but not what I want :/ | ||
rakudo: printf "%x", 33 | |||
p6eval | rakudo 77f9d7: OUTPUT«21» | ||
moritz_ | better | ||
08:52
jferrero joined
|
|||
moritz_ | rakudo: printf "%04x", 33 | 08:53 | |
p6eval | rakudo 77f9d7: OUTPUT«0021» | ||
moritz_ | rakudo: say "möp".subst(/<-[\c0..\c127]>/, { sprintf '\u%04x', ord(~$_) }, :g) | 08:54 | |
p6eval | rakudo 77f9d7: OUTPUT«m\u00f6p» | ||
viklund | yes | 08:55 | |
moritz_ | rakudo: say "möp".subst(/<-[\c0..\c127]>/, { sprintf '\u%04x', ord(~$/) }, :g) | ||
p6eval | rakudo 77f9d7: ( no output ) | ||
viklund | heh | ||
moritz_ | rakudo: say "möp".subst(/<-[\c0..\c127]>/, { sprintf '\u%04x', ord(~$/) }, :g) | ||
p6eval | rakudo 77f9d7: OUTPUT«m\u00f6p» | ||
moritz_ | p6eval hiccup? | ||
anyway, neither works locally here | 08:56 | ||
viklund | really strange | ||
hold on, I'll try | |||
try putting it in a file as well | |||
moritz_ | at least not on the result of a .trans | ||
it says "Lexical '$/' not found" | 08:57 | ||
rakudo: say "\nö".trans(["\n"] => ['\n']).subst(/<-[\c0..\c127]>/, { sprintf '\u%04x', ord(~$_) }, :g) | 08:58 | ||
p6eval | rakudo 77f9d7: OUTPUT«\n\u00f6» | ||
moritz_ | rakudo: say "\nö".trans(["\n"] => ['\n']).subst(/<-[\c0..\c127]>/, { sprintf '\u%04x', ord(~$_) }, :g) | ||
p6eval | rakudo 77f9d7: OUTPUT«\n\u00f6» | ||
viklund | moritz_: I can run it from a file | ||
rakudos cmd-line unicode handling is very buggy | 08:59 | ||
moritz_ | yes, I know that | ||
09:00
payload left
|
|||
moritz_ | viklund: if you pull json and run t/04-roundtrip.t you'll see what I mean | 09:00 | |
viklund | ill do that l8r, right now im playing with $daughter | 09:05 | |
moritz_ | have fun ;-) | ||
09:15
DanielC joined
09:28
xinming joined
09:31
Chillance joined
09:36
M_o_C joined
09:46
xinming_ left
09:47
bejuryu left
09:52
PZt left
09:55
ejs2 joined
10:02
sri_kraih joined
10:04
ejs1 left
10:10
sri_kraih_ joined
10:29
sri_kraih left
|
|||
DanielC | @seen mberends | 10:31 | |
lambdabot | I saw mberends leaving #perl6 15h 2m 16s ago, and . | ||
11:00
ruoso left
|
|||
moritz_ | viklund: I tracked down the bug, it only happens in multi subs, not in ordinary subs | 11:02 | |
11:11
viklund left
11:13
iblechbot joined
11:20
donaldh left
11:21
donaldh joined
11:22
M_o_C left
11:28
M_o_C joined
11:37
M_o_C left
11:39
skids_ joined
|
|||
moritz_ | with latest (optimized) parrot I get a bunch of spectestail failures | 11:48 | |
11:49
M_o_C joined
11:56
payload joined
11:59
zamolxes joined
12:03
raig left
12:11
payload left,
ruoso joined
12:25
pmurias joined
12:28
mib_mqys0i joined
|
|||
pmurias | ruoso: hi | 12:29 | |
12:32
Caringo joined
12:33
Caringo left
12:40
elmex left
12:41
elmex joined
|
|||
ruoso | hi pmurias | 12:55 | |
12:58
pe_cua joined
12:59
pe_cua is now known as CoconutCrab
|
|||
ruoso | pmurias, are you planning a blog post for the work of the last week? | 13:00 | |
pmurias | yes, i think i'll do a all things done thus far blog post | 13:01 | |
ruoso | that'd be cool | ||
13:02
Jaaap joined
|
|||
pmurias | ruoso: what should i work on now (other than on the blog post) | 13:02 | |
? | |||
Jaaap | Does anybody have any ideas how to parse python-like indented code in a perl6 Grammar? | 13:03 | |
pynie uses a magican indent_same and dedent but i don't know where that's coming from. | |||
ruoso | pmurias, do mildew compiles "multi foo ($a, $b, $c) {...}" already? | ||
pmurias | not yet | ||
ruoso | that seems like a good next target | 13:04 | |
Matt-W | Jaaap: that comes from src/parser/indent.pir | 13:06 | |
13:07
CoconutCrab left
|
|||
Jaaap | Matt-W ah. thx. looking at it now. | 13:07 | |
Matt-W | Jaaap: it seems to inject a bunch of helper methods into Pynie::Grammar | 13:08 | |
pmurias | ruoso: a my multi foo (...) {...} creates a new multi and copies over the variants? | ||
Jaaap | Interesting... can i do that in a perl6 grammar too? | ||
Matt-W | you can add methods, sure | ||
grammar is just a special kind of class | |||
Jaaap | and call them with <.method> or soimething? | 13:09 | |
ruoso | pmurias, yes... TimToady said it can assume the candidate list is fixed | ||
Matt-W | Jaaap: It seems that way, but I wouldn't want to bet on it without trying it (or at least checking the spec) | 13:10 | |
ruoso | Jaaap, the grammar has the notion of both horizontal space and vertical space... take a look at S05 | ||
Jaaap | S05. ok. | ||
looks like <\v> matches vertical whitespace | 13:12 | ||
i wonder how trhat's gonna work | |||
Matt-W | I'm not entirely sure that would be helpful | 13:13 | |
Jaaap | How would that even work, multi-line spacing? | ||
Matt-W | it would be things like the vertical tab character, I assume | ||
rjh | newlines | 13:14 | |
carraige return + linefeed | |||
Jaaap | ah like that. | ||
bummer | |||
so that is probably not the way to go. | 13:15 | ||
I could still try injecting helper methods. | |||
rjh | Jaaap: what language are you parsing? | ||
Jaaap | ehm... my own. | 13:16 | |
looks a bit like python | |||
ruoso | pmurias, there are two new leaks in smop | ||
Jaaap | only tabs for indentations | ||
rjh | i hate you | ||
Jaaap | ;) | ||
spaces are for nitwits ;-) | |||
rjh restains himself | 13:18 | ||
oh god | 13:19 | ||
that's the worst typo ever | |||
Jaaap | lol | ||
pmurias | ruoso: fixing... | ||
ruoso | Jaaap, but you can also send parameters to tokens iirc | 13:20 | |
so you can send the "current identation level" as a parameter | |||
Jaaap | hmmm | ||
lt me think about that | |||
you mean send the parameter to the corresponding action method right? | 13:21 | ||
ruoso | the token is a method | 13:22 | |
it can receive parameters | |||
pmurias | ruoso: one think i'm not sure how to solve elegantly is how to determine elegantly if a multi should be created or only a new variant added | ||
Jaaap | ruoso: Oh like that? | 13:23 | |
ruoso | pmurias, I think you can use STD cheats... | ||
Jaaap | is it also possible to modify the source (to remove on tab level)? | 13:24 | |
on=one | |||
13:25
phenny left
|
|||
pugs_svn | r27081 | pmurias++ | [re-smop] fix 2 memory leaks | 13:25 | |
13:26
phenny joined
13:29
mizioumt joined
13:30
ZuLuuuuuu left,
agentzh left
|
|||
Jaaap | perhaps it's easier if i pre-process the source and inject curlies. | 13:30 | |
13:32
payload joined
13:34
agentzh joined
13:35
Jaaap left
13:37
barney left
|
|||
moritz_ | btw I posted www.perlmonks.org/?node_id=771635 | 13:42 | |
Matt-W wonders why Elf emits Common Lisp | 13:45 | ||
Not that I'm complaining, that's pretty cool really :) | 13:46 | ||
pmurias | Matt-W: Common Lisp is quite fast | ||
Matt-W | I have never made the time to learn it | ||
I probably should | |||
pmurias | ruoso: if i do my multi foo() {...}; multi foo() {...} does the second variant get installed in the lexical or package scope? | 13:52 | |
13:57
hanekomu joined,
hanekomu left
13:58
payload left
|
|||
ruoso | pmurias, "our" means "create in this lexical scope, and create an alias in the package" | 13:58 | |
so it's just like | |||
my multi foo() {...}; $?PACKAGE<&foo> := &foo; | 13:59 | ||
14:02
mib_mqys0i left
|
|||
pugs_svn | r27082 | pmurias++ | [re-smop] fix commit 27081 | 14:03 | |
14:03
PacoLinux joined
|
|||
pmurias | ruoso: multi methods are our by default? | 14:04 | |
ruoso | I don't think so | ||
methods are "has" by default | |||
I think that applies to multi methods as well | |||
pmurias | and multi subs? | 14:05 | |
ruoso | subs are our by default | 14:06 | |
I think that applies to multi subs as well | |||
pmurias | so in my first question it would be my multi foo() {...};our multi foo() {...} | 14:07 | |
TimToady | yes, and the package variant is ignored by the dispatcher | 14:09 | |
because the multi dispatch only looks in lexical scopes | |||
the situation is no different from if the second multi was lexically imported from another package | 14:10 | ||
ruoso | TimToady, there was a question few minutes ago about matching indentation level... | 14:13 | |
I thought that to be an interesting case for parameters to tokens | 14:14 | ||
14:14
decasm joined
|
|||
ruoso | but I'm not sure how it would look like | 14:14 | |
TimToady | I'd use a context variable for remembering previous indent | 14:17 | |
but yes, could be done with a parameter | |||
Matt-W | Pynie does it with some PIR, but I suspect this might be due to 'not implemented in PGE' | 14:18 | |
ruoso | TimToady, looking in S05 I can't find the syntax for using the parameter.... | 14:19 | |
TimToady | it's just like using any other variable | ||
ruoso | you mean token foo ($indent_level) { ... } ? | 14:20 | |
pugs_svn | r27083 | pmurias++ | [re-smop] adding variants using the multi foo(...) {...} syntax | ||
TimToady | <?{ $<myindent>.chars < $indent_level }> | ||
which PGE won't implement yet, of course | 14:22 | ||
ruoso | cool... | ||
TimToady | token foo ($indent_level is context) would show up to an action routine, in theory | ||
but if you do that, might as well be a context var on the staement list. | 14:23 | ||
*statement | |||
14:23
sri_kraih joined
|
|||
ruoso | can context variables be *declared* inside tokens? | 14:24 | |
TimToady | stick a : in front of the my | ||
there's lots of these in STD | |||
ruoso | cool... | ||
TimToady | :my slurps everything up to the next ; | ||
ruoso | then using a context var is really a better solution | 14:25 | |
14:26
sri_kraih_ left
|
|||
ruoso | how tied gimme5 is to STD? | 14:26 | |
I mean... | |||
TimToady | that's why I'm working on viv | ||
ruoso | how possible would it be to use it to compile a different grammar? | ||
TimToady | gimme5 is only intended to translate STD | 14:27 | |
ruoso | but if a grammar was written only as a subset of the features of STD? | ||
TimToady | I've got viv to where it can completely translate the operator prec parser from STD | 14:28 | |
then yes, sure, but some constructs have to be written in a way that helps gimme5 | |||
for gimme5 the # end grammar comments are not optional | 14:29 | ||
for instance | |||
ruoso | ok... not that I'm going to do it now... but it looks interesting to have support to "use python" inside Perl 6 code... | ||
TimToady | and a :delete must be applied to a single piece of text without whitespace | ||
14:29
xinming left,
xinming joined
|
|||
TimToady | interesting as in the ancient curse | 14:30 | |
ruoso | interesting as "just to say that I can" ;) | ||
TimToady | that's like trying to prove you can sneak a gun aboard a plane :) | 14:31 | |
moritz_ | s/gun/snake/ ;-) | 14:32 | |
frew | you might get killed trying? | ||
ruoso | or trying to prove the network is insecure, and getting arrested by that... | ||
14:32
rgs joined
|
|||
cognominal | ho, an Hergé Hesse :) | 14:34 | |
14:36
xinming_ joined
14:37
jdv79_ joined
|
|||
diakopter de/relurks | 14:41 | ||
14:44
xinming left
|
|||
pmurias | diakopter: hi | 14:44 | |
ruoso: i once used gimme5 to compile a sm0p grammar | 14:45 | ||
sjohnson | hey d00dz | 14:50 | |
pmichaud | Good morning, #perl6 | ||
pmurias | sjohnson: hi | ||
moritz_ | hi pmichaud | ||
pmichaud: do you plan to merge the ins brach before the release? | 14:51 | ||
14:51
jdv79 left
|
|||
moritz_ | (I tried to test it today, but failed at building a debian package out of parrot; maybe I'll try it later in a chroot) | 14:51 | |
14:56
PerlJam left,
PerlJam joined
|
|||
PerlJam | good morning | 14:58 | |
14:59
finanalyst left
15:00
macae joined
15:04
justatheory joined
|
|||
pmichaud | moritz_: I was hoping to merge the ins branch before release, but I don't think that's going to happen. | 15:06 | |
There are known problems with the branch on at least two platforms, and it's presently an all-or-nothing merge | |||
i.e., building from an installed parrot doesn't co-exist with building from a build-tree parrot | |||
and the things that need fixing in parrot are sufficiently hairy that it's probably not a good idea to add them one day before the parrot release | 15:07 | ||
(and I'm handicapped by not having any of the failing platforms handy on which I can test.) | |||
DanielC | Rakudo has regular releases, right? When are they? Parrot is the second Tuesday of every month. | 15:09 | |
Tomorrow's Parrot release has a bugfix that I'm interested in. Which version of Rakudo would include it? | |||
pmichaud | Rakudo's releases are ~ 2 days after each Parrot release. | 15:11 | |
So, Rakudo will have its next release on Thursday. | |||
Matt-W | Rakudo doesn't include Parrot | ||
DanielC | Matt-W: Yes and no. It downloads parrot. | ||
pmichaud | Rakudo includes Parrot by reference. | ||
which version of Parrot are you interested in? | |||
DanielC | Tomorrow's. | ||
They fixed a bug with is_deeply() | |||
pmichaud | The Parrot version of is_deeply? | 15:12 | |
DanielC | yeah | ||
pmichaud | Because Rakudo uses its own, not Parrot's. | ||
DanielC | They just added a patch so that it works correctly with hashes. | ||
15:13
hse joined
|
|||
hse | hi | 15:13 | |
DanielC | o/ hse | ||
pmichaud | The is_deeply that Parrot provides is not the one that Rakudo uses. | ||
hse | where can i get tcp-tunnel | ||
? | |||
DanielC | pmichaud: I'm pretty sure I'm talking about the Parrot one. | ||
15:13
ejs1 joined
|
|||
pmichaud | DanielC: okay, no problem. | 15:13 | |
DanielC: I'm sure you _are_ talking about the Parrot one; I just haven't figured out how that relates to Rakudo. :-) | 15:14 | ||
DanielC | pmichaud: I'm writing stuff in PIR, and I use rakudo/parrot/parrot | ||
hse | any perl master here? | 15:15 | |
TimToady | only perl6 masters | ||
hse | lol | ||
DanielC | I guess I could install a separate Parrot somewhere else... | ||
hse: I think TimToady knows Perl fairly well. | |||
TimToady | I know nothing about tcp-tunnel | 15:16 | |
hse | is it possible to pm him? | ||
DanielC | hse: Seriously, you probably want to go to #perl | ||
hse | thanks | ||
pmichaud | DanielC: you're writing plain PIR, or inline PIR? | ||
15:16
hse left
|
|||
DanielC | Go to #perl. That's where you'll find the best people to help you with tcp-tunnel. | 15:16 | |
plain PIR | 15:17 | ||
mberend's idea. | |||
pmichaud | okay, then yes, the parrot is_deeply is the one you want. | ||
DanielC | y | ||
pmichaud | anyway, the larger point is that Rakudo doesn't currently tie itself to Parrot releases -- it tends to target intermediate development parrots. | ||
DanielC | ah.. | 15:18 | |
pmichaud | for example, the current version of Rakudo is not using the last released version of Parrot | ||
DanielC | I sort of assumed that it did. | ||
rindolf | TimToady: who introduced the -i flag? Was it you? | ||
TimToady: did perl get it from GNU sed or the other way around? | |||
pmichaud | in fact, the current version of Rakudo won't even work with the last released version of Parrot | ||
DanielC | pmichaud: :-( | 15:19 | |
rgs | rindolf: I think that GNU sed got it from sed | ||
TimToady | I did. I didn't know sed had it too... | ||
pmichaud | DanielC: it's just an indication of how much Rakudo is driving Parrot development, I think. | ||
rindolf | rgs: so it's a standard flag? | ||
DanielC | pmichaud: The goal for the module-lib project we are working on is that eventually it'll go on Rakudo. So maybe we shouldn't use is_deeply() | ||
rgs | at least it's in BSD sed | ||
15:20
donaldh left
|
|||
pmichaud | DanielC: as an example -- the last release of Parrot was on May 19. By May 22, Rakudo could no longer build against the May 19 released version of Parrot. | 15:20 | |
(because Rakudo needed some features that were added to Parrot between May 19 and May 22.) | |||
15:20
donaldh joined
|
|||
DanielC | ah | 15:20 | |
sjohnson | TimToady: have you seen Hikaru no Go? | ||
TimToady | .oO(or if I did know it, I've forgotten that I knew it...) |
15:21 | |
DanielC | pmichaud: So, it's not that Rakudo uses old versions of Parrot, but new ones? | ||
15:21
ZuLuuuuuu joined
|
|||
pmichaud | DanielC: the version of Parrot that Rakudo expects is kept in build/PARROT_REVISION | 15:21 | |
at this moment, Rakudo expects to have Parrot r39531. | 15:22 | ||
DanielC tries to check what version of Parrot has the is_deeply fix | |||
pmichaud | in another window I'm currently testing to make sure that Rakudo will work against Parrot's HEAD (r39571) | 15:23 | |
DanielC has no idea what version of Parrot he wants | |||
15:23
ejs2 left
|
|||
pmichaud | because when Parrot cuts its June release tomorrow sometime, we want to make sure that Rakudo can build against it. If not, then we'll have a situation where a released Rakudo can't be run against a released Parrot. | 15:23 | |
DanielC | *nod* | 15:24 | |
TimToady | sjohnson: いえ。 | ||
pmichaud | DanielC: at any rate, when Parrot cuts its release tomorrow, Rakudo will immediately bump its expected version to use that release. | 15:25 | |
(assuming Rakudo can build/run against that version) | |||
DanielC | ok | ||
Question: is mberends a Rakudo developer? | |||
pmichaud | if my build/test is successful now, then in a few minutes Rakudo will be bumping to use r39571, the current Parrot HEAD. | 15:26 | |
Yes, mberends is a Rakudo developer. He did Temporal.pm, and a lot of work on IO::Socket | |||
DanielC | Ok. Good. I'm counting on him to know how to integrate the module-lib into Rakudo. | ||
15:27
donaldh left
|
|||
DanielC | Assuming that your build/test is successful and Rakudo bumps to r39571, how would I update my Rakudo to get the new Parrot too? Do I just run "Configure.pl --gen-parrot" again? | 15:28 | |
pmichaud | Yes. | 15:29 | |
rindolf | TimToady: I don't see -i here - www.opengroup.org/onlinepubs/000095...s/sed.html | ||
DanielC | thanks | ||
rindolf | TimToady: so I guess GNU sed inherited it from Perl. | ||
TimToady | belike | ||
bbl & | 15:31 | ||
15:33
rindolf left
15:35
alester joined
15:36
yitz_ joined
15:54
zamolxes left
16:01
viklund joined
16:05
justatheory left
16:09
dakkar left
16:20
jhorwitz joined
16:21
Psyche^ joined
16:33
eternaleye joined
16:35
eternaleye_ joined
16:36
pmurias left,
eternaleye left
16:37
Patterner left,
Psyche^ is now known as Patterner,
jferrero left
16:39
|MoC| joined
16:40
payload joined
16:44
bejuryu joined
16:46
bejuryu left
|
|||
Sark23 | hello, is here someone perl core developer ? | 16:46 | |
moritz_ | Sark23: Perl 5 or 6? | 16:47 | |
Sark23 | i have a question to char on perl5. is the perl5 char a linear memory like in C,c++ or is this a struct datatype with pointer next and prev ? | 16:48 | |
moritz_ | Sark23: try #p5p on irc.perl.org | 16:49 | |
Sark23 | thanks | ||
ruoso | @tell pmurias I think you forgot to add a file | 16:54 | |
lambdabot | Consider it noted. | ||
16:54
M_o_C left
17:00
justatheory joined
17:01
synth left
17:03
cdarroch joined
17:04
ruoso_ joined
17:05
ruoso left
17:06
ruoso joined,
ruoso_ left
17:13
macae left
17:14
macae joined
17:16
nihiliad joined
17:20
jferrero joined
17:22
silug left
17:27
ejs1 left
17:35
macae left
17:39
ZuLuuuuuu left
17:43
lichtkind joined
18:02
justatheory left
18:06
xinming joined
|
|||
lichtkind | is here some guy who is involved in planet perl 6? | 18:12 | |
18:13
justatheory joined
18:19
xinming_ left
18:33
hercynium joined,
hercynium left
18:38
sri_kraih left,
sri_kraih joined
18:40
[particle] left
18:46
mizioumt1 joined
18:47
mizioumt left
|
|||
dalek | kudo: 0d5221a | pmichaud++ | build/PARROT_REVISION: Bump PARROT_REVISION to get latest parrot changes. |
18:52 | |
payload | oh i have to recompile | 18:53 | |
18:55
ruoso left
18:59
FurnaceBoy joined
19:06
justatheory left
|
|||
pmichaud | rakudo: say "가".ord | 19:14 | |
p6eval | rakudo 77f9d7: OUTPUT«44032» | ||
pmichaud | rakudo: say "나".ord | 19:15 | |
p6eval | rakudo 77f9d7: OUTPUT«45208» | ||
19:15
silug joined
|
|||
pmichaud | pugs: say 1..4:by(0); | 19:17 | |
p6eval | pugs: OUTPUT«*** Named argument found where no matched parameter expected: (by,Ann (Pos (MkPos "/tmp/oFajEQXWkn" 1 13 1 14)) (Val (VInt 0))) at /tmp/oFajEQXWkn line 1, column 1-15» | ||
19:20
donaldh joined
19:21
|MoC| left
|
|||
pmichaud | rakudo: say chr(229) ~ chr(0x263b); | 19:22 | |
19:22
[particle] joined
|
|||
p6eval | rakudo 77f9d7: OUTPUT«\xE5☻» | 19:22 | |
pmichaud | looks like rakudo hasn't updated yet. | ||
19:27
jferrero left,
mizioumt joined
|
|||
pmichaud | I think tomorrow will be my first Rakudo day. :-) | 19:28 | |
(for Vienna.pm) | |||
dalek | kudo: d3185be | pmichaud++ | docs/spectest-progress.csv: spectest-progress.csv update: 404 files, 11535 passing, 0 failing |
||
kudo: ba09b27 | pmichaud++ | : Merge branch 'master' of [email@hidden.address] |
|||
19:32
mizioumt1 left,
donaldh left
19:35
yary joined
|
|||
yary | perl6: (my @random_numbers).push: int 10.rand for ^3; say @random_numbers.join: ' '; | 19:36 | |
p6eval | elf 27083: OUTPUT«Parse error in: /tmp/sSRL8BlFSupanic at line 1 column 0 (pos 0): Can't understand next input--giving upWHERE: (my @random_numbers).push: intWHERE:/\<-- HERE STD_red/prelude.rb:99:in `panic' STD_red/std.rb:76:in `scan_unitstopper' STD_red/std.rb:224:in `comp_unit' | ||
..STD_red… | |||
..pugs: OUTPUT«3 4 3» | |||
..rakudo 77f9d7: OUTPUT«Lexical '@random_numbers' not found» | |||
yary | Methinks pugs wins in that statement- anyone think that bug looks familiar? Or should I submit? | 19:37 | |
19:37
webfiend joined
|
|||
yary | Or is the scope of "my" really limited to inside parenthesis? | 19:39 | |
PerlJam | that would be weird IMHO | 19:40 | |
pmichaud | rakudo doesn't understand the ':' syntax, I think. | 19:42 | |
also, "int" isn't a valid prefix op. | 19:43 | ||
rakudo: (my @random_numbers).push( int(10.rand) ) for ^3; say @random_numbers.join(' '); | |||
p6eval | rakudo 77f9d7: OUTPUT«Lexical '@random_numbers' not found» | ||
pmichaud | rakudo: my @random_numbers; @random_numbers.push( int(10.rand) ) for ^3; say @random_numbers.join(' '); | 19:44 | |
p6eval | rakudo 77f9d7: OUTPUT«3 3 9» | ||
pmichaud | anyway, I don't think the scope of the 'my' should be limited to the inside parens. | ||
viklund | moritz_: I worked around that $/ in multi bug for json | 19:48 | |
you give up to soon after hitting a bug in rakudo ;) | |||
pmichaud | I think .trans probably needs a substantial rewrite. | ||
viklund | it was a problem with subst as well | 19:49 | |
something happens inside a multi | |||
pmichaud | That one also. :-) | ||
viklund | but the workaround was calling an ordinary sub from the multi to do the work | ||
pmichaud | the issue is that .trans and .subst aren't providing a $_ to match against. | 19:50 | |
viklund | not anywhere? | ||
pmichaud | not that I know of. | ||
at least, that seems like the likely source of the problem. | |||
viklund | yes, indeed | 19:51 | |
pmichaud | rakudo: say map { .chr }, 65..90 | ||
p6eval | rakudo 77f9d7: OUTPUT«sh: ./perl6: No such file or directory» | ||
viklund | compiling... | ||
pmichaud | right. | ||
PerlJam | who runs p6eval? Surely rakudo could be compiled in a sandboxy environment and then a link switched at the last instant. | 19:53 | |
pmichaud | one would need to also switch the links to the .so files | ||
PerlJam | s/a link/the links/ :) | 19:54 | |
pmichaud | rakudo: say map { .chr }, 65..90 | ||
p6eval | rakudo ba09b2: OUTPUT«ABCDEFGHIJKLMNOPQRSTUVWXYZ» | ||
yary | simpler test case- | ||
pmichaud | rakudo: say chr(229) ~ chr(0x263b); | ||
yary | rakudo: (my $x = 1); say $x; | ||
p6eval | rakudo ba09b2: OUTPUT«å☻» | ||
rakudo ba09b2: OUTPUT«1» | |||
pmichaud | \o/ | ||
yary | hmm | ||
rakudo: (my @x= 0..1); say @x; | 19:55 | ||
p6eval | rakudo ba09b2: OUTPUT«01» | ||
pmichaud | oh, I know the problem. | ||
it's the declaration of the "my" as modified by the "for" | |||
rakudo: my $x = 1 for ^3; say $x; | |||
p6eval | rakudo ba09b2: OUTPUT«Lexical '$x' not found» | ||
yary | ++pmichaud | 19:56 | |
pmichaud | the "for" modifier is imposing a block on what it modifies. | ||
19:57
kane__ joined,
kane__ is now known as kane[laptop],
pmurias joined
|
|||
yary | So the next question is, does it make sense for a lexical declaration in an implied block (no curlies) to have a lifetime limited to that implied block? | 20:01 | |
20:01
nihiliad left
|
|||
PerlJam | What does S04 say about it? (if anything) | 20:02 | |
20:05
nihiliad joined
20:08
M_o_C joined,
mikehh joined
|
|||
pmurias | yary: what do you mean by an implied block? | 20:17 | |
lambdabot | pmurias: You have 1 new message. '/msg lambdabot @messages' to read it. | ||
pmurias | yary: generally only curlies introduce a new lexical scope | 20:18 | |
20:18
justatheory joined
|
|||
pmichaud | rakudo: $_ = 'hello'; .say for ^3; say $_; | 20:18 | |
p6eval | rakudo ba09b2: OUTPUT«012hello» | ||
pmichaud | pmurias: the ".say" has an implied block around it. | 20:19 | |
yary | Rakudo's behavior suggests that a "for" modifier at the end of a statement which includes a declaration gives a lexical scope to that declaration, and then the variable is invisible outside | ||
sorr fo rthe verbosity | |||
pugs_svn | r27084 | pmurias++ | [re-smop] | 20:20 | |
r27084 | pmurias++ | fix bug in AST::Seq (TODO check & fix other nodes) | |||
r27084 | pmurias++ | multis install a Multi if it's the first time in a block | |||
pmurias | yary: verbosity is better then ambiguity | ||
pmichaud | it's very possible that implying a block on the lhs isn't correct, and that we need to be making a temporary $_ or something. | 20:22 | |
at any rate, the $_ that is used on the lhs of a for modifier isn't the same as the $_. | |||
at any rate, the $_ that is used on the lhs of a for modifier isn't the same as the $_ outside of the for modifier. | |||
20:23
alester left
|
|||
yary | That much (about $_) I understand from p5... haven't digested S04 yet, but I'll submit this as a bug for folks to ponder and accept/reject | 20:26 | |
viklund is very happy since he found a keymap with xAB and xBB | |||
20:26
clintongormley left
|
|||
pmurias | there is a "Remeber, no implicit block scopes." sentence in S04, although in a different context | 20:28 | |
pmichaud | Yes -- a bit later it talks about the handling of $_ and the for modifier. | ||
It says to get to the outer $_ one uses OUTER::<$_> | |||
which will be a little weird, since it means that OUTER::<$foo> would refer to a different scope from OUTER::<$_> if used inside a for modifier. :-) | 20:29 | ||
TimToady | that's true for any lexical in any lexical scope | 20:30 | |
if $_ is declared internally and $foo externally | |||
pmichaud | TimToady: We're looking at the case of: | ||
say $_ for ^3; | |||
TimToady | yes, I've been thinking abou tit | ||
pmichaud | okay. | ||
TimToady | the spec only requires a private copy for $_ currently | 20:31 | |
pmichaud | correct. | ||
TimToady | doesn't require a block | ||
pmichaud | I think the use of a block might've been a Rakudo shortcut. | ||
TimToady | we could say it is implciit | ||
but... | |||
we can't really allow $^a to pay attention to implicit {} | |||
pmichaud | interestingly, I'm not sure that it does in Rakudo's case. | ||
rakudo: say $^a for ^3; | 20:32 | ||
p6eval | rakudo ba09b2: OUTPUT«too few arguments passed (0) - 1 params expectedin Main (/tmp/jBX8Gm96fv:0)» | ||
TimToady | well, could use a better error :) | ||
pmichaud | sure. | ||
rakudo: { say $^a for ^3 }('hello'); | |||
p6eval | rakudo ba09b2: OUTPUT«hellohellohello» | ||
moritz_ | std: say $^a for ^3; | ||
p6eval | std 27084: OUTPUT«ok 00:02 38m» | ||
pmurias | couldn't we just throw away the for modifier? ;) | ||
viklund | for what? | 20:33 | |
TimToady | this is also all related to $a ?? my $bar !! my $baz | 20:34 | |
thunks aren't quite blocks | |||
perhaps we should say that they actualy are blocks, but you can't do anything that relies on seeing explicit curlies, like my or $^a | 20:37 | ||
20:37
ejs0 left
|
|||
TimToady | so my $x if 0 would be prohibited as an implicit { my $x } if 0 | 20:38 | |
yary | I would like to think that after seeing "$a ?? my $bar !! my $baz" the compiler would create a lexical scope for ${bar ^ baz} (excuse my syntax- exclusive or on the names referenced), which at run-time would collapse to a single variable name... | 20:43 | |
and at runtime, generate an error if the the "wrong variable" is referenced | |||
but I think that's a lot to ask for | |||
TimToady | lexical variables don't do "run time" | 20:44 | |
Tene | MY::{random_string()} = 'lol'; | ||
TimToady | is illegal | ||
yary | then be permissive and allow both, as they are both declared in the same scope, and run-time value of $a doesn't matter | ||
TimToady | you can't modify MY at run time | ||
well, that's what it does right now, but there are problems with silently doing what the user didn't expect | 20:45 | ||
it's be better to just come out and say "you can't declaring things in an implciit conditional block" | 20:47 | ||
except in English | |||
yary | That's a presumtion about programmer expectation that I take exception to. | 20:48 | |
20:48
webfiend left
|
|||
yary | No curlies == no block, my assumption | 20:48 | |
20:49
payload left,
payload joined
|
|||
TimToady | do you expect foo() for ^3 to leave $_ clobbered afterward? | 20:50 | |
20:50
Sunbeam left
|
|||
yary | In the case of "$a ?? my $bar = 1 !! my $baz = 2; say $bar, $baz;" I expect it to compile, perhaps with a warning, and when run to either see "1" or "2" printed with a warning about use of an undefined variable | 20:51 | |
Now, thinking about foo() for ^3... | |||
20:53
Sunbeam joined
|
|||
yary | of course I don't expect $_ to get clobberd by a statement modifier | 20:54 | |
TimToady | which implies that $_ is somehow local | ||
and since we don't really like local the way Perl 5 does it, it tends to argue that $_ is implicitly lexically scope to the statement | 20:55 | ||
or more specifically to the body of the loop | |||
*scoped | |||
20:56
alester joined,
alester left
|
|||
TimToady | but why does that implicit block get its own lexical scope when my $x if 0; doesn't | 20:56 | |
if there's a logic problem in how the programmer is thinking, you'd rather catch it at compile time if possible | 20:57 | ||
std: 42 ?? my $a = 1 !! my $a == 2; | 20:58 | ||
p6eval | std 27084: OUTPUT«##### PARSE FAILED #####Assignment not allowed within ??!! at /tmp/ILTLx5z53c line 1:------> 42 ?? my $a = 1 !! my $a == 2; expecting any of: infix or meta-infix (with precedence tighter than item assignment) infix stopper standard stopper | ||
..terminator trait… | |||
20:58
PZt joined
|
|||
TimToady | std: 42 ?? 1,2,3 Z 4,5,6 !! 1,2,3 X 4,5,6; | 20:59 | |
p6eval | std 27084: OUTPUT«##### PARSE FAILED #####Precedence too loose within ??!!; use ??()!! instead at /tmp/youtfIQcwT line 1:------> 42 ?? 1,2,3 Z 4,5,6 !! 1,2,3 X 4,5,6; expecting any of: POST infix or meta-infix infix or meta-infix (with precedence tighter than item | ||
..assignment)… | |||
TimToady | things like that, we already catch | ||
21:00
Chillance left
|
|||
yary | Let me step back and ask, is rakudo creating a lexical block on the LHS of a "for" modifier becuase that's the right thing to do, or becuase no one can think of another way to create a lexical $_ with the proper lifespan? | 21:02 | |
pmurias | yary: it's the easiest thing | 21:03 | |
s/thing/way | 21:04 | ||
yary | And is "(my @x).push('foo') for ^10; say @x;" something that should be disallowed, or should it work? | ||
21:04
pmurias left
|
|||
lichtkind | moritz_: back? | 21:04 | |
moritz_ | lichtkind: yes | 21:06 | |
TimToady | I think that falls into the category of "overly clever", and fragile | ||
(my @x = ()).push would break it | 21:07 | ||
if the simple thing happens to be rightish, I'm not inclined to bend over backwards to make it more abusable | 21:08 | ||
21:11
acajou joined
21:14
mizioumt1 joined
21:15
Whiteknight joined
21:16
mizioumt left
|
|||
yary | programs become less readable, if I can't rely on scope of a "my" variable I declare to last until the "}" I programmed... | 21:16 | |
TimToady | false | 21:17 | |
you just wouldn't be allowed to put my there | |||
my still scopes to } | |||
21:17
jhorwitz left
|
|||
TimToady | s/false/contrary to fact condition/ :) | 21:18 | |
yary | s'OK | ||
TimToady | detection is an interesting problem though... | 21:20 | |
pmichaud | yes, it's very difficult to detect. | ||
TimToady | it almost needs to be as late as the emitter saying "I want to init this 'my' but there's no appropriate pad visible" | 21:22 | |
certainly it's post parse | |||
yary | If p6 has something like p5's "Safe" then detection is possible. The scope on the left uses a context that disallows compiling any lexicals. | ||
talking out my butt now, as we say around these parts | 21:23 | ||
TimToady | in the sense that "my $x if 0" isn't illegal until after it's thunkified the expr on the left | ||
pmichaud | well, the problem with that is | ||
{ my $i = $^a * 2; ... } for ^3 # should still work | |||
unless that block gets treated like a reference and not an immediate block. | 21:24 | ||
TimToady | sure, but that's because the { started a new scope that is opaque to the autothunker | ||
pmichaud | right, but going from what yary suggested (context disallowing lexicals) -- we'd have to reallow them within a block. | ||
yes, doable | |||
21:25
nihiliad left
|
|||
pmichaud | but you're correct that it wants to show up at the emitting stage somehow | 21:25 | |
at least, that's where PCT and Rakudo would need to place it | |||
TimToady | could probably be done at reduce action time, with sufficient up-propagation of my-ness | ||
well, something I can play with in STD | 21:26 | ||
and then we'll see how abusive the examples and test suite are | 21:27 | ||
this is one of those things that would be easier in an attribute grammar | 21:29 | ||
bbl & | 21:32 | ||
21:32
acajou left
21:49
iblechbot left
21:54
skids_ left
21:56
decasm left
21:57
kane[laptop] left
22:02
[particle] left
22:03
m-i-l-a-n joined
22:08
jan_ left
22:13
jan joined
22:14
jan is now known as Guest52921
22:28
viklund left,
viklund joined,
viklund left,
synth joined
22:38
yary left
22:44
frioux joined
22:45
M_o_C left
22:48
nErVe joined
|
|||
nErVe | can I run a ----- :: system ("mptopdf *.mp"); | 22:48 | |
Tene | nErVe: eh? | 22:49 | |
22:49
zostay left
|
|||
Tene | nErVe: in Perl 6, 'system' has been renamed to 'run' | 22:50 | |
nErVe: Yes, you can use wildcards in a 'run' invocation. | |||
22:56
mizioumt1 left
|
|||
nErVe | well i tried but it does not work | 23:04 | |
Tene | nErVe: can you explain more about what you're doing? | ||
nErVe | scsys.co.uk:8002/29807 | 23:05 | |
Tene | Okay, you're using Perl 5. #perl would be a much better place to get support for that. | 23:07 | |
nErVe | jsut one last question | ||
how do i update to perl^ | 23:08 | ||
now that I am here | |||
23:08
ssm left
|
|||
Tene | Perl 6 is still in heavy development. If you're interested, you can look here: rakudo.org/how-to-get-rakudo | 23:08 | |
nErVe | ok | 23:10 | |
btw wat does it mean | |||
when some one asks me to set a path for mptopdf | |||
? | 23:12 | ||
Tene | nErVe: it's probably not in your $PATH variable | ||
So if it's in /usr/local/bin, try: system('/usr/local/bin/mptopdf /tmp/*.mp'); or whatever | 23:13 | ||
23:15
ssm joined
23:17
DanielC left,
alester joined
23:19
skids joined
|
|||
nErVe | tried that already does not work | 23:21 | |
23:23
DanielC joined
|
|||
Tene | nErVe: what errors does it report? what happens when you try to run the script? | 23:23 | |
nErVe | well its runs and run and runs..does everything except the last mptopdf | 23:28 | |
so I have to finally kill/stop the process | |||
23:36
eternaleye_ left
23:38
eternaleye joined
23:43
sri_kraih_ joined,
sri_kraih left
23:46
ssm left
23:49
ssm joined
23:57
yary joined
23:59
lichtkind left
|