A simple scripting language in C++
Ferenc Szontágh
2025-04-19 558e0191ba5a5b0ab99825de7d7d2219387e559e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Constants Feature Test
# Test declaration of immutable constants and verify re-assignment errors
 
# Declare constant string and print
const string $name = "Alice";
printnl($name);
 
# Declare constant integer and print
const int $x = 100;
printnl($x);
 
# Declare mutable variable and modify
string $y = "mutable";
printnl($y);
$y = "changed";
printnl($y);
 
# Attempt to modify constant (should produce runtime error)
$name = "Bob";