September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
40
Task/Scope-modifiers/Bc/scope-modifiers.bc
Normal file
40
Task/Scope-modifiers/Bc/scope-modifiers.bc
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
define g(a) {
|
||||
auto b
|
||||
|
||||
b = 3
|
||||
|
||||
"Inside g: a = "; a
|
||||
"Inside g: b = "; b
|
||||
"Inside g: c = "; c
|
||||
"Inside g: d = "; d
|
||||
|
||||
a = 3; b = 3; c = 3; d = 3
|
||||
}
|
||||
|
||||
define f(a) {
|
||||
auto b, c
|
||||
|
||||
b = 2; c = 2
|
||||
"Inside f (before call): a = "; a
|
||||
"Inside f (before call): b = "; b
|
||||
"Inside f (before call): c = "; c
|
||||
"Inside f (before call): d = "; d
|
||||
x = g(2) /* Assignment prevents output of the return value */
|
||||
"Inside f (after call): a = "; a
|
||||
"Inside f (after call): b = "; b
|
||||
"Inside f (after call): c = "; c
|
||||
"Inside f (after call): d = "; d
|
||||
|
||||
a = 2; b = 2; c = 2; d = 2
|
||||
}
|
||||
|
||||
a = 1; b = 1; c = 1; d = 1
|
||||
"Global scope (before call): a = "; a
|
||||
"Global scope (before call): b = "; b
|
||||
"Global scope (before call): c = "; c
|
||||
"Global scope (before call): d = "; d
|
||||
x = f(1)
|
||||
"Global scope (before call): a = "; a
|
||||
"Global scope (before call): b = "; b
|
||||
"Global scope (before call): c = "; c
|
||||
"Global scope (before call): d = "; d
|
||||
Loading…
Add table
Add a link
Reference in a new issue