我將如何做到這一點(C#)在F#如何在f#中執行多行lambda表達式?
public class MyClass
{
void Render(TextWriter textWriter)
{
Tag(() =>
{
textWriter.WriteLine("line 1");
textWriter.WriteLine("line 2");
});
Tag(value =>
{
textWriter.WriteLine("line 1");
textWriter.WriteLine(value);
}, "a");
}
public void Tag(Action action)
{
action();
}
public void Tag<T>(Action<T> action, T t)
{
action(t);
}
}
很酷,但他的例子中的C#代碼在F#中看起來如何? – ichiban 2009-05-02 06:39:54