unção @map em vb.net

Estou tentando implementar a função de mapa no VB.NET e tentei o abaix

 Function Map(a,f)
    Dim i
    for each i in a
      f(i)
    next
 End Function

 Function alert(a)
    MessageBox.Show(a)
 end function

Mas o código acima não está funcionando e o alerta não é declarad
Por favor me ajude nisso.