-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New syntax for stamps as Babel plugin #80
Comments
import stampit from 'stampit';
Object.prototype.stampit = stampit;
Object.prototype.isStamp = stampit.isStamp;
let StampA = {
myMethod() {},
myState: "a state",
static staticVar: "static var",
init({instance, stamp, args}) { ... }
}.stampit();
let StampB = {
static staticMethod() {}
}.stampit();
let StampC = StampA.compose(StampB).props({ X: "y" });
Object.prototype.isStamp.call(StampC); \o/ This feels hot. |
Polluting |
You wanted stampit built into the language... stamps are objects. :) |
Exactly. Stamps are object. Arrays are objects. Going further, classes in Java/C# are also objects of a special kind. Why stamps can't be one of them? :) |
Haha, cool idea, but this is out of scope for this repository. Maybe create a separate one for a Babel plugin? =) BTW, while I think native support would be great, I'll probably continue to use stampit as a library until there is a real effort to standardize it in the language. In order to gain support for language standardization, we need to get closer to 20k stars for Stampit, so spread the word. ;) |
Having |
👍 |
I'm cool with an org, but somebody else already has the "stampit" username but I just grabbed "stampit-org". |
I believe stamps are much better approach to OOP. In fact, I call classical OOP as BOP (Blueprint Oriented Programming).
Stamps can, should, and must be inbuilt into programming languages. Imagine you could write this in JS:
I haven't thought about syntax much (I haven't thought about it at all actually).
Do you get the idea? Do you feel it? Do you agree we can turn the programming world upside down?
The text was updated successfully, but these errors were encountered: