Skip to content

Instantly share code, notes, and snippets.

@VladD2
Created March 17, 2017 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VladD2/1f4ff69dfd96f36e4fbcf8ebf50c87bb to your computer and use it in GitHub Desktop.
Save VladD2/1f4ff69dfd96f36e4fbcf8ebf50c87bb to your computer and use it in GitHub Desktop.
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