Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (password, username) = GetUsernameAndPassword()
- let s = "1"
- match tryParse s with
- | Some(i) -> // do whatever with i
- | None -> // failed to parse
- let foo = (1, 2, 3)
- let (one, two, three) = foo
- one
- -- > 1
- three
- -- > 3
- sub foo { 1, 2, 3 }
- my ($one, $two, $three) = foo
- $one
- # > 1
- $three
- # > 3
- SP + 8: param 2
- SP + 6: param 1
- SP + 4: return address
- SP + 2: local 2
- SP + 0: local 1
- f :: Int -> (Int, Int)
- f x = (x - 1, x + 1)
- // Even C++ have tuples - see Boost.Graph for use
- std::pair<int, int> f(int x) {
- return std::make_pair(x - 1, x + 1);
- }
- data MyValue = MyValue Int Int
- g :: Int -> MyValue
- g x = MyValue (x - 1, x + 1)
- int x;
- int f(out int y) {
- x = 0;
- y = 1;
- printf("%dn", x);
- }
- f(out x);
- x = n + sqrt(y);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement