On 1/13/09, David Korn <dgk at research.att.com> wrote:
> cc: shell-discuss at opensolaris.org don.cragun at sun.com pkchris at
> users.sourceforge.ne
> Subject: Re: Re: [ksh93-integration-discuss] CR 6791838 Created P3
> shell/korn93 *ksh93* unset of a variablewhich is not set should return 0
> --------
>
>
> > Doesn't [[ ${x+y} ]] expand variable x?
> > x= ; x.get() { print "hello" ; } [[ ${x+y} ]] ; print $?
> > prints
> > hello
> > 0
> > ${x+y} will be a big performance regression if compared to if (unset -e x)
> >
> > Chris
> >
>
>
> It currently does expand x, but I don't think that this is necessary
> and I could change this.
Yes, and we have another syntax which is hard to memorize.
Why can't we use [[ -v x ]] to test whether x is a variable, [[ -N x
]] to test whether x is a nameref and [[ -F x ]] to test whether x is
a function?
> I could detect that x is followed by a + and just
> check for not set.
How does this help with functions and name references?
Jenny
--
Jennifer Pioch, Uni Frankfurt