Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-06-15

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:01 ruoso joined #perl6
00:28 frew|work joined #perl6
00:47 bacek joined #perl6
00:52 payload joined #perl6
01:08 JDlugosz joined #perl6
01:09 JDlugosz anybody around?
01:12 alester joined #perl6
01:15 ruoso JDlugosz, I just replied your mail
01:16 JDlugosz Thanks, I just saw it arrive.  (pass by reference)
01:20 ruoso JDlugosz, was it helpful?
01:20 ihrd joined #perl6
01:21 JDlugosz not looked yet... in the middle of a paragraph.
01:21 JDlugosz Writing is actually a difficult job.
01:22 JDlugosz 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 #perl6
01:23 JDlugosz How do you get the italic effect for speaking in the 3rd person?
01:23 ruoso /me something
01:24 * 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
01:24 ruoso (btw, you call that an "action")
01:24 * JDlugosz wonders what a social scientist is doing with Perl
01:25 ruoso I was a Perl programmer before becoming a social scientist
01:25 JDlugosz Reading your note...
01:25 ruoso it was Perl that drove me away from computer science...
01:25 JDlugosz I agree that the capture contains the lvalue, e.g. the scalar bound to $a.
01:25 ihrd left #perl6
01:25 DanielC ruoso: Perl drove you away from computer science?
01:26 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
01:26 ruoso DanielC, yeah... but that's a long story...
01:27 DanielC k
01:27 JDlugosz Yes, I go into that in great detail in my writup.
01:27 ruoso JDlugosz, lazy proxies are everywhere in Perl 6
01:27 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.
01:28 ruoso even %a<b><c> requires lazy proxies
01:28 ruoso in order to avoid premature autovivification
01:28 JDlugosz rw doesn't enclose immutables... it demands an lvalue.
01:28 ruoso if the parameter is not an lvalue, it will create oen
01:29 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);
01:29 p6eval rakudo 77f9d7: OUTPUT«2␤»
01:29 ruoso rakudo: sub foo($a is rw) { $a += 1; say $a }; my $b = 1; foo($b); say $b;
01:29 p6eval rakudo 77f9d7: OUTPUT«2␤2␤»
01:29 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.
01:30 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)␤»
01:31 ruoso JDlugosz, well... from what I recall, it will provide you an lvalue if an immutable was sent... but the spec knows
01:33 * ruoso sleep &
01:34 JDlugosz "This [rw] requires a mutable object or container as an argument."  S06.
01:34 JDlugosz "... or binding proxy ..."
01:34 JDlugosz "... otherwise the signature fails to bind."
01:34 JDlugosz binding proxy is my paraphrase.
01:35 JDlugosz That is really necessary for mmd to distinguish rw from not.
01:35 JDlugosz Otherwise, the rw would always match and silently not update the caller.
01:36 JDlugosz It appears that rakudo is being generous, and you seem to be mixing up ref and rw (more or less).
01:36 agentzh joined #perl6
01:36 TimToady rw causes autoviv
01:36 JDlugosz Yes, autoviv.
01:37 JDlugosz I do recall that that was a major point of rw vs ref:  the latter doesn't.
01:37 mycelium joined #perl6
01:38 JDlugosz Oh, does the rw parameter itself cause the autoviviation to take place THEN, or does it delay until actually written to?
01:38 JDlugosz Tim?
01:38 JDlugosz That's something I'm diagramming now, so I'd like to know for sure shortly, if it's not to much trouble.
01:38 TimToady at binding, I've always thought
01:39 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
01:39 TimToady ref just passes the pointer willy nilly
01:40 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
01:40 JDlugosz The attempt is noted and when fails, elimiates the signature from consideration and tries again without?
01:41 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.
01:42 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?
01:42 TimToady yes, it's a sort of commit action to decide to autoviv, I expect
01:43 JDlugosz last example:  of course.  No different from $x=5 directly.
01:43 TimToady right
01:44 TimToady I see autovivifiable values as essentially the same as WHENCE values, Foo{...}
01:44 TimToady just the ... happens to know how to tweak the outer container
01:44 JDlugosz as I recall, the WHENCE is just the programmable/specifiyable way to autovivify.
01:45 TimToady it's a lazy initializer, to be used only after know when (autoviv) or where (BUILD) to init
01:45 TimToady *after we
01:45 JDlugosz Have you seen my pretty pictures?
01:46 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 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 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:48 JDlugosz 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
01:48 TimToady and mainly I wanted the default to be different from C++, where you have to put const everywhere
01:49 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 JDlugosz 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++.
01:50 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.
01:51 JDlugosz 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
01:52 JDlugosz I think that must be key to it.
01:52 TimToady we're okay with enforcing things that can be enforced easily
01:52 TimToady but like C, if you write sloppy code, you can get hurt
01:52 JDlugosz get hurt?
01:53 TimToady as in C if you depend on order of side effects when you shouldn't
01:53 TimToady I always loved the Ada spec
01:53 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.
01:53 TimToady the technical term for "get hurt" was "erroneous"
01:53 * JDlugosz always thought a debug build should randomize order of operations and stuff, to stress the code.
01:53 TimToady "if you do this, the compiler is not required to tell you it's wrong, but it is."
01:54 TimToady 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.
01:55 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
01:55 JDlugosz it?
01:55 TimToady declaring some things as erroneous
01:55 TimToady you can tighten up the typing, driving the user's insane
01:55 JDlugosz and you assume that one of those groups has sanity to preserve.
01:55 TimToady or you can tighten up the analysis, driving the implementors insane
01:56 TimToady anyway, the default of readonly on params is intended to give options to the implementors
01:57 TimToady 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.
01:57 TimToady or erroneous
01:58 JDlugosz Hmm, I wonder if compiled code will end up using pessimism techniques to fall back from optomized version after checking assumptions.
01:59 TimToady usually in Ada it means that semantic inconsistencies cannot be guaranteed to be detected
01:59 TimToady well, there's a lot of work in that direction with tracemonkey and such
01:59 TimToady and we speculated a lot on it during early design
01:59 JDlugosz Remember our thread on perlmonks about "undefined behavior".
01:59 TimToady but we're not trying to rely on it
02:00 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" :)
02:00 JDlugosz But that's an implementor's choice to make, I suppose.
02:01 JDlugosz 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."
02:01 JDlugosz In particular, "wrong" behavior is still within the object model of the high-level language.
02:01 TimToady sure, we try to be failsoft when practical
02:02 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
02:02 JDlugosz Right; essentially a random peturbance to the information model, even if it is still a well-formed information model.
02:02 TimToady "If you do this, you should expect your rocket land in your vegetable garden."
02:03 TimToady *to land
02:03 JDlugosz Code assuming things were as-it-left-it will be wrong.
02:03 TimToady each paradigm has a different approach to consistency, I think
02:03 TimToady and sometimes they fight a bit
02:03 JDlugosz "... will reformat your hard drive."  and log a bug that it doesn't, but only crashes, but never resolve that bug.
02:03 Khisanth hmm isn't leaving something unspeccedd pretty much the same as saying "don't do this"? :)
02:04 JDlugosz Khisanth:  that's the game.
02:04 TimToady well, there's no way to write n! relationships when n is large
02:04 JDlugosz But, it also leaves room for additonal specifications to apply.  Eg the compiler's own docs.
02:05 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:06 TimToady 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.
02:06 TimToady that's the hope
02:07 TimToady declaring the use of a particular version is (we hope) nailing down the API forever
02:07 JDlugosz modules...
02:07 TimToady and Perl itself
02:08 JDlugosz Thanks for the guidance.  I hope to have some serious docs with illustrations real soon now.
02:10 TimToady thanks
02:19 Marake joined #perl6
02:24 beggars joined #perl6
03:20 donaldh joined #perl6
03:35 xinming_ joined #perl6
03:41 araujo joined #perl6
05:12 eternaleye_ joined #perl6
05:16 kate21de joined #perl6
05:41 ejs0 joined #perl6
05:47 eternaleye joined #perl6
05:54 meppl joined #perl6
06:04 eternaleye_ joined #perl6
06:23 ZuLuuuuuu joined #perl6
06:55 cottoo joined #perl6
07:14 dakkar joined #perl6
07:18 barney joined #perl6
07:21 donaldh joined #perl6
07:33 chronniff joined #perl6
07:33 viklund joined #perl6
07:37 clintongormley joined #perl6
07:41 bejuryu joined #perl6
07:43 Matt-W Morning
07:48 chronniff no, not the morning!!! gotta be up in 2 1/2 hours
07:52 Matt-W I've already been up for two and a half hours...
07:53 sjohnson how's it goin
07:54 raig joined #perl6
07:56 chronniff miserable
07:56 viklund Good morning!
07:57 chronniff ha
07:57 viklund ha
07:59 chronniff oh great, my intel f****ing intel jaunty driver is swapping out everything, because I minimized a terminal no less, wonderful!!!
07:59 chronniff gotta shutdown later
08:01 ejs joined #perl6
08:01 moritz_ good morning
08:02 moritz_ viklund: any objections to naming the subs in JSON::Tiny from-json and to-json (with dashes instead of underscores)?
08:02 rindolf joined #perl6
08:04 kate21de1 joined #perl6
08:05 Matt-W sjohnson: it's going far too pollen-y
08:08 moritz_ rakudo: say "a\tb\n".trans("\n" => '\\n', "\t" => '\\t');
08:09 p6eval rakudo 77f9d7: OUTPUT«a\b\␤»
08:09 moritz_ rakudo: say "a\tb\n".trans(("\n" => '\\n', "\t" => '\\t'));
08:09 p6eval rakudo 77f9d7: OUTPUT«a\b\␤»
08:09 moritz_ rakudo: say "a\tb\n"
08:09 p6eval rakudo 77f9d7: OUTPUT«a  b␤␤»
08:10 ejs1 joined #perl6
08:10 moritz_ rakudo: say "a\tb\n".trans(("\n" => 'N', "\t" => 'T'));
08:10 p6eval rakudo 77f9d7: OUTPUT«aTbN␤»
08:10 moritz_ rakudo: say "a\tb\n".trans(("\n" => '\n', "\t" => '\t'));
08:10 p6eval rakudo 77f9d7: OUTPUT«a\b\␤»
08:10 Matt-W moritz_: that looks wrong
08:10 moritz_ rakudo: say "a\tb\n".trans(("\n" => 'NN', "\t" => 'TT'));
08:10 p6eval rakudo 77f9d7: OUTPUT«aTbN␤»
08:10 moritz_ Matt-W: it does indeed
08:10 Matt-W aaah
08:11 moritz_ it takes only the first replacement char
08:11 Matt-W then it looks rather less wrong :)
08:11 Matt-W although slightly irritating
08:11 cognominal joined #perl6
08:11 moritz_ no, it's wrong that it only takes the first
08:11 moritz_ I tried to describe the current behaviour
08:12 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
08:15 Matt-W heh
08:15 Matt-W a lot of the time, actually
08:15 Matt-W it may not always be immediately obvious
08:16 viklund moritz_: none at all
08:17 viklund I would have used hyphens if it wasn't for old habit
08:18 * viklund loves wikipedia (http://en.wikipedia.org/wiki/Hyphen)
08:30 finanalyst joined #perl6
08:32 moritz_ viklund: I'll also rename 04-generate_json.t to 04-roundtrip.t, because that's what the test really does
08:34 finanalyst rakudo: say (map {$_}, -1..3).perl; say (map {$_}, 3..-1).perl
08:34 p6eval rakudo 77f9d7: OUTPUT«[-1, 0, 1, 2, 3]␤[]␤»
08:35 finanalyst Is this a bug in Rakudo, or does the spec have something to say about downward moving ranges?
08:36 moritz_ finanalyst: it works as designed
08:36 moritz_ you'd do that with 3..-1 :by(-1), but that's not yet implemented
08:36 finanalyst ah. i tried :by(-1) but it failed on me locally. thanx for the help
08:37 moritz_ you're welcome
08:41 moritz_ rakudo: say "\n\t".trans(["\n", "\t"] => ['\n', '\t'])
08:41 p6eval rakudo 77f9d7: OUTPUT«\n\t␤»
08:41 Matt-W interesting
08:42 finanalyst rakudo: say (map {$^a + $^b}, ((0 .. 4) Z (2 .. 6))).max
08:42 p6eval rakudo 77f9d7: OUTPUT«10␤»
08:42 finanalyst say max { $^a + $^b },((0 .. 4) Z (2 .. 6))
08:42 finanalyst rakudo: say max { $^a + $^b },((0 .. 4) Z (2 .. 6))
08:42 p6eval rakudo 77f9d7: OUTPUT«0␤»
08:44 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)␤»
08:44 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/OJ6CtM4ZfZ:1)␤called from Main (/tmp/OJ6CtM4ZfZ:2)␤»
08:46 moritz_ rakudo: say ord("\c[127]")
08:46 p6eval rakudo 77f9d7: OUTPUT«127␤»
08:46 moritz_ rakudo: say ord("\c127")
08:46 p6eval rakudo 77f9d7: OUTPUT«127␤»
08:47 moritz_ rakudo: say hex(3)
08:47 p6eval rakudo 77f9d7: OUTPUT«Could not find non-existent sub hex␤»
08:48 viklund joined #perl6
08:49 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.
08:50 viklund nice
08:50 moritz_ rakudo: /<-[\c0..\c127]>/
08:50 p6eval rakudo 77f9d7:  ( no output )
08:50 viklund btw, hex is spelled :16() in p6
08:50 moritz_ rakudo: say :16(33)
08:50 viklund rakudo: say :16(24)
08:51 p6eval rakudo 77f9d7: OUTPUT«51␤»
08:51 p6eval rakudo 77f9d7: OUTPUT«36␤»
08:51 viklund ;)
08:51 viklund rakudo: say :23(24)
08:51 moritz_ no, that's the other direcction
08:51 p6eval rakudo 77f9d7: OUTPUT«50␤»
08:51 moritz_ oh wait
08:51 moritz_ it's the same direction as hex() in perl 5 does
08:51 viklund yes
08:51 moritz_ but not what I want :/
08:51 moritz_ rakudo: printf "%x", 33
08:51 p6eval rakudo 77f9d7: OUTPUT«21»
08:51 moritz_ better
08:52 jferrero joined #perl6
08:53 moritz_ rakudo: printf "%04x", 33
08:53 p6eval rakudo 77f9d7: OUTPUT«0021»
08:54 moritz_ rakudo: say "möp".subst(/<-[\c0..\c127]>/, { sprintf '\u%04x', ord(~$_) }, :g)
08:54 p6eval rakudo 77f9d7: OUTPUT«m\u00f6p␤»
08:55 viklund yes
08:55 moritz_ rakudo: say "möp".subst(/<-[\c0..\c127]>/, { sprintf '\u%04x', ord(~$/) }, :g)
08:55 p6eval rakudo 77f9d7:  ( no output )
08:55 viklund heh
08:55 moritz_ rakudo: say "möp".subst(/<-[\c0..\c127]>/, { sprintf '\u%04x', ord(~$/) }, :g)
08:55 p6eval rakudo 77f9d7: OUTPUT«m\u00f6p␤»
08:55 moritz_ p6eval hiccup?
08:56 moritz_ anyway, neither works locally here
08:56 viklund really strange
08:56 viklund hold on, I'll try
08:56 viklund try putting it in a file as well
08:56 moritz_ at least not on the result of a .trans
08:57 moritz_ it says "Lexical '$/' not found"
08:58 moritz_ rakudo: say "\nö".trans(["\n"] => ['\n']).subst(/<-[\c0..\c127]>/, { sprintf '\u%04x', ord(~$_) }, :g)
08:58 p6eval rakudo 77f9d7: OUTPUT«\n\u00f6␤»
08:58 moritz_ rakudo: say "\nö".trans(["\n"] => ['\n']).subst(/<-[\c0..\c127]>/, { sprintf '\u%04x', ord(~$_) }, :g)
08:58 p6eval rakudo 77f9d7: OUTPUT«\n\u00f6␤»
08:58 viklund moritz_: I can run it from a file
08:59 viklund rakudos cmd-line unicode handling is very buggy
08:59 moritz_ yes, I know that
09:00 moritz_ viklund: if you pull json and run t/04-roundtrip.t you'll see what I mean
09:05 viklund ill do that l8r, right now im playing with $daughter
09:05 moritz_ have fun ;-)
09:15 DanielC joined #perl6
09:28 xinming joined #perl6
09:31 Chillance joined #perl6
09:36 M_o_C joined #perl6
09:47 bejuryu left #perl6
09:55 ejs2 joined #perl6
10:02 sri_kraih joined #perl6
10:10 sri_kraih_ joined #perl6
10:31 DanielC @seen mberends
10:31 lambdabot I saw mberends leaving #perl6 15h 2m 16s ago, and .
11:02 moritz_ viklund: I tracked down the bug, it only happens in multi subs, not in ordinary subs
11:13 iblechbot joined #perl6
11:21 donaldh joined #perl6
11:28 M_o_C joined #perl6
11:39 skids_ joined #perl6
11:48 moritz_ with latest (optimized) parrot I get a bunch of spectestail failures
11:49 M_o_C joined #perl6
11:56 payload joined #perl6
11:59 zamolxes joined #perl6
12:11 ruoso joined #perl6
12:25 pmurias joined #perl6
12:28 mib_mqys0i joined #perl6
12:29 pmurias ruoso: hi
12:32 Caringo joined #perl6
12:41 elmex joined #perl6
12:55 ruoso hi pmurias
12:58 pe_cua joined #perl6
13:00 ruoso pmurias, are you planning a blog post for the work of the last week?
13:01 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 #perl6
13:02 pmurias ruoso: what should i work on now (other than on the blog post)
13:02 pmurias ?
13:03 Jaaap Does anybody have any ideas how to parse python-like indented code in a perl6 Grammar?
13:03 Jaaap pynie uses a magican indent_same and dedent but i don't know where that's coming from.
13:03 ruoso pmurias, do mildew compiles "multi foo ($a, $b, $c) {...}" already?
13:03 pmurias not yet
13:04 ruoso that seems like a good next target
13:06 Matt-W Jaaap: that comes from src/parser/indent.pir
13:07 Jaaap Matt-W ah. thx. looking at it now.
13:08 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?
13:08 Jaaap Interesting... can i do that in a perl6 grammar too?
13:08 Matt-W you can add methods, sure
13:08 Matt-W grammar is just a special kind of class
13:09 Jaaap and call them with <.method> or soimething?
13:09 ruoso pmurias, yes... TimToady said it can assume the candidate list is fixed
13:10 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
13:10 Jaaap S05. ok.
13:12 Jaaap looks like <\v> matches vertical whitespace
13:12 Jaaap i wonder how trhat's gonna work
13:13 Matt-W I'm not entirely sure that would be helpful
13:13 Jaaap How would that even work, multi-line spacing?
13:13 Matt-W it would be things like the vertical tab character, I assume
13:14 rjh newlines
13:14 rjh carraige return + linefeed
13:14 Jaaap ah like that.
13:14 Jaaap bummer
13:15 Jaaap so that is probably not the way to go.
13:15 Jaaap I could still try injecting helper methods.
13:15 rjh Jaaap: what language are you parsing?
13:16 Jaaap ehm... my own.
13:16 Jaaap looks a bit like python
13:16 ruoso pmurias, there are two new leaks in smop
13:16 Jaaap only tabs for indentations
13:16 rjh i hate you
13:16 Jaaap ;)
13:16 Jaaap spaces are for nitwits ;-)
13:18 * rjh restains himself
13:19 rjh oh god
13:19 rjh that's the worst typo ever
13:19 Jaaap lol
13:19 pmurias ruoso: fixing...
13:20 ruoso Jaaap, but you can also send parameters to tokens iirc
13:20 ruoso so you can send the "current identation level" as a parameter
13:20 Jaaap hmmm
13:20 Jaaap lt me think about that
13:21 Jaaap you mean send the parameter to the corresponding action method right?
13:22 ruoso the token is a method
13:22 ruoso it can receive parameters
13:22 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
13:23 Jaaap ruoso: Oh like that?
13:23 ruoso pmurias, I think you can use STD cheats...
13:24 Jaaap is it also possible to modify the source (to remove on tab level)?
13:24 Jaaap on=one
13:25 pugs_svn r27081 | pmurias++ | [re-smop] fix 2 memory leaks
13:26 phenny joined #perl6
13:29 mizioumt joined #perl6
13:30 agentzh left #perl6
13:30 Jaaap perhaps it's easier if i pre-process the source and inject curlies.
13:32 payload joined #perl6
13:34 agentzh joined #perl6
13:35 Jaaap left #perl6
13:42 moritz_ btw I posted http://www.perlmonks.org/?node_id=771635
13:45 * Matt-W wonders why Elf emits Common Lisp
13:46 Matt-W Not that I'm complaining, that's pretty cool really :)
13:46 pmurias Matt-W: Common Lisp is quite fast
13:46 Matt-W I have never made the time to learn it
13:46 Matt-W I probably should
13:52 pmurias ruoso: if i do my multi foo() {...}; multi foo() {...} does the second variant get installed in the lexical or package scope?
13:57 hanekomu joined #perl6
13:58 ruoso pmurias, "our" means "create in this lexical scope, and create an alias in the package"
13:58 ruoso so it's just like
13:59 ruoso my multi foo() {...}; $?PACKAGE<&foo> := &foo;
14:03 pugs_svn r27082 | pmurias++ | [re-smop] fix commit 27081
14:03 PacoLinux joined #perl6
14:04 pmurias ruoso: multi methods are our by default?
14:04 ruoso I don't think so
14:04 ruoso methods are "has" by default
14:04 ruoso I think that applies to multi methods as well
14:05 pmurias and multi subs?
14:06 ruoso subs are our by default
14:06 ruoso I think that applies to multi subs as well
14:07 pmurias so in my first question it would be my multi foo() {...};our multi foo() {...}
14:09 TimToady yes, and the package variant is ignored by the dispatcher
14:09 TimToady because the multi dispatch only looks in lexical scopes
14:10 TimToady the situation is no different from if the second multi was lexically imported from another package
14:13 ruoso TimToady, there was a question few minutes ago about matching indentation level...
14:14 ruoso I thought that to be an interesting case for parameters to tokens
14:14 decasm joined #perl6
14:14 ruoso but I'm not sure how it would look like
14:17 TimToady I'd use a context variable for remembering previous indent
14:17 TimToady but yes, could be done with a parameter
14:18 Matt-W Pynie does it with some PIR, but I suspect this might be due to 'not implemented in PGE'
14:19 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
14:20 ruoso you mean token foo ($indent_level) { ... } ?
14:20 pugs_svn r27083 | pmurias++ | [re-smop] adding variants using the multi foo(...) {...} syntax
14:20 TimToady <?{ $<myindent>.chars < $indent_level }>
14:22 TimToady which PGE won't implement yet, of course
14:22 ruoso cool...
14:22 TimToady token foo ($indent_level is context) would show up to an action routine, in theory
14:23 TimToady but if you do that, might as well be a context var on the staement list.
14:23 TimToady *statement
14:23 sri_kraih joined #perl6
14:24 ruoso can context variables be *declared* inside tokens?
14:24 TimToady stick a : in front of the my
14:24 TimToady there's lots of these in STD
14:24 ruoso cool...
14:24 TimToady :my slurps everything up to the next ;
14:25 ruoso then using a context var is really a better solution
14:26 ruoso how tied gimme5 is to STD?
14:26 ruoso I mean...
14:26 TimToady that's why I'm working on viv
14:26 ruoso how possible would it be to use it to compile a different grammar?
14:27 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?
14:28 TimToady I've got viv to where it can completely translate the operator prec parser from STD
14:28 TimToady then yes, sure, but some constructs have to be written in a way that helps gimme5
14:29 TimToady for gimme5 the # end grammar comments are not optional
14:29 TimToady for instance
14:29 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...
14:29 TimToady and a :delete must be applied to a single piece of text without whitespace
14:29 xinming joined #perl6
14:30 TimToady interesting as in the ancient curse
14:30 ruoso interesting as "just to say that I can" ;)
14:31 TimToady that's like trying to prove you can sneak a gun aboard a plane :)
14:32 moritz_ s/gun/snake/ ;-)
14:32 frew you might get killed trying?
14:32 ruoso or trying to prove the network is insecure, and getting arrested by that...
14:32 rgs joined #perl6
14:34 cognominal ho, an Hergé Hesse :)
14:36 xinming_ joined #perl6
14:37 jdv79_ joined #perl6
14:41 * diakopter de/relurks
14:44 pmurias diakopter: hi
14:45 pmurias ruoso: i once used gimme5 to compile a sm0p grammar
14:50 sjohnson hey d00dz
14:50 pmichaud Good morning, #perl6
14:50 pmurias sjohnson: hi
14:50 moritz_ hi pmichaud
14:51 moritz_ pmichaud: do you plan to merge the ins brach before the release?
14:51 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:56 PerlJam joined #perl6
14:58 PerlJam good morning
15:00 macae joined #perl6
15:04 justatheory joined #perl6
15:06 pmichaud moritz_: I was hoping to merge the ins branch before release, but I don't think that's going to happen.
15:06 pmichaud There are known problems with the branch on at least two platforms, and it's presently an all-or-nothing merge
15:06 pmichaud i.e., building from an installed parrot doesn't co-exist with building from a build-tree parrot
15:07 pmichaud 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 pmichaud (and I'm handicapped by not having any of the failing platforms handy on which I can test.)
15:09 DanielC Rakudo has regular releases, right? When are they? Parrot is the second Tuesday of every month.
15:09 DanielC Tomorrow's Parrot release has a bugfix that I'm interested in. Which version of Rakudo would include it?
15:11 pmichaud Rakudo's releases are ~ 2 days after each Parrot release.
15:11 pmichaud So, Rakudo will have its next release on Thursday.
15:11 Matt-W Rakudo doesn't include Parrot
15:11 DanielC Matt-W: Yes and no. It downloads parrot.
15:11 pmichaud Rakudo includes Parrot by reference.
15:11 pmichaud which version of Parrot are you interested in?
15:11 DanielC Tomorrow's.
15:11 DanielC They fixed a bug with is_deeply()
15:12 pmichaud The Parrot version of is_deeply?
15:12 DanielC yeah
15:12 pmichaud Because Rakudo uses its own, not Parrot's.
15:12 DanielC They just added a patch so that it works correctly with hashes.
15:13 hse joined #perl6
15:13 hse hi
15:13 DanielC o/ hse
15:13 pmichaud The is_deeply that Parrot provides is not the one that Rakudo uses.
15:13 hse where can i get tcp-tunnel
15:13 hse ?
15:13 DanielC pmichaud: I'm pretty sure I'm talking about the Parrot one.
15:13 ejs1 joined #perl6
15:13 pmichaud DanielC: okay, no problem.
15:14 pmichaud 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
15:15 hse any perl master here?
15:15 TimToady only perl6 masters
15:15 hse lol
15:15 DanielC I guess I could install a separate Parrot somewhere else...
15:15 DanielC hse: I think TimToady knows Perl fairly well.
15:16 TimToady I know nothing about tcp-tunnel
15:16 hse is it possible to pm him?
15:16 DanielC hse: Seriously, you probably want to go to #perl
15:16 hse thanks
15:16 pmichaud DanielC: you're writing plain PIR, or inline PIR?
15:16 hse left #perl6
15:16 DanielC Go to #perl. That's where you'll find the best people to help you with tcp-tunnel.
15:17 DanielC plain PIR
15:17 DanielC mberend's idea.
15:17 pmichaud okay, then yes, the parrot is_deeply is the one you want.
15:17 DanielC y
15:17 pmichaud anyway, the larger point is that Rakudo doesn't currently tie itself to Parrot releases -- it tends to target intermediate development parrots.
15:18 DanielC ah..
15:18 pmichaud for example, the current version of Rakudo is not using the last released version of Parrot
15:18 DanielC I sort of assumed that it did.
15:18 rindolf TimToady: who introduced the -i flag? Was it you?
15:18 rindolf TimToady: did perl get it from GNU sed or the other way around?
15:18 pmichaud in fact, the current version of Rakudo won't even work with the last released version of Parrot
15:19 DanielC pmichaud: :-(
15:19 rgs rindolf: I think that GNU sed got it from sed
15:19 TimToady I did.  I didn't know sed had it too...
15:19 pmichaud DanielC: it's just an indication of how much Rakudo is driving Parrot development, I think.
15:19 rindolf rgs: so it's a standard flag?
15:19 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()
15:19 rgs at least it's in BSD sed
15:20 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 pmichaud (because Rakudo needed some features that were added to Parrot between May 19 and May 22.)
15:20 donaldh joined #perl6
15:20 DanielC ah
15:20 sjohnson TimToady: have you seen Hikaru no Go?
15:21 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 #perl6
15:21 pmichaud DanielC: the version of Parrot that Rakudo expects is kept in build/PARROT_REVISION
15:22 pmichaud at this moment, Rakudo expects to have Parrot  r39531.
15:22 * DanielC tries to check what version of Parrot has the is_deeply fix
15:23 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 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:24 DanielC *nod*
15:24 TimToady sjohnson: いえ。
15:25 pmichaud DanielC: at any rate, when Parrot cuts its release tomorrow, Rakudo will immediately bump its expected version to use that release.
15:25 pmichaud (assuming Rakudo can build/run against that version)
15:25 DanielC ok
15:25 DanielC Question: is mberends a Rakudo developer?
15:26 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 pmichaud Yes, mberends is a Rakudo developer.  He did Temporal.pm, and a lot of work on IO::Socket
15:26 DanielC Ok. Good. I'm counting on him to know how to integrate the module-lib into Rakudo.
15:27 donaldh left #perl6
15:28 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:29 pmichaud Yes.
15:29 rindolf TimToady: I don't see -i here - http://www.opengroup.org/onlinep​ubs/000095399/utilities/sed.html
15:29 DanielC thanks
15:29 rindolf TimToady: so I guess GNU sed inherited it from Perl.
15:29 TimToady belike
15:31 TimToady bbl &
15:35 alester joined #perl6
15:36 yitz_ joined #perl6
16:01 viklund joined #perl6
16:20 jhorwitz joined #perl6
16:21 Psyche^ joined #perl6
16:33 eternaleye joined #perl6
16:35 eternaleye_ joined #perl6
16:39 |MoC| joined #perl6
16:40 payload joined #perl6
16:44 bejuryu joined #perl6
16:46 Sark23 hello, is here someone perl core developer ?
16:47 moritz_ Sark23: Perl 5 or 6?
16:48 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:49 moritz_ Sark23: try #p5p on irc.perl.org
16:49 Sark23 thanks
16:54 ruoso @tell pmurias I think you forgot to add a file
16:54 lambdabot Consider it noted.
17:00 justatheory joined #perl6
17:03 cdarroch joined #perl6
17:04 ruoso_ joined #perl6
17:06 ruoso joined #perl6
17:14 macae joined #perl6
17:16 nihiliad joined #perl6
17:20 jferrero joined #perl6
17:43 lichtkind joined #perl6
18:06 xinming joined #perl6
18:12 lichtkind is here some guy who is involved in planet perl 6?
18:13 justatheory joined #perl6
18:33 hercynium joined #perl6
18:38 sri_kraih joined #perl6
18:46 mizioumt1 joined #perl6
18:52 dalek rakudo: 0d5221a | pmichaud++ | build/PARROT_REVISION:
18:52 dalek rakudo: Bump PARROT_REVISION to get latest parrot changes.
18:52 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/0​d5221a380fd2ac5e065cc778bdf1e38f82c1215
18:53 payload oh i have to recompile
18:59 FurnaceBoy joined #perl6
19:14 pmichaud rakudo: say "가".ord
19:14 p6eval rakudo 77f9d7: OUTPUT«44032␤»
19:15 pmichaud rakudo: say "나".ord
19:15 p6eval rakudo 77f9d7: OUTPUT«45208␤»
19:15 silug joined #perl6
19:17 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 #perl6
19:22 pmichaud rakudo:   say chr(229) ~ chr(0x263b);
19:22 [particle] joined #perl6
19:22 p6eval rakudo 77f9d7: OUTPUT«\xE5☻␤»
19:22 pmichaud looks like rakudo hasn't updated yet.
19:27 mizioumt joined #perl6
19:28 pmichaud I think tomorrow will be my first Rakudo day.  :-)
19:28 pmichaud (for Vienna.pm)
19:28 dalek rakudo: d3185be | pmichaud++ | docs/spectest-progress.csv:
19:28 dalek rakudo: spectest-progress.csv update: 404 files, 11535 passing, 0 failing
19:28 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/d​3185be45f4b770890164d96cd9509d2a9ef988f
19:28 dalek rakudo: ba09b27 | pmichaud++ | :
19:28 dalek rakudo: Merge branch 'master' of git@github.com:rakudo/rakudo
19:28 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/b​a09b2773ac6c67fed4ac4ee74e54f41f6cdd1a2
19:32 donaldh left #perl6
19:35 yary joined #perl6
19:36 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/sSRL8BlFSu␤panic at line 1 column 0 (pos 0): Can't understand next input--giving up␤WHERE: (my @random_numbers).push: int␤WHERE:/\<-- HERE␤  STD_red/prelude.rb:99:in `panic'␤  STD_red/std.rb:76:in `scan_unitstopper'␤  STD_red/std.rb:224:in `comp_unit'␤
19:36 p6eval ..STD_red…
19:36 p6eval ..pugs: OUTPUT«3 4 3␤»
19:36 p6eval ..rakudo 77f9d7: OUTPUT«Lexical '@random_numbers' not found␤»
19:37 yary Methinks pugs wins in that statement- anyone think that bug looks familiar? Or should I submit?
19:37 webfiend joined #perl6
19:39 yary Or is the scope of "my" really limited to inside parenthesis?
19:40 PerlJam that would be weird IMHO
19:42 pmichaud rakudo doesn't understand the ':' syntax, I think.
19:43 pmichaud also, "int" isn't a valid prefix op.
19:43 pmichaud rakudo:  (my @random_numbers).push( int(10.rand) ) for ^3;   say @random_numbers.join(' ');
19:43 p6eval rakudo 77f9d7: OUTPUT«Lexical '@random_numbers' not found␤»
19:44 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␤»
19:44 pmichaud anyway, I don't think the scope of the 'my' should be limited to the inside parens.
19:48 viklund moritz_: I worked around that $/ in multi bug for json
19:48 viklund you give up to soon after hitting a bug in rakudo ;)
19:48 pmichaud I think .trans probably needs a substantial rewrite.
19:49 viklund it was a problem with subst as well
19:49 viklund something happens inside a multi
19:49 pmichaud That one also.  :-)
19:49 viklund but the workaround was calling an ordinary sub from the multi to do the work
19:50 pmichaud the issue is that .trans and .subst aren't providing a $_ to match against.
19:50 viklund not anywhere?
19:50 pmichaud not that I know of.
19:50 pmichaud at least, that seems like the likely source of the problem.
19:51 viklund yes, indeed
19:51 pmichaud rakudo:  say map { .chr }, 65..90
19:51 p6eval rakudo 77f9d7: OUTPUT«sh: ./perl6: No such file or directory␤»
19:51 viklund compiling...
19:51 pmichaud right.
19:53 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
19:54 PerlJam s/a link/the links/  :)
19:54 pmichaud rakudo:  say map { .chr }, 65..90
19:54 p6eval rakudo ba09b2: OUTPUT«ABCDEFGHIJKLMNOPQRSTUVWXYZ␤»
19:54 yary simpler test case-
19:54 pmichaud rakudo:   say chr(229) ~ chr(0x263b);
19:54 yary rakudo: (my $x = 1); say $x;
19:54 p6eval rakudo ba09b2: OUTPUT«å☻␤»
19:54 p6eval rakudo ba09b2: OUTPUT«1␤»
19:54 pmichaud \o/
19:54 yary hmm
19:55 yary rakudo: (my @x= 0..1); say @x;
19:55 p6eval rakudo ba09b2: OUTPUT«01␤»
19:55 pmichaud oh, I know the problem.
19:55 pmichaud it's the declaration of the "my" as modified by the "for"
19:55 pmichaud rakudo:   my $x = 1 for ^3;  say $x;
19:55 p6eval rakudo ba09b2: OUTPUT«Lexical '$x' not found␤»
19:56 yary ++pmichaud
19:56 pmichaud the "for" modifier is imposing a block on what it modifies.
19:57 kane__ joined #perl6
19:57 pmurias joined #perl6
20:01 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:02 PerlJam What does S04 say about it?  (if anything)
20:05 nihiliad joined #perl6
20:08 M_o_C joined #perl6
20:08 mikehh joined #perl6
20:17 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.
20:18 pmurias yary: generally only curlies introduce a new lexical scope
20:18 justatheory joined #perl6
20:18 pmichaud rakudo:   $_ = 'hello';   .say for ^3;   say $_;
20:18 p6eval rakudo ba09b2: OUTPUT«0␤1␤2␤hello␤»
20:19 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
20:19 yary sorr fo rthe verbosity
20:20 pugs_svn r27084 | pmurias++ | [re-smop]
20:20 pugs_svn r27084 | pmurias++ | fix bug in AST::Seq (TODO check & fix other nodes)
20:20 pugs_svn r27084 | pmurias++ | multis install a Multi if it's the first time in a block
20:20 pmurias yary: verbosity is better then ambiguity
20:22 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 pmichaud at any rate, the $_ that is used on the lhs of a for modifier isn't the same as the $_.
20:22 pmichaud 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:26 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 � and �
20:28 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.
20:28 pmichaud It says to get to the outer $_ one uses OUTER::<$_>
20:29 pmichaud 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:30 TimToady that's true for any lexical in any lexical scope
20:30 TimToady if $_ is declared internally and $foo externally
20:30 pmichaud TimToady: We're looking at the case of:
20:30 pmichaud say $_ for ^3;
20:30 TimToady yes, I've been thinking abou tit
20:30 pmichaud okay.
20:31 TimToady the spec only requires a private copy for $_ currently
20:31 pmichaud correct.
20:31 TimToady doesn't require a block
20:31 pmichaud I think the use of a block might've been a Rakudo shortcut.
20:31 TimToady we could say it is implciit
20:31 TimToady but...
20:31 TimToady we can't really allow $^a to pay attention to implicit {}
20:31 pmichaud interestingly, I'm not sure that it does in Rakudo's case.
20:32 pmichaud rakudo:   say $^a for ^3;
20:32 p6eval rakudo ba09b2: OUTPUT«too few arguments passed (0) - 1 params expected␤in Main (/tmp/jBX8Gm96fv:0)␤»
20:32 TimToady well, could use a better error :)
20:32 pmichaud sure.
20:32 pmichaud rakudo:    { say $^a for ^3 }('hello');
20:32 p6eval rakudo ba09b2: OUTPUT«hello␤hello␤hello␤»
20:32 moritz_ std: say $^a for ^3;
20:32 p6eval std 27084: OUTPUT«ok 00:02 38m␤»
20:32 pmurias couldn't we just throw away the for modifier? ;)
20:33 viklund for what?
20:34 TimToady this is also all related to $a ?? my $bar !! my $baz
20:34 TimToady thunks aren't quite blocks
20:37 TimToady 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:38 TimToady so my $x if 0 would be prohibited as an implicit { my $x } if 0
20:43 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 yary and at runtime, generate an error if the the "wrong variable" is referenced
20:43 yary but I think that's a lot to ask for
20:44 TimToady lexical variables don't do "run time"
20:44 Tene MY::{random_string()} = 'lol';
20:44 TimToady is illegal
20:44 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
20:44 TimToady you can't modify MY at run time
20:45 TimToady well, that's what it does right now, but there are problems with silently doing what the user didn't expect
20:47 TimToady it's be better to just come out and say "you can't declaring things in an implciit conditional block"
20:47 TimToady except in English
20:48 yary That's a presumtion about programmer expectation that I take exception to.
20:48 yary No curlies == no block, my assumption
20:49 payload joined #perl6
20:50 TimToady do you expect foo() for ^3 to leave $_ clobbered afterward?
20:51 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 yary Now, thinking about foo() for ^3...
20:53 Sunbeam joined #Perl6
20:54 yary of course I don't expect $_ to get clobberd by a statement modifier
20:54 TimToady which implies that $_ is somehow local
20:55 TimToady 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 TimToady or more specifically to the body of the loop
20:55 TimToady *scoped
20:56 alester joined #perl6
20:56 TimToady but why does that implicit block get its own lexical scope when my $x if 0; doesn't
20:57 TimToady if there's a logic problem in how the programmer is thinking, you'd rather catch it at compile time if possible
20:58 TimToady 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:␤------> [32m42 ?? my $a [31m= 1 !! my $a == 2;[0m␤    expecting any of:␤   infix or meta-infix (with precedence tighter than item assignment)␤       infix stopper␤    standard stopper␤
20:58 p6eval ..terminator␤     trait␤…
20:58 PZt joined #perl6
20:59 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:␤------> [32m42 ?? 1[31m,2,3 Z 4,5,6 !! 1,2,3 X 4,5,6;[0m␤    expecting any of:␤ POST␤   infix or meta-infix␤        infix or meta-infix (with precedence tighter than item
20:59 p6eval ..assignment)…
20:59 TimToady things like that, we already catch
21:02 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:03 pmurias yary: it's the easiest thing
21:04 pmurias 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 lichtkind moritz_: back?
21:06 moritz_ lichtkind: yes
21:06 TimToady I think that falls into the category of "overly clever", and fragile
21:07 TimToady (my @x = ()).push  would break it
21:08 TimToady if the simple thing happens to be rightish, I'm not inclined to bend over backwards to make it more abusable
21:11 acajou joined #perl6
21:14 mizioumt1 joined #perl6
21:15 Whiteknight joined #perl6
21:16 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:17 TimToady false
21:17 TimToady you just wouldn't be allowed to put my there
21:17 TimToady my still scopes to }
21:18 TimToady s/false/contrary to fact condition/  :)
21:18 yary s'OK
21:20 TimToady detection is an interesting problem though...
21:20 pmichaud yes, it's very difficult to detect.
21:22 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 TimToady certainly it's post parse
21:22 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.
21:23 yary 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
21:23 pmichaud well, the problem with that is
21:23 pmichaud { my $i = $^a * 2; ... } for ^3    # should still work
21:24 pmichaud 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
21:24 pmichaud right, but going from what yary suggested (context disallowing lexicals) -- we'd have to reallow them within a block.
21:24 pmichaud yes, doable
21:25 pmichaud but you're correct that it wants to show up at the emitting stage somehow
21:25 pmichaud at least, that's where PCT and Rakudo would need to place it
21:25 TimToady could probably be done at reduce action time, with sufficient up-propagation of my-ness
21:26 TimToady well, something I can play with in STD
21:27 TimToady and then we'll see how abusive the examples and test suite are
21:29 TimToady this is one of those things that would be easier in an attribute grammar
21:32 TimToady bbl &
21:32 acajou left #perl6
21:56 decasm left #perl6
22:03 m-i-l-a-n joined #perl6
22:13 jan joined #perl6
22:28 viklund joined #perl6
22:28 synth joined #perl6
22:44 frioux joined #perl6
22:48 nErVe joined #perl6
22:48 nErVe can I run a -----  ::     system ("mptopdf *.mp");
22:49 Tene nErVe: eh?
22:50 Tene nErVe: in Perl 6, 'system' has been renamed to 'run'
22:50 Tene nErVe: Yes, you can use wildcards in a 'run' invocation.
23:04 nErVe well i tried but it does not work
23:04 Tene nErVe: can you explain more about what you're doing?
23:05 nErVe http://scsys.co.uk:8002/29807
23:07 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
23:08 nErVe how do i update to perl^
23:08 nErVe now that I am here
23:08 Tene Perl 6 is still in heavy development.  If you're interested, you can look here: http://rakudo.org/how-to-get-rakudo
23:10 nErVe ok
23:10 nErVe btw  wat does it mean
23:10 nErVe when some one asks me to set a path for mptopdf
23:12 nErVe ?
23:12 Tene nErVe: it's probably not in your $PATH variable
23:13 Tene So if it's in /usr/local/bin, try: system('/usr/local/bin/mptopdf /tmp/*.mp'); or whatever
23:15 ssm joined #perl6
23:17 alester joined #perl6
23:19 skids joined #perl6
23:21 nErVe tried that already does not work
23:23 DanielC joined #perl6
23:23 Tene nErVe: what errors does it report?  what happens when you try to run the script?
23:28 nErVe well its runs and run and runs..does everything except the last mptopdf
23:28 nErVe so I have to finally kill/stop the process
23:38 eternaleye joined #perl6
23:43 sri_kraih_ joined #perl6
23:49 ssm joined #perl6
23:57 yary joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo