Re: [go-nuts] Inconsistency in the casting int to byte

2018-11-18 Thread Gregory Graham
Thank for expanding on that. As a Go newbie, I didn't see how Jan's response answered your question, but you made it clear. On Sunday, November 18, 2018 at 4:34:00 PM UTC-6, gith...@gmail.com wrote: > > Thank you Jan, > I read the spec a bit more carefully after you pointed it out and I now > un

Re: [go-nuts] Inconsistency in the casting int to byte

2018-11-18 Thread github . 7i
Thank you Jan, I read the spec a bit more carefully after you pointed it out and I now understand that a constant and a non-constant value are treated differently and that my examples above is an example of just this. "A constant value x can be converted to type T if x is representable by a val

Re: [go-nuts] Inconsistency in the casting int to byte

2018-11-18 Thread Michael Jones
It feels awkward...I’ve always felt the limit should be removed after the innermost cast because that’s when the programmer has said “treat this as type A” and then says “treat an A as a B with every implication that a narrowing conversion causes.” On Sun, Nov 18, 2018 at 9:55 AM Jan Mercl <0xj...

Re: [go-nuts] Inconsistency in the casting int to byte

2018-11-18 Thread Jan Mercl
On Sun, Nov 18, 2018 at 6:42 PM wrote: It's consistent with the language specification ;-) A constant value x can be converted to type T if x is representable by a value of T. https://golang.org/ref/spec#Conversions -- -j -- You received this message because you are subscribed to the Goog