News for hackers. Stuff that matters.
Re:The Y Combinator (no, not that one) – A Crash Course on L... by anatoly on Thursday September 11, 2014 @02:41AM (#8301186)
Why? Is it unreasonably difficult for you to implement recursion via direct self-reference in your language? Or do you just not want to because the Y combinator is there and it's cool?
Re:The Y Combinator (no, not that one) – A Crash Course on L... by fexl on Sunday September 21, 2014 @12:34PM (#8347518)
OK, I went ahead and revived the "==" syntax for recursive definitions, so you don't have to use '@' (fixpoint) explicitly.

https://github.com/chkoreff/Fexl/commit/57b841cb6c2347cad147...

Re:The Y Combinator (no, not that one) – A Crash Course on L... by fexl on Thursday September 11, 2014 @10:42AM (#8302836)
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.

Thanks for the food for thought.

Re:The Y Combinator (no, not that one) – A Crash Course on L... by fexl on Thursday September 11, 2014 @10:50AM (#8302891)
Postscript: You might well ask why not just use "=" only, and assume that all definitions are potentially self-referencing?

That's a non-starter because I find that redefinition is the more common intent:

    \x=4
    \x=(* x 5)
    \x=(+ y x)
In those cases I don't want x defined in terms of itself, but rather in terms of the previous definition of x.

That is why I would insist on a special token such as "==" to express the intention of self-reference.