[PATCH for review only] Don't Access Non-PObj Pool Elements as PObjs

2007-07-10 Thread chromatic
As I mentioned in RT #43481, the garbage collector does some dodgy flag 
setting in memory pools, particularly in Parrot_add_to_free_list().

The attached patch fixes that, at least for PMC_EXT structures.

See src/gc/smallobject.c:210:

PObj_flags_SETTO((PObj *)object, PObj_on_free_list_FLAG);

This converts down to:

(PMC *)object)-obj.flags = PObj_on_free_list_FLAG;

The relevant structures are:

typedef struct Buffer {
pobj_t obj;
} Buffer;

typedef Buffer PObj;

typedef struct pobj_t {
UnionVal u;
Parrot_UInt flags;
} pobj_t;

All's good so far.  Unfortunately, a pool can also contain PMC_EXT structs, 
which are:

typedef struct PMC_EXT {
#if PMC_DATA_IN_EXT
DPOINTER *data;
#endif /* PMC_DATA_IN_EXT */
struct _Sync *_synchronize;
PMC *_next_for_GC;
} PMC_EXT;

If I do the offset math correctly (and I'm not sure I do), setting what would 
be flags in a PObj-like structure instead flips bits in the _next_for_GC PMC 
pointer, and those somewhere in its u member.

Oops.

This patch isn't clean enough for a final solution, but I think it may clean 
up some weird GC problems in other places.

-- c

=== include/parrot/smallobject.h
==
--- include/parrot/smallobject.h	(revision 4643)
+++ include/parrot/smallobject.h	(local)
@@ -101,6 +101,7 @@
 size_t start_arena_memory;
 size_t end_arena_memory;
 const char *name;
+int has_pobj;
 #if PARROT_GC_GMS
 struct _gc_gms_hdr marker;  /* limit of list */
 struct _gc_gms_hdr *black;  /* alive */
=== src/gc/smallobject.c
==
--- src/gc/smallobject.c	(revision 4643)
+++ src/gc/smallobject.c	(local)
@@ -207,12 +207,14 @@
 object = (void *)((char *)arena-start_objects + start * pool-object_size);
 
 for (i = start; i  end; i++) {
-PObj_flags_SETTO((PObj *)object, PObj_on_free_list_FLAG);
+if (pool-has_pobj)
+PObj_flags_SETTO((PObj *)object, PObj_on_free_list_FLAG);
 /*
  * during GC buflen is used to check for objects on the
  * free_list
  */
-PObj_buflen((PObj*)object) = 0;
+if (pool-has_pobj)
+PObj_buflen((PObj*)object) = 0;
 pool-add_free_object(interp, pool, object);
 object = (void *)((char *)object + pool-object_size);
 }
@@ -328,6 +330,7 @@
 pool-mem_pool  = NULL;
 pool-object_size   = object_size;
 pool-objects_per_alloc = objects_per_alloc;
+pool-has_pobj = 1;
 
 return pool;
 }
=== src/headers.c
==
--- src/headers.c	(revision 4643)
+++ src/headers.c	(local)
@@ -553,6 +553,7 @@
 /* pmc extension buffer */
 arena_base-pmc_ext_pool =
 new_small_object_pool(sizeof (PMC_EXT), 1024);
