Lambda expressions

Lambdas are anonymous functions that can be really useful when working with somewhat straightforward logic.

Here's how we would define AnimalGreeting from the previous example using lambda expressions:

let AnimalGreeting = {animal -> animal . ' says hello'}

Let's test it:

:echo AnimalGreeting('cat')
cat says hello

Lambdas provide short and sweet syntax for writing compact functions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.184.237