GithubHelp home page GithubHelp logo

abstract's Introduction

Abstract


A simple simulation of Object Oriented Programming in Luau. Documentation is currently limited and will be filled in eventually.

Usage


local Object = require(Abstract)

local anObject = Object:__extend("AnObject")

function anObject:__init()
    -- called once the object is initialized
    self.Value = 5
end

function anObject:DoWork()
    -- do work
    print("working:", self.Value)
end

anObject = anObject:__compile()

local obj = anObject()
anObject:DoWork() --> "working: 5"

Conventions


Naming conventions that should be used to avoid collisions with internal metamethods:

Classes will follow the CamelCase naming scheme.

Indices that begin with two underscores and a lowercase letter are meant to be reserved for meta-values. These should not be created by default and should only be overridden in the case of intentional metamethods.

Common metamethods are: the default Lua metamethods, __new, __init, __super, __object, and __static. The only ones that are intended to be overridden are __new and __init along with the default luau metamethods.

Indices that begin with two underscores and an upper case letter are meant to be private/protected members. These (at least currently) are not protected outside through the library (as its not entirely critical); they are only meant to be suggestions though there is no guaruntee this will not change in the future.

abstract's People

Contributors

arcinfini avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.