git @ Cat's Eye Technologies Unlikely / master eg / dependency-injection.unlikely
master

Tree @master (Download .tar.gz)

dependency-injection.unlikely @masterraw · history · blame

class Hello(Print) extends Chain {
  Print p;
  method continue(Passive accumulator) {
    p = new Print(Passive,Chain);
    p.next = next;
    goto p.continue(new "Hello, world!"(Passive));
  }
}

class GoodbyePrint(Stop) extends Print {
  Stop s;
  method continue(Passive accumulator) {
    s = new Stop(Passive);
    goto s.continue(accumulator);
  }
}

class HelloProgram(Hello,GoodbyePrint,Chain,Stop) extends Program {
  Hello h;
  method continue(Passive accumulator) {
    h = new Hello(Passive,Chain,GoodbyePrint);
    h.next = new Stop(Passive);
    goto h.continue(new 0(Passive));
  }
}