mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Adjust for alignment
This commit is contained in:
parent
749e81ace2
commit
e96bfe490e
@ -154,6 +154,7 @@ a = Int64[] # => 0-element Array{Int64,1}
|
||||
# 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[1] # => 4
|
||||
b[end] # => 6
|
||||
|
||||
# 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])
|
||||
setdiff(Set([1,2,3,4]), Set([2,3,5])) # => Set([4, 1])
|
||||
|
||||
|
||||
####################################################
|
||||
## 3. Control Flow
|
||||
####################################################
|
||||
@ -416,15 +416,14 @@ catch e
|
||||
end
|
||||
# => caught it ErrorException("help")
|
||||
|
||||
|
||||
####################################################
|
||||
## 4. Functions
|
||||
####################################################
|
||||
|
||||
# The keyword 'function' creates new functions
|
||||
#function name(arglist)
|
||||
# function name(arglist)
|
||||
# body...
|
||||
#end
|
||||
# end
|
||||
function add(x, y)
|
||||
println("x is $x and y is $y")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user