summaryrefslogtreecommitdiff
path: root/examples/scopeing.fy
blob: 2e36c2cb3760077da3bec3427f24ab56ca22ee59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#*
 * Examples of how to use scopeing
 *#

my foo = 1;

{
	# Prints out 1
	assert 1 == (put defined foo);

	{
		my bar = 2;

		# Prints out 1
		assert 1 == (put defined bar);
	}

	# Prints out 0
	assert 0 == (put defined bar);

	my baz = 3;
}

# Prints out 0
assert 0 == (say defined bar);