You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first example was a -r (rewrite) flag on gofmt itself, which uses a simple pattern-matching language to enable expression-level rewrites. For instance, one day we introduced a default value for the right-hand side of a slice expression: the length itself. The entire Go source tree was updated to use this default with the single command:
gofmt -r 'a[b:len(a)] -> a[b:]'
A key point about this transformation is that, because the input and output are both in the canonical format, the only changes made to the source code are semantic ones.
What did you expect to see?
the only changes made to the source code are semantic syntactic ones.
For me this sentence feels like there should be stated "syntactic" instead of "semantic" since the semantics of the code doesn't change by applying the transformation.
The text was updated successfully, but these errors were encountered:
I'm confused.
Then why are language features like these called syntactic sugar?
Probably we just have different view points concerning the transformation and how this should map to the sentence in the article.
The 2012/splash.article says:
What did you expect to see?
the only changes made to the source code are
semanticsyntactic ones.For me this sentence feels like there should be stated "syntactic" instead of "semantic" since the semantics of the code doesn't change by applying the transformation.
The text was updated successfully, but these errors were encountered: