Return 'this' proposal
Joseph D. Darcy
Joe.Darcy at Sun.COM
Tue Mar 17 15:48:26 PDT 2009
Marek Kozieł wrote:
> 2009/3/17 Joseph D. Darcy <Joe.Darcy at sun.com <mailto:Joe.Darcy at sun.com>>
> This 'this' proposal remains vague and imprecise.
> Including this type/self type in a language is a continuing area
> of study; for example, see the recent paper
> "Matching ThisType to Subtyping," Chieri Saito and Atsushi
> Igarashi, Kyoto University, Japan, ACM SAC 2009.
> There are open bugs requesting this capability. For example typing
> "site:bugs.sun.com <http://bugs.sun.com> this type" into a popular
> search engine quickly yields, amongst other hits,
> 6479372 Add self types (type of 'this' aka ThisClass) to the language
> This bug discusses the size of the type system impact of this
> change, a magnitude far too large for Project Coin.
> There is no need to submit further refinements of this idea; any
> proposal along the lines of adding a this type will be out of
> scope for Project Coin.
> I'll check it, but I'm afraid that introducing 'This' type will be
> impossible for Java and for all other languages with Inheritance, or I
> would say it's possible but conditions would be huge.
> return 'this':
> - Idea is quite simple: you use object from left side of dot as
> returned from method, it's the same quite idea with converting void ->
> this, but allowed only when it's written directly.
> - Byte-code for that is other story and I'm not sure how much
> limitation this contains.
> Maybe you cold while what problems you see (that could help)?
As the author and submitter of a proposal, it is your responsibility to
research, understand, and explain the consequences and implications of
More information about the coin-dev