Thanks for clarifying that Josh.
I thought my issues were because of a subtlety of Julia's type system that
I did not understand.
Thanks Matt,
I kind of like the explicit nature of "Exactly". I will have to let the
idea sink in a bit more.
On Saturday, November 14, 2015 at 10:59:26 AM UTC-5, MA Laforge wrote:
>
>
>> - `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
Instead of keyword argument ordering, you could use an "Exactly" wrapper
type. This would allow you to dispatch and potentially error if the exact
constraints cannot be satisfied.
immutable Exactly{T}
val::T
end
foo(Exactly(1.0), 2.0, Exactly(3.0)) # the second argument might get fudged
>
> 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
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.
You may have already known, but you can
OK, I'll give it a try (sorry about the length of the reply).
*Idea behind "timespace":*
Generates time vector (range) from sampling period & fundamental
Automatically computes # of time steps, N.
Why? Computation of N can easily be off-by-1 - if specified directly.
So... with timespace, users
Can you give a little more context for what you’re trying to do? I’m not clear
on the various behaviors you want from the different `timespace` variants.
I’m actually not sure whether the order can be relied on, but I think the
proposed API might be confusing for users of your function because
Hi users,
I want to be able to generate ranges using a syntax similar to:
t1=timespace(tstart = 2e-9, ts=1e-9, tfund=20e-9);
t11=timespace(fs=1/1e-9, tfund=20e-9, tstart=3e-9);
t2=timespace(tfund=20e-9, tstart=4e-9, ts=1e-9);
*Why not just use different function names?*Simply put, I would