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

backticks

2004-04-14 Thread Juerd
Perl 5 has the qx// operator which does readpipe. I believe the function for it was added later. (It doesn't handle a LIST as system does, unfortunately.) qx// is also known as ``. Two backticks. readpipe/qx/`` isn't used much. In all my @INC, only a handful of uses can be found. Most are in

Re: backticks

2004-04-14 Thread Matthijs van Duin
On Wed, Apr 14, 2004 at 02:18:48PM +0200, Juerd wrote: I propose to use ` as a simple hash subscriptor, as an alternative to {} and . It would only be useable for \w+ keys or perhaps -?\w+. As with methods, a simple atomic (term exists only in perlreftut, afaix, but I don't know another word to

Re: backticks

2004-04-14 Thread Jonathan Scott Duff
On Wed, Apr 14, 2004 at 12:07:18PM -0700, chromatic wrote: On Wed, 2004-04-14 at 05:18, Juerd wrote: I think %hash`key makes sense. But I'd like to find out if more people like this idea. How do you request a hash slice with backticks? I think you wouldn't. For that the more verbose

Re: backticks

2004-04-14 Thread Juerd
chromatic skribis 2004-04-14 12:07 (-0700): I think %hash`key makes sense. But I'd like to find out if more people like this idea. How do you request a hash slice with backticks? You don't. There are %foofoo bar and %foo{'foo', 'bar'} already and hash slices aren't used much at all. The

Re: backticks

2004-04-14 Thread chromatic
On Wed, 2004-04-14 at 12:24, Juerd wrote: chromatic skribis 2004-04-14 12:07 (-0700): I think %hash`key makes sense. But I'd like to find out if more people like this idea. How do you request a hash slice with backticks? You don't. There are %foofoo bar and %foo{'foo', 'bar'} already

Re: backticks

