The official site shows the following function
square = (x) -> x * x
Then you can do something like
square(4)
Is it possible to do the above in a single line using anonymous function? I’m thinking of something like the following
(f = do (x) -> x * x) (4)
My code doesn’t compile but I’m hoping the intent is clear enough
I’m not sure what the application for this is but you can substitute the definition of
squareforsquareif you wrap it in parentheses: