{"issue":{"user":{"id":153596,"login":"StefanKarpinski","url":"https://api.github.com/users/StefanKarpinski","avatar_url":"https://secure.gravatar.com/avatar/21aeae1f260365557523718bc19640f7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"21aeae1f260365557523718bc19640f7"},"milestone":null,"title":"allow all Int types where integers are expected","created_at":"2011-12-14T18:12:37Z","labels":[{"name":"enhancements","url":"https://api.github.com/repos/JuliaLang/julia/labels/enhancements","color":"0b02e1"}],"state":"open","updated_at":"2011-12-21T01:32:36Z","id":2555773,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"html_url":"https://github.com/JuliaLang/julia/issues/311","closed_at":null,"body":"Currently we use `Long` a lot where any integer would make sense. This makes thing brittle, especially across architectures since the behavior on 32-bit machines and 64-bit machines is different. The difference is good for performance and because it keeps us honest. We need to systematically go through and make sure you can use any type of `Int` anywhere that a `Long` or any other integer type works. There are several approaches to this:\r\n\r\n- write a core method that works only for `Long` and then add a more general method that converts first\r\n- make the core method accept any `Int` value but do `long` conversion on the value before using it\r\n- let all kinds of Int values just seep through the code but make sure that all core operations accept all integer types.\r\n\r\nI'm not sure what's best from the performance perspective. The last option seems like the best from the ease-of-coding perspective.","number":311,"url":"https://api.github.com/repos/JuliaLang/julia/issues/311","comments":5,"assignee":null},"comment":{"user":{"id":744556,"login":"JeffBezanson","url":"https://api.github.com/users/JeffBezanson","avatar_url":"https://secure.gravatar.com/avatar/b4b8db23d8096b722483a57d21b7d65d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b4b8db23d8096b722483a57d21b7d65d"},"created_at":"2011-12-21T01:32:36Z","updated_at":"2011-12-21T01:32:36Z","id":3228264,"body":"There is danger of excessive code generation here; you don't really want `ref(a,Int8,Int16)`, `ref(a,Int32,Int8)`, etc. Whether we allow more int types as arguments in general or not, we should try to keep everything `Long` as much as possible. The reason is simply that using different scalar int types does not have much value. \r\n\r\n`show_trailing_hex` exists for the sole purpose of printing the various different integer types that exist; as such it is not itself a use case for integers of different types.\r\n\r\nAs an example, many scheme implementations support homogeneous numeric vectors of many types, but they do not generally have corresponding scalar types. Getting an element from an int16 vector gives an ordinary scheme integer of unspecified size. We don't have to do that, but it tells you a lot of smart people thought that was a reasonable design.","url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/3228264"},"action":"created"}