with examples in TypeScript
Dapeng Li
Source-to-source compile = transcompile = transpile **
Samurai
Ninja
Mixin in TypeScript: step 1/2
Mixin in TypeScript: step 2/2
// This is TypeScript
class Cat { name: string; run() {console.log("cat runs");} }
class Dog { name: string; run() {console.log("dog runs");} }
let cat: Cat = new Cat(); // fine
let dog: Dog = new Dog(); // fine
dog = cat; // what about this?
let animal: Animal = new Dog();
let animals: Animal[] = [new Dog()];
let dogs: dog[] = [new Animal()];
let animals: Animal[] = [new Dog()];
let dogs: dog[] = [new Animal()];
// no code here...
class-based languages
*
* Classes, Interfaces, Mixins & Generics