your first definition in ones_like is redundant with your second:
`ones(eltype(x), size(x))` is sufficient for both numbers and arrays
i have found that it is good to be in the habit of providing type
information as inputs to functions, to reduce surprises. often, this
information is implicit in the arguments themselves, but sometimes the
arguments need to be supplemented with a type, as we see in many of
the array creation methods.
> Honestly, I think that writing ones(()) should probably just be fixed to return a zero-dimensional array containing 1.0.
That sounds reasonable, since we probably wanted the limiting case to
be (1,2) .. (1,) .. (), and don't care much about the limiting case
(Int32,) ... () or whatever that alternative is. Although, it could be
vaguely annoying if someone is trying to wrap ones() or zeros() and
makes the same mistake.
I'm also wondering why `size(::Int) = ()` instead of `size(::Int) =
1`. Is it because `ndims(::Int) = 0`? Array(Int64) appears to have the
same behavior, so I will assume this rationale is correct.