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

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

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.

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

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.

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

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

Re: Compatibility with perl 5

2004-04-15 Thread Aaron Sherman
On Wed, 2004-04-14 at 21:23, Gregor N. Purdy wrote: Lets try that again, since I think you parsed my email in a way I didn't intend (and its at least 50% my fault) Hey! *I* have to step up for 50% of the blame now? Where's my lawyer! ;-) In my opinion, starting a script with #!/usr/bin/perl6

Re: Compatibility with perl 5

2004-04-15 Thread zsdc
Gregor N. Purdy wrote: Personally, I view Perl 6 as such a completely new language (although still Perlish in spirit, it is very different in other respects), that I would be perfectly happy to be required to start all my Perl 6 programs with #!/usr/bin/perl6 instead of #!/usr/bin/perl, just the

Re: Compatibility with perl 5

2004-04-15 Thread Johan Vromans
Gregor N. Purdy [EMAIL PROTECTED] writes: ... that I would be perfectly happy to be required to start all my Perl 6 programs with #!/usr/bin/perl6 instead of #!/usr/bin/perl, Ten years ago I was perfectly happy to start all my perl programs with /usr/bin/perl5. Today, I would be quite unhappy

Re: Compatibility with perl 5

2004-04-15 Thread Aaron Sherman
On Thu, 2004-04-15 at 13:23, Johan Vromans wrote: Gregor N. Purdy [EMAIL PROTECTED] writes: ... that I would be perfectly happy to be required to start all my Perl 6 programs with #!/usr/bin/perl6 instead of #!/usr/bin/perl, Ten years ago I was perfectly happy to start all my perl

Re: Compatibility with perl 5

2004-04-14 Thread Gregor N. Purdy
So, we are moving in a more verbose direction, which is a bummer for people who like to write one-liners and other tiny programs. Assuming only Perl 6 is installed on your system, if your script started with: #!/usr/bin/perl all the stuff about trying to figure out what version you are using

Re: Compatibility with perl 5

2004-04-14 Thread Aaron Sherman
On Wed, 2004-04-14 at 09:29, Gregor N. Purdy wrote: So, we are moving in a more verbose direction, which is a bummer for people who like to write one-liners and other tiny programs. perl6 -i.bak -ple 'rule octet {\d{1,2}|[01]\d{2}|2[[1-4]\d|5[1-5]]}

Re: Compatibility with perl 5

2004-04-14 Thread Brent 'Dax' Royal-Gordon
Aaron Sherman wrote: On Wed, 2004-04-14 at 09:29, Gregor N. Purdy wrote: So, we are moving in a more verbose direction, which is a bummer for people who like to write one-liners and other tiny programs. perl6 -i.bak -ple 'rule octet {\d{1,2}|[01]\d{2}|2[[1-4]\d|5[1-5]]}

Re: Compatibility with perl 5

2004-04-14 Thread Gregor N. Purdy
Lets try that again, since I think you parsed my email in a way I didn't intend (and its at least 50% my fault) -- In my opinion, starting a script with #!/usr/bin/perl6 should force the interpreter to treat it like Perl 6, and if it does anything else that's just ugly. Similarly,

Re: Compatibility with perl 5

2004-04-14 Thread Gregor N. Purdy
Brent -- I think I missed your point. I'll refer to your two code chunks as (a) and (b). Maybe you are getting at a finer point, though... What you've said in (a) is pretty much what I hinted about Inline::Perl6 in my message. If you pass it to a Perl 6 interpreter, then it will probably use

Compatibility with perl 5

2004-04-13 Thread David Cantrell
A few days ago I briefly discussed with Nicholas Clark (current perl 5.8 pumpking) about making perl5 code forward-compatible with perl6. A quick look through the mailing list archives didn't turn up anything obvious, and I don't recall any mechanism being presented in any of the Apocalypses, so

Re: Compatibility with perl 5

2004-04-13 Thread Mark J. Reed
On 2004-04-13 at 13:16:02, David Cantrell wrote: Perl 6, we are promised, will try to run legacy code unchanged. How will it spot such legacy code? My understanding has been that perl6 will assume a program is Perl 5 unless it sees a Perl 6 keyword such as 'module' or 'class'. -- Mark

