>
> This looks like overengineering of what should be a simple problem. Why do 
> you want turn the keywords into arguments for dispatch? Dispatch is best 
> when you need different behavior for different types but here all your 
> input and output types are fixed.
>

I suppose there is some truth to that.  I also look at Julia's dispatch 
system as an alternative to a case statement.  But, unlike the case 
statement, you don't need to register the new function in the case 
statement.  The function signature (that includes KD) takes care of that.

You may have already known, but you can work with your keywords by doing 
> `kwdict = Dict(kwargs)`. That will let you do stuff like `haskey(kwdict, 
> :ts)` to decide which timespace algorithm to use.
>
Interesting... I never thought of that (not sure why).  Thanks.
 

> Some other points for future reference:
>
>   - `immutable KD{Symbol} end` does not force the type parameter to be a 
> symbol. It does the same thing as the more typical 'T' (which could be 
> :tfund, Int, Array{Symbol,2}, or anything else).
>
Hmm... I have been having trouble with this one.  I know I have succeeded 
with things like "abstract KD{T<:Number}" - but I don't seem to be able to 
do "abstract KD{T<:Symbol}", or "abstract KD{T::Symbol}".  I don't 
understand why I cannot get this level of control.  I would appreciate if 
you would have more insight on this part.
 

>   - timespace() and timespace(; kwargs...) are not separate methods. The 
> second one actually overrides any definition in the first one.
>
I should have known better than this.  I did not notice that mistake.  
Thanks.

Reply via email to