Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | misc | |
Tool | itemcontainer |
- i1 := itemcontainer(); T - i1.set('par1', 20); T - i1.set('par2', 30); T - i1.makeconst(); T - i1.set('par3', 40); This is a const tool, you cannot overwrite it <fail>: This is a const object, you cannot overwrite it File: itemcontainer.g, Line 56 Stack: .()
Note that this is a different error from
- const i1 := itemcontainer() - i1 := 'fish' <fail>: <fail>: 'const' values cannot be modified.
Here Glish is complaining that it can't reassign the tool i1. The previous example is illustrating that after application of the makeconst function, you can't change the internal state of the itemcontainer tool (nothing to do with trying to overwrite it).