Collect(a) vs. [a;]

I start with the easy one:

Yes I think so, e.g.:

julia> [5,6,7]==[5,6,7]
true

julia> [5,6,7]===[5,6,7]
false

help?> ===
search: === == !==

  ===(x,y) -> Bool
  ≡(x,y) -> Bool

  Determine whether x and y are identical, in the sense that no program could distinguish them. First the types of x and y are compared. If those are identical, mutable
  objects are compared by address in memory and immutable objects (such as numbers) are compared by contents at the bit level. This function is sometimes called "egal". It
  always returns a Bool value.

julia> ismutable([5,6,7])
true

Array are mutable objects and are therefore compared by address in memory. Thats why above === comparison gives false.

4 Likes