f(floor(x); args...) should work.

On Tue, Jul 21, 2015 at 10:14 AM, Linus Härenstam-Nielsen <
linush...@gmail.com> wrote:

> I am looking for a way to automatically pass on all keyword arguments
> through a function. Naively I would like to be able to do something like
> this:
>
> f(x::Int; y::Int=5, z::Int=3) = x+y+z
> f(x::Float64; args...) = f(floor(x), args...)
>
> But that doesn't work currently (actually, it causes StackOverflowError in
> 0.4.0). So far I've been using the following instead:
>
> f(x::Float64, y::Int=5, z::Int=3) = f(floor(x), y=y, z=z)
>
> But that gets messy very quickly if there are several keyword arguments to
> handle. Does anyone know of a clean way to do this?
>
>
>

Reply via email to