SHARE
TWEET

Untitled

a guest Aug 13th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Identifiers that have a leading underscore (_)
  2. # are not exposed by IntelliSense directly, unless
  3. # _ is typed.
  4. struct File {
  5.     # Constants initialized to lazy must be
  6.     # properly initialized in all of the
  7.     # constructors.
  8.     constant path as String = lazy
  9.    
  10.     function constructor() = invalid
  11.    
  12.     # Arguments are always passed by-value (copied).
  13.     # Thus, they are always variable (i.e. can be
  14.     # reassigned).
  15.     function constructor(path as String) {
  16.         # We initialize the "path" constant, as
  17.         # dictated by the "lazy" keyword.
  18.         self.path = path
  19.     }
  20.    
  21.     function destructor() {
  22.    
  23.     }
  24.    
  25.     # Any function may be overriden in derived
  26.     # classes. If they're not, calls to them
  27.     # default to the non-overriden definition.
  28.     function exists() as Boolean {
  29.         # TODO: Check if the file exists.
  30.     }
  31.    
  32.     # Functions marked as abstract MUST be
  33.     # implemented in derived classes. When
  34.     # a struct's function is marked as abstract,
  35.     # no instances of the struct can be created.
  36.     function load() = abstract
  37.     function save() = abstract
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top