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

2006-06-30 Thread larry
Author: larry
Date: Fri Jun 30 12:07:05 2006
New Revision: 9726

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S03.pod
   doc/trunk/design/syn/S04.pod
   doc/trunk/design/syn/S05.pod
   doc/trunk/design/syn/S06.pod

Log:
Forgot to update versions and dates...


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podFri Jun 30 12:07:05 2006
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 10 Aug 2004
-  Last Modified: 16 Jun 2006
+  Last Modified: 30 Jun 2006
   Number: 2
-  Version: 45
+  Version: 46
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain

Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podFri Jun 30 12:07:05 2006
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 8 Mar 2004
-  Last Modified: 20 Jun 2006
+  Last Modified: 30 Jun 2006
   Number: 3
-  Version: 42
+  Version: 43
 
 =head1 Changes to existing operators
 

Modified: doc/trunk/design/syn/S04.pod
==
--- doc/trunk/design/syn/S04.pod(original)
+++ doc/trunk/design/syn/S04.podFri Jun 30 12:07:05 2006
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 19 Aug 2004
-  Last Modified: 20 June 2006
+  Last Modified: 30 June 2006
   Number: 4
-  Version: 24
+  Version: 25
 
 This document summarizes Apocalypse 4, which covers the block and
 statement syntax of Perl.

Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podFri Jun 30 12:07:05 2006
@@ -14,9 +14,9 @@
Maintainer: Patrick Michaud [EMAIL PROTECTED] and
Larry Wall [EMAIL PROTECTED]
Date: 24 Jun 2002
-   Last Modified: 3 June 2006
+   Last Modified: 30 June 2006
Number: 5
-   Version: 25
+   Version: 26
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them Iregex because they haven't been

Modified: doc/trunk/design/syn/S06.pod
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podFri Jun 30 12:07:05 2006
@@ -13,9 +13,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 21 Mar 2003
-  Last Modified: 26 May 2006
+  Last Modified: 30 June 2006
   Number: 6
-  Version: 37
+  Version: 38
 
 
 This document summarizes Apocalypse 6, which covers subroutines and the


[svn:parrot-pdd] r13070 - trunk/docs/pdds/clip

2006-06-30 Thread chip
Author: chip
Date: Fri Jun 30 13:10:33 2006
New Revision: 13070

Modified:
   trunk/docs/pdds/clip/pdd23_exceptions.pod

Log:
Overhaul.
Take _that_, Coke!

Modified: trunk/docs/pdds/clip/pdd23_exceptions.pod
==
--- trunk/docs/pdds/clip/pdd23_exceptions.pod   (original)
+++ trunk/docs/pdds/clip/pdd23_exceptions.pod   Fri Jun 30 13:10:33 2006
@@ -1,6 +1,9 @@
 # Copyright (C) 2001-2006, The Perl Foundation.
 # $Id$
 
+{{ NOTE: rethrow, and pushaction are removed, and die is different }}
+{{ TODO: enable backtrace }}
+
 =head1 NAME
 
 docs/pdds/pdd23_exceptions.pod - Parrot Exceptions
@@ -16,143 +19,311 @@
 
 =head1 DESCRIPTION
 
-An exception system gives user-developed code control over how run-time error
-conditions are handled.  Exceptions are errors or unusual conditions that
-require special processing.  An exception handler performs the necessary steps
-to appropriately respond to a particular kind of exception.
-
-Parrot is designed to support dynamic languages, but Parrot compromises the
-principle of dynamic behavior when necessary. For example, Parrot requires any
-given subroutine to be fully compiled before it can be called.
-
-Since the structure and content of a compiled subroutine are fixed at compile
-time, it would be wasteful use the dynamic execution of opcodes at runtime to
-keep track of meta-information about that structure -- Iincluding the spans
-of opcodes that the programmer expects to throw exceptions, and how the
-programmer wants to handle them.
+IExceptions are indications by running code that something unusual -- an
+exception to the normal processing -- has occurred.  When code detects an
+exceptional condition, it Ithrows an exception object.  Before this occurs,
+code can register exception Ihandlers, which are functions (or closures)
+which may (but are not obligated to) Ihandle the exception.  Some exceptions
+permit continued execution immediately after the Ithrow; some don't.
+
+Exceptions transfer control to a piece of code outside the normal flow of
+control.  They are mainly used for error reporting or cleanup tasks.
+
+(A digression on terminology: In a system analysis sense, the word exception
+usually refers to the exceptional event that requires out-of-band handling.
+However, in Parrot, exception also refers to the object that holds all the
+information describing hte exceptional condition: the nature of the exception,
+the error message describing it, and other ancillary information.  The
+specific type (class) of an exception object indicates its category.)
 
-=head2 Exception PIR Directives
+=head2 Exception Opcodes
 
-These are the PIR directives relevant to exceptions and exception handlers:
+These are the opcodes relevant to exceptions and exception handlers:
 
