Hi,
I wanted to write this up last week but I found I indeed had a bug that the sixth example found.
Here's how it works at current
When the parser finds a role declaration it rewrites it to a field declaration (a member variable for those that do not speak .NET) and attach some meta data describing the role
when the parser sees a method invocation on a field known to be a role it checks to see if there's role method that fits the method signature. If so uses that, if not calls an instance method.
When the object expression of a method invocation is not known to be a role then fun starts. The meta data is not available at compile time so the parser can't do the above rewrite, instead I have a small hack at the moment when it can't be determined if it's a role or not (Ie. basically all places where it's not possible to identify that it is a role) I will have a runtime check to see if it's a role and act accordingly.
I don't particularly like this and I'm going to see if I can find a way to have the runtime help me with this. I have a few ideas I'll want to try out. At the moment however I haven't even implemented the above runtime check. I'm stuck at a parser error after trying to implement the comments I got on my first post in regards to the language
Best regards