I additionally submit another test case.

let Y = {f -> (({x -> f ({y -> x(x)(y)})}) ({x -> f ({y -> x(x)(y)})}))}
let Fact = {f -> {x -> (x == 0 ? 1 : x * f(x - 1))}}
echo Y(Fact)(5)

I expect this script prints 120 but I got E110: Missing ')' in 7.4.2049 (and 
also with the experimental patch).
Is there something wrong with the above code or is there some bug in the 
parsing code in eval.c?

Here are the counterparts in Python
Y = lambda f: (lambda x: f (lambda y: x(x)(y))) (lambda x: f (lambda y: 
x(x)(y)))
Fact = lambda f: lambda x: (1 if x == 0 else x * f(x - 1))
print Y(Fact)(5)

and in JavaScript
var Y = function(f){ return (function(x){ return f (function(y){ return 
x(x)(y); }); }) (function(x){ return f (function(y){ return x(x)(y); }); }); };
var Fact = function(f){ return function(x){ return (x == 0 ? 1 : x * f(x - 1)); 
}; };
console.log(Y(Fact)(5));

reference: 
https://en.wikipedia.org/wiki/Lambda_calculus#Recursion_and_fixed_points, 
https://en.wikipedia.org/wiki/Fixed-point_combinator#Fixed_point_combinators_in_lambda_calculus

Sincerely,
Ken Hamada

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui