look at promote and convert.  you may be able to promote to some common 
intermediate type, do the the calculation, and then convert back again.

On Sunday, 20 April 2014 05:31:40 UTC-3, MikeEI wrote:
>
> I hope not too contrived, just for learning the Julia style:
> Let's say one wants to implement different day count methods that have 
> same argument types (enddate, begindate), using (-), means not using 
> different function names. Which way would You recommend to realize 
> something like this:
> (-) (enddate, begindate) =  (alg for # of calendrical days in between)
> (-) (enddate, begindate) =  (alg for # of interest days in between)
> (-) (enddate, begindate) =  (alg for # of work days in between)
>
> Could it be done via multiple dispatch and different return type?
> Or via higher order function, defining subtraction beforehand?
> Or does the "problem" just require different function names?
>
>
>

Reply via email to