foo(x) = nothing

gives a function that returns nothing, unexceptionally.

foo(x) = begin end

gives a function that generates an exceptional opcode for `unreachable`

On Thursday, April 7, 2016 at 7:04:52 AM UTC-4, Tamas Papp 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