Earlier quoted context omitted.
Just curious, is that taken from an actual language? Because I've wanted a feature like that for ages.
It exists in Ruby: [socket, window, file].each{|item| item.close()} http://codepad.org/GqNp94Iw It sort-of exists in Lisp-inspired languages (anything from Arc to Lua to Io) with appropriate boilerplate, for example: function apply(tbl, func) for key, val in ipairs(tbl) do func(val) end end apply({socket, window, file}, function (item) item.close() end) http://codepad.org/SNWO1Y6K
$_.close() for $socket, $window, $file;