Thread: Window Chaining
View Single Post
03/07/14, 04:35 PM   #10
SinusPi
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 18
Actually, there's a technicality:

Code:
 -- tmp = T.__index(T, SetHidden) -- 1st anon function runs and returns the 2nd anon function
This here isn't really an anon function - it's a "normal" function in the metatable. You can get it with getmetatable(CHAIN(boo)).__index (if you'd ever need it, of course).
Code:
-- :tmp(true)  -- calls 2nd anon function which calls SetHidden on object and returns self (i.e. T)
Now THIS is a proper anon function. And wasteful, too - each time you call something in the chain, a new function gets made to handle that specific call. But it's quick and easy to use, so why worry about being optimal...
  Reply With Quote