Re: Expunge use English from Perl?

2000-10-02 Thread Bryan C . Warnock

On Wed, 27 Sep 2000, Nathan Wiger wrote:
 Yeah, I've never liked the _ syntax, I've always thought it was weird
 (to say the least). I think grouping file tests would be much cleaner. 

As long as you are okay with having to restat for 'or' clauses.
(There are work arounds, and supposedly 'this or that' is less common
for file tests.)

 -- 
Bryan C. Warnock
([EMAIL PROTECTED])



Re: Expunge use English from Perl?

2000-10-02 Thread Jarkko Hietaniemi

On Mon, Oct 02, 2000 at 07:32:42AM -0400, Bryan C. Warnock wrote:
 On Wed, 27 Sep 2000, Nathan Wiger wrote:
  Yeah, I've never liked the _ syntax, I've always thought it was weird
  (to say the least). I think grouping file tests would be much cleaner. 
 
 As long as you are okay with having to restat for 'or' clauses.
 (There are work arounds, and supposedly 'this or that' is less common
 for file tests.)

A rather sweeping statement.  ANDing makes more sense for the
permissions checks, but ORing makes more sense for the type checks.
For example, I can imagine -f $foo || -l $foo being a rather common idiom.

  -- 
 Bryan C. Warnock
 ([EMAIL PROTECTED])

-- 
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen



Re: Expunge use English from Perl? (was Re: Perl6Storm: Intent toRFC #0101)

2000-09-28 Thread Andy Dougherty

On Wed, 27 Sep 2000, Nathan Wiger wrote:

 Russ Allbery wrote:
 
  I've found the use of use English in code I had to maintain to be annoying
  and unhelpful, and to actually degrade the maintainability of the code

 Y'know, I couldn't have said this better myself. :-) I've always felt
 that "use English" was a waste of time and effort, a bandaid trying to
 act as a tourniquet.

Well, I think it has some limited uses.  Remember that not everyone
programs in perl all day everyday.  Many competent people are only
occasionally perl programmers.

I find that I don't remember many of the less-frequently-used perlvars
(where less-frequently-used depends on the types of programs I write,
obviously).  I certainly couldn't tell you off-hand the differences among
$ $ $( and $).  I'd have to look them up.  I think it's a nice little
bit of optional sugar and I don't see any reason to throw it away.

-- 
Andy Dougherty  [EMAIL PROTECTED]
Dept. of Physics
Lafayette College, Easton PA 18042




Re: Expunge use English from Perl? (was Re: Perl6Storm: Intent to RFC #0101)

2000-09-28 Thread Simon Cozens

On Thu, Sep 28, 2000 at 10:00:49AM -0400, Andy Dougherty wrote:
 On Wed, 27 Sep 2000, Nathan Wiger wrote:
  Y'know, I couldn't have said this better myself. :-) I've always felt
  that "use English" was a waste of time and effort, a bandaid trying to
  act as a tourniquet.

 I think it's a nice little bit of optional sugar and I don't see any reason
 to throw it away.
 
The key point is that it's optional. If you think it's a waste of time and
effort, don't use it. If other people use it, well... does Perl stop people
programming in ways you don't like?

-- 
It is better to wear chains than to believe you are free, and weight
yourself down with invisible chains.



Re: Expunge use English from Perl? (was Re: Perl6Storm: Intent to RFC #0101)

2000-09-28 Thread Russ Allbery

Andy Dougherty [EMAIL PROTECTED] writes:

 I find that I don't remember many of the less-frequently-used perlvars
 (where less-frequently-used depends on the types of programs I write,
 obviously).  I certainly couldn't tell you off-hand the differences
 among $ $ $( and $).  I'd have to look them up.

I never understood why these were variables.  You don't change UIDs or
GIDs that often, and when you do you tend to want precise control and
because they're variables, they have weird interaction semantics and you
have to assign to them in just the right order to get done what you want
to get done.  See recent threads on comp.lang.perl.moderated.

I'd honestly rather see getuid, geteuid, getgid, getegid, and getgroups,
along with some consistent and complete subset of the setting functions
(with portability magic behind the scenes), in a separate module that only
those programs that need to do UID fiddling need to load.

I guess the exception is getpwuid($), which is probably done more than
any other operation on UIDs, but maybe just keep that single variable.

-- 
Russ Allbery ([EMAIL PROTECTED]) http://www.eyrie.org/~eagle/



Re: Expunge use English from Perl? (was Re: Perl6Storm: Intent to RFC #0101)

2000-09-28 Thread Nathan Wiger

Simon Cozens wrote:
 
 On Thu, Sep 28, 2000 at 10:00:49AM -0400, Andy Dougherty wrote:
  On Wed, 27 Sep 2000, Nathan Wiger wrote:
   Y'know, I couldn't have said this better myself. :-) I've always felt
   that "use English" was a waste of time and effort, a bandaid trying to
   act as a tourniquet.
 
  I think it's a nice little bit of optional sugar and I don't see any reason
  to throw it away.
 
 The key point is that it's optional. If you think it's a waste of time and
 effort, don't use it. If other people use it, well... does Perl stop people
 programming in ways you don't like?

I agree with you. That's why I'd never RFC that we should lose it.* I
was just voicing my opinion that I personally think it's a waste. But
that doesn't mean others don't like it. ;-)

-Nate

* assuming it doesn't harm the language, which it doesn't currently



Re: Expunge use English from Perl? (was Re: Perl6Storm: Intent to RFC #0101)

2000-09-27 Thread Adam Turoff

On Wed, Sep 27, 2000 at 04:39:32PM -0700, Nathan Wiger wrote:
 
 My personal feeling is that I'd love "use English" to be expunged from
 the language altogether - it's unnecessary bloat that only increases the
 number of mistakes that people can make. But I'm not sure if I have the
 guts to write that RFC just yet. ;-)

