Protected Access Please

Monkey Forums/Monkey Programming/Protected Access Please

maltic(Posted 2013) [#1]
I am currently writing a (fairly) large game engine in Monkey with 2 other people. We have several Monkey gripes, however we all agree that the benefits of Monkey outweigh its shortcomings--which makes me happy, since I suggested using it! However there is one insurmountable problem. The fact that the 'private' keyword acts somewhere between protected (intra module access) and the normal private keyword outside a module (only intraclass access) is making coding a nightmare! We really want a standard 'protected' keyword which allows access inside a module AND from derived classes. The reason is this: we want people to be able to extend our engine classes and mess with the internal components a little. Also, many of our modules are interdependent and thus we need to make unnecessary get/set methods or provide public access where it doesn't make sense.

Please consider adding this small feature, Mark! I would use it lots! :)


Gerry Quinn(Posted 2013) [#2]
I've been asking that for a long time. An obvious example is what if you want to extend Monkey.List - you can't get at the nodes. And I'm pretty sure Mark isn't planning to change them - besides which there's no reason not to retain the Private access qualifier for stuff that really shouldn't be touched.


maltic(Posted 2013) [#3]
I guess I could try hacking trans myself to add it, I have a background in programming language research, although it might be beyond me--there is a lot of code to read and puzzle out.