Anonymous function in BrightScript
Not the prettiest code but if you must use anonymous function as a function argument in BrightScript you can. This would be the equivalent to JavaScript Arrow Function.
' This function applies a passed function to an argument '
apply = function ( a, fn )
fn(a)
end function
' Here we apply a string to an anonymouse function which prints its argument a '
apply( "foo", function(a)
print a
end function )