On Tue, Jul 21, 2015 at 10:48 AM, Stefan Karpinski <ste...@karpinski.org> wrote: > f(floor(x); args...) should work.
Relevant documentation is here[1] in case you have other confusions about keyword arguments. [1] http://julia.readthedocs.org/en/latest/manual/functions/#keyword-arguments > > 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? >> >> >