AlirezaGH
AlirezaGH

Reputation: 399

Equivalent of c\c++ compiler directives in Julia

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.

Upvotes: 4

Views: 118

Answers (1)

Gnimuc
Gnimuc

Reputation: 8566

@static is what you're looking for.

@static if A
  some instructions
elseif B
  some instructions
end

Upvotes: 7

Related Questions