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.

Opened 16 years ago

Closed 14 years ago

#710 closed enhancement (fixed)

implicit member "this" in NameBlock

Reported by: Jorge Owned by: Víctor de Buen Remiro
Priority: high Milestone: OOP Implementation
Component: OOP Version: 2.0.1
Severity: normal Keywords:
Cc:

Description

It could be very useful if every instance of a NameBlock had an implicit member "this" being a reference to "it self", similar to the this reserved word "this" in C++. This feature could make easy the collaboration between instances.

Change History (3)

comment:1 Changed 15 years ago by Víctor de Buen Remiro

Resolution: fixed
Status: newclosed

Sorry, this problem was resolved a few weeks ago.

//Example of using implicit private member _this
NameBlock a = 
[[
  Text _.name = "a";
  Text getName(Real unused) { _this::_.name }
]];

//User cannot overwrite _this due to it's a reserved word
NameBlock b = 
[[
  Text _.name = "b";
  NameBlock _this = a;
  Text getName(Real unused) { _this::_.name }
]];

comment:2 Changed 14 years ago by Víctor de Buen Remiro

Resolution: fixed
Status: closedreopened

Change [3003] referred to ticket #1054 disables error message about _this reimplementation

comment:3 Changed 14 years ago by Víctor de Buen Remiro

Resolution: fixed
Status: reopenedclosed

(In [3056]) Fixes #710

Note: See TracTickets for help on using tickets.