Update a bunch of io to IO in docs.

This commit is contained in:
Kyle Marek-Spartz
2014-02-16 11:28:56 -06:00
parent 719139a446
commit 3f96637274
7 changed files with 24 additions and 24 deletions
+7 -7
View File
@@ -12,7 +12,7 @@ defined, it can be accessed by name as you would expect.
:::dart
var animal = "Slow Loris"
io.write(animal) // Prints "Slow Loris".
IO.write(animal) // Prints "Slow Loris".
## Scope
@@ -21,11 +21,11 @@ defined until the end of the block where that definition appears.
:::dart
{
io.write(a) // ERROR! a doesn't exist yet.
IO.write(a) // ERROR! a doesn't exist yet.
var a = 123
io.write(a) // "123"
IO.write(a) // "123"
}
io.write(a) // ERROR! a doesn't exist anymore.
IO.write(a) // ERROR! a doesn't exist anymore.
Variables defined at the top level of a script are *global*. All other variables
are *local*. Declaring a variable in an inner scope with the same name as an
@@ -36,9 +36,9 @@ something you likely intend to do much).
var a = "outer"
{
var a = "inner"
io.write(a) // Prints "inner".
IO.write(a) // Prints "inner".
}
io.write(a) // Prints "outer".
IO.write(a) // Prints "outer".
Declaring a variable with the same name in the *same* scope *is* an error.
@@ -63,6 +63,6 @@ assigned value.
:::dart
var a = "before"
io.write(a = "after") // Prints "after".
IO.write(a = "after") // Prints "after".
**TODO: Forward references for globals, closures.**