Add description about compact assignment of functions

This commit is contained in:
Pranit Bauva 2015-11-04 23:04:42 +05:30
parent 20f8f41ad5
commit a6927f543c

View File

@ -395,6 +395,10 @@ end
add(5, 6) # => 11 after printing out "x is 5 and y is 6" add(5, 6) # => 11 after printing out "x is 5 and y is 6"
# Compact assignment of functions
f_add(x, y) = x + y # => "f (generic function with 1 method)"
f_add(3, 4) # => 7
# You can define functions that take a variable number of # You can define functions that take a variable number of
# positional arguments # positional arguments
function varargs(args...) function varargs(args...)