+arena_base-pmc_ext_pool-has_pobj = 0;
 /*
  * pmc_ext isn't a managed item. If a PMC has a pmc_ext structure
  * it is returned to the pool instantly - the structure is never


Project Idea: Perl 6 Syntax Explainer

2007-07-10 Thread Moritz Lenz
Hi,

considering the vast number of Operators and the like, I had the idea to
implement a tool where you can enter a small piece of p6 syntax, and it
explains what that might mean. (like a perldoc -f for operators/syntax
elements instead of functions)

A short example:
$ p6explain '[]'
[...] can be
 * '[$expression]': access to one or more array elements if used as
   postcircumfix
   Example: @a[2]; # access the third element of an array @a
 * '[$operator]': the 'reduce' hyper operator
   Example: [+] (1, 2, 3); # gives 1 + 2 + 3 == 6
In a regex/rule:
 * '[$subregex]': groups the content of the brackets without
   capturing the match result of $subregex

$ p6explain '*'
* can be
 * '$exp1 * $epx2' the multiplication operator, forces numerical
   context onto its arguments.
   Example: say 2 * 3;
 * 'multi sub *method_name' exports the sub method_name into the
   global namespace
In a regex/rule:
 * '$subregex*' is a quantifier meaning that the previous subregex
   may be repeated an arbitrary number of times, including zero
   times.
   Example: m/ [ab]* / matches '', 'ab', 'abab', 'ababab'

# END OF EXAMPLE


I have a few requirements in mind (not necessarily sorted by importance):
  * Free software: Artistic License 2, some BSDish or GPLish - I don't
mind, as long as it's free ;)
  * Multiple frontends: I'd like to have at least a command line and a
web frontend
  * Support for multiple (natural) languages.
  * Perhaps support for other programming languages as well
  * Should contain links/references to the official docs


Now I'd like to hear your opinion:
  * Anything else that should go into the requirements?
  * Is it useful at all?
  * Is it possible to implement it satisfactory without building a p6
compiler?
  * Do you have a good idea for a project name?

Any other ideas and comments are welcome as well.

Cheers,
Moritz

-- 
Moritz Lenz
http://moritz.faui2k3.org/ |  http://perl-6.de/



signature.asc
Description: OpenPGP digital signature


Re: Project Idea: Perl 6 Syntax Explainer

2007-07-10 Thread Juerd Waalboer
Moritz Lenz skribis 2007-07-10 12:43 (+0200):
 $ p6explain '[]'
 [...] can be
  * '[$expression]': access to one or more array elements if used as
postcircumfix
Example: @a[2]; # access the third element of an array @a
  * '[$operator]': the 'reduce' hyper operator
Example: [+] (1, 2, 3); # gives 1 + 2 + 3 == 6
 In a regex/rule:
  * '[$subregex]': groups the content of the brackets without
capturing the match result of $subregex

I had the same idea, but in wiki form, with a clickable map of
characters for the curious.

The idea is basically: categorize by unicode symbols, and then describe
how they're used, in any context.

   * Multiple frontends: I'd like to have at least a command line and a
 web frontend

A command line tool could just do the equivalent of

w3m -dump wiki.perl6.example.com/symbol/*

   * Perhaps support for other programming languages as well

Third system syndrome? :)

   * Anything else that should go into the requirements?

Ultra easy contribution with revision control.

   * Is it useful at all?

Absolutely!

   * Is it possible to implement it satisfactory without building a p6
 compiler?

Yes. Just match individual literal symbols. Someone looking for * should
encounter all uses of *, including ** and **{}. 

   * Do you have a good idea for a project name?

I had Decrypt in mind. (http://decrypt.perl6.nl/*)
-- 
korajn salutojn,

  juerd waalboer:  perl hacker  [EMAIL PROTECTED]  http://juerd.nl/sig
  convolution: ict solutions and consultancy [EMAIL PROTECTED]


Re: Project Idea: Perl 6 Syntax Explainer

2007-07-10 Thread Amir E. Aharoni

  * Anything else that should go into the requirements?


It would be even cooler if the command

$ p6explain 'some_user_defined_sub'

would display prettily-formatted pod for that sub and would work
transparently, regardless of whether this sub is defined in the Perl
standard library, CPAN module, or user's own code. And if there are
several modules that have a sub with this name - print a list of
modules (sorted by relevance to context or alphabetically) and let the
user select what he wants. An overloaded operator should be the same
thing as a sub for this matter.

Rationale: Perl 5's perldoc displays the pod for every properly
installed and documented module just as if they were perl* manpages
and it is transparent to the user. That's one feature of Perl 5 that i
absolutely admire. Why not enhance it to smaller units, like subs? And
it doesn't break the different things should look different
philosophy, as these look different enough to me:

$ p6explain 'some_user_defined_sub' # sub
$ p6explain Date::Hebrew # an imaginary module
$ p6explain := # operator
$ p6explain any # builtin
$ p6explain perlrules # an imaginary P6 manpage that will replace perlre


  * Is it useful at all?


Very much so, yes.

That's what makes Redmond's development tools so attractive - you can
put the cursor on any word, press F1 and get all the help. It doesn't
work so well with operators, and with user-defined functions it just
fails; but for user-defined functions it has the reference feature,
which takes the user to the place where the functions is defined (if
he's lucky enough to have the code). Actually i see no reason why this
couldn't be combined with the help - for me the function's code and
its documentation in a human language are usually equally important.

Integrate that tool with Emacs, and you've got a self-documenting Perl 6 IDE ;)


* Is it possible to implement it satisfactory without building a p6
  compiler?


Syntax highlighters work even with code that doesn't necessarily
compile, so probably the answer is yes.

But if this tool could peek into the compiler's syntax tree and see
all the namespaces that the compiler knows as an easy-to-navigate data
structure, then implementing my wish from above - generically getting
help for every token wherever it is defined - would probably be
easier.

(Too bad i don't really know much about implementing compilers.)


  * Do you have a good idea for a project name?


I really wish that such project just DIDN'T have a name, at least not
at the end-user level. If it will have a name, there's a chance that
it will join the army of Free Software programs with awful names such
as YELP.

It can just be a part of perldoc - that's one good name.


[perl #43709] [TODO] Groups should only contain items or paths

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43709]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43709 


In lib/Parrot/Docs/Group.pm there is the todo item:

# TODO - Groups should only contain items or paths.

This restriction needs to be implemented.


Re: Project Idea: Perl 6 Syntax Explainer

2007-07-10 Thread Moritz Lenz
Hi Amir,

Amir E. Aharoni wrote:
   * Anything else that should go into the requirements?
 
 It would be even cooler if the command
 
 $ p6explain 'some_user_defined_sub'
 
 would display prettily-formatted pod for that sub and would work
 transparently, regardless of whether this sub is defined in the Perl
 standard library, CPAN module, or user's own code. 

That's what we'll call `perldoc', and would be _very_ helpfull indeed,
but is vastly beyond the scope of my project idea.
But if it's made right (and I plan to do so), that should be easy to
incorporate into perldoc.

If you want to, you may consider it as a perldoc subproject, but for now
completely separated ;)

[imaginary, cool perldoc]

 Integrate that tool with Emacs, and you've got a self-documenting Perl 6 IDE 
 ;)

I'm sure somebody will integrate it (not me, I use vim ;-), and for
other editors as well.

 * Is it possible to implement it satisfactory without building a p6
   compiler?
 
 Syntax highlighters work even with code that doesn't necessarily
 compile, so probably the answer is yes.

Yes, Juerd++ convinced me so far ;)

 But if this tool could peek into the compiler's syntax tree

... it would have to deal with syntactically correct perl programs,
which is not my intention.

   * Do you have a good idea for a project name?
 
 I really wish that such project just DIDN'T have a name, at least not
 at the end-user level. If it will have a name, there's a chance that
 it will join the army of Free Software programs with awful names such
 as YELP.
 
 It can just be a part of perldoc - that's one good name.

for the ultimate goal that's true, but for the intermediate goal that I
described in my first mail a name would still be useful - even if it
disappears in the end.

Cheers,
Moritz

-- 
Moritz Lenz
http://moritz.faui2k3.org/ |  http://perl-6.de/



signature.asc
Description: OpenPGP digital signature


[perl #43713] [TODO] Items should only contain paths

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43713]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43713 


In the file lib/Parrot/Docs/Item.pm there is the todo item:

# TODO - Items should only contain paths

This restriction needs to be implemented.


[perl #43717] [TODO] Questionable regex in lib/Parrot/Op.pm

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43717]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43717 


in the file lib/Parrot/Op.pm there is the todo item (including the line of code)

s/{{([a-z]+)\@([^{]*?)}}/ $trans-access_arg($1, $2, $self); /me;
  # XXX ???

Apart from being an overly-verbose explanation of what the question
is, it looks like the line of code is not understood.  I guess all we
need to do here is work out why the line of code is here and write a
comment explaining it more clearly.


Re: Project Idea: Perl 6 Syntax Explainer

2007-07-10 Thread Moritz Lenz
(Sorry for personal message previously, now my answer to the list)

Juerd Waalboer wrote:
 Moritz Lenz skribis 2007-07-10 12:43 (+0200):
 $ p6explain '[]'
 [...] can be
  * '[$expression]': access to one or more array elements if used as
postcircumfix
Example: @a[2]; # access the third element of an array @a
  * '[$operator]': the 'reduce' hyper operator
Example: [+] (1, 2, 3); # gives 1 + 2 + 3 == 6
 In a regex/rule:
  * '[$subregex]': groups the content of the brackets without
capturing the match result of $subregex
 
 I had the same idea, but in wiki form, with a clickable map of
 characters for the curious.

I think the clickable map can easily be generated from the database, but
I'm not really convinced that a wiki is the right idea. (Most wikis tend
to look horrible, and that's a show stopper for me. Of course that can
be dealt with, but it makes me like wikis less ;)

 The idea is basically: categorize by unicode symbols, and then describe
 how they're used, in any context.
 
   * Multiple frontends: I'd like to have at least a command line and a
 web frontend
 
 A command line tool could just do the equivalent of
 
 w3m -dump wiki.perl6.example.com/symbol/*

right, basically ;)

   * Perhaps support for other programming languages as well
 
 Third system syndrome? :)

Let's implement the first system first, and make it easily extensible.
For example a different dictionary for ever combination of human and
computer language (perl6-en-base, perl6-en-regex, python-nl-base, ...)

   * Anything else that should go into the requirements?
 
 Ultra easy contribution with revision control.

Aye. First place to start with would be the pugs repository (which seems
to be the collection of most perl6 related projects anyway)

   * Is it possible to implement it satisfactory without building a p6
 compiler?
 
 Yes. Just match individual literal symbols. Someone looking for * should
 encounter all uses of *, including ** and **{}. 

that's probably the way to go, yes.

   * Do you have a good idea for a project name?
 
 I had Decrypt in mind. (http://decrypt.perl6.nl/*)

I'd like the name if there weren't a few disadvantages:
 * it is used in many other context and therefore not good googlabel
 * it suggests that Perl 6 is cryptic (which it's not most of the time;)
 * On my system there is already a `decrypt' executable (from the
   `airsnort' package)

I thought about p6explain (or something similar like p6plain (pronounced
pi sixplain)), but both sound witless.

Moritz

-- 
Moritz Lenz
http://moritz.faui2k3.org/ |  http://perl-6.de/





signature.asc
Description: OpenPGP digital signature


[perl #38844] [TODO] Make lint, splint and tags targets

2007-07-10 Thread Paul Cochrane via RT
Just updating this ticket to the current state of play:

 The lint target needs to be renamed to splint.

Actually, this has been changed to sunlint and bsdlint.  The splint 
target has existed for a while (in two forms; now combined as of r19721 
into the one target).

 Then create a new lint target to support Sun Studio.

Done.

 And update the tags target.

Still in need of work.


[perl #43715] [TODO] CPerl::Module should really be LPerl::Module (lib/Parrot/Docs/POD2HTML.pm)

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43715]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43715 


In the file lib/Parrot/Docs/POD2HTML.pm there is the todo item:

# TODO - CPerl::Module should really be LPerl::Module
# but this will do until the docs are changed.

This needs to be implemented.


[perl #43719] [TODO] Complain about using, e.g. $3 in an op with only 2 args

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43719]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43719 


In the file lib/Parrot/OpsFile.pm there is the todo item:

# TODO: Complain about using, e.g. $3 in an op with only 2 args.

This needs to be implemented.


[perl #43721] [TODO] throw errors when attempting to rewrite argument accesses

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43721]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43721 


In the file lib/Parrot/OpsFile.pm there is the todo item:

# FIXME: This ought to throw errors when attempting to rewrite $n
# argument accesses and other things that make no sense in the
# preamble.


Re: Project Idea: Perl 6 Syntax Explainer

2007-07-10 Thread Steffen Schwigon
Moritz Lenz [EMAIL PROTECTED] writes:
 Hi,

 considering the vast number of Operators and the like, I had the
 idea to implement a tool where you can enter a small piece of p6
 syntax, and it explains what that might mean. (like a perldoc -f for
 operators/syntax elements instead of functions)

I really like the idea.


 Now I'd like to hear your opinion:
   * Is it useful at all?

Yes.

   * Is it possible to implement it satisfactory without building a
 p6 compiler?

It should ultimately be independent from building yet another compiler
subproject. Else you don't find enough comrades to follow.

I suggest not starting with an implementation but with the base
description itself in any form. That might be a simple text file in
pugs svn or a wiki page. That's step 1, IMHO.

Do you think it's possible to extract and collect all the operators
and descriptions from the synopses into one common place?

If we had such a collection we would then format it in a second step
into a structured collection and the third step is a frontend to that,
the easiest part, IMHO.

Step 1 is the real challenge, isn't it?


Steffen 
-- 
Steffen Schwigon [EMAIL PROTECTED]
Dresden Perl Mongers http://dresden-pm.org/
Deutscher Perl-Workshop http://www.perl-workshop.de/


[perl #43723] [TODO] check for proper nesting in lib/Parrot/PIR/Formatter.pm

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43723]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43723 


In the file lib/Parrot/PIR/Formatter.pm there is the todo item:

# XXX we should check for proper nesting

This check should be implemented.


Re: Project Idea: Perl 6 Syntax Explainer

2007-07-10 Thread Moritz Lenz
Steffen Schwigon wrote:
 Moritz Lenz [EMAIL PROTECTED] writes:
 considering the vast number of Operators and the like, I had the
 idea to implement a tool where you can enter a small piece of p6
 syntax, and it explains what that might mean. (like a perldoc -f for
 operators/syntax elements instead of functions)
 
 I really like the idea.

Good ;)

   * Is it possible to implement it satisfactory without building a
 p6 compiler?
 
 It should ultimately be independent from building yet another compiler
 subproject. Else you don't find enough comrades to follow.

Aye. I think Juerd's suggestion to make it character based is probably
the best.

 I suggest not starting with an implementation but with the base
 description itself in any form. That might be a simple text file in
 pugs svn or a wiki page. That's step 1, IMHO.
 
 Do you think it's possible to extract and collect all the operators
 and descriptions from the synopses into one common place?

Not automatically, sadly.

 If we had such a collection we would then format it in a second step
 into a structured collection and the third step is a frontend to that,
 the easiest part, IMHO.

Since we'll have to skim though the synopsis and compile that file
manually, it would be a good idea to actually write it in a form of
semantic markup in the first place.

 Step 1 is the real challenge, isn't it?

Yes.

Cheers,
Moritz

-- 
Moritz Lenz
http://moritz.faui2k3.org/ |  http://perl-6.de/



signature.asc
Description: OpenPGP digital signature


[perl #43729] [TODO] Is init() in lib/Parrot/Pmc2c.pm unused?

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43729]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43729 


In the file lib/Parrot/Pmc2c.pm, there is the todo item within the
init() method:

# XXX FIXME unused?
#Creates a hash of all the method names correspdoning vtable section.
#Creates a hash of all the method names correspdoning to their attributes.


[perl #43731] [TODO] BIGNUM maps to what in prototype()?

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43731]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43731 


In the file lib/Parrot/Pmc2c.pm there is the todo item associated with
the calltype hash:

#BIGNUM* = ??? # XXX

other values are mapped so:

char = c,
short= s,

A decision needs to be made as to what this should map to, and then it
needs to be implemented.


[perl #43733] [TODO] scan src/call_list.txt if the generated signature is available

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43733]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43733 


In the file lib/Parrot/Pmc2c.pm there is the todo item:

# TODO
# scan src/call_list.txt if the generated signature is available

This needs to be implemented.


[perl #43737] [TODO] properly implement the quick hack to get MMD variants

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43737]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43737 


In the file lib/Parrot/Pmc2c.pm there is the todo item:

# XXX quick hack - to get MMD variants

The quick hack needs to be implemented properly/more cleanly.


[perl #43727] [TODO] support getting implementations from central superclass

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43727]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43727 


In the file lib/Parrot/Pmc2c.pm there is the todo item:

# FIXME support getting implementations from central superclass instead
# (e.g. some ro_fail pseudoclass that generates an exception)

This needs to be implemented.


[perl #43741] [TODO] generate C line comments in vtable_decl()

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43741]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43741 


In the file lib/Parrot/Pmc2c.pm there is the todo item (within the
vtable_decl() sub):

# TODO gen C line comment

Implement this.


[perl #43739] [TODO] work out what the todo item in find_mmd_methods() is

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43739]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43739 


In the file lib/Parrot/Pmc2c.pm there is the todo item:

$self-{mmds} = @mmds;# XXX?

I've got no idea what the problem is here.  If there is no problem,
then the comment should be removed.  If there is a problem it should
be fixed and possibly an explanatory comment added.


[perl #43735] [TODO] report errors for ?

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43735]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43735 


In the file lib/Parrot/Pmc2c.pm there is the todo item (within the
proto() method):

# TODO report errors for ?

A decision needs to be made as to whether or not to report these
errors, and if so, implement this.


[perl #43745] [TODO] properly implement getting the inheritance ParrotClass isa delegate

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43745]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43745 


In the file lib/Parrot/Pmc2c/Pmc2cMain.pm there is the todo item:


# XXX this is a quick hack to get the inheritance
# ParrotClass isa delegate
#
# delegate has everything autogenerated, so these
# methods aren't seen and not inherited properly
#
# the correct way would be to look at
# $class-implements but when dumping there isn't
# a $class object

This needs to be implemented properly.


[perl #43725] [TODO] is exotic type autogeneration appropriate? (lib/Parrot/Pmc2c.pm)

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43725]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43725 


In the file lib/Parrot/Pmc2c.pm there is the todo item:

# autogenerate for exotic types
# (XXX is this appropriate or do we want them to each
# be explicitly cleared to have the variant?)

A decision needs to be made, and then something implemented if necessary.


[perl #43751] [TODO] extract code into sub generate_pbc()

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43751]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43751 


In the file lib/Parrot/Test.pm there is the todo item:

# XXX put this into sub generate_pbc()

Extract this code and put it into generate_pbc()


Can't edit parrot wiki pages with Opera

2007-07-10 Thread Paul Cochrane

Hi all,

I've found that when using the Opera web browser that I can't edit any
parrot wiki pages.  I click on the Edit button, a hash character (#)
gets appended to the URL, and nothing else happens.  I've only had
success at editing the wiki pages with firefox, but it'd be nice to be
able to use more browsers to edit the pages.

Thanks!

Paul


[perl #43757] [BUG] segfault while compiling tge

2007-07-10 Thread via RT
# New Ticket Created by  Jerry Gay 
# Please include the string:  [perl #43757]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43757 


i made some small local mods while trying to debug a segfault during
'make test' for languages/perl6. the segfault occurs when running
t/01-sanity/07-range.t.

below is my patch. there's two changes in here, one for debugging, the
other for better variable naming. since this patch causes a different
segfault, i haven't separated the content of these two patches, as i'd
like to nail this *new* segfault quickly so i can go back to *the
other one*.

---
Index: src/inter_call.c
===
--- src/inter_call.c(revision 19728)
+++ src/inter_call.c(working copy)
@@ -23,6 +23,7 @@
 #include assert.h
 #include parrot/parrot.h
 #include parrot/oplib/ops.h
+#include parrot/interpreter.h
 #include inter_call.str

 /* HEADERIZER HFILE: include/parrot/inter_call.h */
