On Wednesday, April 30, 2014 2:09:45 PM UTC+1, Patrick O'Leary wrote:
>
> On Wednesday, April 30, 2014 7:52:16 AM UTC-5, Oliver Woodford wrote:
>>
>> Is that correct? If not, what really is the correct way to constrain 
>> input arrays to be homogenous?
>>
>
> The tendency in Julia is to embrace that it's a dynamic language, and not 
> excessively type constrain inputs. While I don't think there's a way to do 
> exactly what you want, why do you want to do it?
>
>  
When my function will be a lot slower if you pass in a heterogeneous array, 
and I want to avoid programmers accidentally and obliviously doing that. 
Now, I could convert heterogeneous arrays to homogeneous ones within the 
function, but the Julia style 
guide<http://julia.readthedocs.org/en/latest/manual/style-guide/#handle-excess-argument-diversity-in-the-caller>very
 sensibly counsels against that.

Reply via email to