4 ms·
Well, if you're feeling really sadistic baremodule MyWay ref(x::AbstractArray, i::Int) = Base.ref(x,i+1) ref(args...) = Base.ref(args...) end
by KenoFischer 14y ago
Well, if you're feeling really sadistic
baremodule MyWay
ref(x::AbstractArray, i::Int) = Base.ref(x,i+1)
ref(args...) = Base.ref(args...)
end
is not that far away (I'm oversimplifying a little, but not much).
However, please don't do this as it breaks coherence within the community. I found 1-based indexes annoying at first, but have grown quite fond of them since.
- nnq 14y agoyeah, having mixed 1-indexes and 0-indexes code would be 10x worse than just getting used to 1-based, so hope people don't do that :)