-=over
+=item B push_eh ILABEL   {{FIXME - Not Available Yet}}
+
+=item B push_eh ICONTINUATION 
+
+The Cpush_eh opcode pushes a continuation onto the exception handler stack.
+
+If a ILABEL is provided, Parrot automatically performs the equivalent of a
+Cnewcontinuation operation on the given label, and pushes the resulting
+continuation.
+
+{{FIXME - there is no newcontinuation opcode ... yet!  In the meantime, you
+have to create the continuations the old-fashioned way.}}
+
+When an exception is thrown, Parrot walks up the stack of active exception
+handlers, invoking each one in turn.  (See Crethrow and Ccaught.)
+
+=item B pop_eh 
+
+The Cpop_eh opcode removes the most recently pushed exception handler from
+the control stack.
+
+=item B throw IEXCEPTION 
+
+Throw an exception consisting of the given IEXCEPTION PMC.  Active exception
+handlers (if any) will be invoked with IEXCEPTION as the only parameter.
+
+Throwing an exception with Cthrow is a one-way trip (unless you have made
+other arrangements) because Parrot does not take a continuation after this
+opcode.  (But see Bthrowcc below.)
+
+Any type of PMC can be thrown as an exception.  However, if there's any chance
+of cross-language calls -- and in a Parrot environment, cross-language
+operations are kind of the point -- then you should be prepared to catch
+object of classes you would never have thrown yourself.
 
-=item B.begin_eh ILABEL
+That said, it is IVERY STRONGLY RECOMMENDED that any thrown PMC that can
+possibly escape your private sandbox should meet the minimal interface
+requirements of the Cparrot;exception class, described below.
 
-A C.begin_eh directive marks the beginning of a span of opcodes which the
-programmer expects to throw an exception.  If an exception occurs in the
-execution of the given opcode span, Parrot will transfer control to ILABEL.
+=item B throwcc IEXCEPTION 
 
-[XXX - Is a label a good approach?  Treating exception handlers as label jumps
-rather than full subroutines may be error-prone, but having the lexical stack
-conveniently at hand is worth a lot.]
+Throw an exception consisting of the given IEXCEPTION PMC after taking 

[svn:parrot-pdd] r13071 - in trunk/docs/pdds: . clip

2006-06-30 Thread chip
Author: chip
Date: Fri Jun 30 13:12:26 2006
New Revision: 13071

Added:
   trunk/docs/pdds/pdd23_exceptions.pod
  - copied unchanged from r13070, /trunk/docs/pdds/clip/pdd23_exceptions.pod
Removed:
   trunk/docs/pdds/clip/pdd23_exceptions.pod

Log:
Rename pdd23 into docs/pdds.


pdd23

2006-06-30 Thread Chip Salzenberg
I've got a complete (if not battle-tested) version of the exceptions
pdd is now committed and renamed into docs/pdd.  Share  Enjoy!
-- 
Chip Salzenberg [EMAIL PROTECTED]


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

2006-06-30 Thread larry
Author: larry
Date: Fri Jun 30 15:17:55 2006
New Revision: 9727

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

Log:
Revised quote declarator.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podFri Jun 30 15:17:55 2006
@@ -14,7 +14,7 @@
   Date: 10 Aug 2004
   Last Modified: 30 Jun 2006
   Number: 2
-  Version: 46
+  Version: 47
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -1344,21 +1344,50 @@
 :f  :function   Interpolate  calls
 :c  :closureInterpolate {...} expressions
 :b  :backslash  Interpolate \n, \t, etc. (implies :q at least)
+:code   Quasiquoting
 
-[Conjectural: Ordinarily the colon is required on adverbs, but the
-quote declarator allows you to combine any of the existing adverbial
-forms above without an intervening colon:
-
-quote qw;   # declare a P5-esque qw//
-quote qqx;  # equivalent to P5's qx//
-quote qn;   # completely raw quote qn//
-quote qnc;  # interpolate only closures
-quote qqxwto;   # qq:x:w:to//
+Ordinarily the colon is required on adverbs, but the Cquote declarator
+allows you to combine any of the existing adverbial forms above
+without an intervening colon:
 
-]
+quote qw;   # declare a P5-esque qw// meaning q:w
+quote qn;   # completely raw quote qn//
+quote qnc;  # q:n:c//, interpolate only closures
+
+If you want to abbreviate further, you may also give an explicit
+definition as either a string or quasiquote:
+
+quote qx = 'qq:x';  # equivalent to P5's qx//
+quote qTO = 'qq:x:w:to';# qq:x:w:to//
+quote circumfix:❰ ❱ = q:code { .quoteharder };  # or some such...
+
+In particular, these forms disable the lookahead for an adverbial argument,
+so while
+
+q:n($foo)
+
+will misinterpret C$foo as the C:n argument,
+
+qn(stuff)
+
+has the advantage of misinterpreting it as the argument to the Cqn()
+function instead.  C:)
+
+But parens are special that way.  Other bracketing characters are special
+only if they can be mistaken for adverbial arguments, so
+
+qn[stuff]
+
+is fine, while
+
+q:n[stuff]
+
+is not.  Basically, just don't use parens for quote delimiters, and always
+put a space after your adverbs.
 
 If this is all too much of a hardship, you can define your own quote
