Revise using string interpolation.

This commit is contained in:
Stephen Chung
2021-04-04 23:22:45 +08:00
parent bc9c1ab850
commit 0807c474a1
16 changed files with 33 additions and 32 deletions

View File

@@ -7,7 +7,7 @@ let last_value = ();
let obj1 = #{
_data: 42, // data field
get_data: || this._data, // property getter
action: || print("Data=" + this._data), // method
action: || print(`Data=${this._data}`), // method
update: |x| { // property setter
this._data = x;
last_value = this._data; // capture 'last_value'
@@ -38,4 +38,4 @@ if obj2.get_data() > 0 { // property access
obj2.update(42); // call method
}
print("Should be 84: " + last_value);
print(`Should be 84: ${last_value}`);