summaryrefslogtreecommitdiffhomepage
path: root/julia.html.markdown
diff options
context:
space:
mode:
authorven <vendethiel@hotmail.fr>2015-11-09 09:28:31 +0100
committerven <vendethiel@hotmail.fr>2015-11-09 09:28:31 +0100
commit9bd6e3d10de217e7e40359b2b2b3437fc2d01e05 (patch)
tree507d1edc27d1be7f306902904c99483ad0c8bad1 /julia.html.markdown
parenta383adc9ac802d30287d95e3709580795f963b76 (diff)
parenteee0aba489080a13cdca80af46c3128997d792b3 (diff)
Merge pull request #2007 from pranitbauva1997/new
Strings can be lexicographically compared with comparison operators
Diffstat (limited to 'julia.html.markdown')
-rw-r--r--julia.html.markdown13
1 files changed, 13 insertions, 0 deletions
diff --git a/julia.html.markdown b/julia.html.markdown
index 220b52a4..ef3ea244 100644
--- a/julia.html.markdown
+++ b/julia.html.markdown
@@ -103,6 +103,11 @@ false
# Printing is easy
println("I'm Julia. Nice to meet you!")
+# String can be compared lexicographically
+"good" > "bye" # => true
+"good" == "good" # => true
+"1 + 2 = 3" == "1 + 2 = $(1+2)" # => true
+
####################################################
## 2. Variables and Collections
####################################################
@@ -391,6 +396,14 @@ 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
+
+# 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...)