[perl #38406] [BUG] PGE - truncating PIR code generated by p6rule
Is this bug resolved? If not, what platforms is it still failing on? -J -- > [doughera - Mon Feb 13 09:10:50 2006]: > > On Fri, 10 Feb 2006, Allison Randal wrote: > > > On Feb 10, 2006, at 9:56, Andy Dougherty via RT wrote: > > > > > > I too had seen this memory problem before on Solaris/SPARC, but > I'm > > > pretty sure I saw it even when running t/past_node_5.pir directly. > > > However, trying again today, I'm happy to report that that > particular > > > problem seems to be gone. > > > > Excellent. > > > > > Of course an awful lot of the tests still > > > fail, but I don't know if that's expected or not. > > > > All of the test should be passing (at least, they are on other > platforms). > > Could you send me more details on the failing tests? Some of the > generated > > .out and .pir files would be a good start (running with > POSTMORTEM=1). > > > I don't pretend to remotely understand what the code is attempting to > do, let alone how it's failing, but the failures vaguely seem to be > fairly > similar. It looks like 'node.set_node' doesn't actually end up doing > anything. So for t/past_2.pir, for example, we have > > .sub _main > load_bytecode 'languages/punie/lib/PAST.pir' > .local pmc node > node = new 'PAST::Code' > $P0 = new PerlString > $P0 = 'bar' > $P1 = new PerlArray > push $P1, $P0 > node.set_node('foo', 42, $P1) > $P1 = getattribute node, 'source' > print $P1 > print "\n" > $P1 = getattribute node, 'pos' > print $P1 > print "\n" > $P2 = getattribute node, 'children' > $P3 = $P2[0] > print $P3 > print "\n" > .return () > .end > > and for t/past_2.out, we have > > 1 > 1 > bar > > The other one that looks significantly different is t/past_op_1.pir. > The > pir file is > > .sub _main > load_bytecode 'languages/punie/lib/PAST.pir' > .local pmc node > node = new 'PAST::Op' > node.set_node('foo', 42, 'bar') > $P1 = getattribute node, 'source' > print $P1 > print "\n" > $P1 = getattribute node, 'pos' > print $P1 > print "\n" > $P1 = getattribute node, 'op' > print $P1 > print "\n" > .return () > .end > > and the output file is > > Null PMC access in get_string() > current instr.: '_main' pc 20 (/home/doughera/src/parrot/parrot- > andy/languages/punie/t/past_op_1.pir:7) > > Here's the full output of 'make test'. It accurately reflects the > .out > files (well, I didn't exhaustively check them all, but the ones I did > check matched up.) > > perl5.6 -Ilib t/harness t/*.t > t/base_condok > t/base_if..ok > t/base_lex.ok > t/base_pat.ok > t/base_termok > t/io_print.ok > t/op_goto..ok > t/past. > # Failed test (t/past.t at line 44) > # got: '1 > # 1 > # bar > # ' > # expected: 'foo > # 42 > # bar > # ' > > # Failed test (t/past.t at line 44) > # got: '1 > # 1 > # bar > # ' > # expected: 'foo > # 42 > # bar > # ' > > # Failed test (t/past.t at line 44) > # got: '1 > # 1 > # bar > # ' > # expected: 'foo > # 42 > # bar > # ' > > # Failed test (t/past.t at line 44) > # got: '1 > # 1 > # bar > # ' > # expected: 'foo > # 42 > # bar > # ' > > # Failed test (t/past.t at line 44) > # got: '1 > # 1 > # bar > # ' > # expected: 'foo > # 42 > # bar > # ' > > # Failed test (t/past.t at line 44) > # got: '1 > # 1 > # bar > # ' > # expected: 'foo > # 42 > # bar > # ' > # Looks like you failed 6 tests of 7. > dubious > Test returned status 6 (wstat 1536, 0x600) > DIED. FAILED tests 2-7 > Failed 6/7 tests, 14.29% okay > t/past_nodeok > t/past_op.. > # Failed test (t/past_op.t at line 7) > # got: 'Null PMC access in get_string() > # current instr.: '_main' pc 20 (/home/doughera/src/parrot/parrot- > andy/languages/punie/t/past_op_1.pir:7) > # ' > # expected: 'foo > # 42 > # bar > # ' > # './parrot "/home/doughera/src/parrot/parrot- > andy/languages/punie/t/past_op_1.pir"' failed with exit code 43 > > # Failed test (t/past_op.t at line 30) > # got: ' => { > # 'source' => undef, > # 'pos' => undef, > # 'op' => 'bar', > # 'children' => [] > # } > # ' > # expected: ' => { > # 'source' => 'foo', > # 'pos' => '42', > # 'op' => 'bar', > # 'children' => [] > # } > # ' > # Looks like you failed 2 tests of 2. > dubious > Test returned status 2 (wstat 512, 0x200) > DIED. FAILED tests 1-2 > Failed 2/2 tests, 0.00% okay > t/past_val. > # Failed test (t/past_val.t at line 7) > # got: '42 > # 42 > # bar > # ' > # expected: 'foo > # 42 > # bar > # ' > > # Failed test (t/past_val.t at line 30) > # got: ' => { > # 'source' => '42', > # 'pos' => '42', > # 'value' => 'bar', > # 'valtype' => undef, > # } > # ' > # expected: ' => { > # 'source' => 'foo', > # 'pos' => '42', > # 'value' => 'b
Re: Test::Kwalitee 0.10
> On Wed, 15 Feb 2006 12:41:25 -0800, chromatic <[EMAIL PROTECTED]> said: > On Wednesday 15 February 2006 12:33, Andreas J. Koenig wrote: >> The prerequisite Module::CPANTS::Analyse can currently not be >> installed because it relies on sme YAML import feature: > Ahh right, I forgot to mention I removed the ':all' import request in that > module manually. Everything still worked for my purposes. I've just opened a ticket on RT about the issue. -- andreas
[perl #37930] [TODO] build - bailout mechanism
As of r11568 all configuration step's ->runstep() method is required to return $self unless it wants to indicate a fatal error. An error string is expected to be returned via the ->result() method. The steps we're previously changed to conform to this behavior but Parrot::Configure now requires it. -J --
Re: some newbie questions about synopsis 5
Patrick R. Michaud wrote: In the following, / (a) [ (b) (c) | $5 := (d) $0 := (e) ] (f) / does the first alias have any effect on where the f's will go (probably not)? I'll defer to @Larry on this one, but my initial impression is that the (f) capture would go into $6. I think that sequences should behave exactly as single branch alternations (only that there is no such thing, although we can write "[foo|]"). So I would rather opt for $1. - Which rules do apply to repeated captures with the same alias? For example, the second array aliasing example m:w/ Mr?s? @ := W\. @ := | Mr?s? @ := /; seems to suggests that by using $, the lower branch would have resulted in a single Match object instead of an array (like the array we would have gotten if we hadn't used the aliases in the first place). Is this right? Yes, that's correct. But wouldn't it be nice if the same rules applied to aliases and subrule invocations, that is, recursion put aside, to think of / / simply as a shorter way to say / $ := ([definition of foo]:) /? And I've got two more somewhat related questions: The synopsis says: * If a subrule appears two (or more) times in the same lexical scope (i.e. twice within the same subpattern and alternation), or if the subrule is quantified anywhere within the entire rule, then its corresponding hash entry is always assigned a reference to an array of Match objects, rather than a single Match object. Maybe you're not the right person to ask, but is there a particular reason for the "entire rule" bit? / (|None) () / Here we get three Matches $0 (possibly undefined), $, and $1. At least, I think so. / (?) () / Now, we suddenly get three more or less unrelated arrays with lengths 0..1, 1, and 1. Of course, I admit this example is a bit artificial. Furthermore, I think "within the same subpattern and alternation" is not quite correct, at least it wouldn't apply to somethink like / ( [ | ... ]) / unless we consider the (...) sequence as a kind of single branch alternation. And why are alternation branches considered to be lexical scopes, anyway? Just because of subpattern numbering? My second question is why adding a "?" or "??" to an unquantified subrule which would otherwise result in a single Match object should result in an array, rather than a single (possibly undefined) Match. That is, why doesn't "?" rather behave like "[|]"? This would save us the trouble to create all these tiny arrays, or having to write "[...|]" all the time. Or maybe one could define one's own quantifiers?
Re: some newbie questions about synopsis 5
On Fri, Feb 17, 2006 at 02:33:12PM +0100, H. Stelling wrote: > Patrick R. Michaud wrote: > >>In the following, > >> > >>/ (a) [ (b) (c) | $5 := (d) $0 := (e) ] (f) / > >> > >>does the first alias have any effect on where the f's will go > >>(probably not)? > > > >I'll defer to @Larry on this one, but my initial impression is > >that the (f) capture would go into $6. > > I think that sequences should behave exactly as single branch > alternations (only that there is no such thing, although we > can write "[foo|]"). So I would rather opt for $1. The current implementation is that a capturing subpattern is indexed based on the largest index in all of the alternation branches. I'm not sure it makes sense to base it on aliases of the last alternation branch. Here are some examples we can chew on: / (a) [ (b) (c) | (d) ] (f) / # (f) is $3 or $2? (currently $3) / (a) [ (b) (c) | $1 := (d) ] (f) / # (f) is $3 or $2? Since the second example is essentially saying the same as the first, the (f) capture ought to go to the same place in each case. If we say that the existence of the $1 causes the (f) to go into $2, it also becomes the case that $2 is an array of match objects, which isn't technically problematic but it might be a bit surprising for many. Some other examples to consider: / (a) [ (b) (c) | $0 := (d) ] (f) / # (f) is $3 or $1? / (a) [ (b) (c) | $0 := (d) (3) ] (f) / # (f) is $3 or $2? At any rate, I find that having a subpattern capture base its index on the highest index of all of the previous alternation branches is easy to understand and works well in practice. It can also be easily changed with another alias if needed. > But wouldn't it be nice if the same rules applied to aliases and > subrule invocations, that is, recursion put aside, to think of > > / / > > simply as a shorter way to say > > / $ := ([definition of foo]:) /? First, is that colon following "[definition of foo]" intentional or a typo? Currently we can backtrack into subrules -- there's no "cut" assumed after them. But secondly, I'm not sure we can casually toss recursion aside when thinking about this, since it's really a driving force behind having named subrules. :-) There's also a difference in that subrules can take arguments, as in , or can come from another grammar, as in , which seems to argue that is really something other than an alias shorthand. > The synopsis says: > > * If a subrule appears two (or more) times in the same lexical scope > (i.e. twice within the same subpattern and alternation), or if the > subrule is quantified anywhere within the entire rule, then its > corresponding hash entry is always assigned a reference to an array > of Match objects, rather than a single Match object. > > Maybe you're not the right person to ask, but is there a particular > reason for the "entire rule" bit? > > / (|None) () / > > Here we get three Matches $0 (possibly undefined), $, and > $1. At least, I think so. > > / (?) () / > > Now, we suddenly get three more or less unrelated arrays with lengths > 1..1, 1, and 1. Of course, I admit this example is a bit artificial. Oh, I hadn't caught that particular clause (or hadn't read it as you just did). PGE certainly doesn't implement things that way. I think the "entire rule" clause was intended to cover cases like / [ ]* / where is indirectly quantified and therefore is an array of match objects. We should probably reword it, or get a clarification of what is intended. (Damian, @Larry: can you confirm or clarify this for us?) > Furthermore, I think "within the same subpattern and alternation" is > not quite correct, at least it wouldn't apply to somethink like > > / ( [ | ... ]) / > > unless we consider the (...) sequence as a kind of single branch > alternation. And why are alternation branches considered to be > lexical scopes, anyway? In the example you give, $0 is indeed an array of match objects. The "same alternation" in this case is the subpattern... compare to / ( [ | ... ]) | / $0 is an array, $ is a single match object. Alternation branches don't create new lexical scopes, they just affect quantification and subpattern numbering. In both of the following examples / abc def / / ghi | jkl / each has the same lexical scope ($), but in the "abc" example $ is an array of match objects, while in the "ghi" example $ is a single match object. > My second question is why adding a "?" or "??" to an unquantified > subrule which would otherwise result in a single Match object should > result in an array, rather than a single (possibly undefined) Match. The specification was originally this way but was later changed to the current definition. I think people found the idea of "?" producing a single match object confusing, so for consistency we ended up with "all quantifiers produces arrays of match objects". (Note also that even if "?" produced a single Match obj
Re: RetContinuation promotion, closures, and context leakage
Bob Rogers wrote: I couldn't agree more. Committed as r11609. Should I also get rid of the CHUNKED_CTX_MEM references in interpreter.h? Hmm, doesn't harm but is OTOH confusing. Maybe adding some comment would be best for now. -- Bob leo
Re: Network Testing
[EMAIL PROTECTED] wrote: > Well it depends on what your actually studying... > > 1. You have written the code to implement a network bridge, and you want > to test > i. the codes correctness > ii. its ability to handle packets correctly for various > configurations and load > > 2. You have a network bridge, and you want to study how best to > configure it for various network and load scenarios. I am more in the mode 1 and 2 may become something that is wanted/needed in the future. > For 1.i, normal unit testing should suffice, it all depends on the > implementation languages (and its commonly available libraries) support > for that kind of thing I guess I should have stated that I'm looking more for functional/acceptance testing. > For ii, you could try setting up multiple virtual hosts, using any of > the current tools for this (vmware allows you to create whole virtual > networks just for this kind of thing, user mode linux etc) I actually have the resources of a lab with the true hardware and software that is needed so I'm not too concerned about emulating an environment at the moment. My thoughts right now are more on the actual automation of sending flows of data and checking to see if that data is being stopped or limited. I have done a little looking around at modules that do network communication and am not seeing any that give the ability to ask for the current kb/s or the like. I'm guessing I would need to calculate an average kb/s after the transfer? Hopefully the above gives a better picture of what I am trying to achieve and the type of advise I'm looking for. Thanks, -- David Steinbrunner
svn performance
> snapshots or releases. And, since a checkout takes about an hour (last > time I checked) I tend to be too lazy to fetch one just to make a patch. Only if you're checking out to a Commodore 64. [EMAIL PROTECTED] /tmp$ time svn co http://svn.perl.org/parrot/trunk parrot-trunk > /dev/null real1m4.827s user0m4.108s sys 0m2.852s (I did several other runs, using ssl, and it took less time, probably due to compression. I even did a checkout from 70ms of latency away from the server, and it was less as well.)
Re: svn performance
On Fri, Feb 17, 2006 at 08:38:26AM -0800, Robert Spier wrote: > > snapshots or releases. And, since a checkout takes about an hour (last > > time I checked) I tend to be too lazy to fetch one just to make a patch. > > Only if you're checking out to a Commodore 64. Or possibly hand-transcribing the bits. > [EMAIL PROTECTED] /tmp$ time svn co http://svn.perl.org/parrot/trunk > parrot-trunk > /dev/null > > real1m4.827s > user0m4.108s > sys 0m2.852s > From a random starbucks to my laptop: real1m11.923s user0m6.068s sys 0m4.432s
Re: svn performance
All~ On 2/17/06, jesse <[EMAIL PROTECTED]> wrote: > > > > On Fri, Feb 17, 2006 at 08:38:26AM -0800, Robert Spier wrote: > > > snapshots or releases. And, since a checkout takes about an hour (last > > > time I checked) I tend to be too lazy to fetch one just to make a patch. > > > > Only if you're checking out to a Commodore 64. > > Or possibly hand-transcribing the bits. I could check it out over iridium dial up... Matt -- "Computer Science is merely the post-Turing Decline of Formal Systems Theory." -Stan Kelly-Bootle, The Devil's DP Dictionary
Re: some newbie questions about synopsis 5
On Fri, Feb 17, 2006 at 08:32:18AM -0600, Patrick R. Michaud wrote: : > The synopsis says: : > : > * If a subrule appears two (or more) times in the same lexical scope : > (i.e. twice within the same subpattern and alternation), or if the : > subrule is quantified anywhere within the entire rule, then its : > corresponding hash entry is always assigned a reference to an array : > of Match objects, rather than a single Match object. : > : > Maybe you're not the right person to ask, but is there a particular : > reason for the "entire rule" bit? : > : > / (|None) () / : > : > Here we get three Matches $0 (possibly undefined), $, and : > $1. At least, I think so. : > : > / (?) () / : > : > Now, we suddenly get three more or less unrelated arrays with lengths : > 1..1, 1, and 1. Of course, I admit this example is a bit artificial. : : Oh, I hadn't caught that particular clause (or hadn't read it as : you just did). PGE certainly doesn't implement things that way. : I think the "entire rule" clause was intended to cover cases like : : / [ ]* / : : where is indirectly quantified and therefore is an array of : match objects. We should probably reword it, or get a clarification : of what is intended. (Damian, @Larry: can you confirm or clarify : this for us?) I believe that was the intent, but I'll defer to Damian on the wordsmithing because I'm a bit out of sorts at the moment and it'd probably come out all sideways. Larry
Re: svn performance
On Fri, 17 Feb 2006, Matt Fowles wrote: > All~ > > On 2/17/06, jesse <[EMAIL PROTECTED]> wrote: > > > > > > > > On Fri, Feb 17, 2006 at 08:38:26AM -0800, Robert Spier wrote: > > > > snapshots or releases. And, since a checkout takes about an hour (last > > > > time I checked) I tend to be too lazy to fetch one just to make a patch. > > > > > > Only if you're checking out to a Commodore 64. > > > > Or possibly hand-transcribing the bits. > > I could check it out over iridium dial up... Sigh. I wish it were that simple, or that funny. $ time wget http://cvs.perl.org/snapshots/parrot/parrot-latest.tar.gz real0m16.84s user0m0.09s sys 0m0.20s $ time svn co http://svn.perl.org/parrot/trunk parrot-trunk real 2:01:50.3 user 1:02.0 sys44.9 It's something specific to svn. No, I don't know what. -- Andy Dougherty [EMAIL PROTECTED]
Re: svn performance
> Sigh. I wish it were that simple, or that funny. > > $ time wget http://cvs.perl.org/snapshots/parrot/parrot-latest.tar.gz > > real0m16.84s > user0m0.09s > sys 0m0.20s > > $ time svn co http://svn.perl.org/parrot/trunk parrot-trunk > > real 2:01:50.3 > user 1:02.0 > sys44.9 > > It's something specific to svn. No, I don't know what. What version of subversion are you using? -R
Re: svn performance
Andy~ On 2/17/06, Andy Dougherty <[EMAIL PROTECTED]> wrote: > On Fri, 17 Feb 2006, Matt Fowles wrote: > > > All~ > > > > On 2/17/06, jesse <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > On Fri, Feb 17, 2006 at 08:38:26AM -0800, Robert Spier wrote: > > > > > snapshots or releases. And, since a checkout takes about an hour > > > > > (last > > > > > time I checked) I tend to be too lazy to fetch one just to make a > > > > > patch. > > > > > > > > Only if you're checking out to a Commodore 64. > > > > > > Or possibly hand-transcribing the bits. > > > > I could check it out over iridium dial up... > > Sigh. I wish it were that simple, or that funny. > > $ time wget http://cvs.perl.org/snapshots/parrot/parrot-latest.tar.gz > > real0m16.84s > user0m0.09s > sys 0m0.20s > > $ time svn co http://svn.perl.org/parrot/trunk parrot-trunk > > real 2:01:50.3 > user 1:02.0 > sys44.9 > > It's something specific to svn. No, I don't know what. $ svn --version svn, version 1.1.4 (r13838) compiled May 13 2005, 06:29:47 How bout you? Matt -- "Computer Science is merely the post-Turing Decline of Formal Systems Theory." -Stan Kelly-Bootle, The Devil's DP Dictionary
Re: svn performance
On Fri, 17 Feb 2006, Matt Fowles wrote: > > On 2/17/06, Andy Dougherty <[EMAIL PROTECTED]> wrote: > > Sigh. I wish it were that simple, or that funny. > > > > $ time wget http://cvs.perl.org/snapshots/parrot/parrot-latest.tar.gz > > > > real0m16.84s > > user0m0.09s > > sys 0m0.20s > > > > $ time svn co http://svn.perl.org/parrot/trunk parrot-trunk > > > > real 2:01:50.3 > > user 1:02.0 > > sys44.9 > > > > It's something specific to svn. No, I don't know what. > > $ svn --version > svn, version 1.1.4 (r13838) >compiled May 13 2005, 06:29:47 $ svn --version svn, version 1.1.3 (r12730) compiled Mar 31 2005, 13:19:13 -- Andy Dougherty [EMAIL PROTECTED]
Re: svn performance
> On Fri, 17 Feb 2006, Matt Fowles wrote: > > > > > On 2/17/06, Andy Dougherty <[EMAIL PROTECTED]> wrote: > > > $ time wget http://cvs.perl.org/snapshots/parrot/parrot-latest.tar.gz > > > real0m16.84s > > > $ time svn co http://svn.perl.org/parrot/trunk parrot-trunk > > > real 2:01:50.3 > > > > > > It's something specific to svn. No, I don't know what. Do you, perchance, sit behind an http proxy server? Try: time svn co https://svn.perl.org/parrot/trunk parrot-trunk
Re: svn performance
On 2/17/06, Matt Fowles <[EMAIL PROTECTED]> wrote: > $ svn --version > svn, version 1.1.4 (r13838) >compiled May 13 2005, 06:29:47 > > How bout you? > can't hurt to upgrade... >svn --version svn, version 1.3.0 (r17949) compiled Jan 15 2006, 23:18:48 ~jerry
Re: svn performance
On Fri, 17 Feb 2006, jesse wrote: > > > On Fri, 17 Feb 2006, Matt Fowles wrote: > > > > > > > > On 2/17/06, Andy Dougherty <[EMAIL PROTECTED]> wrote: > > > > $ time wget http://cvs.perl.org/snapshots/parrot/parrot-latest.tar.gz > > > > real0m16.84s > > > > $ time svn co http://svn.perl.org/parrot/trunk parrot-trunk > > > > real 2:01:50.3 > > > > > > > > It's something specific to svn. No, I don't know what. > > Do you, perchance, sit behind an http proxy server? Not that I know of (though I'm not sure how I'd know), and no other mode of communication is similarly affected (i.e. cvs, rsync, etc., all work fine). > Try: > time svn co https://svn.perl.org/parrot/trunk parrot-trunk svn: Unrecognized URL scheme 'https://svn.perl.org/parrot/trunk' I don't know why. I have OpenSSL installed where svn should have found it when building. If I can find the free time, perhaps I'll try upgrading, though I have no reason to think it'll solve the problem. I don't use svn for anything else, and wget works just fine for fetching the snapshots, so this hasn't been a priority for me. -- Andy Dougherty [EMAIL PROTECTED]
Selective String Interpolation
Hello, When building code strings in Perl 5 I usually write the code, then wrap it in double quotes, then "\" escape everything light blue under syntax highlighting. I was wondering if there'll a better way in Perl 6. I thought it would be nice to define the variables you wish to interpolate individually, perhaps as extensions to the :s, :a, etc quote adverbs, perhaps using a signature object. Since user-defined quotes are possible it shouldn't be too hard to add in any case, so I might just leave off the waffling there. One more waffle: Closure interpolation seems largely incompatible "" strings. Interpolation restricted by variable doesn't help this anyway so perhaps there's a more general solution covering all cases. (or just q:c(0)) Another possibility is that code string suppport may be less important given the macro and grammar tools available. On the other hand, the code is not always being generated for immediate consumption and is not always Perl. That probably counts as at least two waffles, Brad ...Maybe CODE's dwimmy binding could be abused: (CODE { ... }).perl -- The occurrence of mysteries is alway by word of mouth. -- Hagakure
CODE {...} mentioning variables without interpolation
Hi again, L Is it possible to refer to a variable in a CODE quotation without splicing it in as an AST or string? I can't see how this is be possible under S06, unless using OUTER:: is intended to be a non-splicing variable mention. The sample snippet in S06 seems simple but got me confused. I'll explain my interpretation so the confusion can be removed from the rules or my understanding, where ever it's found to be. The snippet: return CODE { say $a }; The snippet will probably be found inside a macro and will be run during the macro's expansion elsewhere. When it is run, an AST for "say $a" is produced that searches for $a in the lexical scope containing the CODE block, otherwise the macro call scope is searched, or emit a compile time error. $a is spliced into the say as either a string or AST, not as a runtime use of $a. If the snippet was: $a = '$a'; return CODE { say $a }; Then we'd (eventually) get a non-splicing mention of $a, one that would refer to the $a in scope at the macro call, I think. Is this correct? Perhaps signatures on CODE forms can be used to specify the variables which are to be spliced, and their scope of origin. I'm posting some hypothetical syntax because the post made even less sense without it. It's obviously in need of refinement: # non-splicing $a from this scope return CODE () { say $a }; # non-splicing $a in the scope of the macro call return CODE () { say COMPILING::<$a> }; # ast-splicing with dwiminess return CODE ($a) { say $a }; # ast-splicing requiring a lexical $a here return CODE (OUTER::<$a>) { say $a }; Traits could be used in the signatures instead of the pseudo packages. Sugar to taste. This would probably be overloading the meaning of signatures since there's no explicit application of the code object to a set of runtime arguments. idea-- It seems like I'm currently obsessed with signatures as silver bullets. Is there any hope for my peculiar quest? A minor related query, can the CODE { ... } form appear outside of macro returns? Can we put the AST in a variable, pass it between subroutines and do the usual runtime things with it? This sig seems particularly apt here, Brad -- When one is not capable of true intelligence, it is good to consult with someone of good sense. -- Hagakure http://bereft.net/hagakure/
Re: CODE {...} mentioning variables without interpolation
On Sat, Feb 18, 2006 at 01:57:18AM +0200, Brad Bowman wrote: : Hi again, : : L : : Is it possible to refer to a variable in a CODE quotation without : splicing it in as an AST or string? I can't see how this is : be possible under S06, unless using OUTER:: is intended to be : a non-splicing variable mention. : : The sample snippet in S06 seems simple but got me confused. : I'll explain my interpretation so the confusion can be removed : from the rules or my understanding, where ever it's found to be. : The snippet: : : return CODE { say $a }; : : The snippet will probably be found inside a macro and will be run : during the macro's expansion elsewhere. When it is run, : an AST for "say $a" is produced that searches for $a in : the lexical scope containing the CODE block, otherwise : the macro call scope is searched, or emit a compile time error. : : $a is spliced into the say as either a string or AST, not : as a runtime use of $a. If the snippet was: : : $a = '$a'; : return CODE { say $a }; : : Then we'd (eventually) get a non-splicing mention of $a, one that : would refer to the $a in scope at the macro call, I think. : Is this correct? No. If bare $a is not found in the CODE's scope, it must *bind* to an existing $a in the macro caller's scope as a runtime use of $a, or the macro fails. If the calling code wants to supply arguments to the macro body, they must come in as ordinary arguments, or use some modifier that chases up the dynamic stack, such as one of CALLER::<$a> ENV::<$a> COMPILING::<$a> : Perhaps signatures on CODE forms can be used to specify the variables : which are to be spliced, and their scope of origin. I'm posting : some hypothetical syntax because the post made even less sense without it. : It's obviously in need of refinement: : : # non-splicing $a from this scope : return CODE () { say $a }; : : # non-splicing $a in the scope of the macro call : return CODE () { say COMPILING::<$a> }; : : # ast-splicing with dwiminess : return CODE ($a) { say $a }; : : # ast-splicing requiring a lexical $a here : return CODE (OUTER::<$a>) { say $a }; : : Traits could be used in the signatures instead of the pseudo packages. : Sugar to taste. : : This would probably be overloading the meaning of signatures since : there's no explicit application of the code object to a set of runtime : arguments. idea-- Seems to be trying to duplicate the function of the macro's signature, which is already presumably declaring parameters with various type signatures. It's possible that the interpretation of a macro's $a could depend on its declared type of the variable it is eventually bound to, but we can't readily extend that idea to dynamicly scoped value or run-time types. : It seems like I'm currently obsessed with signatures as silver bullets. : Is there any hope for my peculiar quest? Dunno. But then I don't know if there's any hope for my particular quest either. :-) : A minor related query, can the CODE { ... } form appear outside : of macro returns? Can we put the AST in a variable, pass it between : subroutines and do the usual runtime things with it? I don't see why not. The behavior is defined in terms of the current lexical scope, so it's not required that that particular lexical scope be supplied by a macro. : This sig seems particularly apt here, Signatures are overrated. :-) : Brad : : -- : When one is not capable of true intelligence, it is good to consult with : someone of good sense. -- Hagakure http://bereft.net/hagakure/ It's not entirely clear to me that we should trust the advice of someone who was prevented from committing seppuku only by edict of Tokugawa. :-) But the scary part about that quote is that it seems to be saying that if you have true intelligence you don't need good sense. Larry
Re: svn performance
From: Andy Dougherty <[EMAIL PROTECTED]> Date: Fri, 17 Feb 2006 17:23:55 -0500 (EST) On Fri, 17 Feb 2006, jesse wrote: > Try: > time svn co https://svn.perl.org/parrot/trunk parrot-trunk svn: Unrecognized URL scheme 'https://svn.perl.org/parrot/trunk' I don't know why. I have OpenSSL installed where svn should have found it when building. I had the same problem just last week. To fix it, I upgraded to Subversion 1.3.0 from the tarball, and discovered that you don't get HTTPS support unless you explicitly specify the "--with-ssl" option to configure, which I hadn't realized when I installed 1.1.3. I don't understand why this is necessary; HTTP and HTTPS support both use Neon, and so I would assume that Neon is doing all the TLS stuff itself. I guess SVN is supplying it with certs, so it needs OpenSSL, but you'd think it could check to see if Neon was built to use OpenSSL, and take it from there. Or even just probe for OpenSSL directly. Oh, well . . . -- Bob Rogers http://rgrjr.dyndns.org/
Re: Selective String Interpolation
Brad Bowman asked: When building code strings in Perl 5 I usually write the code, then wrap it in double quotes, then "\" escape everything light blue under syntax highlighting. I was wondering if there'll a better way in Perl 6. I thought it would be nice to define the variables you wish to interpolate individually, perhaps as extensions to the :s, :a, etc quote adverbs, perhaps using a signature object. There is already a mechanism for this. You simply turn off all variable interpolation, and interpolate any the variables you wish to interpolate via block interpolations. Or, more simply, only turn on block interpolation in a non-interpolating string: my $code = q:c{ package {$package_name}; sub {$sub_name} \{ return {$return_val} \} }; Damian
Re: svn performance
On Fri, Feb 17, 2006 at 05:23:55PM -0500, Andy Dougherty wrote: > On Fri, 17 Feb 2006, jesse wrote: > > Do you, perchance, sit behind an http proxy server? > > Not that I know of (though I'm not sure how I'd know), and no other mode > of communication is similarly affected (i.e. cvs, rsync, etc., all work > fine). Perhaps your behind a transparent http proxy. If that's the case I would expect TLS to resolve the issue. -J -- pgp0ONuNQ90HG.pgp Description: PGP signature
Re: pugs link error
Dear Beau Cox, I can't make explicit sense of " you need to keep > the original Parrot source tree around, and let Pugs find one of > src/{null,parrot,install}_config.o for embedding to happen. " Could you give a concrete example of sub-directory placement or environment settings that makes Pugs aware of Parrot's presence? Sincerely, Peter Schwenn [p.s. I have successfully built pugs-6.2.11 with Ghc-4.11 w/ hs-plugins support, and parrot-0.4.1 (with built source tree) both under FedoraC4 linux, but Pugs does not see Parrot when I try, e.g., pugs -Bparrot (or -BPIR ...). Same thing under Cygwin]