Skip to content

Instantly share code, notes, and snippets.

@valvallow
Created May 30, 2012 02:24
Show Gist options
  • Select an option

  • Save valvallow/2832973 to your computer and use it in GitHub Desktop.

Select an option

Save valvallow/2832973 to your computer and use it in GitHub Desktop.
statement to expression
void example() {
var b = Expr<bool>(() => {
switch (1) {
case 1: return true;
default: return false;
}
});
}
public static TReturn Expr<TReturn>(Func<TReturn> body) {
return body();
}
public static TReturn Progn<TReturn>(Func<TReturn> body) {
return body();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment