Pragmatic directives: Difference between revisions

Content added Content deleted
Line 239: Line 239:


=={{header|Julia}}==
=={{header|Julia}}==
Julia has a number of macros which act as compiler directives. For example, the <code>@inbounds</code> macro disables runtime checking of array bounds within a block of code marked by this macro, which sometimes improves performance.
Julia has a number of macros which act as compiler directives. For example, the <code>@inbounds</code> macro disables runtime checking of array bounds within a block of code marked by this macro, which sometimes improves performance. Example:
<lang julia>x = rand(100, 100)
y = rand(100, 100)

@inbounds begin
for i = 1:100
for j = 1:100
x[i, j] *= y[i, j]
y[i, j] += x[i, j]
end
end
end
</lang>


=={{header|Kotlin}}==
=={{header|Kotlin}}==