forum-msg-id-135896-edit

Original date:2021-02-23 12:55:42 Edited by: petelomax Subject: Class/Interface/Contract Re: fake class in OE

[quote mitgedanken] : 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(...) </eucode> [/quote]

Erm, this currently 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.

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu