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

Re: Typeset with array



On Fri, 19 Jun 2015 12:39:30 +0100
Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> I've got as far as a successful
> 
> % typeset array=(one two buckle my shoe)
> % print -l $array
> one
> two
> buckle
> my
> shoe
> 
> but there's a lot more debugging and testing to do.
> 
> This is on a branch typeset-array, which I'll push so you can have a
> look.

Pushed.  Fairly stable, but a couple of tests failing:

- I haven't implemented XTRACE yet.  Will follow.

- The new interface "fixes" the old behaviour

  typeset noktfoo=`echo noktarg1 noktarg2`

so that this now assigns a scalar to noktfoo with no wordsplitting.
This is certainly correct for the interface we are trying to implement,
because it's what bash does.  However, it was previously controlled by
KSH_TYPESET.  What's the right way to do it from now on?  I can probably
kludge in the old behaviour with NO_KSH_TYPESET if it seems desirable,
though logically that shouldn't really control the reserved word
interface which should parse consistently.

Anyway, I haven't touched that test case for nokshtypeset yet.

pws



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