RosettaCodeData/Task/Copy-a-string/Nemerle/copy-a-string.nemerle
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

18 lines
606 B
Text

using System;
using System.Console;
using Nemerle;
module StrCopy
{
Main() : void
{
mutable str1 = "I am not changed"; // str1 is bound to literal
def str2 = lazy(str1); // str2 will be bound when evaluated
def str3 = str1; // str3 is bound to value of str1
str1 = "I am changed"; // str1 is bound to new literal
Write($"$(str1)\n$(str2)\n$(str3)\n"); // str2 is bound to value of str1
// Output: I am changed
// I am changed
// I am not changed
}
}