@@ -325,27 +326,27 @@


 static void
-next_arg_sig(call_state_item *st /*NN*/)
+next_arg_sig(call_state_item *sti /*NN*/)
 {
-switch (st-mode  CALL_S_D_MASK) {
+switch (sti-mode  CALL_S_D_MASK) {
 case CALL_STATE_OP:
-st-sig = SIG_ITEM(st-u.op.signature, st-i);
+sti-sig = SIG_ITEM(sti-u.op.signature, sti-i);
 break;
 case CALL_STATE_SIG:
-switch (st-u.sig.sig[st-i]) {
+switch (sti-u.sig.sig[sti-i]) {
 case 'I':
-st-sig = PARROT_ARG_INTVAL; break;
+sti-sig = PARROT_ARG_INTVAL; break;
 case 'N':
-st-sig = PARROT_ARG_FLOATVAL; break;
+sti-sig = PARROT_ARG_FLOATVAL; break;
 case 'S':
-st-sig = PARROT_ARG_STRING; break;
+sti-sig = PARROT_ARG_STRING; break;
 case 'O':
 case 'P':
-st-sig = PARROT_ARG_PMC; break;
+sti-sig = PARROT_ARG_PMC; break;
 case '@':
-st-sig = PARROT_ARG_PMC | PARROT_ARG_SLURPY_ARRAY; break;
+sti-sig = PARROT_ARG_PMC | PARROT_ARG_SLURPY_ARRAY; break;

 case 'F':
-st-sig = PARROT_ARG_PMC | PARROT_ARG_FLATTEN; break;
+sti-sig = PARROT_ARG_PMC | PARROT_ARG_FLATTEN; break;
 }
 break;
 }
@@ -641,7 +642,8 @@
 {
 PMC *key = UVal_pmc(st-val);

-if (key  key-vtable-base_type == enum_class_Key) {
+/* printf(PMC_IS_NULL(key) = %d\n, PMC_IS_NULL(key)); */
+if (!PMC_IS_NULL(key)  key-vtable  key-vtable-base_type == enum_clas
s_Key) {
 for (; key; key=key_next(interp, key)) {
 /* register keys have to be cloned */
 if (PObj_get_FLAGS(key)  KEY_register_FLAG) {

---

as i mentioned, this causes another segfault--one when generating the
tree grammar for  compilers.

c:\usr\local\parrot\trunk\compilers\past-pm..\..\parrot
..\..\compilers\tge\tgc.pir --output
=POST\Grammar_gen.pir POST\Grammar.tg

here's the backtrace:

---
libparrot.dll!Parrot_NameSpace_get_pointer_keyed(parrot_interp_t *
interp=0x03ae2d80, PMC * pmc=0x03a17708, PMC * key=0x03c7b590)  Line
342 + 0x6 bytes C
libparrot.dll!fail_if_exist(parrot_interp_t * interp=0x03ae2d80, PMC
* name=0x03c7b590)  Line 258 + 0x1a bytes   C
libparrot.dll!Parrot_new_class(parrot_interp_t * interp=0x03ae2d80,
PMC * _class=0x03ccced8, PMC * name=0x03c7b590)  Line 582 + 0xd
bytes   C
libparrot.dll!Parrot_ParrotClass_init_pmc(parrot_interp_t *
interp=0x03ae2d80, PMC * pmc=0x03ccced8, PMC * name=0x03c7b590)  Line
82 + 0x11 bytes C
libparrot.dll!pmc_new_init(parrot_interp_t * interp=0x03ae2d80, long
base_type=47, PMC * init=0x03c7b590)  Line 318 + 0x1a bytes C
   libparrot.dll!Parrot_newclass_p_pc(long * cur_opcode=0x039cf738,
parrot_interp_t * interp=0x03ae2d80)  Line 231 + 0x20 bytes C
libparrot.dll!runops_slow_core(parrot_interp_t * interp=0x03ae2d80,
long * pc=0x039cf738)  Line 184 + 0x18 bytesC
libparrot.dll!runops_int(parrot_interp_t * interp=0x03ae2d80,
unsigned int offset=0)  Line 787 + 0xb bytesC
libparrot.dll!runops(parrot_interp_t * interp=0x03ae2d80, unsigned
int offs=0)  Line 95 + 0xd bytesC
libparrot.dll!runops_args(parrot_interp_t * interp=0x03ae2d80, PMC *
sub=0x03ccd1b8, PMC * obj=0x03a1be98, parrot_string_t *
meth=0x, const char * sig=0x102a06b8, char * ap=0x0017fb8c)
Line 210 + 0xd bytesC
libparrot.dll!Parrot_runops_fromc_args(parrot_interp_t *
interp=0x03ae2d80, PMC * sub=0x03ccd1b8, const char * sig=0x102a06b8,
...)  Line 287 + 0x1d bytes C
libparrot.dll!run_sub(parrot_interp_t * interp=0x03ae2d80, PMC *
sub_pmc=0x03ccd1b8)  Line 375 + 0x12 bytes  C

[perl #43753] [TODO] $language should be the name of the test Module

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43753]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43753 


In the file lib/Parrot/Test.pm there is the todo item:

# TODO: $language should be the name of the test Module
#   that would open the door for Scheme::Test

This needs to be implemented.


[perl #43755] [TODO] example_test_map is broken wrt todo tests

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43755]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43755 


In the file lib/Parrot/Test.pm there is the todo item:

# XXX this is broken WRT todo tests
my %example_test_map = (
example_output_is   = 'language_output_is',
example_output_like = 'language_output_like',
example_output_isnt = 'language_output_isnt',
);

This issue needs to be fixed.


[perl #43749] [TODO] Is the check in prederef() good enough?

2007-07-10 Thread via RT
# New Ticket Created by  Paul Cochrane 
# Please include the string:  [perl #43749]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43749 


In the file lib/Parrot/Pmc2c/StmRef.pm there is the todo item:

if ( $self-does_write($name) ) {# XXX is this good enough?

investigate if this *is* good enough, and if not, implement something better.


[perl #43759] [BUG] realclean leaves files behind

2007-07-10 Thread via RT
# New Ticket Created by  Jerry Gay 
# Please include the string:  [perl #43759]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43759 


below is the results from running the subversion command to list the
status of a working copy with respect to the base revision--while
displaying files that are usually ignored.

i ran this command on a windows machine with msvc 8.0 compiler. if
your platform and compiler are different, you'll likely get somewhat
different results.

after 'make realclean', this list should be empty. it's not. let's fix that.
~jerry


c:\usr\local\parrot\cleansvn st --no-ignore
I  disassemble.exe.manifest
I  test.exe.manifest
I  miniparrot.exe.manifest
I  libparrot.dll.manifest
I  pdb.exe.manifest
I  parrot.exe.manifest
I  pbc_info.exe.manifest
I  pbc_merge.exe.manifest
I  pdump.exe.manifest
I  runtime\parrot\library\PAST
I  runtime\parrot\dynext\libnci_test.dll.manifest
I  src\main.obj
I  src\dynoplibs\dan_ops.dll.manifest
I  src\dynoplibs\dan_ops_switch.dll.manifest
I  src\dynoplibs\myops_ops.dll.manifest
I  src\dynoplibs\myops_ops_switch.dll.manifest
I  src\dynpmc\match_group.dll.manifest
I  src\dynpmc\rotest.dll.manifest
I  src\dynpmc\foo.dll.manifest
I  src\dynpmc\dynlexpad.dll.manifest
I  src\dynpmc\subproxy.dll.manifest
I  ext\Parrot-Embed\Makefile.PL
I  lib\DumbLink.pm
I  compilers\imcc\imcc.l.flag
I  compilers\pge\PGE\pmc\pge.dll.manifest
I  t\src\intlist_1.obj
I  t\src\intlist_2.obj
I  t\src\intlist_3.obj
I  t\src\intlist_4.obj
I  t\src\intlist_1.exe.manifest
I  t\src\intlist_2.exe.manifest
I  t\src\intlist_3.exe.manifest
I  t\src\intlist_4.exe.manifest
I  t\src\intlist_1.pdb
I  t\src\intlist_2.pdb
I  t\src\intlist_3.pdb
I  t\src\intlist_4.pdb
I  t\tools\pmc2c.pmc_t_5.h
I  t\tools\pmc2c.pmc_t_6.h
I  t\tools\pmc2c.pmc_t_7.h
I  t\tools\pmc2c.pmc_t_8.h
I  t\tools\pmc2c.pmc_t_9.h
I  t\tools\pmc2c.t_2.dump
I  t\tools\pmc2c.t_4.dump
I  t\tools\pmc2c.t_6.dump
I  t\tools\pmc2c.t_8.dump
I  t\tools\pmc2c.t_1.pmc
I  t\tools\pmc2c.t_2.pmc
I  t\tools\pmc2c.t_3.pmc
I  t\tools\pmc2c.t_1.c
I  t\tools\pmc2c.t_4.pmc
I  t\tools\pmc2c.t_2.c
I  t\tools\pmc2c.t_5.pmc
I  t\tools\pmc2c.t_3.c
I  t\tools\pmc2c.t_6.pmc
I  t\tools\pmc2c.t_4.c
I  t\tools\pmc2c.t_7.pmc
I  t\tools\pmc2c.t_11.dump
I  t\tools\pmc2c.t_5.c
I  t\tools\pmc2c.t_8.pmc
I  t\tools\pmc2c.t_6.c
I  t\tools\pmc2c.t_9.pmc
I  t\tools\pmc2c.t_7.c
I  t\tools\pmc2c.t_8.c
I  t\tools\pmc2c.t_9.c
I  t\tools\pmc2c.t_10.pmc
I  t\tools\pmc2c.t_11.pmc
I  t\tools\pmc2c.t_10.c
I  t\tools\pmc2c.t_11.c
I  t\tools\pmc2c.t_1.dump
I  t\tools\pmc2c.pmc_t_10.h
I  t\tools\pmc2c.t_3.dump
I  t\tools\pmc2c.pmc_t_11.h
I  t\tools\pmc2c.t_5.dump
I  t\tools\pmc2c.t_7.dump
I  t\tools\pmc2c.t_9.dump
I  t\tools\pmc2c.t_10.dump
I  t\tools\pmc2c.pmc_t_1.h
I  t\tools\pmc2c.pmc_t_2.h
I  t\tools\pmc2c.pmc_t_3.h
I  t\tools\pmc2c.pmc_t_4.h
I  languages\perl5\Makefile
I  languages\perl6\src\pmc\perl6_group.exp
I  languages\perl6\src\pmc\perl6_group.ilk
I  languages\perl6\src\pmc\perl6_group.dll.manifest
I  languages\perl6\src\pmc\vc80.pdb
I  languages\perl6\src\pmc\perl6_group.pdb
I  languages\perl6\src\pmc\perl6_group.lib
I  languages\PIR\Makefile
I  languages\pynie\Makefile


[perl #43761] [PATCH]: Add lib/Perl/Critic to the no_index key in META.yml

2007-07-10 Thread brian d foy
# New Ticket Created by  brian d foy 
# Please include the string:  [perl #43761]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43761 


Some of the Perl::Critic modules are still in the Parrot distro, but
they don't belong (in the PAUSE sense) to Parrot. This patch tells the
PAUSE indexer not to look at them.

If you can get this patch in before today's release, then the next
distro shouldn't be Unauthorized.

-- 
brian d foy [EMAIL PROTECTED]
http://www.pair.com/~comdog/
Index: META.yml
===
--- META.yml(revision 19611)
+++ META.yml(working copy)
@@ -12,6 +12,7 @@
 - lib/Digest
 - lib/File
 - lib/Parse
+- lib/Perl/Critic
 - lib/Pod
 - lib/Test
 - lib/Text

Re: Project Idea: Perl 6 Syntax Explainer

2007-07-10 Thread Dave Whipp

Steffen Schwigon wrote:

Do you think it's possible to extract and collect all the operators
and descriptions from the synopses into one common place?


The problem with that is that it wouldn't scale to user-defined 
operators/macros. I think the way to approach it would be to define a 
POD6 dialect what provides the necessary markup. The standard grammar 
would contain this, as would things like prelude. But anyone would be 
able to add it to any code they distribute so as to provide more 
comprehensive debug info.


Re: [perl #43761] [PATCH]: Add lib/Perl/Critic to the no_index key in META.yml

2007-07-10 Thread chromatic
On Tuesday 10 July 2007 09:43:28 brian d foy wrote:

 Some of the Perl::Critic modules are still in the Parrot distro, but
 they don't belong (in the PAUSE sense) to Parrot. This patch tells the
 PAUSE indexer not to look at them.

 If you can get this patch in before today's release, then the next
 distro shouldn't be Unauthorized.

Thanks, applied as r19770.

-- c


[svn:parrot-pdd] r19772 - trunk/docs/pdds/draft

2007-07-10 Thread allison
Author: allison
Date: Tue Jul 10 13:27:44 2007
New Revision: 19772

Modified:
   trunk/docs/pdds/draft/pdd17_pmc.pod

Log:
[pdd] Archiving conversation about new way of instantiating builtin PMCs after
numeric type system goes away.


Modified: trunk/docs/pdds/draft/pdd17_pmc.pod
==
--- trunk/docs/pdds/draft/pdd17_pmc.pod (original)
+++ trunk/docs/pdds/draft/pdd17_pmc.pod Tue Jul 10 13:27:44 2007
@@ -58,6 +58,41 @@
 the limitation. This runs back to Leo's proposal to make PMCs a little more
 flexible, so we wouldn't have to hold all PMCs to the same 8 bits
 
+=item *
+
+pmichaud there is a question about when 'Integer' is not really .Integer
+e.g., in a HLL, the meaning of 'Integer' can be different, and using Cnew
+'Integer' is safe only if in the root of the parrot HLL namespace
+
+allison true, the only way to guarantee that you're getting a built-in PMC
+under the type id-less system is to look in the 'parrot' HLL, and even that
+isn't a total guarantee, because it could have been replaced in the 'parrot'
+HLL
+
+pmichaud the closest we have at the moment is
+
+  $P0 = get_root_namespace ['parrot'; 'Integer']
+  $P1 = new $P0
+
+but even this assumes that the 'Integer' namespace is tied to the Integer
+class, which also hasn't been specced
+
+allison builtin PMCs will be tied to a corresponding spot in the 'parrot' HLL
+namespace
+
+pmichaud according to pdd15: C$P0 = new .Integer can be replaced by C$P0 =
+new 'Integer' only in the parrot root namespace. in all other
+namespaces, one would need to get the namespace for the 'Integer' class and use
+that
+
+  $P0 = new 'Integer' # works in parrot HLL, root namespace
+  $P0 = new ['Integer'] # works in parrot HLL, any namespace
+
+pmichaud even easier, HLLs can set their notion of 'Integer' to point to the
+parrot class :-)
+
+allison yes, aliasing across namespaces is allowed
+
 =back
 
 =head1 DESCRIPTION


[svn:parrot-pdd] r19773 - trunk/docs/pdds/draft

2007-07-10 Thread allison
Author: allison
Date: Tue Jul 10 13:36:22 2007
New Revision: 19773

Modified:
   trunk/docs/pdds/draft/pdd17_pmc.pod

Log:
[pdd] Saving discussion about dynamically extending PMCs from PIR.


Modified: trunk/docs/pdds/draft/pdd17_pmc.pod
==
--- trunk/docs/pdds/draft/pdd17_pmc.pod (original)
+++ trunk/docs/pdds/draft/pdd17_pmc.pod Tue Jul 10 13:36:22 2007
@@ -93,6 +93,18 @@
 
 allison yes, aliasing across namespaces is allowed
 
+=item *
+
+particle we can design a decoration for core pmcs with something that doesn't
+allow override in 'parrot' namespace, if it's wanted.
+
+pmichaud particle: I'm not sure it's entirely necessary to have the
+decoration i.e., I'd wait until we find we need it :-)
+
+particle sure, it's mostly a change for pmc2c i suspect
+
+  pmclass Foo does bar extends baz is_core {
+
 =back
 
 =head1 DESCRIPTION


Re: Project Idea: Perl 6 Syntax Explainer

2007-07-10 Thread Moritz Lenz
Dave Whipp wrote:
 Steffen Schwigon wrote:
 Do you think it's possible to extract and collect all the operators
 and descriptions from the synopses into one common place?
 
 The problem with that is that it wouldn't scale to user-defined 
 operators/macros. 

You're probably right about that, but somebody who writes his own macros
and operators probably doesn't need such a tool anyway. And should write
very good documentation, otherwise he has lost outright.

 I think the way to approach it would be to define a 
 POD6 dialect what provides the necessary markup. The standard grammar 
 would contain this, as would things like prelude. But anyone would be 
 able to add it to any code they distribute so as to provide more 
 comprehensive debug info.

Of course that would be the best solution, but I don't see how I can
implement that soonish. Do you have good idea how to do it?

Moritz

-- 
Moritz Lenz
http://moritz.faui2k3.org/ |  http://perl-6.de/



signature.asc
Description: OpenPGP digital signature


Re: Can't edit parrot wiki pages with Opera

2007-07-10 Thread Paul Cochrane

I've found that when using the Opera web browser that I can't edit any
parrot wiki pages.  I click on the Edit button, a hash character (#)
gets appended to the URL, and nothing else happens.  I've only had
success at editing the wiki pages with firefox, but it'd be nice to be
able to use more browsers to edit the pages.


Nor does it work in konqueror.  I get the same effect when clicking on
the Edit button.


Re: Can't edit parrot wiki pages with Opera

2007-07-10 Thread Jesse Vincent


On Jul 10, 2007, at 4:44 PM, Paul Cochrane wrote:

I've found that when using the Opera web browser that I can't edit  
any
parrot wiki pages.  I click on the Edit button, a hash character  
(#)

gets appended to the URL, and nothing else happens.  I've only had
success at editing the wiki pages with firefox, but it'd be nice  
to be

able to use more browsers to edit the pages.


Nor does it work in konqueror.  I get the same effect when clicking on
the Edit button.


That sure sounds like no javascript enabled


PGP.sig
Description: This is a digitally signed message part


Re: Can't edit parrot wiki pages with Opera

2007-07-10 Thread Paul Cochrane

On 11/07/07, Jesse Vincent [EMAIL PROTECTED] wrote:


On Jul 10, 2007, at 4:44 PM, Paul Cochrane wrote:

 I've found that when using the Opera web browser that I can't edit
 any
 parrot wiki pages.  I click on the Edit button, a hash character
 (#)
 gets appended to the URL, and nothing else happens.  I've only had
 success at editing the wiki pages with firefox, but it'd be nice
 to be
 able to use more browsers to edit the pages.

 Nor does it work in konqueror.  I get the same effect when clicking on
 the Edit button.

That sure sounds like no javascript enabled


Unfortunately that's not the case with both browsers.  Java and
Javascript are both enabled.


Re: Project Idea: Perl 6 Syntax Explainer

2007-07-10 Thread Dave Whipp

Moritz Lenz wrote:

You're probably right about that, but somebody who writes his own macros
and operators probably doesn't need such a tool anyway. And should write
very good documentation, otherwise he has lost outright.


(I was thinking that your tool would provide a mechanism for them to 
provide that very good documentation)


I think the way to approach it would be to define a 
POD6 dialect what provides the necessary markup. The standard grammar 
would contain this, as would things like prelude. But anyone would be 
able to add it to any code they distribute so as to provide more 
comprehensive debug info.


Of course that would be the best solution, but I don't see how I can
implement that soonish. Do you have good idea how to do it?


One approach would simply be to edit Perl-6.0.0-STD.pm and add some 
markup. To pick a token at random:


=p6explain *
An asterix in a version expression matches any version
=end
token whatever { '*' {*} }


This would have the advantage of better documenting the meaning of all 
the tokens/rules in the grammar file, which isn't always immediately 
obvious from reading it.


Damian's POD Parser can probably do much of the work of actually finding 
the p6explain blocks. Establishing a formal link between these and the 
token/rule might be more work; but probably isn't necessary, except for 
linting purposes.



Dave.


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

2007-07-10 Thread larry
Author: larry
Date: Tue Jul 10 17:39:45 2007
New Revision: 14428

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

Log:
The ** form is now syntactically independent of the following token.
This allows us to distinguish literal counts and ranges from indirect ones
specified via closure.  It also allows a notational simplification for
infix repetition suggested by Morrie Siegel++.  (As a consequence, the ?
character to specify minimal matching now attaches to the ** directly.)


Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podTue Jul 10 17:39:45 2007
@@ -14,9 +14,9 @@
Maintainer: Patrick Michaud [EMAIL PROTECTED] and
Larry Wall [EMAIL PROTECTED]
Date: 24 Jun 2002
-   Last Modified: 9 Jul 2007
+   Last Modified: 10 Jul 2007
Number: 5
-   Version: 60
+   Version: 61
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them Iregex rather than regular
@@ -676,28 +676,60 @@
 
 =item *
 
-The repetition specifier is now C**{...} for maximal matching,
-with a corresponding C**{...}? for minimal matching.  Space is
-allowed on either side of the asterisks.  The curlies are taken to
-be a closure returning an Int or a Range object.
+The general repetition specifier is now C** for maximal matching,
+with a corresponding C**? for minimal matching.  Space is
+allowed on either side.  The next token will determine what kind of
+repetition is desired:
 
- / value was (\d ** {1..6}?) with ([\w]**{$m..$n}) /
+If the next thing is an integer, then it is parsed as either as an exact
+count or a range:
+
+. ** 42  # match exactly 42 times
+item ** 3..*   # match 3 or more times
+
+This form is considered declarational.
+
+If you supply a closure, it should return either an CInt or a CRange 
object.
+
+'x' ** {$m}  # exact count returned from closure
+foo ** {$m..$n}# range returned from closure
+
+/ value was (\d **? {1..6}) with ([ alpha\w* ]**{$m..$n}) /
 
 It is illegal to return a list, so this easy mistake fails:
 
- / [foo]**{1,3} /
+/ [foo] ** {1,3} /
+
+The closure form is always considered procedural, so the item it is
+modifying is never considered part of the longest token.
+
+If you supply any other atom (which may not be quantified), it is
+interpreted as a separator (such as an infix operator), and the
+initial item is quantified by the number of times the separator is
+seen between items:
+
+alt ** '|'# repetition controlled by presence of separator
+addend ** addop # repetition controlled by presence of separator
+item ** [ \!?'==' ]   # repetition controlled by presence of separator
+
+A successful match of such a quantifier always ends in the middle,
+that is, after the initial item but before the next separator.
+(The separator never matches independently of the next item; if the
+separator matches but the next item fails, it backtracks all the way
+back through the separator.)  Therefore
+
+/ ident ** ',' /
+
+can match
+
+foo
+foo,bar
+foo,bar,baz
 
-(At least, it fails in the absence of Cuse rx :listquantifier,
-which is likely to be unimplemented in PerlĀ 6.0.0 anyway.)
+but never
 
-The optimizer will likely optimize away things like C**{1..*}
-so that the closure is never actually run in that case.  But it's
-a closure that must be run in the general case, so you can use
-it to generate a range on the fly based on the earlier matching.
-(Of course, bear in mind the closure must be run Ibefore attempting to
-match whatever it quantifies.)  A closure that must be run is considered
-procedural, but a closure that recognizably returns the same thing every
-time is considered declarative.
+foo,
+foo,bar,
 
 =item *
 


Re: Project Idea: Perl 6 Syntax Explainer

2007-07-10 Thread Larry Wall
On Tue, Jul 10, 2007 at 04:37:13PM -0700, Dave Whipp wrote:
: One approach would simply be to edit Perl-6.0.0-STD.pm and add some 
: markup. To pick a token at random:
: 
: =p6explain *
: An asterix in a version expression matches any version
: =end
: token whatever { '*' {*} }

Indeed, the example you picked indicates how important context
will be.  There are many different uses of '*', and a p6explain that
simply lists all the possible meanings will be very nearly useless.
You really need to parse the surrounding text to have any idea what
the * means.  And a big reason to make the grammar available (including
all the user-defined bits) is so that nobody ever has to reinvent PPI
for Perl 6.  A p6 explainer that is sensitive to grammar mutations
really needs to do its work by annotating an entire compilation unit
and then making that information available to something resembling
an IDE.  I realize that's a long term goal.  A short term explainer
for standard p6 should at least expect to be fed a complete parsable
expression starting with a noun phrase, since starting with an infix
when the parser is expecting a term will just be completely befuddling
to the user.  Similar considerations end up driving you to parse larger
and larger pieces till you parse the whole file.  (In theory that should
always be enough context, assuming everything you use is available on
your machine, because Perl 6 outlaws magical action at a distance,
particularly across file boundaries.)

Larry


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

2007-07-10 Thread larry
Author: larry
Date: Tue Jul 10 18:20:25 2007
New Revision: 14429

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

Log:
Clarify that all quantifier modifiers now attach directly to the **


Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podTue Jul 10 18:20:25 2007
@@ -677,9 +677,10 @@
 =item *
 
 The general repetition specifier is now C** for maximal matching,
-with a corresponding C**? for minimal matching.  Space is
-allowed on either side.  The next token will determine what kind of
-repetition is desired:
+with a corresponding C**? for minimal matching.  (All such quantifier
+modifiers now go directly after the C**.)  Space is allowed on either
+side of the complete quantifier.  The next token will determine what
+kind of repetition is desired:
 
 If the next thing is an integer, then it is parsed as either as an exact
 count or a range:


[perl #43431] build problem

2007-07-10 Thread Will Coleda via RT
On Fri Jun 29 01:52:18 2007, richard !-- x -- at rusrating.ru wrote:
 Dear Parrot people,
 
 Just updates my subversion depository after a long time.
 
 Got this error after 'make'
SNIP

Richard - it is often necessary after a long break between updates to run 'make 
realclean' before 
doing a configure/make cycle.

Can you try this and report back? Thanks.




PMC_data() harmful?

2007-07-10 Thread Will Coleda
Discussion on IRC today about how we can improve the state of the GC  
system. One of the things that came up was that perhaps we shouldn't  
be poking inside PMC guts outside of src/*pmc/: instead, we should be  
using vtable access.


I currently see ~500 instances where we use PMC_data() outside pmc  
code (after a build, so probably some generated code in there.)


I think if we had an example of how these should be fixed, that'd  
help others contribute, so, lets pick one and dissect it.


Here's a function from src/key.c :

/*

FUNCDOC: key_next
Returns the next key if Ckey is in a sequence of linked keys.

*/

PARROT_API
PMC *
key_next(SHIM_INTERP, PMC *key /*NN*/)
{
return key-pmc_ext ? (PMC *)PMC_data(key) : NULL;
}

Is this in need of fixing? If so, how? If not, is there a better  
function to show off what needs fixing?



--
Will Coke Coleda
[EMAIL PROTECTED]




[perl #43775] Testing new ticket

2007-07-10 Thread via RT
# New Ticket Created by  Will Coleda 
# Please include the string:  [perl #43775]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43775 


This transaction appears to have no content


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

2007-07-10 Thread larry
Author: larry
Date: Tue Jul 10 18:45:08 2007
New Revision: 14430

Modified:
   doc/trunk/design/syn/S09.pod

Log:
Some thinking about how .keys and .shape work on user-defined dimensions


Modified: doc/trunk/design/syn/S09.pod
==
--- doc/trunk/design/syn/S09.pod(original)
+++ doc/trunk/design/syn/S09.podTue Jul 10 18:45:08 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 13 Sep 2004
-  Last Modified: 2 Jun 2007
+  Last Modified: 10 Jul 2007
   Number: 9
-  Version: 21
+  Version: 22
 
 =head1 Overview
 
@@ -548,6 +548,21 @@
 @arr{1,3,5}:p[]   # 0='one', 1='two', 2='three'
 @arr{1,3,5}:p{}   # 1='one', 3='two', 5='three' 
 
+The C.keys method also returns the keys of all existing elements.
+For a multidimensional array each key is a list containing one value for
+each dimension.
+
+The C.shape method also works on such an array; it returns a
+slice of the valid keys for each dimension.  The component list
+representing an infinite dimension is necessarily represented lazily.
+(Note that the C.shape method returns the possible keys, but the
+cartesian product of the key slice dimensions is not guaranteed to
+index existing elements in every case.  That is, this is not intended
+to reflect current combinations of keys in use (use C:k for that).
+Note that you have to distingish these two forms:
+
+@array[].shape  # the integer indices
+@array{}.shape  # the user-defined indices
 
 =head1 Inclusive subscripts
 


[perl #39932] [TODO] enable bulk operations in rt

2007-07-10 Thread Will Coleda via RT
It is now possible to open tickets from the command line if you're a bugadmin. 
First, get an RT 
CLI account; see the wiki for details. Then:

rt create -e -t ticket set subject='Testing new ticket' [EMAIL PROTECTED] 
Queue=parrot

Will pop you into an editor. Add your text message at the end (any continuation 
lines must 
begin with whitespace.)

Once you're done editing, save  quit, the ticket will be generated, and you'll 
get your ticket 
number, which you can then pass to other rt invocations.

Regards.


[perl #43779] Testing new ticket

2007-07-10 Thread via RT
# New Ticket Created by  Will Coleda 
# Please include the string:  [perl #43779]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43779 


Here's another test ticket. Line needs to have some leading whitespace?

And one more?