On Wednesday, 2 November 2016 11:24:38 UTC-4, Martin Steffen wrote:
>
> I meant more: the _terminology_ of being untyped may reflect an internal
> treatment of how the go compiler treats
> those things: inside the go-compiler, the ``static phase''/type
> checker/type inferencer may treat
> for
Thanks.
I may have been imprecise using ``implementation specific''. I did not mean
it in the
C-like manner that the ``meaning'' of some (typed) value depends on the
platform (length of some words) or the choice of the compiler
writer for a given platform.
I meant more: the _terminology_
On Wed, Nov 2, 2016 at 4:27 AM, Martin Steffen 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
Thanks for all the replies. Basically it is more like a puzzlement over
choice of terminology,
not so much what the meaning resp. purpose of the ``special form'' of
assignments (with ``ok'') is.
So calling the use of "ok" an ``untyped boolean'' it seems a bit
Go-specific (and/or
On Wed, Nov 2, 2016 at 9:09 AM Martin Steffen
wrote:
> How should one interpret that? If ok behaves like a boolean, why is it
considered as untyped?
Because, in this special case, it really is untyped. It works the same way
as untyped {int,float,...} constants, ie. an
It's a constant literal until it's used in a typed context.
This section explains it in detail:
https://golang.org/ref/spec#Constants
On Wed, Nov 2, 2016 at 6:09 AM, Martin Steffen
wrote:
> Hi, in the language spec, e.g. in connection with ``type assertions'' and
>
Hi, in the language spec, e.g. in connection with ``type assertions'' and
``special forms'', like
v, ok = x.(T)
it's stated that it yield (in ok) an additional value which is both untyped
and boolean
(an ``untyped boolean value'').
How should one interpret that? If ok behaves like a