From 20f8f41ad5631f6638d42aca88ad2e0590abbccb Mon Sep 17 00:00:00 2001 From: Pranit Bauva Date: Wed, 4 Nov 2015 22:15:59 +0530 Subject: Add description that strings can be lexicographically compared with comparison operators --- julia.html.markdown | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'julia.html.markdown') diff --git a/julia.html.markdown b/julia.html.markdown index cba7cd45..2fedcfd8 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -102,6 +102,11 @@ false # Printing is easy println("I'm Julia. Nice to meet you!") +# String can be compared lexicographically compared +"good" > "bye" # => true +"good" == "good" # => true +"1 + 2 = 3" == "1 + 2 = $(1+2)" # => true + #################################################### ## 2. Variables and Collections #################################################### -- cgit v1.2.3 From a6927f543ce6aee3ed409d7c88fc3695163c6609 Mon Sep 17 00:00:00 2001 From: Pranit Bauva Date: Wed, 4 Nov 2015 23:04:42 +0530 Subject: Add description about compact assignment of functions --- julia.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'julia.html.markdown') diff --git a/julia.html.markdown b/julia.html.markdown index 2fedcfd8..a9eed2da 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -395,6 +395,10 @@ end 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 # positional arguments function varargs(args...) -- cgit v1.2.3 From a00cc7127170fe47203900d1ab1aac998501e6ec Mon Sep 17 00:00:00 2001 From: Pranit Bauva Date: Wed, 4 Nov 2015 23:05:47 +0530 Subject: Add description about multiple return values --- julia.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'julia.html.markdown') 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...) -- cgit v1.2.3 From eee0aba489080a13cdca80af46c3128997d792b3 Mon Sep 17 00:00:00 2001 From: Pranit Bauva Date: Mon, 9 Nov 2015 10:33:22 +0530 Subject: Remove the extra 'compared' in julia.html.markdown --- julia.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'julia.html.markdown') diff --git a/julia.html.markdown b/julia.html.markdown index 1a698834..fcfa7e30 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -102,7 +102,7 @@ false # Printing is easy println("I'm Julia. Nice to meet you!") -# String can be compared lexicographically compared +# String can be compared lexicographically "good" > "bye" # => true "good" == "good" # => true "1 + 2 = 3" == "1 + 2 = $(1+2)" # => true -- cgit v1.2.3