Ertl, M. A. (2021). The Essence of Closures---A language design perspective. In Tagungsband zum 21. Kolloquium Programmiersprachen und Grundlagen der Programmierung (pp. 26–33). Kiel Computer Science Series / Self-Publishing of Department of Computer Science, Kiel. http://hdl.handle.net/20.500.12708/55693
21. Kolloquium Programmiersprachen und Programmierung (KPS 2021)
-
Event date:
27-Sep-2021 - 29-Sep-2021
-
Event place:
Kiel, Germany
-
Number of Pages:
8
-
Publisher:
Kiel Computer Science Series / Self-Publishing of Department of Computer Science, Kiel, 2021/7/Kiel
-
Abstract:
Closures are originally associated with lexically
scoped name binding. However, in the course of
implementing closures in Gforth, it turned out that
the actual function (the essence) of closures is to
communicate data between closure creation and the
closure execution (with the closure call usually
being far from the closure creation). This paper
presents a simple language extension for C:
two-stage parameter passing, implemented with flat
closures; the first stage creates a closure, the
second stage calls it. Nested functions and access
to outer locals are not needed.