Skip to content

Instantly share code, notes, and snippets.

@nddrylliog
Forked from ycros/dotvar.ooc
Created September 5, 2011 14:45

Revisions

  1. Amos Wenger revised this gist Sep 5, 2011. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion dotvar.ooc
    Original file line number Diff line number Diff line change
    @@ -3,11 +3,21 @@ A: class <T> {
    foo: T

    init: func(=foo) {
    "A init" printfln(foo as Int)
    }
    }

    B: class extends A<Int> {
    init: func(.foo) {
    init: func (.foo) {
    super(foo)
    "B init | foo = %d" printfln(foo)

    // just 'this foo' should work. Hmm.
    intFoo := this foo as Int
    "intFoo = %d" printfln(intFoo)
    }
    }

    main: func {
    B new(42 as Int)
    }
  2. @ycros ycros created this gist Oct 4, 2010.
    13 changes: 13 additions & 0 deletions dotvar.ooc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@

    A: class <T> {
    foo: T

    init: func(=foo) {
    }
    }

    B: class extends A<Int> {
    init: func(.foo) {
    super(foo)
    }
    }