summaryrefslogtreecommitdiffhomepage
path: root/julia.html.markdown
diff options
context:
space:
mode:
authorMark Green <mark@antelope.nildram.co.uk>2016-01-22 00:54:49 +0000
committerMark Green <mark@antelope.nildram.co.uk>2016-01-22 00:54:49 +0000
commit57053bc95d4166a42da8f6d1732dd21a217b073a (patch)
tree293a7775d4b46313a2ee955691141095653d4044 /julia.html.markdown
parentdef04721be506f1c7ff5ddf407f2333999570a89 (diff)
parent9a5bb286686f5dd4fb743c1bd15ad70a3c6a4a3f (diff)
Merge remote-tracking branch 'refs/remotes/adambard/master'
Diffstat (limited to 'julia.html.markdown')
-rw-r--r--julia.html.markdown4
1 files changed, 4 insertions, 0 deletions
diff --git a/julia.html.markdown b/julia.html.markdown
index ef3ea244..2810555e 100644
--- a/julia.html.markdown
+++ b/julia.html.markdown
@@ -151,12 +151,16 @@ a = Int64[] # => 0-element Int64 Array
# 1-dimensional array literals can be written with comma-separated values.
b = [4, 5, 6] # => 3-element Int64 Array: [4, 5, 6]
+b = [4; 5; 6] # => 3-element Int64 Array: [4, 5, 6]
b[1] # => 4
b[end] # => 6
# 2-dimentional arrays use space-separated values and semicolon-separated rows.
matrix = [1 2; 3 4] # => 2x2 Int64 Array: [1 2; 3 4]
+# Arrays of a particular Type
+b = Int8[4, 5, 6] # => 3-element Int8 Array: [4, 5, 6]
+
# Add stuff to the end of a list with push! and append!
push!(a,1) # => [1]
push!(a,2) # => [1,2]