Also, for many things where you would use a mask like this in Matlab you can actually use the condition directly in Julia, saving the allocation and maybe optimizing in other ways. Compare Matlab’s
x = 1:10;
all(x.^2 < 9);
which corresponds to
x = 1:10; % allocates
y = x.^2; % allocates
z = y < 9; % allocates
z(1); % true
z(2); % true
z(3); % false: return false
to Julia’s
x = 1:10;
all(x -> x^2<9, x)
which is
x = 1:10;
x[1]^2 < 9; # true
x[2]^2 < 9; # true
x[3]^2 < 9; # false: return false