-adverbs and operators.  All the uppercase adverbs are reserved for
+adverbs and operators as standard macros.
+All the uppercase adverbs are reserved for
 user-defined quotes.  All of Unicode above Latin-1 is reserved for
 user-defined quotes.
 


Fwd: CPAN Upload: P/PE/PETDANCE/Test-Harness-2.63_01.tar.gz

2006-06-30 Thread Andy Lester
This version of Test::Harness has the straps return a newly-created  
Test::Harness::Results object.


Next release: Overloadable strap classes.

xoxo,
Andy



Begin forwarded message:


From: PAUSE [EMAIL PROTECTED]
Date: June 30, 2006 5:07:02 PM CDT
To: Andy Lester [EMAIL PROTECTED]
Subject: CPAN Upload: P/PE/PETDANCE/Test-Harness-2.63_01.tar.gz
Reply-To: cpan-testers@perl.org

The uploaded file

Test-Harness-2.63_01.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/P/PE/PETDANCE/Test-Harness-2.63_01.tar.gz
  size: 70240 bytes
   md5: 04a3a16d6b1d870fee7999dbac55e7d9

No action is required on your part
Request entered by: PETDANCE (Andy Lester)
Request entered on: Fri, 30 Jun 2006 22:06:47 GMT
Request completed:  Fri, 30 Jun 2006 22:07:02 GMT

Thanks,
--
paused, v782



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






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

2006-06-30 Thread larry
Author: larry
Date: Fri Jun 30 15:31:34 2006
New Revision: 9728

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

Log:
( and ) no longer need to balance.
 and  are now directional word boundaries, along with « and ».
?wb is generic replacement for \b, !wb for \B
Clarified case semantics of array subrules.


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podFri Jun 30 15:31:34 2006
@@ -949,6 +949,8 @@
 submethod foo
 multi foo
 proto foo
+macro foo
+quote qX
 regex foo
 rule foo
 token foo

Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podFri Jun 30 15:31:34 2006
@@ -16,7 +16,7 @@
Date: 24 Jun 2002
Last Modified: 30 June 2006
Number: 5
-   Version: 26
+   Version: 27
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them Iregex because they haven't been
@@ -557,7 +557,8 @@
 As with a scalar variable, each element is matched as a literal
 unless it happens to be a CRegex object, in which case it is matched
 as a subrule.  As with scalar subrules, a tainted subrule always fails.
-All values pay attention to the current C:ignorecase setting.
+All string values pay attention to the current C:ignorecase setting,
+while CRegex values use their own C:ignorecase settings.
 
 =item *
 
@@ -611,11 +612,15 @@
 
 =head1 Extensible metasyntax (C ... )
 
-=over
+Both C   and C   are metacharacters, and are usually (but not
+always) used in matched pairs.  (Some combinations of metacharacters
+function as standalone tokens, and these may include angles.  These are
+describe below.)
 
-=item *
+For matched pairs, the first character after C   determines the
+behavior of the assertion:
 
-The first character after C   determines the behavior of the assertion.
+=over
 
 =item *
 
@@ -799,27 +804,6 @@
 
 =item *
 
