Common values
In this section, we provide a quick introduction to common basic objects. The function typeof used below returns the type of object provided as argument.
- Logical
truetruefalsefalsetypeof(true)Bool- Integers
11typeof(1)Int64Int8(1)1typeof(Int8(1))Int8- Floating-Point numbers
10.010.0typeof(10.0)Float64Float16(10.0)Float16(10.0)typeof(Float16(1))Float16- Complex numbers
1 + 2im1 + 2imtypeof(1 + 2im)Complex{Int64}- Rational numbers
10 // 152//3typeof(10 // 15)Rational{Int64}- Character
'x''x': ASCII/Unicode U+0078 (category Ll: Letter, lowercase)typeof('x')Chartypeof('β')Char- Strings
"julia""julia"typeof("julia")String- Symbol: Object used to represent identifiers
:name:nametypeof(:name)Symbol- Tuples: Unmutable fixed-length container holding any values
("John", 29, 10.0)("John", 29, 10.0)typeof(("John", 29, 10.0))Tuple{String, Int64, Float64}- Named tuples: Tuples with element names
(name = "John", age = 29, value = 10.0)(name = "John", age = 29, value = 10.0)typeof((name = "John", age = 29, value = 10.0))NamedTuple{(:name, :age, :value), Tuple{String, Int64, Float64}}- Pair: Unmutable object with two elements (first and second)
"January" => 1"January" => 1typeof("January" => 1)Pair{String, Int64}- Dictionaries: Table with keys and values.
Dict("Poisson" => 1, "Gaussian" => 2)Dict{String, Int64} with 2 entries:
"Gaussian" => 2
"Poisson" => 1typeof(Dict("Poisson" => 1, "Gaussian" => 2))Dict{String, Int64}