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

error message about numbers starting with 0 talks about octal, but that's not what I meant (say 02) #6266

Closed
p6rt opened this issue May 25, 2017 · 4 comments
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented May 25, 2017

Migrated from rt.perl.org#131361 (status was 'resolved')

Searchable as RT131361$

@p6rt
Copy link
Author

p6rt commented May 25, 2017

From @AlexDaniel

Code​:
say 02

Result​:
Potential difficulties​:
  Leading 0 does not indicate octal in Perl 6. Please use 0o2 if you mean that.
  at -e​:1
  ------> say 02⏏<EOL>
2

To see the problem with this error message, let's see this task from thinkperl6 book​:

3. In math notation, leading zeros are OK, as in 02. What happens if you try this in Perl?

Indeed, sometimes you'd think that leading zeros should do nothing. In fact, I remember myself writing numbers with leading zeros a couple of times, and I remember zero times I actually needed something in octal.

Is there any way we can improve the error message so that it includes this situation as well (i.e. using leading zeros to mean nothing)? Please also consider that 6 year old kids may not know what octal is, but the error message should be understandable anyway.

@p6rt
Copy link
Author

p6rt commented May 25, 2017

From @zoffixznet

On Thu, 25 May 2017 05​:35​:42 -0700, alex.jakimenko@​gmail.com wrote​:

Code​:
say 02

Result​:
Potential difficulties​:
Leading 0 does not indicate octal in Perl 6. Please use 0o2 if you
mean that.
at -e​:1
------> say 02⏏<EOL>
2

To see the problem with this error message, let's see this task from
thinkperl6 book​:

3. In math notation, leading zeros are OK, as in 02. What happens if
you try this in Perl?

Indeed, sometimes you'd think that leading zeros should do nothing. In
fact, I remember myself writing numbers with leading zeros a couple of
times, and I remember zero times I actually needed something in octal.

Is there any way we can improve the error message so that it includes
this situation as well (i.e. using leading zeros to mean nothing)?
Please also consider that 6 year old kids may not know what octal is,
but the error message should be understandable anyway.

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@b6694bd0b3
Tests​: none

@p6rt
Copy link
Author

p6rt commented May 25, 2017

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

@p6rt p6rt closed this as completed May 25, 2017
@p6rt
Copy link
Author

p6rt commented May 25, 2017

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt p6rt added the LTA Less Than Awesome; typically an error message that could be better label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better
Projects
None yet
Development

No branches or pull requests

1 participant