DEV Community

lechat
lechat

Posted on

My language now can make instances

I made a language and the language now can make instances:

class A {
    pub name = "john";
    pub weight = 10;
    pub fn f() {
        return "cat";
    }
}
let b = new A();
print(b.name);
print(b.f());
Enter fullscreen mode Exit fullscreen mode

Wow, I'm happy for this :)

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay