In general, I am more concerned about the following scenario: type A
makes sense, type B in general, does not, yet a subset of type B values
can be converted to A in a reasonable way, so an the implementation
performs this silently and everything seems fine.

But at the same time, had I known that I left a type B value in there, I
would be concerned, eg because I am assuming that it is exact when it
isn't (integers vs floats) is problematic, or that conversion is
possible only for a subset of the domain, and other values are possible
but rare enough for my unit tests not to discover them, and will strike
me on the nose at some future point like a rake carelessly left in the
grass.

Best,

Tamas

On Sat, Nov 29 2014, Stefan Karpinski <[email protected]> wrote:

> Our conversions throw errors when the value cannot be converted exactly these 
> days so it could be done pretty safely. But yes, this is just because there's 
> no applicable method of linspace.
>
>
>> On Nov 29, 2014, at 7:07 AM, Tamas Papp <[email protected]> wrote:
>>
>> I think of this as a feature: using a float when only an integer makes
>> sense is most likely a bug in my code. Automatic conversion would mask
>> the problem.
>>
>> Best,
>>
>> Tamas
>>
>>> On Sat, Nov 29 2014, [email protected] wrote:
>>>
>>> One of the primary paradigms of Julia is the use of multiple dispatch, that
>>> is choosing which method to call based on the types of the parameters
>>> provided.  To quote from the manual
>>> http://docs.julialang.org/en/latest/manual/methods/#defining-methods "No
>>> automatic casting or conversion of function arguments is ever performed:
>>> all conversion in Julia is non-magical and completely explicit."
>>>
>>> Cheers
>>> Lex
>>>
>>>> On Saturday, November 29, 2014 8:17:26 PM UTC+10, Christoph Ortner wrote:
>>>>
>>>>
>>>> In Julia 3.3  `linspace(0, 1, 10) `  works, but    `linspace(0, 1, 10.)`
>>>> does not.
>>>>
>>>> Why is the type not automatically converted to Int when possible? Is this
>>>> intended or a bug?
>>>>
>>>>    Christoph
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>

Reply via email to