This could actually be solved by having something like this in base:

start{T}(x::T) = error("$T is not iterable. Try implementing start(::$T), 
done(::$T, state), next(::$T, state)")

The basic problem here is, that Julia has weakly enforced interfaces, which 
often ends in no method errors instead of something meaningfull for people 
who don't know the implicit interfaces.

Am Montag, 20. Juli 2015 21:09:00 UTC+2 schrieb Kaj Wiik:
>
> I started to get a strange error while debugging my code, here's a 
> simplified example:
>
> julia> function foo(a)
>            println("foo..")
>        end
> foo (generic function with 1 method)
>
> julia> a = foo(2)
> foo..
>
> julia> a,b = foo(2)
> foo..
> ERROR: `start` has no method matching start(::Nothing)
>
>
> So, the problem was a missing return value, it is strange that missing one 
> value did not give error but two values.... It took a quite long time to 
> track this down. Perhaps a bit more informative error message would be 
> possible...?
>
> Cheers,
> Kaj
>
>

Reply via email to