ok
On Thursday, April 7, 2016 at 1:48:50 PM UTC-4, Yichao Yu wrote: > > > > On Thu, Apr 7, 2016 at 1:14 PM, Jeffrey Sarnoff <jeffrey...@gmail.com > <javascript:>> wrote: > >> thanks for the coverage Tamas; I did not check v0.4. from >> >> Julia Version 0.5.0-dev+3313 Commit 5e01b1a (2016-03-29 15:14 UTC) >> System: >> Windows (x86_64-w64-mingw32) CPU: Intel(R) Core(TM) i7-4960X CPU @ >> 3.60GHz >> >> Empty blocks, the ultimate in code compression. With v0.5.0-dev, used as >> he wrote, they do not behave as `pass`; they show up (llvm --> Intel) as >> opcode ud2 (Undefined/Invalid): >> > > There may be bugs but it is likely fixed on master. If not, please report > a bug. > >> >> >> f_nothing(x) = nothing ; >> f_emptyblock(x) = begin end ; >> from code_llvm: f_nothing(Int32) { return void }; >> f_emptyblock(Int32){ unreachable } ; >> from code_native: f_nothing(Int32) { push move pop return }; >> f_emptyblock(Int32){ push move ud2 } ; >> >> >> >> UD2--Undefined Instruction >> OpcodeInstructionDescription >> >> 0F 0B >> >> UD2 >> >> Raise invalid opcode exception >> Description >> >> Generates an invalid opcode. This instruction is provided for software >> testing to explicitly generate an invalid opcode. The opcode for this >> instruction is reserved for this purpose. >> >> Other than raising the invalid opcode exception, this instruction is the >> same as the NOP instruction. >> Operation >> >> #UD (* Generates invalid opcode exception *); >> Flags Affected >> >> None. >> Exceptions (All Operating Modes) >> >> #UD - Instruction is guaranteed to raise an invalid opcode exception in >> all operating modes. >> >> >> >> On Thursday, April 7, 2016 at 7:29:18 AM UTC-4, Tamas Papp wrote: >>> >>> Thanks, I always forget that empty blocks return nothing. >>> >>> Best, >>> >>> Tamas >>> >>> On Thu, Apr 07 2016, Mauro wrote: >>> >>> > 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 >>> >>> >