I too would like this feature. It's just one more way to throw errors as
soon as possible when appropriate. Could it be solved with parametric
Functions? Does anything like this exist already?
mufun(f::Function{Tuple{arg1Type, arg2Type}, returnType}, args...) = ...
On Wednesday, April 29, 2015 at 2:54:02 PM UTC-4, Ryan Li wrote:
>
> Hi,
>
> As been mentioned in https://github.com/JuliaLang/julia/issues/1090, the
> return type of a function can be specified.
>
> First of all, I found this is not available in the current released
> version.
>
> Also I have another question related to this. If we can specify the return
> type of a function, could we also specify the return type of this function
> when it is used as input argument of another function? For example,
>
> function myfun1(x::Int, y::Int)::Int
> return x+y
> end
>
> function myfun2(func(::Int,::Int)::Int,x::Int,y::Int,z::Int)
> return func(x,y)+z
> end
>
>
> Best,
> Yingzhou
>