True, I could implement it in terms of direct self-reference. At one point I used the "==" syntax for just that purpose:
\append==(\x\y x y \h\t [h; append t y])
Maybe I should resurrect that syntax option. :)
It was trivial to implement. When the parser sees the "==", it just automatically abstracts the symbol "append" from the definition and applies the fixpoint operator (Y combinator).
The only reason I eliminated "==" in the first place was that I was in the throes of using different syntaxes for lazy, eager, and self-referencing definitions. Now I've settled in on "=" always meaning eager evaluation, without exception. Then I got hyper-minimalist and said that's it, there's only one syntax for definitions, and it's "=", and if you want self-reference, use "@".
However, the decision to settle in on eager evaluation now frees up "==" once again as an option for self-reference. So I may bring that back.
It was trivial to implement. When the parser sees the "==", it just automatically abstracts the symbol "append" from the definition and applies the fixpoint operator (Y combinator).
The only reason I eliminated "==" in the first place was that I was in the throes of using different syntaxes for lazy, eager, and self-referencing definitions. Now I've settled in on "=" always meaning eager evaluation, without exception. Then I got hyper-minimalist and said that's it, there's only one syntax for definitions, and it's "=", and if you want self-reference, use "@".
However, the decision to settle in on eager evaluation now frees up "==" once again as an option for self-reference. So I may bring that back.
Thanks for the food for thought.