Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Identifiers that have a leading underscore (_)
- # are not exposed by IntelliSense directly, unless
- # _ is typed.
- struct File {
- # Constants initialized to lazy must be
- # properly initialized in all of the
- # constructors.
- constant path as String = lazy
- function constructor() = invalid
- # Arguments are always passed by-value (copied).
- # Thus, they are always variable (i.e. can be
- # reassigned).
- function constructor(path as String) {
- # We initialize the "path" constant, as
- # dictated by the "lazy" keyword.
- self.path = path
- }
- function destructor() {
- }
- # Any function may be overriden in derived
- # classes. If they're not, calls to them
- # default to the non-overriden definition.
- function exists() as Boolean {
- # TODO: Check if the file exists.
- }
- # Functions marked as abstract MUST be
- # implemented in derived classes. When
- # a struct's function is marked as abstract,
- # no instances of the struct can be created.
- function load() = abstract
- function save() = abstract
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement