Closed ozra closed 8 years ago
Looks alright. But how about this
(instance) and This
(class)?
I like the clearer separation between this
and Self
, it also makes it easier to talk about the concepts (when pair-programming for instance).
Because of the possible confusion stemming from other languages uses, self
will be a reserved word giving an error hinting towards this
and Self
.
I've been wanting this naming a long time, but put it off while looking at the naming-scheme in different languages. Now, I've finally come to the conclusion that it is the best naming:
Self
(capital initial) refers to "the current type / module"this
refers to the current instance (like in "C++-like" languages)Prior art, pros and con:
this
is very common in many languages for the instanceself
for instance, andthis
for the type - the complete reverseThe motivation in two phrases: "Let's operate on this instance" "Let's call a function on the Self of this"
Currently
Self
andType
can be used interchangeably to refer to current type, andself
(lowercase) refers to current instance. So,Type
will be dropped, andself
renamedthis
to clarify the difference.See also #42
Thoughts?