What is the best language-independent source for learning Lambdas / Closures?

Most programming languages ​​use lambdas / closures. Which linguistic source agnostic is recommended as the best to learn the basics of lambda?

Lambdas / Closures in different languages:

+7
closures language-agnostic lambda
source share
5 answers

If you just want something easily digestible, read the Introduction to Lambda Calculus and Diagram . Of course, this is not an agnostic language, but the implementation of the scheme is pretty close.

For a deeper understanding, read Types and Programming Languages - Benjamin Pierce. The theory of a programming language with a thorough study of lambda calculus. Fully agnostic language.

+8
source share

I think lambda is the simplest in Lisp, since it was designed for these kinds of things and dialects, the circuit tends to be the simplest.

It is no coincidence that the largest computer science book ever written uses the Scheme! Here's an introduction to SICP in lambda .

+4
source share

Lambda Calculus is a language agnostic. The answer depends on what you mean by "basics." The moment you choose a language, you have lost your agnostic requirements.

Javascript has a closure. I would add this to the list. Java does not exist yet.

I think that he returns to where you intend to use them in the end. Go back to Lisp or schema as they are the source if you want to be an old school. Choose Javascript or C # or Python if you are done using them in the main commercial language.

+3
source share

For a beginner who wants to learn the theoretical basics, Pierce’s Danben proposal is second to none.

But from the list you give, it looks like what you want - how to program effectively using first class class values, which is what lambda evaluates to. You will not get this experience, information or intuition in a language agnostic package. Worse, in real languages, many anonymous functions are created by partially applying Curried functions, and not through explicit lambda ; most people use first-class features that pretty much find lambdas quite annoying and difficult to read.

With this as a background, here are two tips:

  • If you are dead after learning about lambda , do something with Schema. Schemas, such as first-class functions and circuit notation, make brighter lambdas for programmers than many other functional languages.

  • As a newbie, you might be better off learning why people want to use these first-class features to get started. In this case, read Why functional programming questions from John Hughes. The Hughes document uses a designation that is somewhat linguistic-agnostic; this is not a designation of any language currently popular, but it is somewhat similar to Caml, F #, Haskell and ML.

+2
source share

I would not recognize them as a “language-independent” thing, firstly. I would recommend learning them in practice, first using them in Javascript, then expanding into another language (e.g. lisp, C #). Then, if you feel the need to go further, study the general theoretical material.

+1
source share

All Articles