There has been some discussion on the mailing lists recently about a language construct that allows you to identify the current method that you're in. It would be called something like thisMethod
and would essentially do for methods what this
does for class instances.
I'd be interested to see how this interacts with functions (which are a different concept from methods). Your p
is an anonymous function created from partially applying the hello
method (again, you need to be careful here, a "partially applied function is a very different thing from a PartialFunction
). The actual method then invoked would be apply
on this function object, and there are several possibilities as to how thisMethod
could behave in such a case.
Whatever happens, p
is just an object reference, don't expect to ever be able to access it as a name.