public Object apply ( String source , int lineNo , int columnNo , Object funcBody , Vector paramNames , Vector arguments ) throws BSFException { Object object = eval ( source , lineNo , columnNo , funcBody ) ; if ( object instanceof Closure ) { // lets call the function Closure closure = ( Closure ) object ; return closure . call ( arguments . toArray ( ) ) ; } return object ; }
Allow an anonymous function to be declared and invoked