Brainfade time - what's the proper name for a 'local' handler?

Mark Stuart mstuart at adaptcrm.com
Thu May 27 11:57:20 EDT 2010


Ian,
Can't a function call within a Handler do what you are wanting?
Regards,
Mark Stuart


Ian Wood wrote:

> I remember that one of the recent(ish) versions of Runrev introduced
> handlers that sit inside handlers and can only be called from within
> that handler, but what's the proper name so that I can look up how to
> use them?

In other languages like JavaScript and Scheme that sort of thing is 
referred to as a closure - here's an example from Wikipedia:

   // Return a list of all books with at least 'threshold' copies sold.
   function bestSellingBooks(threshold) {
     return bookList.filter(
         function (book) { return book.sales >= threshold; }
       );
   }

But I don't know of a way to even emulate closures in RevTalk (though it

might be handy at times if we could).



More information about the use-livecode mailing list