Skip to content

Instantly share code, notes, and snippets.

@Kazuki-Kachi
Created December 19, 2017 11:25
Show Gist options
  • Save Kazuki-Kachi/40975529267987f92a6dc06a90987682 to your computer and use it in GitHub Desktop.
Save Kazuki-Kachi/40975529267987f92a6dc06a90987682 to your computer and use it in GitHub Desktop.
For func
Dim i As Integer
' それVBならBuildできますよ?
Dim f As Func(Of Integer, Integer) = If(args.Any() AndAlso Integer.TryParse(args.First(), i), Function(x) x + i, Function(x) x)
' 左に型を明記する必要すらない
Dim f1 = If(args.Any() AndAlso Integer.TryParse(args.First(), i), Function(x As Integer) x + i, Function(x As Integer) x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment