A12 Versioning

2004-04-26 Thread Richard Proctor
I am not happy about the versioning proposal.

While A12 listed many properties that could apply to a a module such as
version, subject, author etc,  the versioning declaration

  class Dog-1.2.1-cpan:JRANDOM;
  
leaves me a little cold.

Issues:

1) Why does this only use Version and Author?  Suppose there are versions
for different oses or that use other particular libraries that are wanted
or not?

2) Shouldn't all these properties just be in a hash against the module
rather than some having special significance?  Others can then be simply
added as appropriate.

3) Why is the information positional rather than by keyword property?
  use Dog :version«1.2.1» :author«JRANDOM» :os«cpm»;
  
4) What are the expected rules for versioning?  While the public CPAN has
one set of versioning, other projects have weird versioning rules, with
letters and numbers.  What would work and why?

These are not fully thought through answers, but illustrate some thoughts
or the matter.

Richard

-- 
Personal [EMAIL PROTECTED]http://www.waveney.org
Telecoms [EMAIL PROTECTED]  http://www.WaveneyConsulting.com
Web services [EMAIL PROTECTED]http://www.wavwebs.com
Independent Telecomms Specialist, ATM expert, Web Analyst  Services



Re: MethodMaker techniques in Perl 6

2004-04-26 Thread Jonathan Scott Duff
On Sun, Apr 25, 2004 at 08:16:30PM -0700, Dave Whipp wrote:
 Abhijit A. Mahabal wrote:
 
  *{Foo::name1} = - $a { $a-{name1} };
 
 If I read A12 correctly, this could be written as:
 
  Foo::$name1 := - $a {$a.name1};
 
 
 
 Could be; that sounds somewhat right, but could you point out where in A12
 because a search for := revelaed nothing relevant to me.
 
 
 Sorry, the assignment part came from A6 (and, rechecking, it seems to 
 use ::= when assigning to a sub). 

It all depends on what you mean.  := is run-time aliasing, ::= is
compile-time aliasing. So, if it really were Foo::name1, then ::=
would be fine, but if it were Foo::$name then it probably needs to be
:=  (I'd guess that if perl knew what $name was by the time that it
got to compiling Foo::$name, then ::= would work just fine)

 The ability to say pkg::$name came from A12.

I'm fairly sure that you have to parenthesize interpolated things, so
all of those above should look like this:

Foo::($name) := - $a { $a.name1 };

See http://dev.perl.org/perl6/apocalypse/A12.html#Class_Name_Semantics
(Or was there someplace that said simple scalars need not be
parenthesized?)

-Scott
-- 
Jonathan Scott Duff
[EMAIL PROTECTED]


Re: A12: Exporation

2004-04-26 Thread Aaron Sherman
On Fri, 2004-04-23 at 19:52, Damian Conway wrote:
 Aaron Sherman wrote:

  Now, I know that the Apoc on modules has not been written, and by that
  time Larry will have thought of this, but I thought I'd point out that
  some mechanism will have to exist in modules to indicate not only that
  they acquire certain subroutines, variables, etc. of other modules, but
  that they re-export them as their own.
 
 My proposal for that issue is just:

Damian, Larry not to contradict you, but over the weekend, I had an idea
that may help (and might be tangential to the other ways of doing this).
If we have the syntax:

class a { does b; }

for classes and roles, then wouldn't it make sense to say:

module b { sub x() is export {...} }
module a { does b; }

to say that a also exports all of b's exportables (including x). In
theory that should allow a to re-export b in a structured manner,
including tags, etc.

IMPLEMENTATION DETAILS:

In a more general sense, could we say that a role is a module with a bit
of extra class-specific behavior, but the does method is defined inside
of MetaModule, and inherited by MetaRole, and overridden as invalid by
MetaClass? That is:

class MetaModule { method does() {...} }
class MetaRole { is MetaModule; }
class MetaClass {
is MetaModule;
method does() {
throw SyntaxError, Can only call 'does' in Roles;
}
}

At least logically, though the Meta* gang might be written in Parrot or
be part of the compiler

This seems to me to be the cleanest way to have module a absorb the
calling interface of module b.

-- 
Aaron Sherman [EMAIL PROTECTED]
Senior Systems Engineer and Toolsmith
It's the sound of a satellite saying, 'get me down!' -Shriekback




Re: Compatibility with perl 5

2004-04-26 Thread Larry Wall
On Thu, Apr 15, 2004 at 07:23:28PM +0200, Johan Vromans wrote:
: Ten years ago I was perfectly happy to start all my perl programs with
: /usr/bin/perl5. Today, I would be quite unhappy if I *still* needed to
: do it that way.

In general it's probably a lousy idea to rely on #!/usr/bin/perl6 to
select language since you want the version number to select the
version of Parrot you're running, not the version of Perl.

One thing that occurred to me over the weekend is that we could fix all
the one-liners using a similar strategy to the package/module/class
switch.  It would be a (roughly) zero growth option to simply
switch to :x syntax for command-line switches instead of -x syntax.
Any program that uses colon switches instead of minus switches would
then automatically be assumed to be in Perl 6.

