Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elseif should be elsif at blahblah.pl line 103. #9318

Closed
p5pRT opened this issue May 7, 2008 · 13 comments
Closed

elseif should be elsif at blahblah.pl line 103. #9318

p5pRT opened this issue May 7, 2008 · 13 comments

Comments

@p5pRT
Copy link

p5pRT commented May 7, 2008

Migrated from rt.perl.org#53808 (status was 'rejected')

Searchable as RT53808$

@p5pRT
Copy link
Author

p5pRT commented May 7, 2008

From ben.aveling@alcatel-lucent.com.au

Hi,

I've just received an error message saying​:

elseif should be elsif at blah.pl line 103.

What happened to do-what-I-mean?

Perl is usually pretty forgiving. In this case, it knows that I should
have typed elsif, so why does it care that I typed elseif? Why not just
treat it as if I'd typed elsif?

  Regards, Ben

--

Ben.Aveling@​alcatel-lucent.com.au

@p5pRT
Copy link
Author

p5pRT commented May 7, 2008

From cmasak@gmail.com

Ben (>)​:

I've just received an error message saying​:

elseif should be elsif at blah.pl line 103.

What happened to do-what-I-mean?

Perl is usually pretty forgiving. In this case, it knows that I should
have typed elsif, so why does it care that I typed elseif? Why not just
treat it as if I'd typed elsif?

I'm not sure laxity among keywords would really be a feature.
Correctly spelled, it's "elsif" in Perl, so why allow misspellings?

Allowing "elseif" would constitute having two reserved words pulling
the weight of one. Similarly allowing "whlie", "wehn" and "ulness"
just because it reduces compilation errors, is a bad idea.

// Carl

@p5pRT
Copy link
Author

p5pRT commented May 7, 2008

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented May 7, 2008

From allbery@ece.cmu.edu

On 2008 May 7, at 7​:21, Carl Mäsak wrote​:

Ben (>)​:

I've just received an error message saying​:

elseif should be elsif at blah.pl line 103.

What happened to do-what-I-mean?

I'm not sure laxity among keywords would really be a feature.
Correctly spelled, it's "elsif" in Perl, so why allow misspellings?

I thought WATFIV proved that this was a really bad idea....

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@​kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery@​ece.cmu.edu
electrical and computer engineering, carnegie mellon university KF8NH

@p5pRT
Copy link
Author

p5pRT commented May 12, 2008

From @smpeters

On Wed May 07 01​:41​:04 2008, ben.aveling@​alcatel-lucent.com.au wrote​:

Hi,

I've just received an error message saying​:

elseif should be elsif at blah.pl line 103.

What happened to do-what-I-mean?

Perl is usually pretty forgiving. In this case, it knows that I should
have typed elsif, so why does it care that I typed elseif? Why not just
treat it as if I'd typed elsif?

Unfortunately, the keyword is elsif, not elseif. Perl is simply nice
enough to warn you what your specific syntax error is in this case
rather than simply returning a syntax error.

Steve Peters

@p5pRT
Copy link
Author

p5pRT commented May 12, 2008

@smpeters - Status changed from 'open' to 'rejected'

@p5pRT p5pRT closed this as completed May 12, 2008
@p5pRT
Copy link
Author

p5pRT commented May 12, 2008

From @smpeters

On Wed May 07 01​:41​:04 2008, ben.aveling@​alcatel-lucent.com.au wrote​:

Hi,

I've just received an error message saying​:

elseif should be elsif at blah.pl line 103.

What happened to do-what-I-mean?

Perl is usually pretty forgiving. In this case, it knows that I should
have typed elsif, so why does it care that I typed elseif? Why not just
treat it as if I'd typed elsif?

Unfortunately, the keyword is elsif, not elseif. Perl is simply nice
enough to warn you what your specific syntax error is in this case
rather than simply returning a syntax error.

Steve Peters

@p5pRT
Copy link
Author

p5pRT commented May 13, 2008

From ben.aveling@alcatel-lucent.com.au

What happened to there's more than one way to do it? :-)

I can't say that using elsif instead of elseif or else if is a problem.
If this were any other language I wouldn't even ask, I'd just assume
there's only one way to do anything.

It just seems a bit unperl-like to say "I know what you mean but I won't
do it" and I was just wondering - why? Is it actually difficult, or is
this just a case where having only one way to say something is seen as
preferable?

  Regards, Ben

--
Ben.Aveling@​alcatel-lucent.com.au
W +61 2 8306 5069
M 0407 228 240

