Created
March 17, 2017 18:29
-
-
Save VladD2/1f4ff69dfd96f36e4fbcf8ebf50c87bb to your computer and use it in GitHub Desktop.
This file contains hidden or 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; | |
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++) | |
{ | |
mutable s; | |
s.X = i + 1; | |
Foo(s); | |
s.Y = 2; | |
} | |
_ = ReadLine(); | |
} | |
} | |
// output: | |
// s.X=1 s.Y=0 | |
// s.X=2 s.Y=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment