RosettaCodeData/Task/Scope-modifiers/Bracmat/scope-modifiers-1.bracmat

14 lines
399 B
Plaintext

67:?x {x has global scope}
& 77:?y { y has global scope }
& ( double
=
. !y+!y { y refers to the variable declared in myFunc, which
shadows the global variable with the same name }
)
& ( myFunc
= y,z { y and z have dynamic scope. z is never used. }
. !arg:?y { arg is dynamically scoped }
& double$
& !x+!y
)