RosettaCodeData/Task/Classes/Nemerle/classes.nemerle
Ingy döt Net 776bba907c Sync
2013-10-27 22:24:23 +00:00

19 lines
485 B
Text

public class MyClass
{
public this() { } // the constructor in Nemerle is always named 'this'
public MyVariable : int
{
get;
set;
}
public MyMethod() : void
{
}
}
def myInstance = MyClass(); // no 'new' keyword needed
myInstance.MyVariable = 42; // set MyVariable
System.Console.WriteLine($"My variable is $(myInstance.MyVariable)") // get MyVariable