[Back]


Talks and Poster Presentations (with Proceedings-Entry):

M.A. Ertl, B. Paysan:
"Closures - the Forth way";
Talk: 34th EuroForth Conference, Edinburgh; 2018-09-14 - 2018-09-17; in: "34th EuroForth Conference", (2018), 17 - 30.



English abstract:
In Forth 200x, a quotation cannot access a local
defined outside it, and therefore cannot be
parameterized in the definition that produces its
execution token. We present Forth closures; they
lift this restriction with minimal implementation
complexity. They are based on passing parameters on
the stack when producing the execution token. The
programmer has to explicitly manage the memory of
the closure. We show a number of usage examples.
We also present the current implementation, which
takes 109~source lines of code (including some extra
features). The programmer can mechanically convert
lexical scoping (accessing a local defined outside)
into code using our closures, by applying assignment
conversion and flat-closure conversion. The result
can do everything one expects from closures,
including passing Knuth's man-or-boy test and living
beyond the end of their enclosing definitions.


Electronic version of the publication:
https://publik.tuwien.ac.at/files/publik_277357.pdf


Created from the Publication Database of the Vienna University of Technology.