Supporting array index as function