Are you talking about the overlong variable names?

Aliasing -X is being proposed through a 'use english;' mechanism.

Z.




Re: Expunge use English from Perl? (was Re: Perl6Storm: Intent to RFC #0101)

2000-09-27 Thread Robert Mathews

Adam Turoff wrote:
 
 On Wed, Sep 27, 2000 at 04:39:32PM -0700, Nathan Wiger wrote:
 
  My personal feeling is that I'd love "use English" to be expunged from
  the language altogether - it's unnecessary bloat that only increases the
  number of mistakes that people can make. But I'm not sure if I have the
  guts to write that RFC just yet. ;-)
 
 Are you talking about the overlong variable names?
 
 Aliasing -X is being proposed through a 'use english;' mechanism.

It's a good thing we've got Larry Wall to untie the Gordian knot of
perl6.  One rfc to add more english, one to take it away.

-- 
Robert Mathews
Software Engineer
Excite@Home



Re: Expunge use English from Perl?

2000-09-27 Thread Nathan Wiger

  My personal feeling is that I'd love "use English" to be expunged from
  the language altogether - it's unnecessary bloat that only increases the
  number of mistakes that people can make. But I'm not sure if I have the
  guts to write that RFC just yet. ;-)
 
 Are you talking about the overlong variable names?
 
 Aliasing -X is being proposed through a 'use english;' mechanism.

Yes, but perhaps a little bit of both. Truthfully, I've always seen long
alternatives as useless bloat, not used widely over the long term. Once
people learn the shortcuts, they use them.

Expunging "use English" may will improve Perl syntax, since it's one
less way to do things with already dubious value. Yes, the overlong
variable names are a waste of time, IMO, because I've never seen them
used in "real code". It's almost a rite of passage to take off the
training wheels and use the "real names" of the variables. Who wants to
write $INPUT_RECORD_SEPARATOR when you can write $/ ? 

I'm not vehemently opposed to "use English", or even the long
alternatives to -r and -w that RFC 290 proposes. But I do think,
truthfully:

   1. They don't solve the real syntactic problems

   2. Very few people will ever use them long-term

So if they bloat the language, we should consider expunging them. They
certainly bloat Camel with duplicate definitions. And I consider the
mneumonic of $! much stronger than $ERRNO (or was that $OS_ERROR or
$SYS_ERROR or ??)

Personally, my stance is that we should all come to accept that we use
and love a language with a syntax that drives many people mad. Not
everyone's gonna like Perl, so I think we should just accept it and move
on.

-Nate



Re: Expunge use English from Perl?

2000-09-27 Thread Adam Turoff

On Wed, Sep 27, 2000 at 05:11:30PM -0700, Nathan Wiger wrote:
 Yes, but perhaps a little bit of both. Truthfully, I've always seen long
 alternatives as useless bloat, not used widely over the long term. Once
 people learn the shortcuts, they use them.
 
 Expunging "use English" may will improve Perl syntax, since it's one
 less way to do things with already dubious value. 

A lot of use English has to do with aliasing global variable linenoise,
which is already going away.  For instance, $/ is becoming per-handle,
and $: (?) is probably going away because it has nasty 
action-at-a-distance properties, and FORTRAN programmers never use it
to offset the zero-index to one.  (Abigail uses it to make japhs that
bizarrely store the number 17.)

It has nothing to do with improving the syntax though, because everything
in use English is a variable that serves as a reference to some other
variable.
 
 I'm not vehemently opposed to "use English", or even the long
 alternatives to -r and -w that RFC 290 proposes. But I do think,
 truthfully:
 
1. They don't solve the real syntactic problems

No, because the syntactic problems are -s(FH)/2, and that is
solved by fsize(FH)/2 iff -s is replaced with fsize (or a better
spelling thereof).

2. Very few people will ever use them long-term

I dunno.  I remember looking at some code that used '-x _' that
had half a department befuddled.  -rwx FH is better, and gets rid
of the special case bare _ syntax.

Z.




Re: Expunge use English from Perl?

2000-09-27 Thread Nathan Wiger

Adam Turoff wrote:
 
 It has nothing to do with improving the syntax though, because everything
 in use English is a variable that serves as a reference to some other
 variable.

Yes, and that's why I really think it's a waste of time. ;-)
 
  I'm not vehemently opposed to "use English"... But I do think,
 
 1. They don't solve the real syntactic problems
 
 No, because the syntactic problems are -s(FH)/2, and that is
 solved by fsize(FH)/2 iff -s is replaced with fsize (or a better
 spelling thereof).

This is one thing that I'm scared most of, and that is having two
alternatives which work only in certain contexts. I'm sure p5p has
already extensively looked at -s(FH)/2 being "wickedly broken" (as I
believe Tom put it), but the solution should theoretically be to make
-s(FH)/2 work.

The consensus has already pretty much said that they want -s et all to
stick around. So if RFC 290's idea is still to replace -X, then I'm very
much against it. But I was under the impression that they're just "use
english" alternatives.

If, however, these alternatives fix bugs that -X can't handle, then
that's not good.

I'll dig through the p5p archives and toke.c to see if any wisdom is
magically imparted on me. ;-)
 
 2. Very few people will ever use them long-term
 
 I dunno.  I remember looking at some code that used '-x _' that
 had half a department befuddled.  -rwx FH is better, and gets rid
 of the special case bare _ syntax.

Yeah, I've never liked the _ syntax, I've always thought it was weird
(to say the least). I think grouping file tests would be much cleaner. 

-Nate