tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 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