You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 4, 2019. It is now read-only.
Right now, we are far too liberal when recycling values. We should only allow the following behaviors:
Allow operations between arrays when their sizes are perfectly matched.
Recycle scalars so that they behave like an array of the same size as the non-scalar operand in an operation like addition or multiplication.
We should definitely not follow the R lead of recycling vectors of short length until they match the length of the longer vector. Only arrays whose sizes exactly match should be allowed to interact.
As an example of what we should not allow going forward, consider the following
julia> using DataArrays
julia> x = @data([1, 2, 3, 4, 5])
5-element DataArray{Int64,1}:
1
2
3
4
5
julia> y = @data([6, 7])
2-element DataArray{Int64,1}:
6
7
julia> x[:] = y
2-element DataArray{Int64,1}:
6
7
julia> x
5-element DataArray{Int64,1}:
6
7
3
4
5
This operation does not work on Julia's normal arrays. In general, we should always try to behave exactly like Julia's normal arrays, except with NA's added in.
The text was updated successfully, but these errors were encountered:
Right now, we are far too liberal when recycling values. We should only allow the following behaviors:
We should definitely not follow the R lead of recycling vectors of short length until they match the length of the longer vector. Only arrays whose sizes exactly match should be allowed to interact.
As an example of what we should not allow going forward, consider the following
This operation does not work on Julia's normal arrays. In general, we should always try to behave exactly like Julia's normal arrays, except with NA's added in.
The text was updated successfully, but these errors were encountered: