Skip to content

Reserve more numeric types #138

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

Closed
wants to merge 1 commit into from
Closed

Reserve more numeric types #138

wants to merge 1 commit into from

Conversation

emberian
Copy link
Member

No description provided.

@sinistersnare
Copy link

Does this include uints?

@huonw
Copy link
Member

huonw commented Jun 26, 2014

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
Copy link
Member

huonw commented Jun 26, 2014

Does this include uints?

There is explicit mention of u128.

@sinistersnare
Copy link

@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
Member 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
Member Author

(uints were an oversight)

@sinistersnare
Copy link

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

@huonw
Copy link
Member

huonw commented Jun 26, 2014

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
Member Author

Actually, this is entirely unnecessary.

@emberian emberian closed this Jun 26, 2014
@sinistersnare
Copy link

@cmr care to explain?

@alexchandel
Copy link

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
Member 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
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