Use:

foo(x) = nothing

Note, you're suggestion also returns `nothing`.

On Thu, 2016-04-07 at 13:04, Tamas Papp <tkp...@gmail.com> wrote:
> Hi,
>
> What's the most compact form of writing a function in assignment form
> with an empty body? Eg is
>
> foo(x) = begin end
>
> the shortest?
>
> (context: I am using a local function for iterating over a collection in
> a function. for a particular set of argument types, it does nothing,
> hence the need. I am aware that I could be using Match.jl)
>
> Best,
>
> Tamas

Reply via email to