Multiline comments in Perl6

2007-12-29 Thread Christian Mueller
Hello list,

i don't know the actually state in the discussion about multiline
comments, but i would propose an idea.. a combination of POD's = and the
traditional route char...

=#
this is a multi
line comment
#=

=# comment #= this is not commented

What you think about it?

regards
Christian




[perl #48493] [CAGE] Parrot::Configure::Step: Explicitly pass all arguments to all methods

2007-12-29 Thread James Keenan via RT
explicitconf branch merged into trunk in r24294.


[perl #45201] [PATCH] Be sure to call the correct 'prove' program.

2007-12-29 Thread James Keenan via RT
Implemented chromatic's suggestion in r24283:  using
Test::Harness::runtests() instead of prove.


Re: Perl6::Doc # Hail to the new pharao

2007-12-29 Thread Jonathan Scott Duff
You have my permission as well.

-Scott

On Dec 29, 2007 7:04 AM, herbert breunung <[EMAIL PROTECTED]> wrote:

> thanks to chromatic, so i have ask Jonathan Scott Duff, Phil  Crow and
> wait for /Adrianos answer.
>
> what i yesterday also forgot to mention is that rumor says that the
> emerald tables
> are designed to can provide answer for people on over 100 different
> levels of consciousness.
> to teach the newbeees the simpel stuff and simultaniously the Damians ,
> last bits is what
> really describes the goal of my perl tables
>
> /
> > On Friday 28 December 2007 17:04:40 herbert breunung wrote:
> >
> >
> >> I have also plans to add my perl article (once they transelated) for
> $foo
> >> perl magazine and maybe some perl.com articles, if chomatic allowes.
> >>
> >
> > It's fine with O'Reilly, as long as the authors of the articles agree
> (they
> > hold the copyright).  Where I'm the author, you have my permission.
> >
> > O'Reilly generally asks that you include a link to the original article
> as
> > published on our site, but that's a request and not a requirement.
> >
> > -- c
> >
> >
>
>


-- 
Jonathan Scott Duff
[EMAIL PROTECTED]


[perl #49202] SmartLink.pm patch to cope with current Moose/Class::MOP implementation

2007-12-29 Thread via RT
# New Ticket Created by  Flavio Poletti 
# Please include the string:  [perl #49202]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=49202 >


Hi,

   I encountered a couple of problems with lib/SmartLinks.pm. In
particular, its implementation breaks with the current Moose/Class::MOP
versions.

First of all, "undef" is no longer an acceptable value for something that
has an 'isa' that does not allow it. And 'undef' can't be regarded as a
valid Keyphrase object.

Moreover, as of version 0.43 of Class::MOP, the predicate methods do not
work any more as they were documented (and as they're still documented in
0.50, but it will be in the next release I think). To be brief, the
predicate method now checks for the existence of any value for a given
attribute, not its definedness.

I'm attaching a patch that addresses both concerns, I hope you'll find it
useful. Be warned that if you take it, you'll be forced to upgrade at
least to the current version of Moose (0.33) and Class::MOP (0.50).

Best regards,

   Flavio Poletti.--- lib/SmartLink.pm	2007-12-29 15:52:38.0 +0100
+++ lib/SmartLink.pm.new	2007-12-29 17:09:35.251666784 +0100
@@ -29,13 +29,17 @@
 
 has 'keyphrases' => (
 is => 'ro', isa => 'Keyphrase',
-default => sub{
-($_)= shift->link =~ m|^L<.*?/.*?/([^>]+)>|;
-defined $_ ? Keyphrase->new( string => $_ ) : undef;
-},
 predicate => 'has_keyphrases',
 );
 
+sub BUILD { # Set a value for keyphrases *only* if there is any
+   my $self = shift;
+   my ($keyphrase)= $self->link =~ m|^L<.*?/.*?/([^>]+)>|;
+   $self->meta->find_attribute_by_name("keyphrases")->set_value(
+  $self, Keyphrase->new(string => $keyphrase)
+   ) if defined $keyphrase;
+   return;
+}
 
 package Doc;
 use Moose;
--- CREDITS	2007-12-29 17:53:28.792307752 +0100
+++ CREDITS.new	2007-12-29 17:53:20.252605984 +0100
@@ -211,6 +211,9 @@
 N: Felix Gallo
 D: delegate.pmc patch
 
+N: Flavio Poletti
+D: SmartLink patch for Moose after 0.43
+
 N: Florian Ragwitz
 E: [EMAIL PROTECTED]
 W: http://www.tu-chemnitz.de/~rafl/

[perl #41897] [BUG]: Parrot::Pmc2c::STMRef gets 'subroutine prederef redefined' warning

2007-12-29 Thread James Keenan via RT
I'm closing this ticket for a number of reasons.

1.  The "subroutine redefined" problem -- the original focus of the RT
-- is, I think, largely a Devel::Cover problem.  More of an annoyance
than anything else.

2.  The other problem I discussed -- the spurious test failures while
running Devel::Cover -- has been addressed in 2 ways:  (i) I put an
extra 'pass' test at the end of many files.  This seems to keep
Devel::Cover happy.  (ii) I think that many of the problems occurred
when using Parrot::IO::Capture::Mini to capture STDOUT and STDERR.  That
module did so via tied filehandles.  Since we've moved to
IO::CaptureOutput::capture() for that purpose, I haven't seen any of
those spurious test failures while conducting coverage analysis.  And,
as I'm writing new tests that use IO::CaptureOutput, I'm omitting the
'keep Devel::Cover happy' test and living to tell about it.

3.  The ticket is old and stale and I'm sick of looking at it.

kid51


Re: More pbc2c Fun

2007-12-29 Thread chromatic
On Saturday 29 December 2007 18:13:26 chromatic wrote:

> As of r24274:

Let's call that r24276.

>   $ perl Configure.pl
>   $ make pbc_to_c.pir

... and this should be:

$ make pbc_to_c

>   $ cd languages/perl6
>   $ make
>   $ ../../parrot pbc_to_c.pir perl6.pbc

... and instead:

$ ../../pbc_to_c perl6.pbc

>   $ cd ../..
>   $ languages/perl6/perl6 languages/perl6/t/01-sanity/01-tap.t
>   1..10
>   ok 1
>   ok 2
>   ok
>   # comment
>   ok 4
>   ok 5
>   ok 6 foo
>   ok 7 # skip
>   ok 8 # skip bar
>   not ok 9 # TODO
>   not ok 10 # TODO baz
>   $

-- c


More pbc2c Fun

2007-12-29 Thread chromatic
As of r24274:

$ perl Configure.pl
$ make pbc_to_c.pir
$ cd languages/perl6
$ make
$ ../../parrot pbc_to_c.pir perl6.pbc
$ cd ../..
$ languages/perl6/perl6 languages/perl6/t/01-sanity/01-tap.t 
1..10
ok 1
ok 2
ok
# comment
ok 4
ok 5
ok 6 foo
ok 7 # skip
ok 8 # skip bar
not ok 9 # TODO
not ok 10 # TODO baz
$ 

-- c


[perl #47347] [TODO] Merge configuration steps gen::cpu and auto::cpu

2007-12-29 Thread James Keenan via RT
On Sat Dec 29 15:57:14 2007, [EMAIL PROTECTED] wrote:

> However, I'm having problems with 3 of the coding standards tests on
> these 2 files:
> 
> config/auto/cpu/i386/memcpy_mmx.c
> config/auto/cpu/i386/memcpy_sse.c
> 
> They're causing failures in:
> 
> t/codingstd/c_indent.t
> t/codingstd/copyright.t
> t/codingstd/svn_id.t
> 

I think I figured it out.  Because these are C-source files and because
they are generated files, their new names had to be added to the list in
lib/Parrot/Distribution.pm of files which are exempt from certain
standards and to MANIFEST.generated.


[perl #47347] [TODO] Merge configuration steps gen::cpu and auto::cpu

2007-12-29 Thread James Keenan via RT
On Sat Dec 29 11:37:49 2007, [EMAIL PROTECTED] wrote:
> Smoke test results have been favorable, so I will now proceed to
> renaming gen::cpu to auto::cpu, the better to reflect its character as
> probe.

I moved these files.  All configuration tests are passing.

However, I'm having problems with 3 of the coding standards tests on
these 2 files:

config/auto/cpu/i386/memcpy_mmx.c
config/auto/cpu/i386/memcpy_sse.c

They're causing failures in:

t/codingstd/c_indent.t
t/codingstd/copyright.t
t/codingstd/svn_id.t

Since I copied the content of these files unchanged from their ancestral
directories, I'm puzzled.  The 2 files have DO NOT EDIT warnings inside,
so I don't think, e.g., I should add an svn Id tag inside the file.  And
I'm not familiar with some of the SVN properties.

Can anyone help out?  Thanks.


Re: [perl #49168] [TODO] create a simplified command interface for perl6

2007-12-29 Thread Patrick R. Michaud
On Sat, Dec 29, 2007 at 12:13:19PM -0800, chromatic wrote:
> On Saturday 29 December 2007 01:29:46 Allison Randal wrote:
> 
> > > * convert perl6.pbc into a C executable
> 
> > Possible, but ultimately too constraining. There are significant
> > advantages to having the full Parrot runtime environment available.
> 
> Don't reject this out of hand.  The C executables generated from pbc2c link 
> against libparrot, so they have the full Parrot runtime environment 
> available.  Basically, this code replaces src/main.c with src/perl6pbc.c and 
> a few lines that create a new Parrot interpreter and give it the Perl 6 
> compiler's bytecode.
> 
> I hope to check in a small demo later today.

I'm eager to see it.  I'd like to try it on the perl6.pbc executable,
if only to discover what works and what doesn't work.

Pm


Re: [perl #49168] [TODO] create a simplified command interface for perl6

2007-12-29 Thread Patrick R. Michaud
On Sat, Dec 29, 2007 at 11:29:46AM +0200, Allison Randal wrote:
> Patrick R.Michaud (via RT) wrote:
> >* add some smarts to Parrot to allow it to search/execute .pbc files
> >  in some standard locations (RT#47992)
> 
> We certainly need to allow configurable search paths (at runtime and 
> compile-time). And we certainly need to eliminate the requirement for 
> passing full relative paths for everything.
> 
> There was an old proposal to do file-extension searches for all files, 
> but the problem was that any automatic selection of extension turned out 
> to be wrong about half-the-time. 

Just a note/reminder that RT#47992 doesn't go as far as file-extension
searches.  What it really wants is to be able to place command-line
.pbc files in a standard location (e.g., runtime/parrot/commands/ )
so that "parrot foo"  automatically invokes runtime/parrot/commands/foo.pbc .

> >* other...?
> 
> Busybox has a nice feature where it checks the name you used to call it, 
> and presents different behavior based on that name. So, if 'ps' is a 
> symlink to 'busybox', when you call 'ps' on the command-line, Busybox 
> knows to process the options given as if it were the 'ps' command.
> 
> 
> 
> Parrot can do something similar, checking the name used to call it. 

Works for me, although this sounds like an extension to the RT#47992 
proposal.  In other words, we have a standard location to place 
command-line .pbc files, and if parrot is invoked with a command 
name of "foo" it automatically locates foo.pbc in the standard
location and executes that.

> If 'perl6' is a symlink to 'parrot' and the user calls 'perl6 myscript.pl' 
> Parrot can simply act as if the --language=perl6 option was passed on 
> the command-line.

I'm a bit reluctant to assume that the thing to be executed
will be a --language.  It could be a standalone application:

$ parrot httpd# or just 'httpd'
$ parrot calc # or just 'calc'

> The goal is to have the 'parrot' part be invisible, so an embedded 
> system or install CD can present the illusion of running Python, PHP, 
> Perl 5, Perl 6, etc, but actually be running only Parrot.

Absolutely.

Pm


Re: [perl #49175] [TODO] pct - throw useful exception for non-PAST children

2007-12-29 Thread Patrick R. Michaud
On Sat, Dec 29, 2007 at 12:04:09PM +0200, Allison Randal wrote:
> Patrick R.Michaud (via RT) wrote:
> >
> >Whenever a PAST::Op node gets a non-PAST child, PCT currently
> >throws a cryptic exception message like:
> >
> >Method 'named' not found for invocant of class 'Perl6::Grammar'
> >
> >A better exception message would be something like:
> >
> >Perl6::Grammar ("2") child of PAST::Op cannot be converted to POST.
> ...
> Though, the cheapest option may be to simply wrap non-PAST children in a 
> PAST-compatible proxy. (That assumes that the non-PAST children are 
> intentionally there, and aren't slipping in by mistake.)

The exception generally means that the non-PAST children slipped in
by mistake -- the purpose of this ticket is to get PCT to provide
a better diagnosis when that occurs.

Pm


Re: [perl #49175] [TODO] pct - throw useful exception for non-PAST children

2007-12-29 Thread Patrick R. Michaud
On Fri, Dec 28, 2007 at 07:11:23PM -0800, chromatic wrote:
> On Friday 28 December 2007 16:16:55 Patrick R.Michaud wrote:
> 
> > Whenever a PAST::Op node gets a non-PAST child, PCT currently
> > throws a cryptic exception message like:
> >
> > Method 'named' not found for invocant of class 'Perl6::Grammar'
> >
> > A better exception message would be something like:
> >
> > Perl6::Grammar ("2") child of PAST::Op cannot be converted to POST.
> 
> How does this node "get" a non-PAST child?  Is there a single point at which 
> you add a child to a PAST::Op node?  (I'm pretty sure I know the answer, but 
> I'm not entirely sure.)

Yes, however, adding a non-PAST child to a PAST node isn't necessarily
an error.  The exception should probably be thrown at the point where
PAST::Compiler attempts to convert the (non-PAST) child to POST, not
at the point where the child is added to a PAST::Node.

The fix is easy enough to do -- just a small modification to the 
'post_children' method of PAST::Compiler (src/PAST/Compiler.pir)
to throw an exception when it sees a non-PAST child.  I simply entered 
the ticket as a placeholder so it's not forgotten.

Or, we could perform the check at the point of the 'push' or 'unshift'
method that adds nodes to a PAST child, with an optional :force
flag to allow non-PAST children to be added.

As to how it's possible for a non-PAST node to appear as a child,
it comes up when a transformation method inadvertently adds a match
object or constant to a PAST::Node instead of the ast (PAST) 
representation of the match object or constant.

Thanks!

Pm



RE: Official Perl 6 and Parrot wikis

2007-12-29 Thread Conrad Schneiker
This thread originated on perl6.compiler (see either of the links below), but 
it pertains to earlier discussions on perl6.users, so I'm continuing here.

http://www.nntp.perl.org/group/perl.perl6.compiler/2007/12/msg1677.html

http://groups.google.com/group/perl.perl6.compiler/browse_thread/thread/d5f6561dbea83a0b/c072a1d7ce206263#c072a1d7ce206263

Here's an abbreviated summary:

Mark J. Reed Mark wrote:

> .cgi?  Is that really a CGI-based implementation?  Because
> that seems a little, I don't know, backward-looking.  Maybe
> it's just me, but it seems like it will just feed the
> all-too-common perception that Perl is for CGI scripts, and
> "real" web apps need to be written in something else (be it
> Java, PHP, Ruby/Rails, whatever).
> 
> Besides, I hope that the language and wiki will be
> successful enough that a cgi-based implementation will
> completely fail to scale to meet demand. :)

Gabor Szabo wrote:

> Maybe the site maintainers could add an Apache rewrite rule
> so the URLs used by the public will be
> 
>http://www.perlfoundation.org/perl6/index.p6
> and
>http://www.perlfoundation.org/parrot/index.parrot
> 
> That would change the perception and we would not need to
> explain about mod_perl running the .cgi scripts at the rate
> 100-200 faster than good old CGI.
> 
> When asked if they really run on Perl 6 and Parrot we could
> just smile...

chromatic wrote:

> It's not a *bad* idea, but it's less important in my mind
> than getting useful information on the wiki.  Anyone who
> wants to pursue it can do so, but I'd like to forestall a
> long digression on the [perl6.compiler] list about it.
> That's all.

Since my role was limited to originally lobbying for a Perl 6 wiki (and 
initially filling it out), I'm completely out of the loop on the above issues 
(and they probably seem overly-trivial to me because I'm still mainly concerned 
with Perl 6 wiki content, organization, and availability). 

However, given that the Perl 6 wiki now exists, and that first impressions are 
often important (especially for other people that might be early adapters or 
might help with Perl 6 development, at least in this particular case), the 
above issues may be something that others here may want to pursue. 

I'm all for anything that can help stack the odds in favor of eventual 
"accelerated Moore's Law" success for Perl 6.

Best regards,
Conrad Schneiker

www.AthenaLab.com





Re: Test Results

2007-12-29 Thread James E Keenan

Alberto Simões wrote:

Hi

James E Keenan wrote:

Which OS-cpu?  Which Parrot version?


Forgot to tell it.
Mac OS Tiger on PPC G4
Perl 5.10
Parrot Revision: 24263



t/library/mime_base64.t(Wstat: 6 Tests: 0 Failed: 0)
  Parse errors: No plan found in TAP output


Can you send output of prove -v?


[EMAIL PROTECTED] parrot]$ prove -v t/library/mime_base64.t
t/library/mime_base64..src/pmc_freeze.c:1202: failed assertion 
'must_have_seen'

 No subtests run

Test Summary Report
---
t/library/mime_base64.t (Wstat: 6 Tests: 0 Failed: 0)
  Parse errors: No plan found in TAP output
Files=1, Tests=0,  1 wallclock secs ( 0.02 usr  0.02 sys +  0.17 cusr 
0.09 csys =  0.30 CPU)

Result: FAIL


This is a new one to me, and the test file itself has not recently been 
changed.  Could you file a [BUG] ticket at [EMAIL PROTECTED]





t/compilers/json/to_parrot.t   (Wstat: 15104 Tests: 60 
Failed: 59)

  Failed test number(s):  1-58, 60
  Non-zero exit status: 59


This test had some failures last week (see 
http://rt.perl.org/rt3/Ticket/Display.html?id=48965), but were 
reported fixed via r24163.  Can you send output of prove -v?


See attach :)



I reopened this ticket with your attachment: 
http://rt.perl.org/rt3/Ticket/Display.html?id=48965


kid51


[perl #48965] [BUG] t/compilers/json/to_parrot.t test failure

2007-12-29 Thread James Keenan via RT
c:  Alberto Simões reported (new?) errors in
t/compilers/json/to_parrot.t on list today.

Mac OS Tiger on PPC G4
Perl 5.10
Parrot Revision: 24263 

See attached.

Can you take a look?  thanks.

kid51 


to_parrot.err
Description: Binary data


Re: [perl #49168] [TODO] create a simplified command interface for perl6

2007-12-29 Thread Allison Randal

chromatic wrote:


Don't reject this out of hand.  The C executables generated from pbc2c link 
against libparrot, so they have the full Parrot runtime environment 
available.  Basically, this code replaces src/main.c with src/perl6pbc.c and 
a few lines that create a new Parrot interpreter and give it the Perl 6 
compiler's bytecode.


I hope to check in a small demo later today.


The ability to compile PBC down to C code is useful in many contexts 
even if we don't use it as the primary strategy for installing languages.


Allison


Re: [svn:parrot] r24268 - trunk/src

2007-12-29 Thread chromatic
On Saturday 29 December 2007 13:47:49 [EMAIL PROTECTED] wrote:

> +                while (flags && idx < sizeof(buf)-100) {

Is 100 the length of everything in flag_names appended together?

-- c


Re: [svn:parrot-pdd] r24108 - in trunk: . docs/pdds

2007-12-29 Thread Allison Randal

Klaas-Jan Stol wrote:


In order to solve that, adding a :invocant('any') (* a special marker would
be more convenient, maybe someone would like to define a class 'any'  (you
never know :-) but that's beside the pointnow *)
By adding these markers, what effectively happens is that all :invocant
parameters that are considered the :multi signature, are grouped together,
anyway. So, this is the reason that :invocant-marked params must be grouped
together.


Yes! :)

And agreed on using something that wouldn't be a valid class name, 
unless we end up with a handful of pseudotypes like SELF.


Allison


Re: Disassembler enhancement for review

2007-12-29 Thread Bob Rogers
   From: Allison Randal <[EMAIL PROTECTED]>
   Date: Sat, 29 Dec 2007 12:08:10 +0200

   Looks good. Go ahead and commit. Better abstraction for signature 
   decoding can be added later.

   Allison

Thanks; done in r24268.  I also changed it to use PIR syntax, so we
wouldn't have a new syntax to document.

-- Bob


Re: [svn:parrot-pdd] r24108 - in trunk: . docs/pdds

2007-12-29 Thread Klaas-Jan Stol
On Dec 29, 2007 11:34 AM, Allison Randal <[EMAIL PROTECTED]> wrote:

> Klaas-Jan Stol wrote:
> >
> > Earlier I read over this, thinking: there's probably a good reason for
> that
> > (the need for being contiguous), but I haven't figured it out yet.
> > For sake of documentation, could you please explain why this is so?
> >
> > so, why would it not be possible to write this:
> >
> > sub foo :multi
> >   .param pmc x :invocant('Integer')
> >   .param pmc y
> >   .param pmc z :invocant('Integer')
> > ..
> >
> > and
> >
> > sub foo :multi
> >   .param pmc x :invocant('Integer')
> >   .param pmc y
> >   .param pmc z :invocant('String')
> >
> > The former "foo" can be thought of as having signature "Integer, *,
> Integer"
> > and the second "Integer, *, String", (where * means any type, don't
> care).
> >
> > I don't see a particular problem. Not that I need to be able to do this,
> > just wondering why this rule is so.
>
>  From both a parsing and self-documentation perspective, it's clearer to
> explicitly say:
>
>   .sub foo :multi
> .param pmc x :invocant('Integer')
> .param pmc y :invocant('ANY')
> .param pmc z :invocant('String')
> .param pmc a
>
> than it is to simply leave 'y' blank.
>
> The behavior of the parameters 'y' and 'a' are a bit different. The 'a'
> parameter is only considered at the very start to knock out signatures
> that couldn't possibly fit (wrong number of required parameters). The
> 'y' parameter is a full participant in multi-dispatch, and contributes
> to the overall score of the signature for a particular call. An
> "Integer, Integer, Integer" signature may be considered a better match
> for a call than "Integer, *, Integer" (when the call is all Integers),
> because it's more specific to the particular types passed.
>

I think the penny dropped here :-) I'll write down here how I see it, also
so that I don't forget, and this text can be rephrased into documentation.

Assume that :invocant markers do not need to be contiguous, then:
Essentially, you don't know how many :invocants there are for a specific
:multi. For instance:

.sub foo :multi
  .param pmc a :invocant('Integer')
  .param pmc b
  .param pmc c
..
.end

Is this sub a multi that takes 1 invocant (of type Integer) or maybe an
Integer parameter and 1 'any' parameter (don't care which type), or maybe 2
don't-care types.

In order to solve that, adding a :invocant('any') (* a special marker would
be more convenient, maybe someone would like to define a class 'any'  (you
never know :-) but that's beside the pointnow *)
By adding these markers, what effectively happens is that all :invocant
parameters that are considered the :multi signature, are grouped together,
anyway. So, this is the reason that :invocant-marked params must be grouped
together.

kjs


Re: Official Perl 6 and Parrot wikis

2007-12-29 Thread chromatic
On Saturday 29 December 2007 13:35:00 Mark J. Reed wrote:

> Ok, consider me duly chastised.  Sorry for the sidetracking.

It's not a *bad* idea, but it's less important in my mind than getting useful 
information on the wiki.  Anyone who wants to pursue it can do so, but I'd 
like to forestall a long digression on the list about it.  That's all.

-- c


Re: Official Perl 6 and Parrot wikis

2007-12-29 Thread Mark J. Reed
Ok, consider me duly chastised.  Sorry for the sidetracking.


On 12/29/07, chromatic <[EMAIL PROTECTED]> wrote:
> On Saturday 29 December 2007 06:56:45 Mark J. Reed wrote:
>
> > Maybe it's just me, but it
> > seems like it will just feed the all-too-common perception that Perl
> > is for CGI scripts, and "real" web apps need to be written in
> > something else (be it Java, PHP, Ruby/Rails, whatever).
>
> Proposed new rule: for every ten contributions to the wiki, you get one
> bikeshed mail.
>
> -- c
>


-- 
Mark J. Reed <[EMAIL PROTECTED]>


Re: Official Perl 6 and Parrot wikis

2007-12-29 Thread chromatic
On Saturday 29 December 2007 06:56:45 Mark J. Reed wrote:

> Maybe it's just me, but it
> seems like it will just feed the all-too-common perception that Perl
> is for CGI scripts, and "real" web apps need to be written in
> something else (be it Java, PHP, Ruby/Rails, whatever).

Proposed new rule: for every ten contributions to the wiki, you get one 
bikeshed mail.

-- c


Re: [perl #49168] [TODO] create a simplified command interface for perl6

2007-12-29 Thread chromatic
On Saturday 29 December 2007 01:29:46 Allison Randal wrote:

> > * convert perl6.pbc into a C executable

> Possible, but ultimately too constraining. There are significant
> advantages to having the full Parrot runtime environment available.

Don't reject this out of hand.  The C executables generated from pbc2c link 
against libparrot, so they have the full Parrot runtime environment 
available.  Basically, this code replaces src/main.c with src/perl6pbc.c and 
a few lines that create a new Parrot interpreter and give it the Perl 6 
compiler's bytecode.

I hope to check in a small demo later today.

-- c


[perl #47347] [TODO] Merge configuration steps gen::cpu and auto::cpu

2007-12-29 Thread James Keenan via RT
Smoke test results have been favorable, so I will now proceed to
renaming gen::cpu to auto::cpu, the better to reflect its character as
probe.


Re: Test Results

2007-12-29 Thread Alberto Simões

Hi

James E Keenan wrote:

Which OS-cpu?  Which Parrot version?


Forgot to tell it.
Mac OS Tiger on PPC G4
Perl 5.10
Parrot Revision: 24263



t/library/mime_base64.t(Wstat: 6 Tests: 0 Failed: 0)
  Parse errors: No plan found in TAP output


Can you send output of prove -v?


[EMAIL PROTECTED] parrot]$ prove -v t/library/mime_base64.t
t/library/mime_base64..src/pmc_freeze.c:1202: failed assertion 
'must_have_seen'

 No subtests run

Test Summary Report
---
t/library/mime_base64.t (Wstat: 6 Tests: 0 Failed: 0)
  Parse errors: No plan found in TAP output
Files=1, Tests=0,  1 wallclock secs ( 0.02 usr  0.02 sys +  0.17 cusr 
0.09 csys =  0.30 CPU)

Result: FAIL

t/compilers/json/to_parrot.t   (Wstat: 15104 Tests: 60 
Failed: 59)

  Failed test number(s):  1-58, 60
  Non-zero exit status: 59


This test had some failures last week (see 
http://rt.perl.org/rt3/Ticket/Display.html?id=48965), but were reported 
fixed via r24163.  Can you send output of prove -v?


See attach :)

Cheers
ambs
--
Alberto Simões - Departamento de Informática - Universidade do Minho
 Campus de Gualtar - 4710-057 Braga - Portugal
t/compilers/json/to_parrot.t
1..60
not ok 1 - empty string

# Failed test (t/compilers/json/to_parrot.t at line 688)
# Exited with error code: [SIGNAL 6]
# Received:
# src/pmc_freeze.c:1202: failed assertion 'must_have_seen'
# 
# Expected:
# "JSON" => ""
# 
not ok 2 - string

# Failed test (t/compilers/json/to_parrot.t at line 688)
# Exited with error code: [SIGNAL 6]
# Received:
# src/pmc_freeze.c:1202: failed assertion 'must_have_seen'
# 
# Expected:
# "JSON" => "json"
# 
not ok 3 - strings need quotes

# Failed test (t/compilers/json/to_parrot.t at line 709)
#   'src/pmc_freeze.c:1202: failed assertion 'must_have_seen'
# '
# doesn't match '(?-xism:not a valid JSON value)'
# './parrot   "/Users/ambs/Projects/parrot/t/compilers/json/to_parrot_3.pir"' 
failed with exit code [SIGNAL 6]
not ok 4 - string with backslash "

# Failed test (t/compilers/json/to_parrot.t at line 688)
# Exited with error code: [SIGNAL 6]
# Received:
# src/pmc_freeze.c:1202: failed assertion 'must_have_seen'
# 
# Expected:
# "JSON" => "\"json\""
# 
not ok 5 - string with backslash \

# Failed test (t/compilers/json/to_parrot.t at line 688)
# Exited with error code: [SIGNAL 6]
# Received:
# src/pmc_freeze.c:1202: failed assertion 'must_have_seen'
# 
# Expected:
# "JSON" => "\\json\\"
# 
not ok 6 - string with /

# Failed test (t/compilers/json/to_parrot.t at line 688)
# Exited with error code: [SIGNAL 6]
# Received:
# src/pmc_freeze.c:1202: failed assertion 'must_have_seen'
# 
# Expected:
# "JSON" => "/json/"
# 
not ok 7 - string with backslash b

# Failed test (t/compilers/json/to_parrot.t at line 688)
# Exited with error code: [SIGNAL 6]
# Received:
# src/pmc_freeze.c:1202: failed assertion 'must_have_seen'
# 
# Expected:
# "JSON" => "\bjson\b"
# 
not ok 8 - string with backslash f

# Failed test (t/compilers/json/to_parrot.t at line 688)
# Exited with error code: [SIGNAL 6]
# Received:
# src/pmc_freeze.c:1202: failed assertion 'must_have_seen'
# 
# Expected:
# "JSON" => "\fjson\f"
# 
not ok 9 - string with backslash n

# Failed test (t/compilers/json/to_parrot.t at line 688)
# Exited with error code: [SIGNAL 6]
# Received:
# src/pmc_freeze.c:1202: failed assertion 'must_have_seen'
# 
# Expected:
# "JSON" => "\njson\n"
# 
not ok 10 - string with backslash r

# Failed test (t/compilers/json/to_parrot.t at line 688)
# Exited with error code: [SIGNAL 6]
# Received:
# src/pmc_freeze.c:1202: failed assertion 'must_have_seen'
# 
# Expected:
# "JSON" => "\rjson\r"
# 
not ok 11 - string with backslash t

# Failed test (t/compilers/json/to_parrot.t at line 688)
# Exited with error code: [SIGNAL 6]
# Received:
# src/pmc_freeze.c:1202: failed assertion 'must_have_seen'
# 
# Expected:
# "JSON" => "\tjson\t"
# 
not ok 12 - number int

# Failed test (t/compilers/json/to_parrot.t at line 688)
# Exited with error code: [SIGNAL 6]
# Received:
# src/pmc_freeze.c:1202: failed assertion 'must_have_seen'
# 
# Expected:
# "JSON" => 1
# 
not ok 13 - number int minus

# Failed test (t/compilers/json/to_parrot.t at line 688)
# Exited with error code: [SIGNAL 6]
# Received:
# src/pmc_freeze.c:1202: failed assertion 'must_have_seen'
# 
# Expected:
# "JSON" => -1
# 
not ok 14 - number int frac

# Failed test (t/compilers/json/to_parrot.t at line 688)
# Exited with error code: [SIGNAL 6]
# Received:
# src/pmc_freeze.c:1202: failed assertion 'must_have_seen'
# 
# Expected:
# "JSON" => 3.14
# 
not ok 15 - number int frac minus

# Failed test (t/compilers/json/to_parrot.t at line 688)
# Exited with error code: [SIGNAL 6]
# Received:
# src/pmc_freeze.c:1202: failed assertion 'must_have_seen'
# 
# Expected:
# "JSON" => -3.14
# 
not ok 16 - number int exp

# Failed test (t/compilers/json/to_parrot.t at line 688)
# 

Re: Test Results

2007-12-29 Thread James E Keenan

Alberto Simões wrote:

Hi

Probably this is all known, but as I am quite out from Parrot lately, 
and just wanted to try a make test under Perl 6, today I compiled 
Parrot, and run a make test.




Which OS-cpu?  Which Parrot version?


This was the result:

Test Summary Report
---
t/configure/115-auto_warnings-01.t (Wstat: 0 Tests: 4 Failed: 0)
  TODO passed:   4
t/configure/124-auto_alignptrs-05.t(Wstat: 0 Tests: 21 Failed: 0)
  TODO passed:   20


Known issues; working on them.


t/library/mime_base64.t(Wstat: 6 Tests: 0 Failed: 0)
  Parse errors: No plan found in TAP output


Can you send output of prove -v?

t/compilers/json/to_parrot.t   (Wstat: 15104 Tests: 60 
Failed: 59)

  Failed test number(s):  1-58, 60
  Non-zero exit status: 59


This test had some failures last week (see 
http://rt.perl.org/rt3/Ticket/Display.html?id=48965), but were reported 
fixed via r24163.  Can you send output of prove -v?



t/examples/shootout.t  (Wstat: 2304 Tests: 20 
Failed: 9)

  Failed test number(s):  6-11, 17-19
  Non-zero exit status: 9


Has failed a lot.   Nowadays, passes for me on Linux, but always fails 
on Darwin.  See also http://rt.perl.org/rt3/Ticket/Display.html?id=43481.




Re: VTABLE_elements

2007-12-29 Thread Allison Randal

Andy Lester wrote:


What about when you want to implement things like, element -1 gets the 
last element of the array? That's the case in some languages, I 
believe...


Yes, but we're talking about returning the number of elements in a PMC.  
That should never be negative.


Unless someone wants to write a PMC that does return a negative number 
for VTABLE_elements and have that number be significant in some way.


The vtable functions define a standard interface for all PMCs and they 
use a standard set of types: INTVAL, FLOATVAL, STRING*, and PMC*. These, 
unsurprisingly, directly correspond to the register types. That's an 
intentional part of the design.


Allison


[perl #43134] [TODO] Find a generalised way to determine location of Fink

2007-12-29 Thread James Keenan via RT
Please review the patch attached, which proposes adding a new Parrot
configuration step, auto::fink, for the purpose of locating the Fink
directories needed for three later configuration steps.

Adding config/auto/fink.pm and 9 test files.  Modifying
Parrot::Configure::Step::List, the 3 affected config step classes and
MANIFEST.

If there is no objection, I will apply this to trunk within a week. Is
there anyone out there building Parrot on Darwin who has Fink installed
in a non-standard location?  If so, your smoke of the patch would be
welcome.  (But since there probably won't be that many such people, I
won't wait long before applying the patch.)

Thank you very much.
kid51
Index: MANIFEST
===
--- MANIFEST(revision 24263)
+++ MANIFEST(working copy)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Sat Dec 29 07:48:33 2007 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Sat Dec 29 16:58:16 2007 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -216,6 +216,7 @@
 config/auto/env.pm  []
 config/auto/env/test_setenv.in  []
 config/auto/env/test_unsetenv.in[]
+config/auto/fink.pm []
 config/auto/format.pm   []
 config/auto/funcptr.pm  []
 config/auto/funcptr/test_c.in   []
@@ -3124,6 +3125,15 @@
 t/configure/111-auto_gcc-13.t   []
 t/configure/112-auto_backtrace-01.t []
 t/configure/112-auto_backtrace-02.t []
+t/configure/113-auto_fink-01.t  []
+t/configure/113-auto_fink-02.t  []
+t/configure/113-auto_fink-03.t  []
+t/configure/113-auto_fink-04.t  []
+t/configure/113-auto_fink-05.t  []
+t/configure/113-auto_fink-06.t  []
+t/configure/113-auto_fink-07.t  []
+t/configure/113-auto_fink-08.t  []
+t/configure/113-auto_fink-09.t  []
 t/configure/113-auto_msvc-01.t  []
 t/configure/113-auto_msvc-02.t  []
 t/configure/113-auto_msvc-03.t  []
Index: lib/Parrot/Configure/Step/List.pm
===
--- lib/Parrot/Configure/Step/List.pm   (revision 24263)
+++ lib/Parrot/Configure/Step/List.pm   (working copy)
@@ -20,6 +20,7 @@
 inter::yacc
 auto::gcc
 auto::backtrace
+auto::fink
 auto::msvc
 auto::attributes
 auto::warnings
Index: t/configure/113-auto_fink-01.t
===
--- t/configure/113-auto_fink-01.t  (revision 0)
+++ t/configure/113-auto_fink-01.t  (revision 0)
@@ -0,0 +1,81 @@
+#! perl
+# Copyright (C) 2007, The Perl Foundation.
+# $Id: 113-auto_fink-01.t 23588 2007-12-08 14:31:02Z jkeenan $
+# 113-auto_fink-01.t
+
+use strict;
+use warnings;
+use Test::More;
+plan( skip_all => 'Fink is Darwin only' ) unless $^O =~ /darwin/;
+plan( tests => 11 );
+use Carp;
+use lib qw( lib t/configure/testlib );
+use_ok('config::init::defaults');
+use_ok('config::auto::fink');
+
+use Parrot::Configure;
+use Parrot::Configure::Options qw( process_options );
+use Parrot::Configure::Test qw( test_step_thru_runstep);
+
+my $args = process_options( {
+argv=> [],
+mode=> q{configure},
+} );
+
+my $conf = Parrot::Configure->new();
+
+test_step_thru_runstep($conf, q{init::defaults}, $args);
+
+my ($task, $step_name, $step, $ret);
+my $pkg = q{auto::fink};
+
+$conf->add_steps($pkg);
+$conf->options->set(%{$args});
+$task = $conf->steps->[-1];
+$step_name   = $task->step;
+
+$step = $step_name->new();
+ok(defined $step, "$step_name constructor returned defined value");
+isa_ok($step, $step_name);
+ok($step->description(), "$step_name has description");
+
+# Success in the following test means:
+# (a) OS is Darwin.
+# (b) Either Fink is not installed or it is installed correctly, i.e., we can
+# locate the Fink subdirectories we need for later Parrot configuration steps.
+ok($step->runstep($conf), "runstep() returned true value");
+
+pass("Completed all tests in $0");
+
+### DOCUMENTATION ###
+
+=head1 NAME
+
+113-auto_fink-01.t - test config::auto::fink
+
+=head1 SYNOPSIS
+
+% prove t/configure/113-auto_fink-01.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by F.
+
+The tests in this file run on Darwin only and test config::auto::fink.
+
+=head1 AUTHOR
+
+James E Keenan
+
+=head1 SEE ALSO
+
+config::auto

[svn:parrot-pdd] r24265 - trunk/docs/pdds

2007-12-29 Thread allison
Author: allison
Date: Sat Dec 29 09:14:50 2007
New Revision: 24265

Modified:
   trunk/docs/pdds/pdd25_concurrency.pod

Log:
[pdd] Completing truncated sentence in Concurrency PDD.


Modified: trunk/docs/pdds/pdd25_concurrency.pod
==
--- trunk/docs/pdds/pdd25_concurrency.pod   (original)
+++ trunk/docs/pdds/pdd25_concurrency.pod   Sat Dec 29 09:14:50 2007
@@ -95,6 +95,8 @@
 The following are a few of the concurrency models Parrot intends to
 support. The biggest differences between them are in how they handle
 variables shared across concurrent tasks.  But the design is such that
+each of the different models can run simultaneously, coordinated through the
+central concurrency scheduler.
 
 =head3 Mutex/Lock Concurrency
 


Re: VTABLE_elements

2007-12-29 Thread Andy Lester


What about when you want to implement things like, element -1 gets  
the last element of the array? That's the case in some languages, I  
believe...



Yes, but we're talking about returning the number of elements in a  
PMC.  That should never be negative.



--
Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance






Re: VTABLE_elements

2007-12-29 Thread Jonathan Worthington

chromatic wrote:

On Friday 28 December 2007 07:09:24 Andy Lester wrote:

  

Should we be allowing negative in the PMC elements() functions?  Seems
to me they'd be more appropriate as UINTVALs.



I can't think of any reason they could be negative.  Can you make a patch to 
convert them and see if anything breaks?
  
What about when you want to implement things like, element -1 gets the 
last element of the array? That's the case in some languages, I believe...


Jonathan



Re: Official Perl 6 and Parrot wikis

2007-12-29 Thread Gabor Szabo
On Dec 29, 2007 4:56 PM, Mark J. Reed <[EMAIL PROTECTED]> wrote:
> .cgi?  Is that really a CGI-based implementation?  Because that seems
> a little, I don't know, backward-looking.  Maybe it's just me, but it
> seems like it will just feed the all-too-common perception that Perl
> is for CGI scripts, and "real" web apps need to be written in
> something else (be it Java, PHP, Ruby/Rails, whatever).
>
> Besides, I hope that the language and wiki will be successful enough
> that a cgi-based implementation will completely fail to scale to meet
> demand. :)


Maybe the site maintainers could add an Apache rewrite rule
so the URLs used by the public will be

   http://www.perlfoundation.org/perl6/index.p6
and
   http://www.perlfoundation.org/parrot/index.parrot

That would change the perception and we would not need to explain
about mod_perl running the .cgi scripts at the rate 100-200 faster
than good old CGI.

When asked if they really run on Perl 6 and Parrot we could just smile...

Gabor


Re: Official Perl 6 and Parrot wikis

2007-12-29 Thread Mark J. Reed
.cgi?  Is that really a CGI-based implementation?  Because that seems
a little, I don't know, backward-looking.  Maybe it's just me, but it
seems like it will just feed the all-too-common perception that Perl
is for CGI scripts, and "real" web apps need to be written in
something else (be it Java, PHP, Ruby/Rails, whatever).

Besides, I hope that the language and wiki will be successful enough
that a cgi-based implementation will completely fail to scale to meet
demand. :)


On 12/29/07, Conrad Schneiker <[EMAIL PROTECTED]> wrote:
> For those who didn't know (or didn't recognize the links), these are the
> URLs for the official Perl 6 and Parrot wikis:
>
> http://www.perlfoundation.org/perl6/index.cgi
>
> http://www.perlfoundation.org/parrot/index.cgi
>
> Contributions of content are of course always welcome.
>
> Please consider linking to these wikis where appropriate, to help raise
> their visibility and utility.
>
> (Also consider dropping a note to perl6-users about major wiki updates of
> general interest to Perl 6 test drivers and fans.)
>
> FYI, there's also an official Perl 5 wiki.
>
> http://www.perlfoundation.org/perl5/index.cgi
>
> Best regards,
> Conrad Schneiker
>
> www.AthenaLab.com
>
>
>
>


-- 
Mark J. Reed <[EMAIL PROTECTED]>


Test Results

2007-12-29 Thread Alberto Simões

Hi

Probably this is all known, but as I am quite out from Parrot lately, 
and just wanted to try a make test under Perl 6, today I compiled 
Parrot, and run a make test.


This was the result:

Test Summary Report
---
t/configure/115-auto_warnings-01.t (Wstat: 0 Tests: 4 Failed: 0)
  TODO passed:   4
t/configure/124-auto_alignptrs-05.t(Wstat: 0 Tests: 21 Failed: 0)
  TODO passed:   20
t/library/mime_base64.t(Wstat: 6 Tests: 0 Failed: 0)
  Parse errors: No plan found in TAP output
t/compilers/json/to_parrot.t   (Wstat: 15104 Tests: 60 
Failed: 59)

  Failed test number(s):  1-58, 60
  Non-zero exit status: 59
t/examples/shootout.t  (Wstat: 2304 Tests: 20 Failed: 9)
  Failed test number(s):  6-11, 17-19
  Non-zero exit status: 9
Files=531, Tests=9968, 1393 wallclock secs ( 9.46 usr  8.78 sys + 480.69 
cusr 248.39 csys = 747.32 CPU)

Result: FAIL
Failed 3/531 test programs. 68/9968 subtests failed.

--
Alberto Simões - Departamento de Informática - Universidade do Minho
 Campus de Gualtar - 4710-057 Braga - Portugal


Re: Perl6::Doc # Hail to the new pharao

2007-12-29 Thread herbert breunung
thanks to chromatic, so i have ask Jonathan Scott Duff, Phil  Crow and 
wait for /Adrianos answer.


what i yesterday also forgot to mention is that rumor says that the 
emerald tables
are designed to can provide answer for people on over 100 different 
levels of consciousness.
to teach the newbeees the simpel stuff and simultaniously the Damians , 
last bits is what

really describes the goal of my perl tables

/

On Friday 28 December 2007 17:04:40 herbert breunung wrote:

  

I have also plans to add my perl article (once they transelated) for $foo
perl magazine and maybe some perl.com articles, if chomatic allowes.



It's fine with O'Reilly, as long as the authors of the articles agree (they 
hold the copyright).  Where I'm the author, you have my permission.


O'Reilly generally asks that you include a link to the original article as 
published on our site, but that's a request and not a requirement.


-- c

  




[perl #49182] [TODO] access outer lexicals in dynamically compiled subs (e.g. 'eval')

2007-12-29 Thread via RT
# New Ticket Created by  Patrick R. Michaud 
# Please include the string:  [perl #49182]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=49182 >


I'm converting a parrot-porters post into RT tickets so
that progress can be tracked.  The original post is at
http://www.nntp.perl.org/group/perl.perl6.internals/2007/12/msg42112.html

It appears that imcc is unable to handle :outer() flags when
they cross source code boundaries or to be able to use :outer()
to refer to subroutines currently stored in the symbol table.
(There may also be an issue in how one would use :outer() for
nameless subs, but I can come up with workarounds for that.)

In order to support constructs such as "eval", we need some way to
be able to dynamically compile new subroutines that are treated
as lexically nested within an existing sub.

See the parrot-porters post for a more detailed use case and
explanation.  (I can copy it into this ticket if that would
be better, but it's fairly long.)

Pm


Re: [svn:parrot-pdd] r24108 - in trunk: . docs/pdds

2007-12-29 Thread Allison Randal

Klaas-Jan Stol wrote:


Earlier I read over this, thinking: there's probably a good reason for that
(the need for being contiguous), but I haven't figured it out yet.
For sake of documentation, could you please explain why this is so?

so, why would it not be possible to write this:

sub foo :multi
  .param pmc x :invocant('Integer')
  .param pmc y
  .param pmc z :invocant('Integer')
..

and

sub foo :multi
  .param pmc x :invocant('Integer')
  .param pmc y
  .param pmc z :invocant('String')

The former "foo" can be thought of as having signature "Integer, *, Integer"
and the second "Integer, *, String", (where * means any type, don't care).

I don't see a particular problem. Not that I need to be able to do this,
just wondering why this rule is so.


From both a parsing and self-documentation perspective, it's clearer to 
explicitly say:


  .sub foo :multi
.param pmc x :invocant('Integer')
.param pmc y :invocant('ANY')
.param pmc z :invocant('String')
.param pmc a

than it is to simply leave 'y' blank.

The behavior of the parameters 'y' and 'a' are a bit different. The 'a' 
parameter is only considered at the very start to knock out signatures 
that couldn't possibly fit (wrong number of required parameters). The 
'y' parameter is a full participant in multi-dispatch, and contributes 
to the overall score of the signature for a particular call. An 
"Integer, Integer, Integer" signature may be considered a better match 
for a call than "Integer, *, Integer" (when the call is all Integers), 
because it's more specific to the particular types passed.


Allison


[perl #49173] [TODO] Allow source written in perl6

2007-12-29 Thread via RT
# New Ticket Created by  Patrick R. Michaud 
# Please include the string:  [perl #49173]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=49173 >


Currently all of the builtins for perl6 are written in PIR.
However, it would make more sense if some builtins were written
in Perl 6.

We have all of the pieces we need to make this happen -- we just
need (1) a logical means of keep track of builtins written in Perl 6
versus builtins written in PIR, and (2) to decide if the Perl 6
written builtins are part of a library loaded at runtime (stored where?)
or part of the perl6.pbc binary.

Pm


Re: Disassembler enhancement for review

2007-12-29 Thread Allison Randal

Bob Rogers wrote:

   The attached patch adds decoding of call/return registers to the
disassembler, and also fixes a segfault; both are byproducts of a long
and otherwise fruitless debugging session.  Please let me know what you
think.


Looks good. Go ahead and commit. Better abstraction for signature 
decoding can be added later.


Allison


Re: [perl #49175] [TODO] pct - throw useful exception for non-PAST children

2007-12-29 Thread Allison Randal

Patrick R.Michaud (via RT) wrote:


Whenever a PAST::Op node gets a non-PAST child, PCT currently
throws a cryptic exception message like:

Method 'named' not found for invocant of class 'Perl6::Grammar'

A better exception message would be something like:

Perl6::Grammar ("2") child of PAST::Op cannot be converted to POST.


If you want a different exception message, you need to catch the type of 
the child before calling the method on it. You can call 'VTABLE_isa' if 
PAST nodes all share a parent, or you can call 'VTABLE_can' to check if 
the object can perform the method.


Though, the cheapest option may be to simply wrap non-PAST children in a 
PAST-compatible proxy. (That assumes that the non-PAST children are 
intentionally there, and aren't slipping in by mistake.)


Allison


Re: [svn:parrot-pdd] r24108 - in trunk: . docs/pdds

2007-12-29 Thread Allison Randal

Will Coleda wrote:


Yes, it would be specified as Int/Str/Num in the signature.  But
then invoking the multi with an I register or integer constant
should recognize 'Int' as being a match, and not just 'Integer'.


My concern here is HLL interop. I think it would be cleaner to specify 
the base types ( or perhaps a does ) to be generic enough to let another 
language invoke your multis.


So, use a generic Integer/String/Float (or INT/STRING/FLOAT) when you 
can accept any equivalent type, and only use Int/Str/Num when you 
specifically need the Perl 6 types.


That I would leave as a choice for the compiler writer. They'll want to 
hide the details of Parrot's internal multi signatures from the users, 
but can emit any low-level signature they want for a high-level 
signature (or even several different low-level signatures, if the 
high-level multidispatch system has greater flexibility).


Allison


Re: [perl #49168] [TODO] create a simplified command interface for perl6

2007-12-29 Thread Allison Randal

Patrick R.Michaud (via RT) wrote:


Currently the most frequently asked question (by far) about perl6 
is "how can I just get an executable that I can use to run Perl 
6 programs?" 

At present this isn't possible, the best we can offer is 
"/path/to/parrot/parrot /path/to/parrot/languages/perl6/perl6.pbc hello.pl", 
which is a pain. So, we need a way to package this up into a simple 
shell script, executable, or other item that can be placed in a 
PATH and executed directly. Some ideas:


* automatically generate a perl6/perl6.bat shell script that hardcodes
  the paths


This is a good place to start to increase the perception of progress 
(it'll only take a minute or two).



* add some smarts to Parrot to allow it to search/execute .pbc files
  in some standard locations (RT#47992)


We certainly need to allow configurable search paths (at runtime and 
compile-time). And we certainly need to eliminate the requirement for 
passing full relative paths for everything.


There was an old proposal to do file-extension searches for all files, 
but the problem was that any automatic selection of extension turned out 
to be wrong about half-the-time. I don't consider the idea rejected for 
all time, but that particular implementation wasn't the right one.


Adding a --prog= (or --language= or --compiler=) option is an easy sell, 
at least in the context of loading a language compiler, and could do 
more than just selecting a .pbc file to run.



* convert perl6.pbc into a C executable


Possible, but ultimately too constraining. There are significant 
advantages to having the full Parrot runtime environment available.



* other...?


Busybox has a nice feature where it checks the name you used to call it, 
and presents different behavior based on that name. So, if 'ps' is a 
symlink to 'busybox', when you call 'ps' on the command-line, Busybox 
knows to process the options given as if it were the 'ps' command.




Parrot can do something similar, checking the name used to call it. If 
'perl6' is a symlink to 'parrot' and the user calls 'perl6 myscript.pl' 
Parrot can simply act as if the --language=perl6 option was passed on 
the command-line.



The goal is to have the 'parrot' part be invisible, so an embedded 
system or install CD can present the illusion of running Python, PHP, 
Perl 5, Perl 6, etc, but actually be running only Parrot.


Allison


Re: Perl6::Doc # Hail to the new pharao

2007-12-29 Thread chromatic
On Friday 28 December 2007 17:04:40 herbert breunung wrote:

> I have also plans to add my perl article (once they transelated) for $foo
> perl magazine and maybe some perl.com articles, if chomatic allowes.

It's fine with O'Reilly, as long as the authors of the articles agree (they 
hold the copyright).  Where I'm the author, you have my permission.

O'Reilly generally asks that you include a link to the original article as 
published on our site, but that's a request and not a requirement.

-- c


[perl #49135] [BUG] pge - zero-quantified expression doesn't create empty array

2007-12-29 Thread Patrick R. Michaud via RT
On second look, it appears that PGE is doing the correct thing, and the
problem we were seeing that triggered this ticket was due to a GC bug. 
So, never mind!

Thanks,

Pm


Re: [perl #49085] [PATCH] perl6 add pick method to List

2007-12-29 Thread Patrick R. Michaud
On Mon, Dec 24, 2007 at 05:12:24PM -0800, Christopher Pruden wrote:
> # New Ticket Created by  Christopher Pruden 
> # Please include the string:  [perl #49085]
> # in the subject line of all future correspondence about this issue. 
> # http://rt.perl.org/rt3/Ticket/Display.html?id=49085 >
> 
> 
> I've put together a patch to add a 'pick' method to the perl6  
> compiler's List class.  This is mainly cargo-culted from the Junction  
> pick method, with a few changes to bring it inline with the pugs pick  
> method.

Excellent, thank you for the patch!

Before I apply it, though, how hard would it be to submit the
same functionality as a sub (or subs) written in Perl 6?  I can
certainly accept the function as a PIR sub, but I'm also looking
to get as much of the libraries and compiler code written in Perl 6
as we can, and this looks like a really good candidate.  What
support would be needed from the perl6 compiler to do that?

> Once again, criticism is more than welcome -- this is the first thing  
> bigger than hello world that I've done in PIR.

No immediate criticism on my part as far as the PIR goes (I haven't
reviewed it extensively) -- I'm just thinking this is a good point to
figure out how we can get library functions to be written in Perl 6
instead of PIR.  (See also RT#49173 for more details about this.)

Thanks again!

Pm



Re: [perl #49061] parsing hangs forever, fixed with custom token ws

2007-12-29 Thread Patrick R. Michaud
On Sun, Dec 23, 2007 at 06:01:22PM -0800, Stephen Weeks wrote:
> Working on getting parrot to parse the lojban grammar, I found that it
> would hang forever with --target=parse.  Tracked it down to a  rule.
> When I define a custom token ws in the grammar, it parses without
> problem.
> 
> Built a stripped-down test case.
> 
> http://nopaste.snit.ch:8001/paste has the grammar.
> http://pleasedieinafire.net/~tene/jp.tar.bz2 has the grammar, a slightly
> modified version of abc's .pir and Makefile.
> 
> Can anyone else confirm this?  Am I doing something wrong?

The default  rule (as defined by Synopsis 5) only requires whitespace
between two word characters.  Thus the grammar as written (without a custom
 rule) looks for an infinite number of  matches, and since
 can match an empty string when not between two word characters, PGE
gets caught in an infinite loop.

Thus this ticket should likely be merged with or treated as a duplicate
of RT#37745 (handle repeated zero-length captures in PGE).  At any rate,
until #37745 is fixed it's probably worthwhile to make sure grammars don't
end up with repeated zero-length subrules or subpatterns.

Pm


Pugs File-Util tests

2007-12-29 Thread Mark A. Hershberger

The recent perl6 brouhaha got me to try out pugs again.

After grabbing pugs from svn and running the smoke tests
(http://xrl.us/bdipe), I noticed some ext/File-Util/t/03.dirs.t was
failing and looked like it would be a relatively easy fix.

Diff attached.

I worked from the File::Util docs on CPAN and added some tests.  I'd be
especially interested in any criticism since this is my first real
attempt at perl6.

-- 
http://hexmode.com/
GPG Fingerprint: 7E15 362D A32C DFAB E4D2  B37A 735E F10A 2DFC BFF5

My happiness grows in direct proportion to my acceptance, and in
inverse proportion to my expectations.  -- Michael J. Fox

Index: ext/File-Util/t/03.dirs.t
===
--- ext/File-Util/t/03.dirs.t   (revision 19284)
+++ ext/File-Util/t/03.dirs.t   (working copy)
@@ -7,7 +7,23 @@
 use File::Util; pass "(dummy instead of broken use_ok)";
 
 my $f = File::Util.new;
+my $d = 'ext/File-Util/t';
 
-my @files = $f.list_dir('ext/File-Util/t');
-
+my @files = $f.list_dir($d);
 ok( @files );
+
[EMAIL PROTECTED] = $f.list_dir($d, '--no-fsdots');
+ok( @files.grep:{/^\.\.$/} == 0 ); # only .svn
+
[EMAIL PROTECTED] = $f.list_dir($d, '--dirs-only');
+ok( @files.grep:{$_ ~~ :d} == @files && @files > 1 );
+
[EMAIL PROTECTED] = $f.list_dir($d, '--dirs-only', '--no-fsdots');
+ok( @files == 1 && @files.grep:{$_ ~~ :d} == 1 ); # only .svn
+
[EMAIL PROTECTED] = $f.list_dir($d, '--files-only');
+ok( @files.grep:{"$d/$_" ~~ :f} == @files );
+
[EMAIL PROTECTED] = $f.list_dir($d, '--with-paths');
+ok( @files.grep:{$_.substr(0, $d.chars) eqv $d} > 0 &&
+@files.grep:{$_.substr(0, $d.chars) !eqv $d} == 0 );
Index: ext/File-Util/lib/File/Util.pm
===
--- ext/File-Util/lib/File/Util.pm  (revision 19284)
+++ ext/File-Util/lib/File/Util.pm  (working copy)
@@ -159,8 +159,7 @@
 }
 }
 
-method list_dir (Str $dirname, %options?){
-
+method list_dir (Str $dirname, [EMAIL PROTECTED]){
 # my $maxd = $.maxdives;
 my $maxd = 12;
 my $path = $dirname;
@@ -196,24 +195,52 @@
 
 my @shadow = @dirs;
 @dirs = ();
+my @files = ();
+my @others = ();
 while @shadow {
 my $f = @shadow.shift;
+if(@options.grep:{$_ eqv '--no-fsdots'}) {
 next if $f eq '.';
 next if $f eq '..';
-next if $f ~~ /^\./;
+}
+
+my $fullpath = $path ~ "/" ~ $f;
+my $pathname;
+
+if(@options.grep:{$_ eqv '--with-paths'}) {
+  $pathname = $fullpath;
+} else {
+  $pathname = $f;
+}
 
-my $pathname = $path ~ "/" ~ $f;
-if $pathname ~~ :d {
-@dirs.push($path ~ "/" ~ $f);
+given $fullpath {
+ when :d {
+   @dirs.push($pathname);
 }
+ when :f {
+   @files.push($pathname);
 }
+ default {
+   @others.push($pathname);
+ }
+};
+  };
+
+my @ret;
 
-for @dirs -> $dir {
-self.list_dir($dir);
+if(@options.grep:{$_ eqv '--files-only'}) {
+  @ret.push(@files);
+}
+elsif(@options.grep:{$_ eqv '--dirs-only'}) {
+  @ret.push(@dirs);
 }
+else {
+  @ret.push(@dirs, @files, @others);
+}
+
 # for @options -> $option {
 # }
-return @dirs.sort;
+return @ret.sort;
 }
 
 method size (Str $filename) {



[perl #43305] [TODO] config/auto/perldoc.pm: Write unit tests

2007-12-29 Thread James Keenan via RT
Please see the refactored version of config/auto/perldoc.pm and two test
files, t/configure/147-auto_perldoc-01.t and -02.t, which were committed
in or before r24258.

I had intended to submit these as a patch to list, but my SVN sandbox
got confused today during theh planned outage, and everthing ended up
getting committed.

I took doughera's suggestion and looked for the version of 'perldoc'
associated with the perl used to run Configure.pl.

Other aspects of the control flow of this class's runstep() method were
baffling.  I *think* I preserved that flow; I *know* I made that flow
easier to follow.  But I would ask those of you who have a perldoc
version 1 lying around to take a look.

thanks.

kid51


Perl6::Doc # Hail to the new pharao

2007-12-29 Thread herbert breunung

Hereby I declare myself as the Pharao of the Perl 6 Documentation.

My first sign of regence will be most probably tomorrow the release the 
initial stable release of


http://search.cpan.org/~lichtkind/Perl6-Doc/

this is a perly command line tool to read perl 6 related documentation. 
The code was actually made by
Ingy döt net since this is just an updated version of Perl6::Bible which 
will hereby depreciated.
It contains the newest version of the Synopses, Apocalypses and 
Exegesis, like Perl6::Bible did,
plus the more usefull docs from the Pugs repository including the 
tutorial. I have also plans to add
my perl article (once they transelated) for $foo perl magazine and maybe 
some perl.com articles,

if chomatic allowes.

I plan also include my wiki styled tutorial that i began to translate 
these days, as you can see under


http://www.perlfoundation.org/perl6/index.cgi?perl_table

Yes i renamed it perl tables, to avoid namespace collision with the 
already started perl tutorial in pugs SVN,
and also because its a much nicer and more descriptive name of what it 
does. its a table like summary of all
perl 6 feature, so well ordered and with some aditional explaining text, 
so you can always find quickly if you

look for something. its also a reference to the

http://en.wikipedia.org/wiki/Emerald_Tablet

which contained all the wisdom people of ancient times had. so it should 
perl tables contain all wisdom about perl.

As always everybody is invited,

blessfull holidays
end of communication



Re: [perl #49175] [TODO] pct - throw useful exception for non-PAST children

2007-12-29 Thread chromatic
On Friday 28 December 2007 16:16:55 Patrick R.Michaud wrote:

> Whenever a PAST::Op node gets a non-PAST child, PCT currently
> throws a cryptic exception message like:
>
> Method 'named' not found for invocant of class 'Perl6::Grammar'
>
> A better exception message would be something like:
>
> Perl6::Grammar ("2") child of PAST::Op cannot be converted to POST.

How does this node "get" a non-PAST child?  Is there a single point at which 
you add a child to a PAST::Op node?  (I'm pretty sure I know the answer, but 
I'm not entirely sure.)

-- c


Re: [perl #49168] [TODO] create a simplified command interface for perl6

2007-12-29 Thread Patrick R. Michaud
On Fri, Dec 28, 2007 at 08:09:23PM -0600, John M. Dlugosz wrote:
> 
> >At present this isn't possible, the best we can offer is 
> >"/path/to/parrot/parrot /path/to/parrot/languages/perl6/perl6.pbc 
> >hello.pl", which is a pain. So, we need a way to package this up into a 
> >simple shell script, executable, or other item that can be placed in a 
> >PATH and executed directly. 
> 
> If I understand correctly, you want the parrot executable and the 
> perl6.pbc file to be somewhere on the PATH, and not coded into the shim 
> or otherwise configured at install time.  

I don't mind if they're coded into the shim at install time, I
just want something that "works" the way most end-users would
expect to invoke a perl interpreter.

> And putting parrot on the PATH 
> is not enough because it doesn't know to search for the .pbc file.

Correct.

> In the 4NT command shell under Windows, try this:
> 
> set .pl=perl6
> alias perl6=parrot `"[EMAIL PROTECTED]"`
> 
> The second line permits the use:
>prompt> parrot hello.pl
> 
> And the first further gives
>prompt> hello.pl
> or
>prompt> hello

This sounds like a potential solution for Windows users, but is it
possible to create it so that this occurs somewhat "automatically"
when perl6 is built or installed?  Or do we have to tell people
to execute the above commands whenever they want to run perl6?

Also, I wouldn't want perl6 to (yet :-) usurp the 
.pl extension entirely -- I suspect people playing with perl6
will also have a few Perl 5 scripts lying about that they want
to be invoked as Perl 5.

Thanks!

Pm


[perl #49171] [META] High priority perl6 tickets

2007-12-29 Thread via RT
# New Ticket Created by  Patrick R. Michaud 
# Please include the string:  [perl #49171]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=49171 >


This is a metaticket identifying the other bugs or TODO items
in RT (both the perl6 and parrot queues) that are "high priority"
to be resolved for progress on perl6.

To add another ticket to this queue, simply link it as a dependency
to this one.




[perl #49170] [TODO] document perl6 compiler architecture

2007-12-29 Thread via RT
# New Ticket Created by  Patrick R. Michaud 
# Please include the string:  [perl #49170]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=49170 >


Many have indicated that the plethora of tools (PCT, PAST, NQP)
seem like a barrier to hacking on the perl6 compiler, so we
need a good introduction to how the compiler is put together
and where the pieces fit together.



[perl #49175] [TODO] pct - throw useful exception for non-PAST children

2007-12-29 Thread via RT
# New Ticket Created by  Patrick R. Michaud 
# Please include the string:  [perl #49175]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=49175 >


Whenever a PAST::Op node gets a non-PAST child, PCT currently
throws a cryptic exception message like:

Method 'named' not found for invocant of class 'Perl6::Grammar'

A better exception message would be something like:

Perl6::Grammar ("2") child of PAST::Op cannot be converted to POST.

Pm


[svn:perl6-synopsis] r14474 - doc/trunk/design/syn

2007-12-29 Thread larry
Author: larry
Date: Fri Dec 28 14:54:36 2007
New Revision: 14474

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S05.pod

Log:
Fossil noticed by pmichaud++
Quote macros should be "quote:" rather than "circumfix:"--the latter implies 
EXPR in the middle.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podFri Dec 28 14:54:36 2007
@@ -2271,7 +2271,7 @@
 
 macro qx { 'qq:x ' }  # equivalent to P5's qx//
 macro qTO { 'qq:x:w:to ' }# qq:x:w:to//
-macro circumfix:<❰ ❱> ($expr) { q:code{ $expr.quoteharder } }
+macro quote:<❰ ❱> ($text) { q:code{ $text.quoteharder } }
 
 All the uppercase adverbs are reserved for user-defined quotes.
 All Unicode delimiters above Latin-1 are reserved for user-defined quotes.

Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podFri Dec 28 14:54:36 2007
@@ -14,9 +14,9 @@
Maintainer: Patrick Michaud <[EMAIL PROTECTED]> and
Larry Wall <[EMAIL PROTECTED]>
Date: 24 Jun 2002
-   Last Modified: 29 Nov 2007
+   Last Modified: 28 Dec 2007
Number: 5
-   Version: 68
+   Version: 69
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them I rather than "regular
@@ -361,7 +361,7 @@
 
 Lists and junctions are allowed: C<:nth(1|2|3|5|8|13|21|34|55|89)>.
 
-So are closures: C<:nth{.is_fibonacci}>
+So are closures: C<:nth({.is_fibonacci})>
 
 =item *
 


[svn:parrot-pdd] r24256 - trunk/docs/pdds

2007-12-29 Thread pmichaud
Author: pmichaud
Date: Fri Dec 28 14:58:53 2007
New Revision: 24256

Modified:
   trunk/docs/pdds/pdd15_objects.pod

Log:
[pdds]:  0..10 makes eleven internal attributes.  (bgeron++)


Modified: trunk/docs/pdds/pdd15_objects.pod
==
--- trunk/docs/pdds/pdd15_objects.pod   (original)
+++ trunk/docs/pdds/pdd15_objects.pod   Fri Dec 28 14:58:53 2007
@@ -161,7 +161,7 @@
 class for each OO class, and they all share the Class or Object vtable,
 respectively.
 
-An instance of the Class PMC has ten internal attributes, which are:
+An instance of the Class PMC has eleven internal attributes, which are:
 
 =over 4
 


Re: [perl #49168] [TODO] create a simplified command interface for perl6

2007-12-29 Thread John M. Dlugosz


At present this isn't possible, the best we can offer is 
"/path/to/parrot/parrot /path/to/parrot/languages/perl6/perl6.pbc hello.pl", 
which is a pain. So, we need a way to package this up into a simple 
shell script, executable, or other item that can be placed in a 
PATH and executed directly. 


If I understand correctly, you want the parrot executable and the 
perl6.pbc file to be somewhere on the PATH, and not coded into the shim 
or otherwise configured at install time.  And putting parrot on the PATH 
is not enough because it doesn't know to search for the .pbc file.


In the 4NT command shell under Windows, try this:

set .pl=perl6
alias perl6=parrot `"[EMAIL PROTECTED]"`

The second line permits the use:
   prompt> parrot hello.pl

And the first further gives
   prompt> hello.pl
or
   prompt> hello


Note that this will perform the SEARCH every time it is invoked.  If you 
won't be changing the PATH around on the fly to point to different 
versions of the files (as I would expect for users who are not 
developers of perl6) drop the backquotes and it will perform the SEARCH 
when the alias is established.


--John



[perl #49177] [TODO] pct - PAST::Val node should throw exception if :value attribute not set

2007-12-29 Thread via RT
# New Ticket Created by  Patrick R. Michaud 
# Please include the string:  [perl #49177]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=49177 >


PAST::Val nodes should throw an exception if :value attribute is not
set.

Pm