in reply to Re^5: why are hex values not numbers?
in thread why are hex values not numbers?
A string containing just decimal digits, can only be a number.You could just as easily say a string containing just octal, or binary or hexadecimal digits, can only be a number.
A decimal number might be a "leetspeak" word if you were wanting to be cryptic.
Perl determines from *context* if the user is trying to use a variable as a number or a string. If the user tries to perform addition on a string -- it tries to see if the string looks like a number and allows it if it does. But there is no reason it needs to be limited to decimal digits. This is even more evident if you consider octal digits as an example. Using a rule of 'leading 0' for octal or 'leading 0x' for hex seem fairly safe -- can you give an example where doing so would be a problem?
Come-on BuK, question the status quo! ;-)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: why are hex values not numbers?
by hippo (Bishop) on Sep 27, 2016 at 12:21 UTC | |
by perl-diddler (Chaplain) on Sep 27, 2016 at 16:48 UTC | |
by BrowserUk (Patriarch) on Sep 27, 2016 at 17:31 UTC | |
by perl-diddler (Chaplain) on Sep 27, 2016 at 20:03 UTC | |
by BrowserUk (Patriarch) on Sep 27, 2016 at 20:13 UTC | |
| |
Re^7: why are hex values not numbers?
by BrowserUk (Patriarch) on Sep 27, 2016 at 12:33 UTC | |
by perl-diddler (Chaplain) on Sep 27, 2016 at 16:51 UTC |
In Section
Seekers of Perl Wisdom