Skip to content

Reserve more numeric types#138

Closed
emberian wants to merge 1 commit into
rust-lang:masterfrom
emberian:reserve-numeric-types
Closed

Reserve more numeric types#138
emberian wants to merge 1 commit into
rust-lang:masterfrom
emberian:reserve-numeric-types

Conversation

@emberian

Copy link
Copy Markdown
Contributor

No description provided.

@sinistersnare

Copy link
Copy Markdown

Does this include uints?

@huonw

huonw commented Jun 26, 2014

Copy link
Copy Markdown
Contributor

I'm not really sure this is necessary. Built-in types like int are not keywords now, and 1f128 doesn't tokenise, so AFAICT there no backward compatibility concern from either of those.

Does rust plan on adding support for arbitrarily sized primitives? If so how will this work with it?

What do you mean by this/how does this relate?

@huonw

huonw commented Jun 26, 2014

Copy link
Copy Markdown
Contributor

Does this include uints?

There is explicit mention of u128.

@sinistersnare

Copy link
Copy Markdown

@huonw Yes i misread, but i reread and saw, and deleted my comment, but you were too quick!

Also, his grammar in the detailed design section does not mention uints.

@emberian

Copy link
Copy Markdown
Contributor Author

I'm not really sure this is necessary. Built-in types like int are not keywords now, and 1f128 doesn't tokenise, so AFAICT there no backward compatibility concern from either of those.

They are not keywords, but they are built-in in the type grammar, and you cannot introduce a new built-in without breaking code that used that identifier. 1f128 will not parse, but it does tokenize, as LIT_FLOAT(1f) LIT_INTEGER(128).

I will update to clarify.

@emberian

Copy link
Copy Markdown
Contributor Author

(uints were an oversight)

@sinistersnare

Copy link
Copy Markdown

I figure so, I just meant to point it out.

@huonw

huonw commented Jun 26, 2014

Copy link
Copy Markdown
Contributor

1f128 will not parse, but it does tokenize, as LIT_FLOAT(1f) LIT_INTEGER(128).

Ah, I was mistaken, sorry. In any case, 1f is no longer a valid float literal.

@emberian

Copy link
Copy Markdown
Contributor Author

Actually, this is entirely unnecessary.

@emberian emberian closed this Jun 26, 2014
@sinistersnare

Copy link
Copy Markdown

@cmr care to explain?

@alexchandel

Copy link
Copy Markdown

It's more than conceivable that we will need u128, i128, and f128, and maybe even f16.

Are you sure these are already in the grammar?

@emberian

Copy link
Copy Markdown
Contributor Author

This is legal today:

struct int;
struct f128;

Adding a built-in f128 would not break any code (modulo bugs in re-using those identifiers, which are just bugs in resolve), redefinitions using that name would just shadow it, as would imports etc.

@Ericson2314

Copy link
Copy Markdown
Contributor

On the flip side, should any numeric types parse, let alone tokenize specially?

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

Successfully merging this pull request may close these issues.

5 participants