Explicit this for methods

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Tue Jul 23 15:57:42 UTC 2024


For type state analysis I do have a need to introduce ``this`` and 
``return`` as function parameters.

However they would not be mandatory.

I can however see ``this`` having a variable name specified that 
overrides the implicit ``this`` pointer.

If you want to force it to be mandatory you could implement a check in 
DScanner, however I do not think D itself would have it. I would be 
against such a requirement.

I suspect that there might be some overlap here that would be beneficial 
to the language.

I do want to emphasize we must not introduce this to for similarity to 
other languages, it must be introduced to solve problems that D has.



More information about the dip.ideas mailing list