close
Warning:
Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.
Ticket #869: ticket_18.ObjectReferencesAndDecompilation.tol
| File ticket_18.ObjectReferencesAndDecompilation.tol, 1.1 KB (added by pgea@…, 16 years ago) |
|
|
| Line | |
|---|
| 1 | |
|---|
| 2 | ////////////////////////////////////////////////////////////////////////////// |
|---|
| 3 | // Compílese el archivo (con F9) |
|---|
| 4 | |
|---|
| 5 | Class @Element { |
|---|
| 6 | Text _.info; |
|---|
| 7 | Anything GetThis(Real void){ _this } |
|---|
| 8 | }; |
|---|
| 9 | |
|---|
| 10 | NameBlock Container = [[ |
|---|
| 11 | Set _.elements = Copy(Empty); |
|---|
| 12 | Real CreateElement(Text info) { |
|---|
| 13 | @Element element = [[ |
|---|
| 14 | Text _.info = info |
|---|
| 15 | ]]; |
|---|
| 16 | Set Append(_.elements, [[element]]); |
|---|
| 17 | 0}; |
|---|
| 18 | @Element GetElement(Real index) { |
|---|
| 19 | _.elements[index] |
|---|
| 20 | } |
|---|
| 21 | ]]; |
|---|
| 22 | |
|---|
| 23 | Real Container::CreateElement("nota"); |
|---|
| 24 | |
|---|
| 25 | ////////////////////////////////////////////////////////////////////////////// |
|---|
| 26 | // Compílese aparte esta línea (con F11, en el Eval u otro archivo) |
|---|
| 27 | // Decompílese la línea anterior (con F8 donde corresponda) |
|---|
| 28 | |
|---|
| 29 | // @Element algo = Container::GetElement(1); |
|---|
| 30 | |
|---|
| 31 | ////////////////////////////////////////////////////////////////////////////// |
|---|
| 32 | // Compílese aparte esta línea (con F11, en el Eval u otro archivo) |
|---|
| 33 | // y se obtendrá el error |
|---|
| 34 | |
|---|
| 35 | // Anything ea = Container::GetElement(1)::GetThis(?); |
|---|
| 36 | |
|---|
| 37 | ////////////////////////////////////////////////////////////////////////////// |
|---|
| 38 | |
|---|
| 39 | |
|---|
Download in other formats: