The default example (Code examples) Mandelbrot set can be written cheaper:
f(z,a) = z^2 + a
mandelbrot(a, n=50) = (n == 0) ? 0 : f(mandelbrot(a, n-1) ,a)
or even
mandelbrot(a, n=50) = (n == 0) ? 0 : mandelbrot(a, n-1)^2 + a
Instead of
function mandelbrot(a)
z = 0
for i=1:50
z = z^2 + a
end
return z
end