goscript-engine 0.1.0

goscript engine
Documentation
package main


type geometry interface {
    area() float64
    perim() float64
}

type rect struct {
    width, height float64
}

func (r rect) perim() float64 {
    return 2*r.width + 2*r.height
}

func (r rect) area() float64 {
    return r.width * r.height
}

func main() {

    //a := geometry(nil)
    var b geometry = (geometry)(nil)
   // assert(a == nil)
    assert(b == nil)

    var r *rect
    b = r
    assert(b != nil)
}