File: Test10

package info (click to toggle)
omake 0.10.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,076 kB
  • sloc: ml: 49,729; ansic: 5,163; makefile: 688; sh: 110
file content (25 lines) | stat: -rw-r--r-- 349 bytes parent folder | download | duplicates (3)
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
x = 1
try
   x = 2
default
   x = 3
println($"""Without "export", x is $x""")
if $(eq $x, 2)
   eprintln($""Error: "try" blocks automatically export!"")
   exit 1

try
   x = 2
   export x
default
   x = 3
   export x
println($"""With "export x", x is $x""")

try
   x = 2
   export
default
   x = 3
   export
println($"""With "export", x is $x""")