1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-12 09:44:24 +02:00

Adjust for alignment

This commit is contained in:
0u0
2018-08-31 09:47:30 +08:00
parent 749e81ace2
commit e96bfe490e

View File

@@ -154,6 +154,7 @@ a = Int64[] # => 0-element Array{Int64,1}
# 1-dimensional array literals can be written with comma-separated values. # 1-dimensional array literals can be written with comma-separated values.
b = [4, 5, 6] # => 3-element Array{Int64,1}: [4, 5, 6] b = [4, 5, 6] # => 3-element Array{Int64,1}: [4, 5, 6]
b = [4; 5; 6] # => 3-element Array{Int64,1}: [4, 5, 6] b = [4; 5; 6] # => 3-element Array{Int64,1}: [4, 5, 6]
b[1] # => 4
b[end] # => 6 b[end] # => 6
# 2-dimensional arrays use space-separated values and semicolon-separated rows. # 2-dimensional arrays use space-separated values and semicolon-separated rows.
@@ -344,7 +345,6 @@ intersect(filled_set, other_set) # => Set([4, 3, 5])
union(filled_set, other_set) # => Set([4, 2, 3, 5, 6, 1]) union(filled_set, other_set) # => Set([4, 2, 3, 5, 6, 1])
setdiff(Set([1,2,3,4]), Set([2,3,5])) # => Set([4, 1]) setdiff(Set([1,2,3,4]), Set([2,3,5])) # => Set([4, 1])
#################################################### ####################################################
## 3. Control Flow ## 3. Control Flow
#################################################### ####################################################
@@ -416,15 +416,14 @@ catch e
end end
# => caught it ErrorException("help") # => caught it ErrorException("help")
#################################################### ####################################################
## 4. Functions ## 4. Functions
#################################################### ####################################################
# The keyword 'function' creates new functions # The keyword 'function' creates new functions
#function name(arglist) # function name(arglist)
# body... # body...
#end # end
function add(x, y) function add(x, y)
println("x is $x and y is $y") println("x is $x and y is $y")