Re: Compatibility with perl 5

2004-04-13 Thread Matthew Walton
Mark J. Reed wrote: On 2004-04-13 at 13:16:02, David Cantrell wrote: Perl 6, we are promised, will try to run legacy code unchanged. How will it spot such legacy code? My understanding has been that perl6 will assume a program is Perl 5 unless it sees a Perl 6 keyword such as 'module' or

Re: Compatibility with perl 5

2004-04-13 Thread Juerd
David Cantrell skribis 2004-04-13 13:16 (+0100): Perl 6, we are promised, will try to run legacy code unchanged. How will it spot such legacy code? Doing this reliably is a hard problem, but we can make it easier. I suggest that people put: use perl5; Why change what already works?

Re: Compatibility with perl 5

2004-04-13 Thread David Cantrell
On Tue, Apr 13, 2004 at 02:27:08PM +0200, Juerd wrote: David Cantrell skribis 2004-04-13 13:16 (+0100): Perl 6, we are promised, will try to run legacy code unchanged. How will it spot such legacy code? Doing this reliably is a hard problem, but we can make it easier. I suggest that

Re: Compatibility with perl 5

2004-04-13 Thread Thomas A. Boyer
Matthew Walton wrote: Mark J. Reed wrote: On 2004-04-13 at 13:16:02, David Cantrell wrote: Perl 6, we are promised, will try to run legacy code unchanged. How will it spot such legacy code? My understanding has been that perl6 will assume a program is Perl 5 unless it sees a Perl 6

Re: Compatibility with perl 5

2004-04-13 Thread Matthew Walton
Thomas A. Boyer wrote: Matthew Walton wrote: That could be problematic, because if Perl 6 sees something like: my %myhash; %myhash{'foo'} = 'bar'; Is it going to think 'ahah, perl 6' or 'perl 5 with errors'? It's going to think 'ahah', perl 5'. Because it doesn't contain any Perl 6 keyword

Re: Compatibility with perl 5

2004-04-13 Thread Luke Palmer
David Cantrell writes: A few days ago I briefly discussed with Nicholas Clark (current perl 5.8 pumpking) about making perl5 code forward-compatible with perl6. A quick look through the mailing list archives didn't turn up anything obvious, and I don't recall any mechanism being presented in

Re: Compatibility with perl 5

2004-04-13 Thread Dan Sugalski
At 4:07 PM +0100 4/13/04, Matthew Walton wrote: Thomas A. Boyer wrote: Matthew Walton wrote: That could be problematic, because if Perl 6 sees something like: my %myhash; %myhash{'foo'} = 'bar'; Is it going to think 'ahah, perl 6' or 'perl 5 with errors'? It's going to think 'ahah', perl 5'.

Re: Compatibility with perl 5

2004-04-13 Thread Thomas A. Boyer
Matthew Walton wrote: Thomas A. Boyer wrote: Matthew Walton wrote: That could be problematic, because if Perl 6 sees something like: my %myhash; %myhash{'foo'} = 'bar'; It's going to think 'ahah', perl 5'. Because it doesn't contain any Perl 6 keyword (such as 'module' or 'class'), as Mark

Re: Compatibility with perl 5

2004-04-13 Thread Matthew Walton
Thomas A. Boyer wrote: The original question was how do I label my code as Perl 5? The correct answer, according to Apocalypse 1, is to start your source with package. If you didn't want to put your code in a package, then start it with package main. The other question was how do I label my

Re: Compatibility with perl 5

2004-04-13 Thread Aaron Sherman
On Tue, 2004-04-13 at 11:16, Thomas A. Boyer wrote: Here is the relevant paragraph from the apocalypse: I hereby declare that a |package| declaration at the front of a file unambiguously indicates you are parsing Perl 5 code. If you want to write a Perl 6 module or class, it'll start

Re: Compatibility with perl 5

2004-04-13 Thread David Cantrell
On Tue, Apr 13, 2004 at 09:16:21AM -0600, Thomas A. Boyer wrote: The original question was how do I label my code as Perl 5? The correct answer, according to Apocalypse 1, is to start your source with package. If you didn't want to put your code in a package, then start it with package