diff options
author | Pranit Bauva <pranit.bauva@gmail.com> | 2015-11-04 23:05:47 +0530 |
---|---|---|
committer | Pranit Bauva <pranit.bauva@gmail.com> | 2015-11-04 23:05:47 +0530 |
commit | a00cc7127170fe47203900d1ab1aac998501e6ec (patch) | |
tree | 2a41dbec8108f895805842fc438df605e311b46b /julia.html.markdown | |
parent | a6927f543ce6aee3ed409d7c88fc3695163c6609 (diff) |
Add description about multiple return values
Diffstat (limited to 'julia.html.markdown')
-rw-r--r-- | julia.html.markdown | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/julia.html.markdown b/julia.html.markdown index a9eed2da..1a698834 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -399,6 +399,10 @@ add(5, 6) # => 11 after printing out "x is 5 and y is 6" f_add(x, y) = x + y # => "f (generic function with 1 method)" f_add(3, 4) # => 7 +# Function can also return multiple values as tuple +f(x, y) = x + y, x - y +f(3, 4) # => (7, -1) + # You can define functions that take a variable number of # positional arguments function varargs(args...) |