Broadcast


                sqrt.([1, 4, 9]) # Notice the dot after `sqrt`
                # Outputs
                # 3-element Vector{Float64}:
                #  1.0
                #  2.0
                #  3.0         
            

The above is an example of applying a function that usually takes a single input to an array of values. The syntax that does this is the dot after the function name and before the parameter list. The syntax can be used with anonymous functions too:


                (x->2*x).([1,2,3])
                # Outputs [2,4,6]
            

This feature reminds me of using map in Haskell, which seems to do a similar thing.

This dot syntax is not available for macros, as in you can't use a macro with a dot after it like you can a julia function. However, with some thought they can be used: here is an example:


                using Printf
                (x -> @printf("%5d\n", x^3)).(1:5)
                # Output:
                1
                8
               27
               64
              125