Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Copy-a-string/Nemerle/copy-a-string.nemerle
Normal file
18
Task/Copy-a-string/Nemerle/copy-a-string.nemerle
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
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
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue