Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
20
Task/Variables/Logo/variables.logo
Normal file
20
Task/Variables/Logo/variables.logo
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
make "g1 0
|
||||
name 2 "g2 ; same as make with parameters reversed
|
||||
global "g3 ; no initial value
|
||||
to func :x
|
||||
make "g4 4 ; still global
|
||||
localmake "L1 6
|
||||
local ["L2 "L3] ; local variables, collection syntax
|
||||
func2 :g4
|
||||
print :L2 ; 9, modified by func2
|
||||
print :L3 ; L3 has no value, was not modified by func2
|
||||
end
|
||||
to func2 :y
|
||||
make "g3 :y
|
||||
make "L2 :L1 + 3 ; dynamic scope: can see variables of callers
|
||||
localmake "L3 5 ; locally override L3 from caller
|
||||
(print :y :L1 :L2 :L3) ; 4 6 9 5
|
||||
end
|
||||
print :g4 ; 4
|
||||
print :L1 ; L1 has no value
|
||||
print name? "L1 ; false, L1 is not bound in the current scope
|
||||
Loading…
Add table
Add a link
Reference in a new issue