4

using compiler directives like

#if A
some instructions 
#elseif B
some instructions
#end

In C\C++ language, one can tell the compiler to ignore some parts of code under some conditions. I`m curious about to know if there is an equivalent of this feature in Julia language.

Gnimuc
  • 8,098
  • 2
  • 36
  • 50

1 Answers1

7

@static is what you're looking for.

@static if A
  some instructions
elseif B
  some instructions
end
Gnimuc
  • 8,098
  • 2
  • 36
  • 50
  • Cross posting from [Julia Discourse](https://discourse.julialang.org/t/equivalent-of-c-c-compiler-directives-in-julia/10480). – Arda Aytekin Apr 23 '18 at 08:43