Anonymous Functions

This is an example of a single parameter lambda expression:


                sum(x -> x + 0.5, 1:5; init = 0.0)
            

This is an example of using a tuple as the single parameter in the lambda expression


                a = "abcde"
                b = "askde"
                r1 = sum( t -> t[1] != t[2] ? 1 : 0 , zip(a,b); init = 0)
                println("Differences in input strings: ", r1)
             

The above can be done using the following method which uses two parameters in the lambda expression. The parameters come from using map to iterate two lists at the same time


                r2 = sum( map((a,b) -> a != b ? 1 : 0, a, b); init = 0 )
                println("Differences in input strings: ", r2)