Created
March 17, 2017 19:18
-
-
Save VladD2/8cf390d3417b887ceab5216981feb3e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Console; | |
using Nemerle.Imperative.GoTo; // It need for 'goto' and 'label' macros. | |
struct S | |
{ | |
public mutable X : int; | |
public mutable Y : int; | |
} | |
module Program | |
{ | |
Foo(s : S) : void { WriteLine($"s.X=$(s.X) s.Y=$(s.Y)"); } | |
Main() : void | |
{ | |
for (mutable i = 0; i < 2; i++) | |
{ | |
goto label_1; | |
mutable s; | |
label label_1; | |
s.X = i + 1; | |
Foo(s); | |
s.Y = 2; | |
} | |
_ = ReadLine(); | |
} | |
} | |
// output: | |
// s.X=1 s.Y=0 | |
// s.X=2 s.Y=2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment