Collect all declared variables at start of program execution
This commit is contained in:
@@ -6,59 +6,64 @@ initialise-binding scope
|
||||
(integers)),
|
||||
map
|
||||
( ),
|
||||
map
|
||||
( ),
|
||||
bind
|
||||
("y",
|
||||
allocate-variable
|
||||
(integers)),
|
||||
map
|
||||
( ),
|
||||
map
|
||||
( )),
|
||||
sequential
|
||||
(assign
|
||||
(initialise-variable
|
||||
(bound "x",
|
||||
int-mul
|
||||
(decimal-natural
|
||||
("10"),
|
||||
decimal-natural
|
||||
("10"))),
|
||||
print assigned
|
||||
(bound
|
||||
("x")),
|
||||
scope
|
||||
(collateral
|
||||
(bind
|
||||
("x",
|
||||
allocate-variable
|
||||
(integers)),
|
||||
bind
|
||||
("y",
|
||||
allocate-variable
|
||||
(integers)),
|
||||
map
|
||||
( ),
|
||||
map
|
||||
( ),
|
||||
map
|
||||
( )),
|
||||
sequential
|
||||
(assign
|
||||
(bound "x",
|
||||
decimal-natural
|
||||
("10")),
|
||||
assign
|
||||
(bound "y",
|
||||
int-mul
|
||||
(assigned
|
||||
(bound
|
||||
("x")),
|
||||
assigned
|
||||
(bound
|
||||
("x")))),
|
||||
print assigned
|
||||
(bound
|
||||
("x")),
|
||||
print assigned
|
||||
(bound
|
||||
("y")))),
|
||||
print assigned
|
||||
(bound
|
||||
("y"))))
|
||||
print
|
||||
(to-string assigned bound
|
||||
"x",
|
||||
"
|
||||
"),
|
||||
initialise-variable
|
||||
(bound "y",
|
||||
decimal-natural
|
||||
("5")),
|
||||
if-else
|
||||
(true,
|
||||
scope
|
||||
(collateral
|
||||
(bind
|
||||
("y",
|
||||
allocate-variable
|
||||
(integers)),
|
||||
map
|
||||
( ),
|
||||
map
|
||||
( )),
|
||||
sequential
|
||||
(initialise-variable
|
||||
(bound "y",
|
||||
int-mul
|
||||
(assigned bound
|
||||
"x",
|
||||
assigned bound
|
||||
"x")),
|
||||
print
|
||||
(to-string assigned bound
|
||||
"x",
|
||||
"
|
||||
"),
|
||||
print
|
||||
(to-string assigned bound
|
||||
"y",
|
||||
"
|
||||
"))),
|
||||
null),
|
||||
print
|
||||
(to-string assigned bound
|
||||
"y",
|
||||
"
|
||||
")))
|
||||
Reference in New Issue
Block a user