In this very simplified example, I need to address both key and value of an array element:
declare -A writer writer[H.P.]=Lovecraft writer[Stephen]=King writ
From the Bash Reference Guide:
The positional parameters are temporarily replaced when a shell function is executed (see Shell Functions).
So you could do this:
fullname() { for first do echo "$first ${writer[$first]}" done } fullname "${!writer[@]}"