Should there be a properties and accessibility tidy up?

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Should there be a properties and accessibility tidy up?

Postby MartinHowe » Fri May 08, 2020 3:41 pm

Having just started with ZScript I am exploring its capabilities, especially compared to commercial or otherwise well-established OO languages.

One of the things that most glaringly stands out is the lack of property accessors and indeed any way to access properties from ACS. For that matter, with [GS]etUserVariable I can modify or read even private variables in a class! Surely this ought not to be possible? Also, these methods in ACS will not read/write properties, only actual variables. Furthermore, the lack of property accessors breaks encapsulation, especially as a property might have for implementations sake, several counters and flags as backing variables to simplify the state logic under the hood. Property accessors also allow validation of input, something that thin wrappers do not.

Perhaps the whole idea of what can be accessed from ACS needs looking at, along with a re-examination of what properties are for and how they should be used.

Or is this something already scheduled for the future?
User avatar
In space, no-one can hear you KILL an ALIEN
Joined: 11 Aug 2003
Location: Waveney, United Kingdom

Re: Should there be a properties and accessibility tidy up?

Postby Graf Zahl » Sat May 09, 2020 12:12 pm

The limiting factor for ACS access is ACS and its cheap-ass compiler. Doing some reasonable interaction between ZScript and ACS is not easy due to ACSs' limitations.

Allowing private data through these functions is certainly not intentional, and can result in mod breakage.
Property access would surely be nice because it'd allow better data encapsulation, but that'd require quite a bit of low level changes in the compiler backend.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Joined: 19 Jul 2003
Location: Germany

Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests