4 ms·
Why didn't the language designers want closures? AFAIK they are pretty standard in many programming languages (even Java has them).
by aliasEli 5y ago
Why didn't the language designers want closures?
AFAIK they are pretty standard in many programming languages (even Java has them).
- martyalain 5y agoExploring another way is the first reason. The lambdas of this language are "pure" without any link with the context, a bit like "combinators" having access to global constants. The absence of closure is compensated by the possibility to apply these lambdas to any number of values, (less than, equal to or greater than the number of arguments). Another reason is the ease of implementation and use of these lambdas. Managing the local context by hand is a learning experience. This does not take away the interest of closures, it just puts their importance into perspective. More in this page http://lambdaway.free.fr/lambdawalks/?view=coding http://lambdaway.free.fr/lambdawalks/?view=coding Thank you for your feedback.
- aliasEli 5y agoI see, it is a very interesting tiny language. How do you handle scoping of variables, do you have dynamic scope like early lisp? PS: The web page is not very readable for me because it requires both horizontal and vertical scrolling.
- martyalain 5y agoThank you. It's indeed a "tiny language", a foreign dialect of lambda-calculus made easy, a dwarf installed on top of shoulders of giants, the modern web browsers, taking benefit from the powerful web technologies they bring for free and from the huge eco-system at their fingertips. About scope, the point is that there is "no scope", functions are like combinators, isolated in a global context where everything is defined, constants, primitives and user defined functions. You might see http://lambdaway.free.fr/lambdawalks/?view=closure http://lambdaway.free.fr/lambdawalks/?view=closure and http://lambdaway.free.fr/lambdawalks/?view=lambda http://lambdaway.free.fr/lambdawalks/?view=lambda About readability it's a matter of choice, 1D as in a book or 2D as in spreadsheet, who knows, and you might find more readable this one http://lambdaway.free.fr/lambdawalks/?view=fromroots2canopy http://lambdaway.free.fr/lambdawalks/?view=fromroots2canopy.