test_one {
test_two $1 $2
echo -a Called as a command $result
echo -a Called as an identifier $test_two($1,$2)
}
test_two {
if ($1 isin $2) {
return true
}
else {
return false
}
}
If you call it as a command then the return value is stored in $result
If you call the alias as an $identifier it is replaced with the return value
^ this is why you were seeing TRUE unknown command, since $test_two($1,$2) was replaced with "TRUE" and that was attempted as a command in itself.