Kipper-Lang / Kipper

The Kipper programming language for Browsers and Node.js 🦊✨ Made at HTL Leonding & JKU Linz
https://kipper-lang.org
GNU General Public License v3.0
26 stars 4 forks source link

[Feature] Implement `new` to be able to instantiate objects #679

Closed ByteWolf-dev closed 1 week ago

ByteWolf-dev commented 1 month ago

Is there an existing proposal for this?

This feature does not exist in the latest version

Proposal

We want to implement the new keyword so that objects can be instantiated.

Exact behaviour / changes you want

Here is an example:


class Person {
    name: str;

    constructor(name: str) {
        this.name = name;
    }
}

// Instantiate the class
const person = new Person("Alice", 30);```
Luna-Klatzer commented 1 week ago

Implemented by #689