Class/Interface/Contract -- Re: fake class in OE
- Posted by petelomax Feb 23, 2021
- 1309 views
mitgedanken said...
But I prefer
class_pointer goat_ = class:new("Goat") method_return goat_name = class:method(goat_, "get_name", {}) -- or class:call(...) -- or class:func(..) / class:proc(...)
Erm, this currently/already works in Phix
class Goat string name function get_name() return name end function end class Goat goat = new({"Gertrude"}) ?goat.get_name()
Note that goat.name works the same as goat.get_name() here, because it recognises the "get_" part.