On Sun, Oct 28, 2018 at 2:54 AM,  <alan.f...@gmail.com> wrote:
> OK, that's a fair point.
>
> So how about this then. The default (no tag) would be determined by the
> compiler depending on what major version was being used to build the
> application. If you were using Go 2.0, 2.1 etc, then the absence of the tag
> would mean that new keywords would be treated as such and couldn't therefore
> be used as ordinary identifiers.
>
> However, you could still build code which didn't use the new features with
> version 2.x of the compiler by adding a "go 1" tag to the package clause.
>
> By the time Go 3.0 came along, you'd have the choice of building 'old' code
> with the new compiler by including either the "go 1" or "go 2" tag. New code
> wouldn't need any tag but wouldn't be able to use new keywords as ordinary
> identifiers.
>
> TBH I don't know of any other language that has used this approach. They've
> either said: hey, it's a new keyword - get used to it - or matters have been
> arranged so that new keywords are always contextual and can therefore be
> used as ordinary identifiers outside that context. The latter approach has
> had some success (take C# for example) but can distort the language somewhat
> if a non-optimal approach is used for new features just to fit in with this
> philosophy.

To me this seems similar to the approach outlined in
https://golang.org/issue/28221, but that approach doesn't require any
tags.

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