medit object model
Prev | Chapter 1. medit Lua API | Next

## medit object model

medit uses a very simple object model where its objects are represented as user data in Lua and methods are provided via metatable shared by all objects of all "classes". Method dispatch is dynamic, i.e. metatable does not contain functions which correspond to methods, and `obj:method` returns a function object which knows which method on which object it is going to call.

This manual lists and talks about "classes", but it is merely to avoid complicated terminology. When we say that an object belongs to or is an instance of a class `Foo`, it just means that it has methods listed in manual section for class `Foo` and methods of parent classes, if any.

### Note

To call a method, you can use both `obj:method(args)` and `obj.method(args)`.

Prev | Up | Next
Introduction | Home | Notations