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

Consider renaming str, int, etc. to Str, Int, Etc. #7275

Closed
bstrie opened this issue Jun 21, 2013 · 4 comments
Closed

Consider renaming str, int, etc. to Str, Int, Etc. #7275

bstrie opened this issue Jun 21, 2013 · 4 comments

Comments

@bstrie
Copy link
Contributor

bstrie commented Jun 21, 2013

< bstrie> I'm starting to think that maybe it *would* be better if str
          and int etc. were Str and Int for the sake of consistency...
          was there a good reason that's not the case, other than legacy
          reasons?
< bstrie> because I'm reading tjc's slides and it does stick out that
          those types are lowercase unlike all other types
<@brson> bstrie: it stuck out to me too. that was one of the noob q's i
         asked him during his rehearsal
< aatch> I'd prefer keeping all the primitive types as lower-case though
<@brson> Java and C# are precedents
< aatch> I'm not too bothered about str though
< strcat> what makes them a primitive type though?
< dbaupp> strcat: hard-coded into the compiler & corresponding to machine
          operations?
< aatch> Does the CPU itself have some notion of it? For most types, no,
         but it does understand about integers and floats.
< Eridius> bstrie: I haven't read any backscroll, but I rather like the
           idea that intrinsic types are lowercased
< Eridius> (not traits though)
< strcat> aatch: LLVM represents signed/unsigned integers as the same type
<@brson> we could turn str and vec into lang items
< steven_is_false> Java has the boxing reason for why int, and such are
                   lower case. There is no such reason for Rust.
< strcat> aatch: uint vs int is a distinction made by rust
<@brson> if str and vec were lang items they wouldn't have to have so
         many awkward traits to hold their impls
<@brson> since they would be user-defined types
< strcat> brson: why not make everything a lang item then? ;p
< aatch> strcat, so? LLVM does make a distinction between signed and
         unsigned versions of operations.
< strcat> aatch: not the integer ops
< dbaupp> brson: that would presumably require DST? (it sounds nice
          though! move more things to libraries.)

Let's try not to get too bikesheddy here.

Arguments in favor of changing to uppercase:

  • Every other type in the language is uppercased, so we get consistency.
  • Will head off questions from new users.
  • We really have no coherent concept of "primitive types", so a distinction doesn't make sense.

Arguments in favor of leaving them lowercase:

  • Slightly easier to type.
@graydon
Copy link
Contributor

graydon commented Jun 21, 2013

Primitive types have single lexeme literals.

@jdm
Copy link
Contributor

jdm commented Jun 22, 2013

Types like U8 become a bit shouty when capitalized.

@brson
Copy link
Contributor

brson commented Jul 10, 2013

nominating

@catamorphism
Copy link
Contributor

wontfix

flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 24, 2022
Migrate `dbg_macro` to late pass

changelog: Make `dbg_macro` work with crate level attributes and inside macro calls

One down for rust-lang#6610, fixes rust-lang#7275

Also fixes rust-lang#7274, and adds parenthesis around the suggestion for `dbg!(1, 2, 3)` as it expands to a tuple
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

5 participants