wyvernlang / wyvern

The Wyvern programming language.
http://wyvernlang.github.io/
GNU General Public License v2.0
555 stars 65 forks source link

Add syntactic sugar "class" #328

Open sychoo opened 5 years ago

sychoo commented 5 years ago

The "class" declaration will combine object type declaration and object implementation.

i.e. type IntList def sum():Int val empty:IntList = new def sum():Int = 0

is equivalent to class empty:IntList = new def sum():Int = 0

JonathanAldrich commented 5 years ago

One potential design for this is outlined in this paper: http://www.cs.cmu.edu/~aldrich/papers/maspeghi13.pdf