On Wed, Nov 2, 2016 at 4:27 AM, Martin Steffen <martin.sput...@gmail.com> wrote:
>
> So calling the use of "ok"  an ``untyped boolean'' it seems a bit
> Go-specific (and/or go-implementation-centric)
> terminology. Indeed the section about "constants" (mentioned in an earlier
> reply) sheds some light,  in
> that it's a special case of how the Go specification speaks about typing
> issues surrounding literals.

It's Go-specific, but in the context of Go it's meaningful.  It's not
implementation-centric.  Remember that in Go if you write

type B1 bool
type B2 bool
var v1 B1
var v2 B2

then it is a type error to write

v1 = v2

So an untyped boolean, like an untyped int, etc., is a value that can
be assigned to any type whose underlying type is bool without
requiring a type conversion.

It may help to read https://golang.org/blog/constants.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to