charly-lang / charly

🐈 The Charly Programming Language | Written by @KCreate
https://charly-lang.github.io/charly/
MIT License
199 stars 10 forks source link

Constant functions #75

Closed KCreate closed 7 years ago

KCreate commented 7 years ago

Allow defining constant functions in objects

Syntax:

class Person {
  const func greet() {
    # write code
  };
};

let me = Person();
me.greet = 25 # RunTimeError: Can't overwrite constant
KCreate commented 7 years ago

Implemented on master