One small advantage is that you can use them to differentiate an object expression's this
from that of the type which has created it:
type IExample = abstract GetAnObject : unit -> obj
type MyClass() =
member outer.Example1 = { new IExample with member inner.GetAnObject() = upcast inner }
member outer.Example2 = { new IExample with member inner.GetAnObject() = upcast outer }
A potential philosophical reason is that it makes it seem like the this
reference is not too different from any other argument. If you should be able to name the other arguments (instead of being forced to use arg1
, arg2
, etc.), then why shouldn't you be able to name the first argument as you please, too?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…