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

Suggestion from MS-DOS #18

Open
Vershner opened this issue Apr 21, 2022 · 2 comments
Open

Suggestion from MS-DOS #18

Vershner opened this issue Apr 21, 2022 · 2 comments

Comments

@Vershner
Copy link

Just saw your talk at NDC Oslo - marvellous!

Here's a great feature from MS-DOS batch script:
Variables whose contents start with a non-zero integer are considered to be numbers. Okay...
Variables whose contents start with "0x" are considered to be hex. That's not too bad, but...
Variables whose contents start with"0" are considered to be octal. Err....
...except, of course, 08 & 09 are not valid octal and so throw an error whenever they're evaluated.

Years ago I spent weeks trying to figure out why my weekly backup script would occasionally fail.

I think this has great potential to be expanded as well:
Variables starting with "01" should be assumed to be binary.
Variables starting with "00" should be assumed to be international telephone numbers.

@barkermn01
Copy link

barkermn01 commented Jun 7, 2022

that as good till the last bit,

Variables starting with "00" should be assumed to be international telephone numbers.

telephone numbers are strings of numeric characters otherwise the 0's would be dropped from the start so that would have to be 00 assumed to be a string.

@Argavyon
Copy link

Argavyon commented Sep 13, 2024

I believe you mean "literals" rather than "variables"
Speaking of, each numeric representation should be its own type. When operating two numeric types, they will both be cast to a base equal to two thirds of the sum of the operands' bases, if that is an integer, or to unary otherwise (programmers should be advised to make sure two thirds of the sum of the bases of all their different base numbers is always an integer for performance reasons).

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

3 participants