skrolikowski / modern Goto Github PK
View Code? Open in Web Editor NEWA module/mixin system written in the Lua programming language.
License: MIT License
A module/mixin system written in the Lua programming language.
License: MIT License
Example:
function Foo:__string()
return string.format('Foo(%d, %d)', self:unpack())
end
It will just continue to use Modern's __tostring
method
Modern should provide a graceful message of a user calls a function that doesn’t exist.
E.g. “Function you are looking for does not exist. Is it possible you forgot to include a Mixin?”
Now that namespaces are established, it would be useful to have a way to call a single Mixin function out of a Compound Function.
Terminology:
Compound Function - Module property that executes more than one function.
Mixin Function - Mixin property with a datatype of function
.
💡 Idea:
Problem:
When calling a "new" Module
, the new(...)
functions will be called. If the Module
includes Mixins
, then their new(...)
functions will be called as well. For some, this may not be acceptable, due to the Mixins
requiring a different set of arguments.
Solution:
Introduce a new function __new(...)
, which will override a Mixin
's new(...)
call if one exists, otherwise fallback to the default new(...)
function.
Simple, effective branding for package.
Idea - allow for namespacing modules for the use of mixins.
Use case: including multiple mixins with conflicting names (all will fire but what if you want to call just one).
Adding namespaces could provide an avenue to call a specific mixin’s function, while keeping function names short and to the point.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.