-----Original Message-----
From​: Steve Peters via RT [mailto​:perlbug-followup@​perl.org]
Sent​: Monday, 12 May 2008 23​:12
To​: AVELING BEN
Subject​: [perl #53808] elseif should be elsif at blahblah.pl line 103.

On Wed May 07 01​:41​:04 2008, ben.aveling@​alcatel-lucent.com.au wrote​:

Hi,

I've just received an error message saying​:

elseif should be elsif at blah.pl line 103.

What happened to do-what-I-mean?

Perl is usually pretty forgiving. In this case, it knows that I
should
have typed elsif, so why does it care that I typed elseif? Why not
just
treat it as if I'd typed elsif?

Unfortunately, the keyword is elsif, not elseif. Perl is simply nice
enough to warn you what your specific syntax error is in this case
rather than simply returning a syntax error.

Steve Peters

@p5pRT
Copy link
Author

p5pRT commented May 13, 2008

From @Abigail

On Tue, May 13, 2008 at 07​:25​:39AM +0800, AVELING BEN wrote​:

What happened to there's more than one way to do it? :-)

I can't say that using elsif instead of elseif or else if is a problem.
If this were any other language I wouldn't even ask, I'd just assume
there's only one way to do anything.

It just seems a bit unperl-like to say "I know what you mean but I won't
do it" and I was just wondering - why? Is it actually difficult, or is
this just a case where having only one way to say something is seen as
preferable?

Changing as it is now could potentially break code​:

  sub elseif (&) {say "--> ", &{$_ [0]}}

  if (1) {
  say "Hello, world"
  }
  elseif {
  "Foo"
  }

  __END__
  Hello, world
  --> Foo

I'd say, if we really wanted 'elseif' as an alias for 'elsif', it should
have been added right at the beginning. IMO, the benefits of adding it now
as small; I don't see that many requests for 'elseif' passing by.

Abigail

@p5pRT
Copy link
Author

p5pRT commented May 13, 2008

From @doughera88

On Tue, 13 May 2008, AVELING BEN wrote​:

What happened to there's more than one way to do it? :-)

I can't say that using elsif instead of elseif or else if is a problem.
If this were any other language I wouldn't even ask, I'd just assume
there's only one way to do anything.

It just seems a bit unperl-like to say "I know what you mean but I won't
do it" and I was just wondering - why? Is it actually difficult, or is
this just a case where having only one way to say something is seen as
preferable?

Your point is well taken. It's not at all difficult -- just change the
test in toke.c that issues the warning to return KEY_elsif. However, the
current way is rather firmly entrenched. If you run with -Mdiagnostics,
you'll get the following excerpt from pod/perldiag.pod​:

  =item elseif should be elsif

  (S syntax) There is no keyword "elseif" in Perl because Larry thinks
  it's ugly. Your code will be interpreted as an attempt to call a
  method named "elseif" for the class returned by the following block.
  This is unlikely to be what you want.

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented May 13, 2008

From @davidnicol

use Macrame;
macro elseif { elsif }

@p5pRT
Copy link
Author

p5pRT commented May 13, 2008

From @ysth

On Tue, May 13, 2008 2​:34 am, Abigail wrote​:

Changing as it is now could potentially break code​:

And syntax-highlighters, etc.

@p5pRT
Copy link
Author

p5pRT commented May 14, 2008

From ben.aveling@alcatel-lucent.com.au

Hi Andy,

I thought it would have to be something like that.

I can live with that answer.

  Thanks, Ben

PS. Abigail, thanks for the example - very... educational.

-----Original Message-----
From​: Andy Dougherty [mailto​:doughera@​lafayette.edu]
Sent​: Tuesday, 13 May 2008 22​:23
To​: AVELING BEN
Cc​: perlbug-followup@​perl.org
Subject​: RE​: [perl #53808] elseif should be elsif at blahblah.pl line
103.

On Tue, 13 May 2008, AVELING BEN wrote​:

What happened to there's more than one way to do it? :-)

I can't say that using elsif instead of elseif or else if is a
problem.
If this were any other language I wouldn't even ask, I'd just assume
there's only one way to do anything.

It just seems a bit unperl-like to say "I know what you mean but I
won't
do it" and I was just wondering - why? Is it actually difficult, or
is
this just a case where having only one way to say something is seen as
preferable?

Your point is well taken. It's not at all difficult -- just change the
test in toke.c that issues the warning to return KEY_elsif. However, the

current way is rather firmly entrenched. If you run with -Mdiagnostics,

you'll get the following excerpt from pod/perldiag.pod​:

  =item elseif should be elsif

  (S syntax) There is no keyword "elseif" in Perl because Larry thinks
  it's ugly. Your code will be interpreted as an attempt to call a
  method named "elseif" for the class returned by the following block.
  This is unlikely to be what you want.

--
  Andy Dougherty doughera@​lafayette.edu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant