oop.txt  Basic Python-like OOP support
==============================================================================
CONTENTS                                                      oop-contents
    1. Intro                                      oop-intro
    2. Functionality provided                     oop-functionality
        2.1. Functions                            oop-functions
        2.2. Built-in classes                     oop-classes
    3. Class members                              oop-classinstance
==============================================================================
1. Intro                                                         oop-intro
This plugin provides some basic OOP support with OOP model similar to Python.
Plugin requires vimpluginloader and its dependencies.
==============================================================================
2. Functionality provided                                oop-functionality
This plugin provides three functions. Functions are accessed via dictionary 
returned by load-func-getfunctions function.
------------------------------------------------------------------------------
2.1. Functions                                               oop-functions
All following functions are accessed via dictionary returned by 
load-func-getfunctions function.
                                                    oop-func-registerclass
registerclass({name}[, {functions}[, {variables}[, {parents}]]])
        Register a new class with given {name}, list of {functions} and list 
        of {variables} which will inherit from {parents}. Here {functions} 
        argument is a dictionary; all non-funcref arguments are filtered out. 
        List of {variables} is also a dictionary, but nothing is filtered out. 
        {parents} must be a list of class names, all classes should be defined 
        before defining {name} class. This function returns a function 
        reference which is the only way to delete a class with given name. 
        Note that registerclass function will not redefine existing class.
getinstance({name}[, ...])                            oop-func-getinstance
        Get the instance of a class {name}. All subsequenc arguments will be 
        passed to class constructor (if any). See oop-classinstance.
------------------------------------------------------------------------------
2.2. Built-in classes                                          oop-classes
Exception                                              oop-class-Exception
        Basic class for custom exceptions. Functions:
warn                                                    oop-Exception.warn
        Generates error message using __str__ method and echoes it with 
        hl-ErrorMsg higlighting. Returns echoed error message. Note that 
        this warning will not be caught by :try ... :catch blocks.
raise                                                  oop-Exception.raise
        Invokes oop-Exception.warn and then throws generated error message.
__str__                                              oop-Exception.__str__
        Returns basic error message. Should be redefined in child classes.
==============================================================================
3. Class members                                         oop-classinstance
When you request new class instance the following steps are performed.
1. New dictionary with keys __class__ and __variables__ is generated.
2. Generated dictionary is extended with parent classes variables (if any).
3. Generated dictionary is extended with its class variables (but before the 
   dictionary with varibles is generated by deepcopy(): one copy for every 
   instance).
4. Generated dictionary is extended with its class functions. Note that 
   functions from parent classes are inherited when class is registered.
5. Constructor is called with generated dictionary as a self dictionary.
6. Generated dictionary is returned.
All class members may have following special methods/variables:
__class__                                                   oop-__class__
        Defined for all instances, contains class name.
__variables__                                           oop-__variables__
        Defined for all instances, contains class variables. Unlike instance 
        variables, redefining variables in this dictionary will lead to 
        changing class variables default values (but not the values of already 
        existing class instances). Changing instance variables will affect 
        neither existing nor new class instances.
__init__({super}, ...)                                       oop-__init__
        If defined, this method will be called whenever new instances are 
        generated. {super} argument is a dictionary with either a parent 
        class methods (if there is only one parent) or with {{name}
        {methods}} pairs. Other arguments are passed from 
        oop-func-getinstance.
vim: ft=help:tw=78