got rid of 'const' handling code attempted.

cleaned up pooldic handling code more.
made a pooldic item value read-only by default
This commit is contained in:
hyunghwan.chung
2019-10-02 09:34:43 +00:00
parent 9ba623d5a0
commit cdd8d7f890
2 changed files with 107 additions and 134 deletions

View File

@ -102,7 +102,7 @@ pooldic MyData
C := 40
}
class MyClass
class MyClass(Object)
{
import MyData.
@ -114,12 +114,12 @@ class MyClass
}
class MyClass2
class MyClass2(Object)
{
pooldic Const
{
A := 20.
B := 30.
A := 20,
B := 30
}
method x()
@ -130,6 +130,29 @@ class MyClass2
}
}
class MyClass3(MyClass2)
{
pooldic Const
{
A := MyClass2.Const.A // pooldic is not inherited. need redefinition for auto-import
B := MyClass2.Const.B
}
}
class MyClass4(MyClass2)
{
import MyClass2.Const. // similar to redefinition inside the class. it won't be available MyClass4.Const as such is not available.
method x
{
MyClass2.Const at: #XXX put: 'QQQQQQQQQQQQQQ'. // you can add a new item dynamically,
(MyClass2.Const at: #XXX) dump. // and can access it.
// the compiler doesn't recognize the dynamically added item as MyClass2.Const.XXX
}
}
### Flow Control
```
k := if (i < 20) { 30 } else { 40 }.