Re: [julia-users] Re: printing UInt displays hex instead of decimal

2015-09-21 Thread Stefan Karpinski
Not really, since the argument seems to be that unsigned integer types should be used widely for indexes and offsets into arrays, rather than just for bit patterns. The argument against using unsigned integers for anything arithmetic, including indexes and sizes is the following. If all your code

Re: [julia-users] Re: printing UInt displays hex instead of decimal

2015-09-20 Thread Jesse Johnson
On 09/20/2015 04:11 PM, Milan Bouchet-Valat wrote: > > The point is, in Julia using unsigned ints to store values that should > always be positive is *not* recommended. This is starting to get off my main topic of consistently printing numerical types and allowing the user to change the default

Re: [julia-users] Re: printing UInt displays hex instead of decimal

2015-09-20 Thread Scott Jones
That is a bug though, you should submit an issue about it on GitHub. Somehow, when it prints a 2D array, it seems to lose the information that those are UInt64 values, not Int values. On Sunday, September 20, 2015 at 4:31:03 PM UTC-4, Jesse Johnson wrote: > > Thanks, I wasn't sure of the nomencla

Re: [julia-users] Re: printing UInt displays hex instead of decimal

2015-09-20 Thread Jesse Johnson
Thanks, I wasn't sure of the nomenclature. Why is print producing different results for the 1D and 2D array? On 09/20/2015 04:29 PM, Zheng Wendell wrote: > `b` is a 2-dimensional array. > > On Sun, Sep 20, 2015 at 9:59 PM, Jesse Johnson > mailto:holocronwea...@gmail.com>> wrote: > > That is pa

Re: [julia-users] Re: printing UInt displays hex instead of decimal

2015-09-20 Thread Zheng Wendell
`b` is a 2-dimensional array. On Sun, Sep 20, 2015 at 9:59 PM, Jesse Johnson wrote: > That is part of the inconsistency I was referring to. IMO a single default > representation for a value should be used everywhere. > > Further, in 0.4rc1 there seems to be another, more serious inconsistency: >

Re: [julia-users] Re: printing UInt displays hex instead of decimal

2015-09-20 Thread Milan Bouchet-Valat
Le mercredi 16 septembre 2015 à 21:06 -0400, Jesse Johnson a écrit : > That looks like it would fit my use case well. Is this the issue we > should use to discuss getting this merged in? I am willing to help > test and debug. > > https://github.com/JuliaLang/Formatting.jl/issues/8 > > Summarizing

Re: [julia-users] Re: printing UInt displays hex instead of decimal

2015-09-20 Thread Jesse Johnson
That is part of the inconsistency I was referring to. IMO a single default representation for a value should be used everywhere. Further, in 0.4rc1 there seems to be another, more serious inconsistency: decimal is being printed for UInt column vectors and hex for row vectors. a = UInt[] for n::UI

Re: [julia-users] Re: printing UInt displays hex instead of decimal

2015-09-17 Thread Tom Breloff
If I understand correctly, the "returned value" is really calling this: function display(d::REPLDisplay, ::MIME"text/plain", x) > io = outstream(d.repl) > Base.have_color && write(io, answer_color(d.repl)) > writemime(io, MIME("text/plain"), x) > println(io) > end > display(d::REPL

[julia-users] Re: printing UInt displays hex instead of decimal

2015-09-17 Thread Sisyphuss
This is not "printing" but "returned value" Try `a[1]`, you get 0x0001 Try `print(a[1])`, you get 1 So overload `print` if ever needed. On Wednesday, September 16, 2015 at 11:34:33 PM UTC+2, holocro...@gmail.com wrote: > > In Julia 0.4rc1, when I create a UInt, either as an individu

Re: [julia-users] Re: printing UInt displays hex instead of decimal

2015-09-16 Thread Scott Jones
I've been meaning to review that and comment, as I thought your ideas for it were very good, and it is something I'd want to be able to use in the not too distant future. I plead startup stress! Also, no matter how much I might like it, I can't merge diddlysquat!

Re: [julia-users] Re: printing UInt displays hex instead of decimal

2015-09-16 Thread Tom Breloff
Well, everyone kinda checks everything, so if your concern it whether someone will see it, they probably have. If you want to talk through design/wishlist in detail, then a github issue in formatting is best (I think). If you start a new issue, please link from here. On Wed, Sep 16, 2015 at 9:06

Re: [julia-users] Re: printing UInt displays hex instead of decimal

2015-09-16 Thread Jesse Johnson
That looks like it would fit my use case well. Is this the issue we should use to discuss getting this merged in? I am willing to help test and debug. https://github.com/JuliaLang/Formatting.jl/issues/8 Summarizing my argument so far: In order to promote the practice of using UInt to explicitly

Re: [julia-users] Re: printing UInt displays hex instead of decimal

2015-09-16 Thread Tom Breloff
> > Maybe there should be an interface for declaring the default output format > for a specific type, similar to stream formatting in C++? I started down this path, made a PR to Formatting, but no one ever commented or merged it, so I assume no one cares about this functionality. Here it is if yo

[julia-users] Re: printing UInt displays hex instead of decimal

2015-09-16 Thread J Luis
I also find that the hex printing without specifically requiring it is very annoying. quarta-feira, 16 de Setembro de 2015 às 23:08:23 UTC+1, holocro...@gmail.com escreveu: > > On Wednesday, September 16, 2015 at 5:38:30 PM UTC-4, Steven G. Johnson > wrote: > >> It's not a bug, it's intentional

[julia-users] Re: printing UInt displays hex instead of decimal

2015-09-16 Thread holocronweaver
On Wednesday, September 16, 2015 at 5:38:30 PM UTC-4, Steven G. Johnson wrote: > It's not a bug, it's intentional. The feeling is that most applications > of UInt** types are using them as bitstrings, in which cases a hex display > is more useful. > UInt is very useful for catching signed in

[julia-users] Re: printing UInt displays hex instead of decimal

2015-09-16 Thread Steven G. Johnson
On Wednesday, September 16, 2015 at 5:34:33 PM UTC-4, holocro...@gmail.com wrote: > > This annoys me because 98% of the time I want the decimal representation. > Decimal is shown for Int, so why is hex the default for UInt? Is it a bug? > It's not a bug, it's intentional. The feeling is that