News for hackers. Stuff that matters.
Re:About V, the language Volt is written in by boomlinde on Thursday February 07, 2019 @12:28PM (#19106703)
> Why not have a simple `class` construct as in JavaScript? Keeping functions together in a class is very convenient and means you don't have to pass the struct as the first argument each time.

This already seems to have a way to associate functions with data structures, in the same way that methods are done in Go, via a "receiver" before the function name

Eg.

    type Something{}
    fn (self mut Something) method() { ... }
and calling the method with an instance

    x := Something{}
    x.method()

There are no comments on this comment yet.