30log Versions Save

30 lines library for object orientation in Lua

30log-1.3.0-1

7 years ago
  • Added class:create, which allocates a new instance without invoking the class initializer
  • Added 30log-commons.lua
  • Updated specs

30log-1.2.0-1

7 years ago
  • Added class:cast(), changes the class of an instance

30log-1.1.0-1

7 years ago

New features

  • Added class:subclasses() returns the list of all classes which extend from class
  • Added class:instances(), returns the list of all instances of class
  • Added class:classOf(), checks if class is a superclass of arg
  • Added class:subclassOf(), checks if class is a subclass of arg
  • Added instance:instanceOf(), checks if instance is an instance of arg
  • Added class:without() to remove a mixin from a class
  • Added class:with(), includes a mixin to a class

Breaking changes

  • Changed implementation of class.isClass, now only checks if arg is a class
  • Changed implementation of class.isInstance, now only checks if arg is an instance
  • Removed class:include()
  • An instance of class is considered to be the instance of any superclass of class
  • A class is considered to be the subclass of any of its direct superclass's superclasses

30log-1.0.0-1

9 years ago

New features

  • require "30log" now returns a callable table
  • Added class.isClass
  • Added class.isInstance
  • Adding mixins can be chained
  • subclass.super returns the superclass of subclass
  • instance.class returns the class of instance

Breaking changes

  • Changed class prototype to class(name, params)
  • Renamed class:__init() to class:init()
  • Renamed class.__name to class.name
  • Renamed class:extends() to class:extend
  • Renamed class:is() to class:extends
  • Renamed class:has() to class:includes
  • Changed class:extend prototype to class:extend(name, params)
  • Changed tostring(class) and tostring(instance) output.

30log-0.9.1-1

10 years ago
  • Converted internal registers to tables with weak keys

30log-0.9.0-1

10 years ago
  • Added class.is and instance.is to inspect inheritance relationship between two objects.
  • Removed spaces in class/instance tostring output.

30log-0.8.0-1

10 years ago
  • Mixins are now included with include, not with
  • Objects (instances) cannot call new
  • Shortened class/instances __tostring output (class (?) instead of class (Unnamed))
  • Bugfixes for 30logclean (Thanks zorfmorf)
  • Updated specification tests and README

30log-0.2-1

10 years ago
  • Added specs
  • Added local shortcuts to global functions internally used
  • Typo fix in Readme's snippets

30log-0.3-0

10 years ago
  • Added Class-Commons support (Thanks to TsT2005)
  • Added Tracis-CI validation
  • Updated Readme with chained initialization sample
  • Updated specs

30log-0.4-0

10 years ago
  • __init can either be a table or a function
  • Added the abitlity to turn classes and objects into strings.