2004-04-14 Thread John Williams
On Wed, 14 Apr 2004, Juerd wrote: I propose to use ` as a simple hash subscriptor, as an alternative to {} and . It would only be useable for \w+ keys or perhaps -?\w+. As with methods, a simple atomic (term exists only in perlreftut, afaix, but I don't know another word to describe a simple

Re: backticks

2004-04-14 Thread Juerd
chromatic skribis 2004-04-14 12:32 (-0700): That's exactly my objection to this idea. I think it goes too far to make simple things simpler while making complex things impossible. Absolutely false. This is an addition to the already existing {}, which should stay. %foo{ something } will still

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: backticks

2004-04-14 Thread Juerd
John Williams skribis 2004-04-14 13:36 (-0600): On Wed, 14 Apr 2004, Juerd wrote: I propose to use ` as a simple hash subscriptor, as an alternative to {} and . It would only be useable for \w+ keys or perhaps -?\w+. As with methods, a simple atomic (term exists only in perlreftut, afaix,

Re: backticks

2004-04-14 Thread Scott Walters
When I announced that I fixed a version of Perl6::Variables to do , crickets chirped. I dislike having to place a lot of matching quotes, brackets, parenthesis, and braces in my code. You must stop and visually inspect code to make sure it balances out and even then is a common source of bug

Re: backticks

2004-04-14 Thread Matthew Walton
Juerd wrote: chromatic skribis 2004-04-14 12:32 (-0700): That's exactly my objection to this idea. I think it goes too far to make simple things simpler while making complex things impossible. Absolutely false. This is an addition to the already existing {}, which should stay. %foo{

Re: backticks

2004-04-14 Thread Juerd
Scott Walters skribis 2004-04-14 13:12 (-0700): Second, autovivication is impossible for the same reason. We can't tell from parsing this lone expression whether baz should be converted to numbers or strings automatically. I want ` for hashes in the first place. Having it for arrays too would

Re: backticks

2004-04-14 Thread Aaron Sherman
On Wed, 2004-04-14 at 08:18, Juerd wrote: Perl 5 has the qx// operator which does readpipe. I believe the function for it was added later. (It doesn't handle a LIST as system does, unfortunately.) qx// is also known as ``. Two backticks. readpipe/qx/`` isn't used much. In all my @INC, only a

Re: backticks

2004-04-14 Thread Juerd
Matthew Walton skribis 2004-04-14 21:23 (+0100): %foo$bar doesn't quite do the same as %foo{$bar}. That's one method, really - being like {' '}, and really just carrying on the very familiar idea of different kinds of quotes. Like ' and . The thing works as if there is an implicit {}

Re: backticks

2004-04-14 Thread Randal L. Schwartz
Juerd == Juerd [EMAIL PROTECTED] writes: Juerd readpipe/qx/`` isn't used much. In all my @INC, only a handful of uses Juerd can be found. Most are in Debian's modules. That's because they aren't particularly interesting in modules, but in 10 line scripts, they show up quite frequently. This

Re: backticks

2004-04-14 Thread Matthijs van Duin
On Wed, Apr 14, 2004 at 01:56:35PM -0700, Randal L. Schwartz wrote: That's because they aren't particularly interesting in modules, but in 10 line scripts, they show up quite frequently. This undermines the rest of your request. No, actually, it doesn't. Juerd doesn't seem to like ``, but that

Re: backticks

2004-04-14 Thread Juerd
Randal L. Schwartz skribis 2004-04-14 13:56 (-0700): Juerd == Juerd [EMAIL PROTECTED] writes: Juerd readpipe/qx/`` isn't used much. In all my @INC, only a handful of uses Juerd can be found. Most are in Debian's modules. That's because they aren't particularly interesting in modules, but in

Re: backticks

2004-04-14 Thread Simon Cozens
[EMAIL PROTECTED] (Aaron Sherman) writes: $ find . -name \*.pl | wc -l 330 $ find . -name \*.pl -exec grep -hlE 'qx|`|`|readpipe' {} \; | wc -l 123 `` gets used an awful lot But that's in Perl 5, which is a glue language. -- Though a program be but

Re: backticks

2004-04-14 Thread Matthijs van Duin
On Wed, Apr 14, 2004 at 01:36:21PM -0600, John Williams wrote: %hash`$key oops, you contradicted yourself here. only be useable for \w+ keys I guess you disliked his idea so much you didn't bother to read what exactly he said, right? As with methods, a simple [...] scalar should be usable

Re: backticks

2004-04-14 Thread Jarkko Hietaniemi
hash slices aren't used much at all. People *always* overgeneralize.

Re: backticks

2004-04-14 Thread Scott Walters
Juerd, You'd do well to not remove the conclusion of my post when the conclusion is that the I strongly support you. Otherwise, your reply, read out of context, sounds like you're fending off an attacker ;) People would do well to seperate the merits of the idea from the merits of the suggested

Re: backticks

2004-04-14 Thread Scott Walters
I propose we pretend that $$foo = 'bar' stills work and use that as a benchmark for hash subscripting ease. If it requires fewer keystrokes or neuron fires to write Perl 4 code, then Perl 6 might be succeding on the programming in the small but failing at programming in the large. ${'bar'} =

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: backticks

2004-04-14 Thread Luke Palmer
Scott Walters writes: Juerd, You'd do well to not remove the conclusion of my post when the conclusion is that the I strongly support you. Otherwise, your reply, read out of context, sounds like you're fending off an attacker ;) People would do well to seperate the merits of the idea from

RE: backticks

2004-04-14 Thread Chris
Perhaps this is naive, but couldn't something like this be achieved in a manner similar to how I just implemented it in Ruby? Surely Perl will have similar capabilities to handle unknown methods. class Hash def method_missing(method_name) str = method.id2name if str =~ /^\w+$/

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: backticks

2004-04-14 Thread Joe Gottman
- Original Message - From: Simon Cozens [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 14, 2004 5:04 PM Subject: Re: backticks [EMAIL PROTECTED] (Aaron Sherman) writes: $ find . -name \*.pl | wc -l 330 $ find . -name \*.pl -exec grep

Re: backticks

2004-04-14 Thread Jonathan Scott Duff
On Wed, Apr 14, 2004 at 10:31:23PM -0400, Joe Gottman wrote: [EMAIL PROTECTED] (Aaron Sherman) writes: $ find . -name \*.pl | wc -l 330 $ find . -name \*.pl -exec grep -hlE 'qx|`|`|readpipe' {} \; | wc -l 123 `` gets used an awful lot

Re: backticks

2004-04-14 Thread Dave Whipp
Jonathan Scott Duff [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Wed, Apr 14, 2004 at 10:31:23PM -0400, Joe Gottman wrote: And Perl 6 isn't? I use backticks quite a bit in Perl, and I don't see that changing if I upgrade to Perl 6. Me too, but I write my backticks like

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

Re: backticks

2004-04-14 Thread David Storrs
On Wed, Apr 14, 2004 at 10:06:23PM +0200, Juerd wrote: If on your keyboard ` is in a worse place than {}, I'd like to know where it is. Juerd Very top row, one space right of the F12 key. Extremely awkward. (This is a US keyboard on a Dell Inspiron 5100 laptop.) Please put me down as