Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Typeset with array



On Jun 19,  9:16pm, Peter Stephenson wrote:
}
} 2. The only reason we left it that way by default is the fact that
} KSH_TYPESET was only ever a partial fix that didn't parse assignments
} properly.  With that objection removed there's no real reason for
} NO_KSH_TYPESET; and further anyone relying on
} 
}    typeset foo=`echo one=two`
} 
} doing what it now does needs to get out more as it's an accident
} waiting to happen.

There are a few instances of declarations using foo=`command` and/or
foo=$(command) in the completion code.  Arbitrary examples:

    _tla:47:  local expl1 expl2 tree_version=`$TLA tree-version`
    _rebootin:5:local loader=$(sudo detectloader -q)

Probably these are expecting single word responses.

In any case I also lean to this answer.

On Jun 19,  9:32pm, Peter Stephenson wrote:
}
} > 2. We don't have a distinct syntax for associative array assignment, so
} > this still works only for ordinary arrays.
} 
} Well, we don't have [ksh] syntax, but this should work:
} 
}   typeset -A hash=(bob robert bill william)

That's not quite what I was getting at -- rather I was pointing out that
you can't do

    typeset scalar=string array=(elem list) assoc=(key value)

all in one statement, because there's no way to distinguish (key value)
from (elem list) by inspection.



Messages sorted by: Reverse Date, Date, Thread, Author