set boolean after comparison

Hi there,
Sorry if the title doesn't mean much to you, I don't know how to sum up my pb in one line.
I'd like to set a value to 0 or 1 depending on the result of a comparison. Here's what I do:

supernova:~# a=
supernova:~# isempty=$([[ -z $a ]] && echo 1 || echo 0)
supernova:~# echo $isempty
1
supernova:~# a=something
supernova:~# isempty=$([[ -z $a ]] && echo 1 || echo 0)
supernova:~# echo $isempty
0

Is there any more trivial way to do that?
Thans in advance
Santiago

Depends on the shell you're using. You could use something like this:

[ -z "$a" ]&&isempty=1||isempty=0

Thanks Radoulov, that's better!
I was wondering if there was a way to do something like

supernova:~# isempty=$(( -z "$a" ))
supernova:~# isempty=$(( "$a"=="" ))

But this doesn't work.

Another approach:

[ ! -z "$a" ];isempty=$?

Interesting!
Thanks radoulov for taking some time for me.