I've never understood why y-combinator is useful or impressive. Interesting, maybe, but not really useful.
I've never understood why y-combinator is useful or impressive. Interesting, maybe, but not really useful.
Although the Fexl language itself has syntax for recursive definitions, it translates everything to combinators internally, so there are no "symbol tables" or "environments" at run time. Therefore it uses the Y combinator to implement those recursive definitions.
A while ago I wrote this detailed example: http://news.ycombinator.com/item?id=2719635
tl;dr here is a non-recursive definition of the append function for two lists:
(Y \append \x\y x y \h\t cons h; append t y)
If you need more parentheses for clarity, here you go: (Y (\append \x\y x y \h\t cons h (append t y)))That may sound like bickering over a fine point, but I'm just saying that combinators can be more than a theoretical tool.
It seems reasonably fast for my purposes so far, and the expansion rule is just a one-liner: https://github.com/chkoreff/Fexl/blob/master/src/Y.c
http://www.dsi.uniroma1.it/~labella/absMcAdam.ps (or search with Google for an HTML translation).