(no subject)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

(no subject)

XenoLiz
ï
On the contentious issue(problem) of lambda function can look imposing new keyword:
Lua :
    local local_f = function(x,y) return local_f(x)+local_f(y) end --- not work
    local local_g
    local_g = function(x,y) return local_g(x)+local_g(y) end  -- it`s half decision
 
Lua_New:
    local local_f = function(x,y) return lambda(self, x)+lambda(self, y) end
    a={ __main=function(x) return lambda(self.super, x.value) end, __run=function(x,y) if x>1 then return function(a,b) return lambda:1:(self, x-1, a) | lambda:1:(self, y-1, b) end  return 1/y end }
 
or something of this kind
Reply | Threaded
Open this post in threaded view
|

Re:

KHMan
XenoLiz wrote:
> On the contentious issue(problem) of lambda function can look imposing
> new keyword:
> Lua :
>     local local_f = function(x,y) return local_f(x)+local_f(y) end ---
> not work
>     local local_g
>     local_g = function(x,y) return local_g(x)+local_g(y) end  -- it`s
> half decision
>  
> Lua_New:
>     local local_f = function(x,y) return *lambda*(self,
> x)+*lambda*(self, y) end
>     a={ __main=function(x) return *lambda*(self.super, x.value) end,
> __run=function(x,y) if x>1 then return function(a,b) return
> *lambda:1:*(self, x-1, a) | *lambda:1:*(self, y-1, b) end  return 1/y end }
>  
> or something of this kind

Unnecessary verbiage. The function definition syntax sugar does
this well enough, please read the reference manual again.

-- 
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia