ksh syntax error: `(' unexpected

So I am trying to convert my bash script into ksh, and this is what I have in the file so far:

#!/bin/ksh

login()
{
        if [ "$ALPHA" = "" ]
        then
sendcmd BETA
else
sendcmd "$(xxd -c 32 -g 0 ${ZETA_ZETA} | awk '{print $2}')"
        fi
}

But when I run it:

$ ./test.sh  
./test.sh[3]: syntax error: `(' unexpected

Am I not seeing something here? I closed all of my () and I don't see any open parentheses...

---------- Post updated at 04:54 PM ---------- Previous update was at 04:39 PM ----------

Never mind, login() is already a pre-defined function in ksh that I didn't know about. Renamed my function and now it's working fine.

The customary way round this issue is to make sure that the string is never empty:

if [ "${ALPHA}""X" = "X" ]

And I realise that my answer is rubbish but there is still a potential syntax error if $ALPHA is blank.