I've been asked a couple of times now about my use of "open recursion". It's covered in some detail by Pierce in "Types and Programming Languages"; I've included the one paragraph definition he gives below.
Open recursion. Another handy feature offered by most languages with objects and classes is the ability for one method body to invoke another method of the same object via a special variable called
self
or, in some langauges,this
. The special behavior ofself
is that it is late-bound, allowing a method defined in one class to invoke another method that is defined later, in some subclass of the first.Types and Programming Lanauges, Benjamin C. Pierce, 2002, MIT Press, pg 227.
No comments:
Post a Comment