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

2007-02-13 Thread allison
Author: allison
Date: Tue Feb 13 02:00:10 2007
New Revision: 16965

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

Log:
[pdd]: Update to reflect core conceptual changes to Objects PDD.


Modified: trunk/docs/pdds/draft/pdd15_objects.pod
==
--- trunk/docs/pdds/draft/pdd15_objects.pod (original)
+++ trunk/docs/pdds/draft/pdd15_objects.pod Tue Feb 13 02:00:10 2007
@@ -5,381 +5,251 @@
 
 docs/pdds/pdd15_objects.pod - Object and Class semantics for Parrot
 
-=head1 REQUIREMENTS
-
-This PDD is due an overhaul. This requirements section is for language
-implementers to list the OO-related needs of their language in so as to aid
-that.
-
-=head2 PMCS
-
-Ruby: Just like small talk, everything is an object.  I'm hoping to be able to 
-implement core Ruby classes(String, Array, Hash, Module, etc)  something like 
this.
-
-ParrotClass
-|
- RubyClass   String
-| |
- \  /
-RubyString
-
-=head2 Objectspace
-
-Ruby: Objectspace in ruby allows the programmer to iterate through every live 
object
-in the system.  There is some debate about how to make this play nice with 
different
-garbage collection schemes.
-
-=head2 Classes
-
-A class is a collection of methods and attributes. It would be desirable, for
-those classes whose definition is fully known at compile time, to have a
-convenient way to have the class along with its attributes and methods stored
-into a PBC file rather than created at runtime. However, creation of new
-classes at runtime will be needed too.
-
-=head2 Meta-classes
-
-Ruby: Ruby has meta classes.  It would be nice if classes were objects in 
Parrots OO model.
-
-=head2 Attributes
-
-Attributes are instance data associated with a class (or role, however those
-are supported). They may not always be of a type specified by a PMC, though
-boxing/unboxing is of course an option.
-
-Perl 6: All attributes are opaque (not externally visible, even to any
-subclasses).
-
-.Net: Attributes may be private (not externally visible), public (always
-externally visible), protected (only visible to subclasses) and internal
-(only visible inside the current assembly - the closest correspondence in
-Parrot is perhaps only visible inside the same PBC file). Additionally, it
-is allowable for a subclass to introduce an attribute of the same name as
-the a parent class has, and they both exist depending on what type an
-instance of the class is currently viewed as being (read: there is a
-difference between the type of the reference and the type of the value).
+=head1 ABSTRACT
 
-Ruby: Attributes can be dynamically added and removed at runtime.
+This PDD describes the semantics of Parrot's object and class systems. 
 
-=head2 Methods
+=head1 VERSION
 
-Perl 6: Methods may be public (anyone can invoke them) or private (only
-invokable by the class they are defined in). Additionally, submethods are
-methods that do not get inherited.
+$Revision$
 
-.Net: Like attributes, methods may be public, private, protected or internal.
+=head1 DEFINITIONS
 
-Ruby: has a method_missing that gets called when method resolution fails to 
find a method.
-Methods can be dynamically added and removed at runtime.
+=head2 Class
 
-=head2 Constructors
-
-A constructor is run when an object is instantiated.
+=head2 Object
 
-.Net: There may be many constructors for an object (provided they all have
-different signatures), and the correct one is called based upon the passed
-parameters.
+=head2 Attribute
 
-=head2 Inheritance
+An attribute is a slot in an object that contains a value, generally a
+PMC. Attributes are referenced by class name/attribute name pairs.
 
-Perl 6: Multiple inheritance.
+Attributes are set on a class-wide basis, and all the objects of a class
+will have the same set of attributes.  Most OO languages don't allow
+attribute changes to existing classes, but Parrot's base attribute
+system does allow it. In order to safely support advanced dynamic
+features in HLLs, attributes are not accesible via fixed attribute
+offsets, but only via named lookup.
 
-.Net: Single inheritance.
+=head2 Method
 
-Ruby: Single inheritance but support for mixins of ruby modules.
+A method is a piece of code that you invoke by name through an object.
 
-=head2 Interfaces
+=head2 Parent class
 
-An interface specifies a set of methods that must be implemented by a class
-that inherits (or implements) the interface, but does not provide any form of
-implementation for them.
-
-.Net: Interfaces are pretty much what was just describe above. XXX Need to
-check behavior of you implement two interfaces with methods of the same name.
-
-=head2 Roles
-
-A role consists of a set of methods and attributes. It cannot be instantiated
-on its own, but must be composed into a class. When this happens its methods
-and attributes become of that classes methods and attributes. This may happen
-at compile time or runtime, however when a role 

