Re: RFC: Highlander Variables

2000-08-03 Thread Andy Wardley

On Aug 2,  4:37pm, Ted Ashton wrote:
   With all due respect, it appears that you are trading two characters for
 six with little to show for it.  Currently, we have
   @array  -- the array as a whole
[...]
   $array__list  -- the array as a whole

I didn't make that part clear.  I was simply suggesting that this would
one possible way for the Perl5-Perl6 translator to handle the case where
a script uses more than one variable of the same name.  It would need
to change the name of one or more of the variables to avoid conflict.

@array would still be @array.


A


-- 
Andy Wardley [EMAIL PROTECTED]   Signature regenerating.  Please remain seated.
 [EMAIL PROTECTED]   For a good time: http://www.kfs.org/~abw/



Re: RFC: Highlander Variables

2000-08-03 Thread Ted Ashton

Thus it was written in the epistle of Andy Wardley,
 
 I'm not assaulting Perl's flexibility or syntax.  Nor am I suggesting
 that you, Randal or anyone else is particularly confused by this.  I'm
 simply making a Request For Comments on a suggestion on how some of
 Perl's syntax might be made less "weird" (their choice of words, not mine).
 We may not decide to make it less weird, which is fine by me, but if we
 do, then this is one way in which we might do so. I *personally* can see
 the teaching advantage, but no-one is obliged to agree with me.  :-)
 
 Please also note that at no point did I suggest making exceptions for
 $ARGV/@ARGV, etc.  I just flagged them as issues that needed addressing.

Andy,
  Agreed about the ARGV business.  It would have to be addressed and I had
no illusions that you suggested it as an exception.  Further, I do not feel
threatened, insulted, assaulted or even just salted :-).  We recognized that
you were making a Request For Comments and, helpful folks that we are, we were
supplying the comments.  
  One of the difficult things in this business of ours is knowing where to be
in the ease-of-learning vs. power issue.  It is even more difficult when trying
to decide where to be in a system one is not writing oneself which will be 
learned by students one is not teaching.  
  In this case, I *think* that the learning curve is worth the advantages of
having the symbols we have, but I am only one voice.

Ted
-- 
Ted Ashton ([EMAIL PROTECTED]), Info Sys, Southern Adventist University
  ==   
To isolate mathematics from the practical demands of the sciences is to
invite the sterility of a cow shut away from the bulls.
-- Chebyshev
  ==   
 Deep thoughts to be found at http://www.southern.edu/~ashted



Re: RFC: Highlander Variables

2000-08-02 Thread Randal L. Schwartz

 "John" == John Porter [EMAIL PROTECTED] writes:

John Imho, this is A Bad Practice.  Making it impossible would therefore 
John be Good, existing-script-breakage not withstanding.

So you'll break $ARGV and @ARGV?  Is that really OK?

And will you extend this to ensuring that scalars, arrays, hashes,
subroutines, filehandles, formats, directory handles, and labels all
have distinct names?

I don't see a teaching advantage in saying "the three variable
namespaces are all one, but all the other namespaces are distinct".
When the rule gets longer, it gets harder to teach.  And if it's
harder to teach, it's probably harder to learn.

(Maybe we can just add something to that ever-increasing "-w" to do
this.  Make it a warning for beginners.)

I'll argue the opposite... "related things" can have similar names.  I
do it all the time.  I think it makes sense.  It also makes glob-ish
things similar, although I understand this is a separate issue up for
grabs.

-- 
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: RFC: Highlander Variables

2000-08-02 Thread H . Merijn Brand

On Wed, 2 Aug 2000 12:29:41 -0400, John Porter [EMAIL PROTECTED] wrote:
 H.Merijn Brand wrote:
  
  If I could, I would VETO!
 
 If I could, I would mandate this change.  This is definitely in my
 Top 10 List of Perl 5 Suckinesses.

So here we differ. That's what discussions are for.

  This would break about 90% of my scripts.
 
 Some large percentage of your scripts is going to break anyway.

Hope not. I have grown a habit of pretty clean programming, using -w and use
strict all the way.

  I use the same name for different
  type of variables to group them:
 
 Imho, this is A Bad Practice.  Making it impossible would therefore 
 be Good, existing-script-breakage not withstanding.

I think you cannot say "A bad practice". It's a way of thinking. I'm glad
Tom's with me on this, except that he refers to global variables that might be
deemed anyway.

We're not thinking like in C where every variable `should' be prefixed with
it's type, like p_var for a pointer to a variable or t_var for defining the
type for var. In perl I just LOVE the way $, @, % and  unambiguously defines
the type of the var. I just miss a prefix for formats (which will be dropped
anyway) and IO.

I'd hate to see my code being converted to (as suggested):

$foo__array = qw(monday tuesday wednesday thursday friday saturday
sunday);
$foo = 4;
print $foo__array[$foo], "\n";

YUK!

-- 
H.Merijn Brand   Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)
using perl5.005.03, 5.6.0  516 on HP-UX 10.20, HP-UX 11.00, AIX 4.2, AIX 4.3,
 DEC OSF/1 4.0 and WinNT 4.0 SP-6a,  often with Tk800.022 and/or DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/




Re: RFC: Highlander Variables

2000-08-02 Thread Simon Cozens

On Wed, Aug 02, 2000 at 04:32:40PM +0100, Andy Wardley wrote:
 This would permit the rationalisation and simplification of the syntax
 required to access individual elements or slices of arrays and hash arrays,
 while remaining backwardly compatible with Perl5 syntax.

This is the rationale? Sounds a bit of assault on Perl's flexibility for this
little gain. As Randal said, there's no teaching advantage in it.

-- 
"The Amiga is the only personal computer where you can run a multitasking 
operating system and get realtime performance, out of the box."
-- Peter da Silva