-A leading C( indicates the start of a result capture:
-
-/ foo ( \d+ ) bar /
-
-is equivalent to:
-
-/ after foo \d+ before bar /
-
-except that the scan for Cfoo can be done in the forward direction,
-while a lookbehind assertion would presumably scan for C\d+ and then
-match Cfoo backwards.  The use of C (...)  affects only the
-meaning of the Iresult object and the positions of the beginning and
-ending of the match.  That is, after the match above, C$() contains
-only the digits matched, and C.pos is pointing to after the digits.
-Other captures (named or numbered) are unaffected and may be accessed
-through C$/.
-
-It is a syntax error to use an unbalanced C (  or C ) .
-
-=item *
-
 A leading C[ or C+ indicates an enumerated character class.  Ranges
 in enumerated character classes are indicated with C...
 
@@ -858,6 +842,24 @@
 
 =item *
 
+In general, any general quoting form such as Cq or Cqq will be
+recognized as if it had curlies around it.  This includes quotes
+declared with the Cquote declarator:
+
+quote qX = q:x:c;
+/qX[cat -n {$foo}]/
+
+same as
+
+/{ qX[cat -n {$foo}] }/
+
+This hides any qX rule that might be defined in the gramma.  Note that
+this means that the language parser has to pass the current list
+of quote forms into the regex parser since it needs to be known at
+compile time.
+
+=item *
+
 The special assertion C .  matches any logical grapheme
 (including a Unicode combining character sequences):
 
@@ -876,13 +878,43 @@
 Note that C !alpha  is different from C -alpha  because the
 latter matches C/./ when it is not an alpha.
 
+=back
+
+The following tokens include angles but are not required to balance:
+
+=over
+
 =item *
 
-Conjecture: Multiple opening angles are matched by a corresponding
-number of closing angles, and otherwise function as single angles.
-This can be used to visually isolate unmatched angles inside:
+A C (  token indicates the start of a result capture, while the
+corresponding C )  token indicates its endpoint.  When matched,
+these behave as assertions that are always true, but have the side
+effect of setting the C.from and C.to attributes of the match
+object.  That is:
+
+/ foo ( \d+ ) bar /
+
+is equivalent to:
+
+/ after foo \d+ before bar /
+
+except that the scan for Cfoo can be done in the forward direction,
+while a lookbehind assertion would presumably scan for C\d+ and then
+match Cfoo backwards.  The use of C (...)  affects only the
+meaning of the Iresult object and the positions of the beginning and
+ending of the match.  That is, after the match above, C$() contains
+only the digits matched, and C.pos is pointing to after the digits.
+Other captures (named or numbered) are unaffected and may be accessed
+through C$/.
+
+=item *
 
-Ccode: a  1
+A C« or C   token indicates a left 

Re: [svn:parrot-pdd] r13070 - trunk/docs/pdds/clip

2006-06-30 Thread Leopold Toetsch


On Jun 30, 2006, at 22:10, [EMAIL PROTECTED] wrote:


Log:
Overhaul.
Take _that_, Coke!


I'd really appreciate more verbose log messages, the more that we might 
somewhen autogen ChangeLog.


Thanks (to all),
leo



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

2006-06-30 Thread pmichaud
Author: pmichaud
Date: Fri Jun 30 15:53:39 2006
New Revision: 9729

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

Log:
describe below - described below


Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podFri Jun 30 15:53:39 2006
@@ -615,7 +615,7 @@
 Both C   and C   are metacharacters, and are usually (but not
 always) used in matched pairs.  (Some combinations of metacharacters
 function as standalone tokens, and these may include angles.  These are
-describe below.)
+described below.)
 
 For matched pairs, the first character after C   determines the
 behavior of the assertion:


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

2006-06-30 Thread Daniel Hulme
 +This hides any qX rule that might be defined in the gramma.  Note
s/gramma/grammar/ if you please. I prefer the new quoting behaviour and
I like  and  as word boundaries. (Sometimes I miss Vim regexes' \
and \.) Are  and  zero-width?

-- 
The  rules  of  programming  are  transitory;  only  Tao  is  eternal. 
 Therefore you  must contemplate Tao before you receive  enlightenment.
How will I know when I have received enlightenment?  asked the novice.
Your program will then run correctly, replied the master. 


pgpJPnPhUcrcr.pgp
Description: PGP signature


Re: r13070 - trunk/docs/pdds/clip

2006-06-30 Thread Chip Salzenberg
On Sat, Jul 01, 2006 at 12:22:05AM +0200, Leopold Toetsch wrote:
 I'd really appreciate more verbose log messages, the more that we might 
 somewhen autogen ChangeLog.

I actually believe in good change entries, but overhauled is a pretty good
description in this case, as it leads to interested parties reading the whole
pdd21, and in this case, that's important.

Documentation of C functions, on the other hand, *is* lagging...  ;-)
-- 
Chip Salzenberg [EMAIL PROTECTED]


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

2006-06-30 Thread Daniel Hulme
  +This hides any qX rule that might be defined in the gramma.  Note
 s/gramma/grammar/ if you please.
Erm, credit TreyHarris on this one, as he seems to have spotted it
first on #perl6.

-- 
Of all  things,  good sense is  the most fairly  distributed:  everyone
thinks  he is  so well  supplied  with it  that even  those who  are the
hardest to satisfy in  every other respect never  desire more of it than
they already have.   --  Descartes, 1637  http://surreal.istic.org/


pgphk3MbFh9eh.pgp
Description: PGP signature


pgpRQfAjcGLsj.pgp
Description: PGP signature


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

2006-06-30 Thread larry
Author: larry
Date: Fri Jun 30 16:40:05 2006
New Revision: 9730

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

Log:
Typo spotted by TreyHarris++


Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podFri Jun 30 16:40:05 2006
@@ -853,7 +853,7 @@
 
 /{ qX[cat -n {$foo}] }/
 
-This hides any qX rule that might be defined in the gramma.  Note that
+This hides any CqX rule that might be defined in the grammar.  Note that
 this means that the language parser has to pass the current list
 of quote forms into the regex parser since it needs to be known at
 compile time.


Fwd: CPAN Upload: P/PE/PETDANCE/Test-Harness-2.63_02.tar.gz

2006-06-30 Thread Andy Lester

Here's an even newer Test::Harness with overloadable straps.


Begin forwarded message:


From: PAUSE [EMAIL PROTECTED]
Date: June 30, 2006 6:43:58 PM CDT
To: Andy Lester [EMAIL PROTECTED]
Subject: CPAN Upload: P/PE/PETDANCE/Test-Harness-2.63_02.tar.gz
Reply-To: cpan-testers@perl.org

The uploaded file

Test-Harness-2.63_02.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/P/PE/PETDANCE/Test-Harness-2.63_02.tar.gz
  size: 70873 bytes
   md5: b5bc3f637998699f74ecbc0028eb57b0

No action is required on your part
Request entered by: PETDANCE (Andy Lester)
Request entered on: Fri, 30 Jun 2006 23:42:24 GMT
Request completed:  Fri, 30 Jun 2006 23:43:58 GMT

Thanks,
--
paused, v782



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






pdd23: closure vs. continuation

2006-06-30 Thread Chip Salzenberg
Just before I committed pdd23 as it currently is, I asked Audrey whether it
was better to make handlers continuations or closures.  She said it was not
important, and to choose whichever is faster.  However, I think I erred in
choosing continuations.

In the continuation model (as in pdd23 at present), the exception handler
runs _outside_ the dynamic scope where the exception occurred, which means
that dynamically scoped state required to describe, diagnose, or fix the
exception is not available.

Oops.

Allison, if you give me the OK, I'll recast pdd23 in the alternative way I
had in mind, where:

 * exception handlers are closures,

 * the closures are called _inside_ the dynamic scope where the throw occurred,

 * a closure returning without executing Ccaught implies I didn't handle
   it, try the next handler,
 therefore obviating the rethrow opcode.

PS: caught will perhaps be better renamed handled.
-- 
Chip Salzenberg [EMAIL PROTECTED]


[PATCH]#38469: [BUG] -O1 branch optimization

2006-06-30 Thread Vishal Soni
This patch fixes the branch reorganization failing for tail recursion.Previously.---$ ./parrot  -Oc ack.pir 3Ack(3, 3) = 61

$ /parrot  -Oc1 ack.pir 3maximum recursion depth exceeded (According to Leo)But on Linux I was getting a segfault.After--$ ./parrot -Oc ./examples/shootout/ack.pir 3
Ack(3, 3) = 61$ ./parrot -Oc1 ./examples/shootout/ack.pir 3Ack(3, 3) = 61Thanks,VishalIndex: CREDITS===
--- CREDITS (revision 13046)+++ CREDITS (working copy)@@ -470,3 +470,7 @@N: Norman NunleyD: Shaving a PonieE: [EMAIL PROTECTED]++N: Vishal Soni
+E: [EMAIL PROTECTED]+D: Bug fixes in IMCCIndex: compilers/imcc/optimizer.c===--- compilers/imcc/optimizer.c (revision 13046)
+++ compilers/imcc/optimizer.c (working copy)@@ -932,7 +932,7 @@ } /* this was screwing up multi-block loops... */- if (end != ins) {
+ if (end != ins  ins-next !=NULL ) { ins-next-prev = end; start-prev-next = end-next; if (end-next)
-- Thanks,Vishal
Index: CREDITS
===
--- CREDITS	(revision 13046)
+++ CREDITS	(working copy)
@@ -470,3 +470,7 @@
 N: Norman Nunley
 D: Shaving a Ponie
 E: [EMAIL PROTECTED]
+
+N: Vishal Soni
+E: [EMAIL PROTECTED]
+D: Bug fixes in IMCC
Index: compilers/imcc/optimizer.c
===
--- compilers/imcc/optimizer.c	(revision 13046)
+++ compilers/imcc/optimizer.c	(working copy)
@@ -932,7 +932,7 @@
 }
 
 /* this was screwing up multi-block loops... */
-if (end != ins) {
+if (end != ins  ins-next !=NULL ) {
 ins-next-prev = end;
 start-prev-next = end-next;
 if (end-next)


Re: Namespaces Redux

2006-06-30 Thread Chip Salzenberg
On Wed, Jun 28, 2006 at 11:40:28PM -0700, Matt Diephouse wrote:
 The get_namespace opcode gets namespaces from the root namespace.
 Should it get namespaces from the HLL namespace instead? The PDD isn't
 explicit either way [...]

It is, actually:

   =head2 Namespace Opcodes

   Note that all namespace opcodes operate from the local HLL root namespace.
   Navigating outside one's own HLL namespace requires either the Cinterpinfo
   .INTERPINFO_NAMESPACE_ROOT opcode or the get_namespace() compiler PMC 
method.

All namespace opcodes.

 Is there any reason that [...; ''] and [...] couldn't refer to the
 same namespace?

The design as it stands avoids any special meaning for *any* string.  Any
string whatsoever is a valid key; any valid key is a valid namespace name.
This is a design goal that would be compromised by the '' special case.

 Tcl uses C .namespace ['']  to refer to the root namespace (correctly, I
 think) and I can't think of any language that would want to differentiate
 between the two.

All you need to disprove this speculation is one counterexample, and the
counterexample doesn't even have to exist yet.

 Also, is there any reason we can't/shouldn't add find_global variants
 that lookup globals in HLL's? Right now we have find_global_p_p_s.
 Adding find_global_p_s_p_s would let me reach into Tcl's private very
 easily instead of having to crawl the namespaces myself.

It's three steps rather than one, but it's not crawling, and it's already in
the pdd, mostly:

.local pmc tcl
tcl = compreg tcl

.local pmc ns
ns = tcl.'get_namespace'(['Foo';'Bar'])

I'm cheating a little here because I'm showing you an example with a key
(which the docs don't specifically allow) rather than an array (which they
do allow), but the point is to demonstrate compiler.get_namespace().
-- 
Chip Salzenberg [EMAIL PROTECTED]


Re: [PATCH]#38469: [BUG] -O1 branch optimization

2006-06-30 Thread chromatic
On Friday 30 June 2006 20:43, Vishal Soni wrote:

 This patch fixes the branch reorganization failing for tail recursion.

Thanks, applied as #13084.

-- c


[perl #39672] Re: [PATCH]#38469: [BUG] -O1 branch optimization

2006-06-30 Thread via RT
# New Ticket Created by  chromatic 
# Please include the string:  [perl #39672]
# in the subject line of all future correspondence about this issue. 
# URL: https://rt.perl.org/rt3/Ticket/Display.html?id=39672 


On Friday 30 June 2006 20:43, Vishal Soni wrote:

 This patch fixes the branch reorganization failing for tail recursion.

Thanks, applied as #13084.

-- c


Re: Re: Namespaces Redux

2006-06-30 Thread Matt Diephouse

Chip Salzenberg [EMAIL PROTECTED] wrote:

On Wed, Jun 28, 2006 at 11:40:28PM -0700, Matt Diephouse wrote:
 The get_namespace opcode gets namespaces from the root namespace.
 Should it get namespaces from the HLL namespace instead? The PDD isn't
 explicit either way [...]

It is, actually:

   =head2 Namespace Opcodes

   Note that all namespace opcodes operate from the local HLL root namespace.
   Navigating outside one's own HLL namespace requires either the Cinterpinfo
   .INTERPINFO_NAMESPACE_ROOT opcode or the get_namespace() compiler PMC 
method.

All namespace opcodes.


Dunno how I missed that. But that is very good news.


 Is there any reason that [...; ''] and [...] couldn't refer to the
 same namespace?

The design as it stands avoids any special meaning for *any* string.  Any
string whatsoever is a valid key; any valid key is a valid namespace name.
This is a design goal that would be compromised by the '' special case.

 Tcl uses C .namespace ['']  to refer to the root namespace (correctly, I
 think) and I can't think of any language that would want to differentiate
 between the two.

All you need to disprove this speculation is one counterexample, and the
counterexample doesn't even have to exist yet.


Fair enough. But one question remains: how do you tell IMCC that you
want to be in the root HLL namespace? C .namespace []  is a parse
error.


 Also, is there any reason we can't/shouldn't add find_global variants
 that lookup globals in HLL's? Right now we have find_global_p_p_s.
 Adding find_global_p_s_p_s would let me reach into Tcl's private very
 easily instead of having to crawl the namespaces myself.

It's three steps rather than one, but it's not crawling, and it's already in
the pdd, mostly:

.local pmc tcl
tcl = compreg tcl

.local pmc ns
ns = tcl.'get_namespace'(['Foo';'Bar'])

I'm cheating a little here because I'm showing you an example with a key
(which the docs don't specifically allow) rather than an array (which they
do allow), but the point is to demonstrate compiler.get_namespace().


This doesn't work for *private* namespaces -- only public ones. ParTcl
currently uses a macro to crawl its private namespaces, which AFAIK is
the *only* way to access the helper subs it has in private namespaces.

Thanks,

--
matt diephouse
http://matt.diephouse.com


[BUG] parrot 0.4.5: Configure.pl: tru64

2006-06-30 Thread Jarkko Hietaniemi
Parrot 0.4.5 in Tru64 5.1B:

$ perl Configure.pl
...
Determining if your platform supports readline.yes.
Determining if your platform supports gdbm..no.

Testing snprintf...resolve_symbols: loader error: dlopen:
libreadline.so.4: symbol tgetnum unresolved

step auto::snprintf died during execution: Can't run the snprintf
testing program:  at config/auto/snprintf.pm line 33.

 at Configure.pl line 443

$

(sorry about possible linewraps, Thunderbird thinks its doing me
a favour...)

I don't know what tgetnum() from libreadline.so has to do with
testing for snprintf.  (I do know from other contexts that Tru64
wouldn't have a C99 snprintf.)

Any way to add verbosity to e.g. see which commands are being run?





Re: IMCC Register Allocation Algorithm

2006-06-30 Thread Watson Ladd
Bin packing looks better because I don't think SSA has been implemented yet. Linear Search looks perfect for SSA code, but Bin Packing would be better for Parrot. (Bin Packing views allocation as a bin packing problem and solves it heuristically.) On Jun 29, 2006, at 11:20 PM, Vishal Soni wrote:Hi Everyone,Currently IMCC uses a Graph Coloring based Register allocation algorithm.The implementation is a trimmed down version of Brigg's Allocator.I came across this research paper that talks about the new registerallocation algorithm "Linear Scan Allocation"for dynamically compiledlanguages. Parrot perfectly fits the mold of dynamically compiled language.The Linear Scan Allocator is faster at register allocation process and seemsto have the same execution time for the code. For more information pleaserefer to the research paper from IBM on Liner Scan Allocationhttp://www.research.ibm.com/jalapeno/papers/toplas99.pdfLet me know what your thoughts are and would it be worth implementing thisalgorithm to see how it performs compared to graph coloring algorithm.Please share your thoughts accordingly-- Thanks,Vishal  Sincerely,Watson Ladd---"Those who would give up Essential Liberty to purchase a little Temporary Safety deserve neither  Liberty nor Safety."-- Benjamin Franklin  

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


[perl #39669] No PIR Compiler Available for Embedded Parrot

2006-06-30 Thread via RT
# New Ticket Created by  chromatic 
# Please include the string:  [perl #39669]
# in the subject line of all future correspondence about this issue. 
# URL: https://rt.perl.org/rt3/Ticket/Display.html?id=39669 


I've been playing with embedding Parrot and trying to pass arbitrary PIR code 
to the embedded interpreter.  The easiest approach I've found so far is to 
create a small eval.pbc file that takes one argument in argv as PIR code to 
eval and execute.

(There should really be easier approaches, but I digress.)

Unfortunately, it appears that there is no PIR compiler available to embedded 
Parrot.  I'll check in a test to t/src/extend.t as soon as I get a bug number 
here.  My PIR code is:

.sub main :main
.param pmc argv
.local int argc

.local pmc compiler
compiler = compreg 'PIR'

.local string code
code = argv[1]

.local pmc new_sub
new_sub  = compiler( code )

new_sub()
.end

-- c


Re: [perl #38594] [BUG] source line numbers

2006-06-30 Thread Vishal Soni

Hi,

The .end seems to be replaced by an implicit end.

-Vishal


On 6/29/06, Will Coleda via RT [EMAIL PROTECTED] wrote:


Hey, Vishal:

 [vsoni - Tue Jun 27 05:48:27 2006]:

 Hi,

 This was a straight forward fix. The line number was being decremented
 at the start of a 'sub' token imcc.y.


 Thanks,
 Vishal

 Here is a sample run

 Sample Code:
 ---
 .sub main :main
 print 2\n
 print 3\n
 print 4\n
 .end

 Output:
 
 ./parrot -d 10 ./hello.pir
 1
 last:5
 pcc_sub main nparams 0

 Dumping the instructions status:
 ---
 nins line blck deep flags   type opnr size   pc  X ins
0100 0  8   -100 main:
1200 1  0  41320print 2\n
2300 1  0  41322print 3\n
3400 1  0  41324print 4\n
4400 0  18000016end

Looks like the first line is fixed there (1) and then the guts are fixed
(2,3,4), but is the
duplicate line 4 correct? (is that corresponding to the implicit end that
PIR puts in, or the .end
of the subroutine?

If you can just validate that, we can apply this.


 Labels
 namepos last ref
 ---


 Dumping the CFG:
 ---
 0 (0)-  -


 Dumping the Dominators Tree:
 ---
  0 - ( 0)  0

 Loop info
 -



 Patch
 

 Index: compilers/imcc/imcc.y

=
==
 --- compilers/imcc/imcc.y   (revision 13035)
 +++ compilers/imcc/imcc.y   (working copy)
 @@ -202,7 +202,7 @@
  r-type = (r-type  VT_ENCODED) ? VT_PCC_SUB|VT_ENCODED :
 VT_PCC_SUB;
  r-pcc_sub = calloc(1, sizeof(struct pcc_sub_t));
  cur_call = r;
 -i-line = line - 1;
 +i-line = line ;
  add_namespace(interp, unit);
  return i;
  }










--
Thanks,
Vishal


Re: [BUG] parrot 0.4.5: Configure.pl: tru64

2006-06-30 Thread Leopold Toetsch


On Jun 29, 2006, at 18:48, Jarkko Hietaniemi wrote:


Any way to add verbosity to e.g. see which commands are being run?


perl Configure.pl --verbose-step=snprintf

leo



Re: [perl #39669] No PIR Compiler Available for Embedded Parrot

2006-06-30 Thread Leopold Toetsch


On Jun 30, 2006, at 17:06, chromatic (via RT) wrote:



Unfortunately, it appears that there is no PIR compiler available to 
embedded

Parrot.


The PIR compiler is registered within imcc_init(), which should 
probably called automagically during Parrot init sequence. See also 
compilers/imcc/main.c.


leo



Delegating and defining a method at the same time

2006-06-30 Thread Adriano Ferreira

What is supposed to happen if one says:

class Dog {

  has $:tail handles 'wag';

  meth wag { # something else than $:tail.wag
  }
}

Is it a compilation error? Or one of the definitions prevail (with a
warning or something)?

Adriano Ferreira.


Re: [perl #39669] No PIR Compiler Available for Embedded Parrot

2006-06-30 Thread chromatic
On Friday 30 June 2006 09:35, Leopold Toetsch wrote:

 The PIR compiler is registered within imcc_init(), which should
 probably called automagically during Parrot init sequence. See also
 compilers/imcc/main.c.

Okay, here's the patch I checked in as #13066.  The IMCC headers need some 
cleanup.  Andy?

-- c


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

2006-06-30 Thread larry
Author: larry
Date: Fri Jun 30 11:57:00 2006
New Revision: 9725

Modified:
   doc/trunk/design/syn/S02.pod
   doc/trunk/design/syn/S03.pod
   doc/trunk/design/syn/S04.pod
   doc/trunk/design/syn/S05.pod
   doc/trunk/design/syn/S06.pod

Log:
Change env variables to context variables.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podFri Jun 30 11:57:00 2006
@@ -570,7 +570,7 @@
 $.foo   object attribute accessor
 $^foo   self-declared formal parameter
 $*foo   global variable
-$+foo   environmental variable
+$+foo   contextual variable
 $?foo   compiler hint variable
 $=foo   pod variable
 $foo  match variable, short for $/{'foo'}
@@ -578,9 +578,7 @@
 
 Most variables with twigils are implicitly declared or assumed to
 be declared in some other scope, and don't need a my or our.
-Attribute variables are declared with Chas, though, and environment
-variables are declared somewhere in the dynamic scope with the Cenv
-declarator.
+Attribute variables are declared with Chas, though.
 
 =item *
 
@@ -839,7 +837,7 @@
 GLOBAL
 OUTER
 CALLER
-ENV
+CONTEXT
 SUPER
 COMPILING
 
@@ -960,43 +958,48 @@
 The CCALLER package refers to the lexical scope of the (dynamically
 scoped) caller.  The caller's lexical scope is allowed to hide any
 variable except C$_ from you.  In fact, that's the default, and a
-lexical variable must be declared using Cenv rather than Cmy to be
+lexical variable must have the trait Cis context to be
 visible via CCALLER.  (C$_, C$! and C$/ are always
-environmental.) If the variable is not visible in the caller, it returns
+contextual.) If the variable is not visible in the caller, it returns
 failure.
 
-An explicit Cenv declaration is implicitly readonly.  You may add
-Cis rw to allow subroutines from modifying your value.  C$_ is
-Crw by default.  In any event, your lexical scope can access the
-variable as if it were an ordinary Cmy; the restriction on writing
-applies only to subroutines.
+Any lexical declared with the Cis context trait is by default
+considered readonly outside the current lexical scope.  You may add
+Cis rw to allow called routines to modify your value.  C$_,
+C$! and C$/ are Crw by default.  In any event, your lexical
+scope can always access the variable as if it were an ordinary Cmy;
+the restriction on writing applies only to called subroutines.
 
 =item *
 
-The CENV pseudo-package is just like CCALLER except that it scans
-outward through all dynamic scopes until it finds an environmental
-variable of that name in that caller's lexical scope.  (Use of C$+FOO
-is equivalent to ENV::$FOO or $ENV::FOO.)  If after scanning all
-the lexical scopes of each dynamic scope, there is no variable of
-that name, it looks in the C* package.  If there is no variable in
-the C* package, it looks in C%*ENV for the name, that is, in the
-environment variables passed to program.  If the value is not found
-there, it returns failure.  Note that C$+_ is always the same as
-CALLER::$_ since all callers have a C$_ that is automatically
-considered environmental.  Note also that CENV and C$+ always
-skip the current scope, since you can always name the variable
-directly without the CENV or C+ if it's been declared Cenv
-in the current lexical scope.
-
-Subprocesses are passed only the global C%*ENV values.  They do not
-see any lexical variables or their values.  The CENV package is only
-for internal overriding of environmental parameters.  Change C%*ENV
-to change what subprocesses see.  [Conjecture: This might be suboptimal
-in the abstract, but it would be difficult to track the current set of
-environment variable names unless we actually passed around a list.
-The alternative seems to be to walk the entire dynamic scope and
-reconstruct %*ENV for each subprogram call, and then we only slow
-down subprogram calls.]
+The CCONTEXT pseudo-package is just like CCALLER except that
+it scans outward through all dynamic scopes until it finds a
+contextual variable of that name in that caller's lexical scope.
+(Use of C$+FOO is equivalent to CONTEXT::$FOO or $CONTEXT::FOO.)
+If after scanning all the lexical scopes of each dynamic scope,
+there is no variable of that name, it looks in the C* package.
+If there is no variable in the C* package and the variable is
+a scalar, it then looks in C%*ENV for the identifier of the variable,
+that is, in the environment variables passed to program.  If the
+value is not found there, it returns failure.  Note that C$+_ is
+always the same as CALLER::$_ since all callers have a C$_ that
+is automatically considered environmental.  Note also that CCONTEXT
+and C$+ always skip the current scope, since you can always name
+the variable directly without the CCONTEXT or C+ if it's been
+declared in the current