Open richardpawson opened 2 months ago
Assigned to RP to permit private methods to be added to an abstract class in the MemberSelector
The parser now permits creating private property
, procedure
, and function
- directly from the MemberSelector
(i.e. no optional private
keyword in the frame any more).
These private members can be added into a regular class
, an immutable class
(except for procedure
), and also as concrete members in both abstract class', and
abstract immutable class`.
Passing over to Stef to implement the private members in compiled code.
Note, however, that private property
, private procedure
, and private function
have been temporarily removed from the "class_members"
property of the default profile.json
- pending their implementation.
For discussion
In Elan,
private
has the same meaning asprotected
in C#/Java - visible to sub-classes but not externally.So we may have:
abstract class Foo ... private procedure defaultBar() ...
abstract procedure Bar() ... end class
class Yon inherits Foo
procedure Bar() . call defaultBar() end procedure end class
(where
default
is a convention only, not a recognised prefix).If a class inherits from two abstract classes that ...
While the latter would not be acceptable in a commercial language for large-scale systems, this is unlikely to be an issue in an educational context, any more than not supporting overloaded methods generally.