Re: [perl #41478] [PATCH] add Test::More::skip()

2007-02-13 Thread Allison Randal

Why the reversed order of arguments from Test::Builder.skip? It seems that:

skip(5, 'lengthy message about reasoning')

is more readable than:

skip('lengthy message about reasoning', 5)

Is the assumption that skipping a single test with a message is more 
common than skipping a number of tests without a message?


skip('lengthy message about reasoning')
vs.
skip(5)

Could you tweak your git options to produce patches as attached files? 
(Is there a .gitrc file or something to set defaults for a particular 
repository?)


Allison

Sam Vilain (via RT) wrote:
# New Ticket Created by  Sam Vilain 
# Please include the string:  [perl #41478]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=41478 >



Test::More.skip() was missing; add it
---
 runtime/parrot/library/Test/More.pir |   27 +++
 t/library/test_more.t|   12 +++-
 2 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/runtime/parrot/library/Test/More.pir 
b/runtime/parrot/library/Test/More.pir
index ac5f440..b972d0e 100644
--- a/runtime/parrot/library/Test/More.pir
+++ b/runtime/parrot/library/Test/More.pir
@@ -737,6 +737,33 @@ optional test description in C.
   done:
 .end
 
+=item C

+
+Pass a number of tests, but with a comment that marks the test was
+actually skipped.  Arguments are are optional.
+
+Note that the arguments are in reverse compared to
+C.  They are in the order of the Perl5 Test::More
+module.
+
+=cut
+
+.sub skip
+.param string description :optional
+.param int has_description :opt_flag
+.param int how_many :optional
+.param int has_how_many :opt_flag
+
+$I0 = how_many
+if has_how_many goto just_say_it
+$I0 = 1
+just_say_it:
+
+.local pmc test

+find_global test, 'Test::More', '_test'
+test.'skip'($I0, description)
+.end
+
 .sub _make_diagnostic
 .param string received
 .param string expected
diff --git a/t/library/test_more.t b/t/library/test_more.t
index 9f548e0..f9a6044 100644
--- a/t/library/test_more.t
+++ b/t/library/test_more.t
@@ -23,6 +23,7 @@
.IMPORT( 'Test::More', 'is' )
.IMPORT( 'Test::More', 'diag' )
.IMPORT( 'Test::More', 'like' )
+   .IMPORT( 'Test::More', 'skip' )
.IMPORT( 'Test::More', 'is_deeply' )
.IMPORT( 'Test::Builder::Tester', 'plan' )
.IMPORT( 'Test::Builder::Tester', 'test_out' )
@@ -31,7 +32,7 @@
.IMPORT( 'Test::Builder::Tester', 'test_pass' )
.IMPORT( 'Test::Builder::Tester', 'test_test' )
 
-	plan( 43 )

+   plan( 45 )
test_ok()
test_is()
test_like()
@@ -341,4 +342,13 @@
test_out( 'ok 44 #skip skipping' )
 test.'skip'( 2, 'skipping' )
test_test( 'skip test should pass' )
+
+   test_out( 'ok 45 #skip jumping' )
+   skip( "jumping" )
+   test_test( 'skip(string)' )
+
+   test_out( 'ok 46 #skip lunch' )
+   test_out( 'ok 47 #skip lunch' )
+   skip( "lunch", 2 )
+   test_test( 'skip(string, int)' )
 .end


Re: [perl #41478] [PATCH] add Test::More::skip()

2007-02-13 Thread Nicholas Clark
On Tue, Feb 13, 2007 at 11:44:01AM +0200, Allison Randal wrote:
> Why the reversed order of arguments from Test::Builder.skip?

Well, it's not reversed from Perl 5's Test::Builder

=item B

  SKIP: {
  skip $why, $how_many if $condition;

  ...normal testing code goes here...
  }


>  It seems that:
> skip(5, 'lengthy message about reasoning')
> 
> is more readable than:
> 
> skip('lengthy message about reasoning', 5)

I agree. I believe that I've made this mistake before in writing tests in
Perl 5.

> Is the assumption that skipping a single test with a message is more 
> common than skipping a number of tests without a message?

This is my guess too. Probably need to as Schwern to find out the original
(Perl 5) reason.

Nicholas Clark


Re: [perl #41478] [PATCH] add Test::More::skip()

2007-02-13 Thread Sam Vilain
Nicholas Clark via RT wrote:
> On Tue, Feb 13, 2007 at 11:44:01AM +0200, Allison Randal wrote:
>   
>> Why the reversed order of arguments from Test::Builder.skip?
>> 
>
> Well, it's not reversed from Perl 5's Test::Builder
>
> =item B
>
>   SKIP: {
>   skip $why, $how_many if $condition;
>
>   ...normal testing code goes here...
>   }
>
>
>   
>>  It seems that:
>> skip(5, 'lengthy message about reasoning')
>>
>> is more readable than:
>>
>> skip('lengthy message about reasoning', 5)
>> 
>
> I agree. I believe that I've made this mistake before in writing tests in
> Perl 5.
>
>   
>> Is the assumption that skipping a single test with a message is more 
>> common than skipping a number of tests without a message?
>> 
>
> This is my guess too. Probably need to as Schwern to find out the original
> (Perl 5) reason.
>
>   
multi-sub?

  skip string
  skip int, string

Sam.
 


> Nicholas Clark
>
>
>   

>From fe91f8e4469a56285254424e7c408dfc7e13241e Mon Sep 17 00:00:00 2001
From: Sam Vilain <[EMAIL PROTECTED]>
Date: Wed, 14 Feb 2007 01:27:23 +1300
Subject: [PATCH] [t/pmc] convert multisub test to PIR

---
 t/pmc/multisub.pir.t |   47 +++
 t/pmc/multisub.t |   42 --
 2 files changed, 47 insertions(+), 42 deletions(-)
 create mode 100644 t/pmc/multisub.pir.t
 delete mode 100644 t/pmc/multisub.t

diff --git a/t/pmc/multisub.pir.t b/t/pmc/multisub.pir.t
new file mode 100644
index 000..3c73408
--- /dev/null
+++ b/t/pmc/multisub.pir.t
@@ -0,0 +1,47 @@
+#! parrot
+# Copyright (C) 2001-2007, The Perl Foundation.
+# $Id$
+
+.macro IMPORT ( lib, subname, TEMP )
+	.TEMP = find_global .lib, .subname
+	store_global .subname, .TEMP
+.endm
+
+.sub main
+load_bytecode 'library/Test/More.pir'
+
+.local pmc _
+.IMPORT( 'Test::More', 'plan', _ )
+.IMPORT( 'Test::More', 'ok',   _ )
+.IMPORT( 'Test::More', 'is',   _ )
+
+plan( 2 )
+
+=head1 NAME
+
+t/pmc/multisub.t - Multi Sub PMCs
+
+=head1 SYNOPSIS
+
+% prove t/pmc/multisub.t
+
+=head1 DESCRIPTION
+
+Tests the creation and invocation of Perl6 multi subs.
+
+=cut
+
+new P0, .MultiSub
+I0 = defined P0
+ok(I0, "create PMC")
+
+elements I0, P0
+is(I0, 0, "multisubs start empty")
+
+.end
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 70
+# End:
+# vim: expandtab shiftwidth=4:
diff --git a/t/pmc/multisub.t b/t/pmc/multisub.t
deleted file mode 100644
index 24a9844..000
--- a/t/pmc/multisub.t
+++ /dev/null
@@ -1,42 +0,0 @@
-#! perl
-# Copyright (C) 2001-2005, The Perl Foundation.
-# $Id$
-
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 1;
-
-=head1 NAME
-
-t/pmc/multisub.t - Multi Sub PMCs
-
-=head1 SYNOPSIS
-
-% prove t/pmc/multisub.t
-
-=head1 DESCRIPTION
-
-Tests the creation and invocation of Perl6 multi subs.
-
-=cut
-
-pasm_output_is( <<'CODE', <<'OUTPUT', "create PMC" );
-new P0, .MultiSub
-print "ok 1\n"
-elements I0, P0
-print I0
-print "\n"
-end
-CODE
-ok 1
-0
-OUTPUT
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
-- 
1.5.0.rc3.g3e023

>From 271801a9d4a3cbe7bd66418dd09be934d4b6f7ef Mon Sep 17 00:00:00 2001
From: Sam Vilain <[EMAIL PROTECTED]>
Date: Wed, 14 Feb 2007 02:54:09 +1300
Subject: [PATCH] [t/pmc] add a multisub test

Guessing from the code, it looks like it is designed to have Sub
objects pushed onto it.
---
 t/pmc/multisub.pir.t |   67 -
 1 files changed, 60 insertions(+), 7 deletions(-)

diff --git a/t/pmc/multisub.pir.t b/t/pmc/multisub.pir.t
index 3c73408..7b42410 100644
--- a/t/pmc/multisub.pir.t
+++ b/t/pmc/multisub.pir.t
@@ -7,15 +7,33 @@
 	store_global .subname, .TEMP
 .endm
 
-.sub main
+.sub skipone
+.param string why
+$S0 = "mmd - S - " . why
+.return($S0)
+.end
+
+.sub skipn
+.param int i
+.param string why
+$S1 = i
+$S0 = "mmd - IS - x" . $S1
+$S0 = $S0 . " - "
+$S0 = $S0 . why
+.return($S0)
+.end
+
+.sub main :main
 load_bytecode 'library/Test/More.pir'
 
 .local pmc _
 .IMPORT( 'Test::More', 'plan', _ )
 .IMPORT( 'Test::More', 'ok',   _ )
 .IMPORT( 'Test::More', 'is',   _ )
+$P0 = find_global 'Test::More', 'skip'
+store_global '_skip', $P0
 
-plan( 2 )
+plan( 5 )
 
 =head1 NAME
 
@@ -31,12 +49,47 @@ Tests the creation and invocation of Perl6 multi subs.
 
 =cut
 
-new P0, .MultiSub
-I0 = defined P0
-ok(I0, "create PMC")
+$P0 = new .MultiSub
+$I0 = defined $P0
+ok($I0, "create PMC")
+
+$I0 = elements $P0
+is($I0, 0, "multisubs start empty")
+
+#push $P0, skipone
+$P1 = find_global "skipone"
+push $P0, $P1
+
+#push $P0, skipn
+$P1 = find_global "skipn"
+push $P0, $P1
+
+$I0

Re: [perl #41485] [TODO] Add a test for svn:eol-style property

2007-02-13 Thread Paul Cochrane

On 12/02/07, jerry gay <[EMAIL PROTECTED]> wrote:

On 2/11/07, via RT Paul Cochrane <[EMAIL PROTECTED]> wrote:
> # New Ticket Created by  Paul Cochrane
> # Please include the string:  [perl #41485]
> # in the subject line of all future correspondence about this issue.
> # http://rt.perl.org/rt3/Ticket/Display.html?id=41485 >
>
>
> chromatic asked me recently whether or not a subversion property
> exists for line endings to help keep text files consistent within the
> repository.  It turns out there is, namely the svn:eol-style property.
>  This should be set to "LF" so that one has Unix-style end-of-line
> characters.  I have added a test for this into
> t/codingstd/line_endings.t but before I commit it, I thought I'd check
> if having all text files have this property set was appropriate
> (especially for Windows users).
>
> If noone complains then I'll commit the change, and close this ticket.
>
svn:eol-style should be set to 'native', so it'll save files with the
line ending the platform expects. the only exceptions i'm aware of are
examples using file io. as the tests are currently designed, these
require svn:eol-style=LF (see t/examples/streams.t for more.)


I'd thought about using 'native' but the line endings test explicitly
looks for DOS endings with a view to removing them, so why not let svn
handle this task?  Do users on Windows have major problems editing the
files because they're all (mostly) UNIX line endings?  Should we
change the coding standard test to look just for text files with the
eol-style set to native, and not worry about DOS/UNIX etc line
endings?


if you want to make sure this test is platform-friendly before
committing, feel free to attach the patch to this ticket, and i'll run
it on windows.


I've attached the patch to this email, let me know how you go.

Paul


line_endings.patch
Description: Binary data


[perl #41496] [TODO] config - profiling options should have their own step in config/init/defaults.pm

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


The profiling options specified in config/init/defaults.pm should be
moved into their own 'step' of the configure process.


[perl #41497] [TODO] config - profiling options are specific to gcc in config/init/defaults.pm

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


The profiling options used in config/init/defaults.pm are specific to
gcc.  This should probably be specified in the relevant hints file.


Re: [perl #41485] [TODO] Add a test for svn:eol-style property

2007-02-13 Thread Jonathan Worthington

Paul Cochrane wrote:

Do users on Windows have major problems editing the
files because they're all (mostly) UNIX line endings?
Yes. Even things I may use that can handle input with UNIX line endings, 
tend to spit out files with Windows line endings too. I rely on 
eol-style being set to native for this all to work out, and when I edit 
files without it set someone probably make an "OH NO \r's everywhere" 
kinda comment in my direction. :-)



Should we
change the coding standard test to look just for text files with the
eol-style set to native, and not worry about DOS/UNIX etc line
endings?
I think native should just do the right thing and be set on almost every 
file - many files are set with this property already.


If you're checking out on a UNIX platform and seeing things with a 
DOS/Windows line ending, that's probably an issue (a few select test 
files aside, I guess). But on a DOS/Windows platform, it should be the 
common case and it's the UNIX endings that are the problem. Both of 
these point to forgetting to set eol-style to native.


Thanks,

Jonathan


[perl #41498] [TODO] create Makefile.PL for CPAN friendliness

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


CPAN doesn't like parrot's F, as it expects
F. in order to conform, we should create F
which runs with the expected style of argument passing. the file will
translate to the style F expects, and run
F.


[perl #41499] [TODO] config - 32/64 bit architecture setting gcc specific

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


The architecture-setting compiler options are possibly gcc specific in
config/init/defaults.pm.  This needs to be checked and made more
general if necessary.


[perl #41500] [TODO] config - lib directory needs to be set appropriately for 32/64 bit archs

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


In config/init/defaults.pm the lib install path needs to be set
correctly for 32 and 64 bit architecture systems.


[perl #40722] [TODO] Tcl - implement [file dirname]

2007-02-13 Thread Nuno Carvalho via RT
On Wed Nov 08 09:17:21 2006, ptc wrote:
> Implement the stub routine 'dirname' in
> languages/tcl/runtime/builtin/file.pir
> 
> This ticket is in response to cage task #39704.

 Implemented in revision 16967, this implementation looks more
complicated that what should be in order to cover some edge cases. This
could use some windows OS base testing. Here are some live examples on
linux:

** Tclsh:
% file dirname "."
.
% file dirname "file"
.
% file dirname "file.ext"
.
% file dirname "/path/file.ext"
/path
% file dirname "/path/"
/
% file dirname "///./more/com.pli.ca.ted/path/file.ext"
/./more/com.pli.ca.ted/path

** Parrot's Tcl:
% file dirname "."
.
% file dirname "file"
.
% file dirname "file.ext"
.
% file dirname "/path/file.ext"
/path
% file dirname "/path/"
/
% file dirname "///./more/com.pli.ca.ted/path/file.ext"
/./more/com.pli.ca.ted/path

 Please, let me me know if you find any missing case. I wouldn't like to
close this ticket until this is tweaked and testd for Windows.

./smash


Re: [perl #41478] [PATCH] add Test::More::skip()

2007-02-13 Thread chromatic
On Tuesday 13 February 2007 06:25, Sam Vilain wrote:

> >> Why the reversed order of arguments from Test::Builder.skip?
> multi-sub?
>
>   skip string
>   skip int, string

Seems appropriate to me.  Now if the former were a curried version of the 
latter, installed as a multi

-- c


Porting parrot on PDA -- work in progress

2007-02-13 Thread Aldo Calpini

whoa there!

I've managed to build parrot for the PocketPC. yes, really. I hacked 
just a little the Configure process - now it _really_ compiles test 
executables, run them on the PDA and gather the result. this wasn't 
really hard.


I had a half-written Perl XS extension which uses RAPI to communicate 
with the PDA. I just worked on it a little and prepared a simple script 
which does the trick. all I had to do was to add a parameter to 
_run_command in lib/Parrot/Configure/Step.pm which simply does:


  if($remote) {
  $command = "$^X runonpda.pl $command";
  }

runonpda.pl is my simple script in this case. once I have my RAPI 
extension on CPAN, this could eventually be turned into a proper patch 
to Parrot's Configure.


the resulting files needed just a few fixes, mainly because Configure 
pulls out information about headers from Perl's Config.pm (which of 
course, in this case, isn't just right).


there are also minor glitches with threads and OS system calls, but they 
can be solved by creating a directory in config/gen/platform (eg. cegcc 
or whatever) and writing there the correct code.


furthermore, the Configure process uses $^O here and there, and this 
should eventually be replaced by an --arch=something parameter to 
Configure.pl (which defaults to $^O, of course).


my parrot does indeed run some of the examples/pasm files. I tried 
hello.pasm, fact.pasm, xml_parser.pasm, they all run just fine.


now, from what I understand looking at the Makefile, this parrot should 
be used to generate a lot of .pbc files that constitute the "core" 
Parrot library. this is going to be a real pain, because while it's true 
that I can run parrot on the PDA, all the directory structure (eg. 
runtime/parrot/library) is not there at all.


so I'm really puzzled about what to do next. is this parrot.exe alone 
worth something (except for running .pasm files, that is)? should I 
transfer the whole parrot directory to the PDA and build the library 
there, by hand?


I would appreciate any feedback :-)

cheers,
Aldo


Re: Negative array subscripts

2007-02-13 Thread Smylers
Jonathan Scott Duff writes:

> On 2/6/07, Smylers <[EMAIL PROTECTED]> wrote:
> 
> > Blair Sutton writes:
> > 
> > > David Green wrote:
> > >
> > > > In some ways, I like not having a [0] index at all: programmers
> > > > may be used to counting from zero, but normal humans start with
> > > > first, second, third, ... third last, second last,...
> > >
> > > My feelings are Perl 6 should stick to 0 being the index of the
> > > first element of a list. Otherwise we might alienate programmers
> > > from P5 and nearly every other language. Couldn't the first array
> > > index be adjusted by adding a user defined Parrot grammar
> > > definition that applies the transformation +1 inside [] operators
> > > instead; maybe this could be accessible via a Perl "use" pragma.
> >
> > Hmmm, a pragma's a bit heavyweight for this; how about being able to
> > set this with a special global variable -- that sure sounds handy
> > ...
> 
> I can't quite tell how serious you are  :-)

I was being completely serious in my attempt to remind folk of C<$[> in
Perl 5, how much it is despised, and that it is a mistake that Perl 6
won't be repeating.

> ... I can see the need for a pragma to help out the Pascal or Fortran
> programmers start all of their arrays at something other than 0.

Those sort of crutches in programming languages (let's help folk who
know some other language -- meaning they end up programming in some
hybrid of the two languages) often turn out to be a mistake.  Think of
Pascal programmers #define-ing begin and end as { and } in C, or
WordBasic being 'localized' into French, or C in Perl 5.

Part of this is cos they are mostly unnecessary: there are so many
fundamental and much deeper differences between Pascal and Perl that any
Pascal programmer who's managed to learn about and cope with all the
weird and wonderful things that Perl offers isn't going to struggle with
the relatively superficial difference in array subscripts.

> And I can see the need for a modifier so that an individual array can
> start at an index other that 0.

Isn't that something shaped arrays can already do?

Smylers


Re: Porting parrot on PDA -- work in progress

2007-02-13 Thread Joshua Isom

On Feb 13, 2007, at 1:28 PM, Aldo Calpini wrote:


whoa there!

furthermore, the Configure process uses $^O here and there, and this 
should eventually be replaced by an --arch=something parameter to 
Configure.pl (which defaults to $^O, of course).


my parrot does indeed run some of the examples/pasm files. I tried 
hello.pasm, fact.pasm, xml_parser.pasm, they all run just fine.


now, from what I understand looking at the Makefile, this parrot 
should be used to generate a lot of .pbc files that constitute the 
"core" Parrot library. this is going to be a real pain, because while 
it's true that I can run parrot on the PDA, all the directory 
structure (eg. runtime/parrot/library) is not there at all.


so I'm really puzzled about what to do next. is this parrot.exe alone 
worth something (except for running .pasm files, that is)? should I 
transfer the whole parrot directory to the PDA and build the library 
there, by hand?


I would appreciate any feedback :-)

cheers,
Aldo


You should be able to run most pir files and pbc files too, since the 
pbc files are platform independent.  It'd help to have then generated 
on a platform with the same endian for speed, but not required(portable 
byte code).  You can sort of pick and choose which libraries if you're 
feeling adventurous, and which headers.  They're often used in other 
files to run.  You won't need all the .h files since they're for 
linking with libparrot, so just the stuff with runtime.  You may even 
be able to get tcl running on your pda.




Re: Porting parrot on PDA -- work in progress

2007-02-13 Thread Patrick R. Michaud
On Tue, Feb 13, 2007 at 08:28:38PM +0100, Aldo Calpini wrote:
> I've managed to build parrot for the PocketPC. yes, really. 
>
> I would appreciate any feedback :-)

Feedback:  Truly amazing, and terrific work.  Aldo++

Pm


Parrot on PDA - work in progress

2007-02-13 Thread [EMAIL PROTECTED]

whoa there!

I've managed to build parrot for the PocketPC. yes, really. I hacked 
just a little the Configure process - now it _really_ compiles test 
executables, run them on the PDA and gather the result. this wasn't 
really hard.


I had a half-written Perl XS extension which uses RAPI to communicate 
with the PDA. I just worked on it a little and prepared a simple script 
which does the trick. all I had to do was to add a parameter to 
_run_command in lib/Parrot/Configure/Step.pm which simply does:


   if($remote) {
   $command = "$^X runonpda.pl $command";
   }

runonpda.pl is my simple script in this case. once I have my RAPI 
extension on CPAN, this could eventually be turned into a proper patch 
to Parrot's Configure.


the resulting files needed just a few fixes, mainly because Configure 
pulls out information about headers from Perl's Config.pm (which of 
course, in this case, isn't just right).


there are also minor glitches with threads and OS system calls, but they 
can be solved by creating a directory in config/gen/platform (eg. cegcc 
or whatever) and writing there the correct code.


furthermore, the Configure process uses $^O here and there, and this 
should eventually be replaced by an --arch=something parameter to 
Configure.pl (which defaults to $^O, of course).


my parrot does indeed run some of the examples/pasm files. I tried 
hello.pasm, fact.pasm, xml_parser.pasm, they all run just fine.


now, from what I understand looking at the Makefile, this parrot should 
be used to generate a lot of .pbc files that constitute the "core" 
Parrot library. this is going to be a real pain, because while it's true 
that I can run parrot on the PDA, all the directory structure (eg. 
runtime/parrot/library) is not there at all.


so I'm really puzzled about what to do next. is this parrot.exe alone 
worth something (except for running .pasm files, that is)? should I 
transfer the whole parrot directory to the PDA and build the library 
there, by hand?


I would appreciate any feedback :-)

cheers,
Aldo







Re: [perl #41485] [TODO] Add a test for svn:eol-style property

2007-02-13 Thread James E Keenan

jerry gay wrote:

On 2/11/07, via RT Paul Cochrane <[EMAIL PROTECTED]> wrote:


# New Ticket Created by  Paul Cochrane
# Please include the string:  [perl #41485]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=41485 >



svn:eol-style should be set to 'native', so it'll save files with the
line ending the platform expects. the only exceptions i'm aware of are
examples using file io. as the tests are currently designed, these
require svn:eol-style=LF (see t/examples/streams.t for more.)




Apropos the discussion in this thread, should any svn properties be set 
on files submitted as patches or new files?


Or is this not relevant, as such files cannot yet have svn properties?

But perhaps more to the point:  Suppose that I am committing new files 
to a *branch* (e.g., the buildtools branch) -- files that ultimately 
will be submitted to the project as patches/new files to *trunk*.  What 
svn properties should I set on files I'm committing to my branch?


(So far, I'm just adding 'svn:keywords "Id"', because otherwise I don't 
get proper updates in my svn Id tags.)


kid51


Re: [perl #41485] [TODO] Add a test for svn:eol-style property

2007-02-13 Thread jerry gay

On 2/13/07, James E Keenan <[EMAIL PROTECTED]> wrote:

jerry gay wrote:
> On 2/11/07, via RT Paul Cochrane <[EMAIL PROTECTED]> wrote:
>
>> # New Ticket Created by  Paul Cochrane
>> # Please include the string:  [perl #41485]
>> # in the subject line of all future correspondence about this issue.
>> # http://rt.perl.org/rt3/Ticket/Display.html?id=41485 >
>>
>>
> svn:eol-style should be set to 'native', so it'll save files with the
> line ending the platform expects. the only exceptions i'm aware of are
> examples using file io. as the tests are currently designed, these
> require svn:eol-style=LF (see t/examples/streams.t for more.)
>


Apropos the discussion in this thread, should any svn properties be set
on files submitted as patches or new files?

Or is this not relevant, as such files cannot yet have svn properties?

But perhaps more to the point:  Suppose that I am committing new files
to a *branch* (e.g., the buildtools branch) -- files that ultimately
will be submitted to the project as patches/new files to *trunk*.  What
svn properties should I set on files I'm committing to my branch?

(So far, I'm just adding 'svn:keywords "Id"', because otherwise I don't
get proper updates in my svn Id tags.)


the metadata requirements for parrot repo files are poorly documented.
there's a little info in docs/submissions.pod, and a little at
http://www.parrotcode.org/source.html. if you count tests as
documentation (i do,) then t/distro/file_metadata.t is another place
to look.

the documentation for file metadata is not well organized, nor
complete. i'm not certain where this info best fits, but the coding
standard pdd seems like a good candidate. in any case, the general
rule (there are exceptions) is that the following properties have the
following settings on the listed filetypes:
 [*.*]:  svn:eol-style=native
 [*.*]:  svn:keywords="Author Date Id Revision"
 [*.t]:  svn:mime-type=text/plain

and hopefully someday svn will support custom keywords (it's been
threatened for years) and we can add "Year" and/or "Copyright" -- but
that's another story.

the cleanup and organization of documentation related to svn
properties should be tracked in a separate ticket.
~jerry


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

2007-02-13 Thread larry
Author: larry
Date: Tue Feb 13 23:07:00 2007
New Revision: 13585

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

Log:
Got rid of quote declarator.  Just use a macro.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podTue Feb 13 23:07:00 2007
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall <[EMAIL PROTECTED]>
   Date: 10 Aug 2004
-  Last Modified: 11 Feb 2007
+  Last Modified: 13 Feb 2007
   Number: 2
-  Version: 86
+  Version: 87
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -1958,67 +1958,20 @@
 :trans  Parse as transliteration
 :code   Quasiquoting
 
-Ordinarily the colon is required on adverbs, but the C declarator
-allows you to combine any of the existing adverbial forms above
-without an intervening colon:
+You may omit the first colon by joining an initial 'Q', 'q', or 'qq' with
+a single short form adverb, which produces forms like:
 
-quote qw;   # declare a P5-esque qw// meaning q:w
-quote Qc;   # Q:c//, interpolate only closures
+qw /a b c/; # P5-esque qw// meaning q:w
+Qc '...{$x}...';# Q:c//, interpolate only closures
+qqx/$cmd @args/ # equivalent to P5's qx//
 
-Actually, those two are already assumed, because you get all of the
-forms that use a single character modifier predeclared for free.  (Note
-this means that C doesn't intepolate.)
+(Note that C doesn't intepolate.)
 
-If you want to abbreviate further, you may also give an explicit
-definition as either a string or quasiquote:
+If you want to abbreviate further, just define a macro:
 
-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, all these forms disable the lookahead for an adverbial argument,
-as if there were a space after the keyword.  So although
-
-q:s($foo)
-
-will misinterpret C<$foo> as the C<:s> argument,
-
-qs(stuff)
-
-has the advantage of misinterpreting it as the argument to the C
-function instead.  C<:)>
-
-But parens are special that way.  (Even C is assumed to be a
-function call rather than a quote.)  Other bracketing characters are
-special only if they can be mistaken for adverbial arguments, so
-
-qs[stuff]
-
-is fine, and means
-
-q:s /stuff/
-
-while
-
-q:s[stuff]
-
-also happens to work because quote adverbs only allow the paren form of
-bracketed adverbs.
-
-If this is all too much of a hardship, you can define your own quote
-adverbs and operators as standard macros.  The main difference is that,
-unlike
-
-quote qs = 'q:s';
-
-declaring something like
-
-macro qs { 'q:s' }
-
-does I disable the subsequent search for a parenthesized argument
-to C<:n>.  To get the equivalent, you need to add a space:
-
-macro qs { 'q:s ' }
+macro qx { 'qq:x ' }  # equivalent to P5's qx//
+macro qTO { 'qq:x:w:to ' }# qq:x:w:to//
+macro circumfix:<❰ ❱> ($expr) { q:code{ $expr.quoteharder } }
 
 All the uppercase adverbs are reserved for user-defined quotes.
 All Unicode delimiters above Latin-1 are reserved for user-defined quotes.


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

2007-02-13 Thread larry
Author: larry
Date: Tue Feb 13 23:22:05 2007
New Revision: 13586

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

Log:
typos
changed :to be the short form for :heredoc


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podTue Feb 13 23:22:05 2007
@@ -1952,20 +1952,20 @@
 :f  :function   Interpolate & calls
 :c  :closureInterpolate {...} expressions
 :b  :backslash  Interpolate \n, \t, etc. (implies :q at least)
-:to Parse result as heredoc terminator
+:to :heredocParse result as heredoc terminator
 :regex  Parse as regex
 :subst  Parse as substitution
 :trans  Parse as transliteration
 :code   Quasiquoting
 
-You may omit the first colon by joining an initial 'Q', 'q', or 'qq' with
+You may omit the first colon by joining an initial C, C, or C with
 a single short form adverb, which produces forms like:
 
 qw /a b c/; # P5-esque qw// meaning q:w
 Qc '...{$x}...';# Q:c//, interpolate only closures
 qqx/$cmd @args/ # equivalent to P5's qx//
 
-(Note that C doesn't intepolate.)
+(Note that C doesn't interpolate.)
 
 If you want to abbreviate further, just define a macro: