I have a class and another that inherits from it. There are some methods that I defined in the parent class that I'd like to share privately with the subclass, but not with the world.
How can I achieve something like the protected scope in other programming languages for such methods?
I've thought about introducing a role with private methods, but I'd also need to maintain some private states for use by the methods, and I would need to make both classes does the role, but that seems to result in the instance variables (of the role) being duplicated in both classes...