So maybe a minimal Perl 6 marker would be something like

#!/usr/bin/perl :
#!/usr/bin/perl ::
#!/usr/bin/perl :6

Larry


Re: Compatibility with perl 5

2004-04-26 Thread Simon Cozens
[EMAIL PROTECTED] (Larry Wall) writes:
 It would be a (roughly) zero growth option to simply
 switch to :x syntax for command-line switches instead of -x syntax.

And POSIX be damned!

-- 
A person is smart. People are dumb, panicky dangerous animals and you know it.
- Agent J, Men in Black


Re: Compatibility with perl 5

2004-04-26 Thread Larry Wall
On Mon, Apr 26, 2004 at 06:48:56PM +0100, Simon Cozens wrote:
: [EMAIL PROTECTED] (Larry Wall) writes:
:  It would be a (roughly) zero growth option to simply
:  switch to :x syntax for command-line switches instead of -x syntax.
: 
: And POSIX be damned!

And maybe we should rename POSIX to NEGIX while we're at it...

Larry


Re: Compatibility with perl 5

2004-04-26 Thread Juerd
Jonathan Scott Duff skribis 2004-04-26 13:02 (-0500):
 I know this sounds slightly irrational but I don't like using shifted
 characters to offset my command line switches.  Also, that colon seems
 *way* overloaded.  :-)  How about = instead?

Overloaded, but similar to :pairs and s:modifiers.

   #!/usr/bin/perl =
   #!/usr/bin/perl =6

Feels like something is missing. Like a LHS.

I like - for command line switches.


Juerd


Re: Compatibility with perl 5

2004-04-26 Thread Rod Adams
Larry Wall wrote:

In general it's probably a lousy idea to rely on #!/usr/bin/perl6 to
select language since you want the version number to select the
version of Parrot you're running, not the version of Perl.
One thing that occurred to me over the weekend is that we could fix all
the one-liners using a similar strategy to the package/module/class
switch.  It would be a (roughly) zero growth option to simply
switch to :x syntax for command-line switches instead of -x syntax.
Any program that uses colon switches instead of minus switches would
then automatically be assumed to be in Perl 6.
So maybe a minimal Perl 6 marker would be something like

   #!/usr/bin/perl :
   #!/usr/bin/perl ::
   #!/usr/bin/perl :6
Larry

 

Uhm... What exactly is wrong with

#!/usr/bin/perl -M6

?
-- Rod


Re: Compatibility with perl 5

2004-04-26 Thread Corris Randall
why not add a -6 perl flag:

perl -6 foo.pl

perl -6e 'print yahoo\n'

-corris

On Apr 26, 2004, at 11:09 AM, Juerd wrote:

Jonathan Scott Duff skribis 2004-04-26 13:02 (-0500):
I know this sounds slightly irrational but I don't like using shifted
characters to offset my command line switches.  Also, that colon seems
*way* overloaded.  :-)  How about = instead?
Overloaded, but similar to :pairs and s:modifiers.

#!/usr/bin/perl =
#!/usr/bin/perl =6
Feels like something is missing. Like a LHS.

I like - for command line switches.

Juerd



Re: Compatibility with perl 5

2004-04-26 Thread Randal L. Schwartz
 Larry == Larry Wall [EMAIL PROTECTED] writes:

Larry   It would be a (roughly) zero growth option to simply
Larry switch to :x syntax for command-line switches instead of -x syntax.
Larry Any program that uses colon switches instead of minus switches would
Larry then automatically be assumed to be in Perl 6.

Boy, when Larry says I get the colon, he really had plans for it.

:-)

Perl8 will look like:

 ::  : : :: :: ::: :;

(note the semicolon line terminator, to be replaced by a colon in Perl9).

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


Re: Compatibility with perl 5

2004-04-26 Thread Randy W. Sims
On 4/26/2004 2:16 PM, Rod Adams wrote:

Larry Wall wrote:

In general it's probably a lousy idea to rely on #!/usr/bin/perl6 to
select language since you want the version number to select the
version of Parrot you're running, not the version of Perl.
One thing that occurred to me over the weekend is that we could fix all
the one-liners using a similar strategy to the package/module/class
switch.  It would be a (roughly) zero growth option to simply
switch to :x syntax for command-line switches instead of -x syntax.
Any program that uses colon switches instead of minus switches would
then automatically be assumed to be in Perl 6.
So maybe a minimal Perl 6 marker would be something like

   #!/usr/bin/perl :
   #!/usr/bin/perl ::
   #!/usr/bin/perl :6
ick


Uhm... What exactly is wrong with

#!/usr/bin/perl -M6
What is wrong with a pragma

use lang perl = 6;

where the version is optional? This will still work on the commandline:

perl -Mlang,perl,6 -e 'blah'

it will also work in a file to allow (possibly in the future) embedding 
other languages or parrot assembler. It's unambiguous. It could also 
allow hooks for Inline::* modules to be called in the same consistent way.

Randy.