Functional programming is a thing in many languages today, and higher order functions are its masterpieces. And higher order functions demand functions to be objects that can be passed around, aka lambdas.

Since vimscript and vim9script both have lambdas, as well as functions like filter and map taking other functions, can we have a tag?

Here's a list of questions that makes reference to lambdas in Vim:

  • 2
    Tags should naturally be added as questions with that category are introduced and need to be grouped. Maybe you can either add to this question a list of questions that fit that tag or make an answer with the same info. That will help show how you propose to use the tag.
    – Dom Mod
    Feb 19, 2022 at 18:33

1 Answer 1


My personal opinion, with influence from Martin's comments on previous tag-related things: I don't see vimscript lambdas being a high-signal technical subject in which you can have expertise, and I find it unlikely that people are trying to connect to questions specifically about vimscript lambdas.

From a community perspective: if people want the tag, so it shall be :)

A technical nit: "lambda" is not the name for a function that can be "passed around." There are lots of concepts at play here:
  • A "lambda" is a (syntactic) expression whose value is a function, sometimes called a closure when it also creates a lexical (or dynamic) closure, which most do.
  • A language has "first-class functions" when a function is a valid kind of value, for example, when it is possible to construct functions and pass them as arguments.
  • First-class functions are used by most kinds of functional programming, as noted, usually as arguments to higher-order functions. These arguments need not be lambdas (if the language supports proper first-class functions). Other kinds of syntactic expressions can evaluate to functions; lambdas are but one kind.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .