I'd like you to review this change to
spec: fix description of initialization
The analysis does not depend on the values of the items.
Fixes issue 4648.
Please review this at https://codereview.appspot.com/7593050/
@@ -1,6 +1,6 @@
"Title": "The Go Programming Language Specification",
- "Subtitle": "Version of March 15, 2013",
+ "Subtitle": "Version of March 20, 2013",
@@ -5602,16 +5602,19 @@
Within a package, package-level variables are initialized,
and constant values are determined, in
-data-dependent order: if the initializer of <code>A</code>
-depends on the value of <code>B</code>, <code>A</code>
+topological reference order: if the initializer of <code>A</code>
+depends on <code>B</code>, <code>A</code>
will be set after <code>B</code>.
-It is an error if such dependencies form a cycle.
-Dependency analysis is done lexically: <code>A</code>
+Dependency analysis does not depend on the actual values
+of the items being initialized, only on their appearance
+in the source.
depends on <code>B</code> if the value of <code>A</code>
contains a mention of <code>B</code>, contains a value
mentions <code>B</code>, or mentions a function that
mentions <code>B</code>, recursively.
+It is an error if such dependencies form a cycle.
If two items are not interdependent, they will be initialized
in the order they appear in the source.
Since the dependency analysis is done per package, it can produce
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
For more options, visit https://groups.google.com/groups/opt_out.