Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // C# JS Dart Scala(1)
- x => x + 1
- // Scala (2)
- _ + 1
- // Java
- x -> x + 1
- // Haskell/Elm
- \x -> x + 1
- // Kotlin (1)
- { x -> x + 1 }
- // Kotlin (2)
- { it + 1 }
- // Swift (1)
- { x in x + 1 }
- // Swift (2)
- { $0 + 1 }
- // F# / OCaml
- fun x -> x + 1
- // SML
- fn x => x + 1
- // Elixir (1)
- fn (x) -> x + 1 end
- // Elixir (2)
- &(&1 + 1)
- // Clojure (1)
- (fn [x] (+ x 1))
- // Clojure (2)
- #(+ % 1)
- // Python
- lambda a : a + 10
- // Scheme
- (lambda (x) (+ 1 x))
- // Lua
- function(x) return x + 1 end
- // Go
- func(x int) string { return x + 1 }
- // R
- (function (x) x+1)
- // Octave / Matlab
- @(x) x + 1
- //Delphi
- function(x: Integer): Integer
- begin
- Result := x + 1;
- end;
- // Wolfram
- // Mathematica
- #1+1&
- // Perl
- sub { my $x = shift; $x + 1 }
- // Visual Prolog
- { (X) = X+1 },
- // Smalltalk
- [:x|x+1]
- // Rust
- |x| { x + 1 }
- // C++
- [](int x) { return x + 1; }
- // PowerShell (1)
- { $args[0] + 1 }
- // PowerShell (2)
- { param($x) $x + 1 }
- // Erlang
- fun(X) -> X + 1 end
- // Ruby
- lambda { |x| x + 1 }
- // PHP
- function ($x) { return $x + 1};
- // VB.NET
- Function(x) x + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement