mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
25 lines
385 B
Text
25 lines
385 B
Text
|
|
// test modification of a substring after an assignment.
|
||
|
|
|
||
|
|
var a := "testvalue";
|
||
|
|
var b := "value2";
|
||
|
|
var c := "value";
|
||
|
|
|
||
|
|
print( "a="+a );
|
||
|
|
print( "b="+b );
|
||
|
|
print( "c="+c );
|
||
|
|
|
||
|
|
var d := a["val"];
|
||
|
|
|
||
|
|
// This is key: this assignment must not modify 'a'.
|
||
|
|
d := "hello";
|
||
|
|
|
||
|
|
print( "a="+a );
|
||
|
|
print( "d="+d );
|
||
|
|
|
||
|
|
// Now, this one _should_.
|
||
|
|
a["val"] := "hello";
|
||
|
|
|
||
|
|
print( "a="+a );
|
||
|
|
print( "d="+d );
|
||
|
|
|