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

Re: 4.0.1-pre-1



On Feb 17, 12:53am, Peter Stephenson wrote:
} Subject: Re: 4.0.1-pre-1
}
} Ignoring most of the items which are associated with long discussions
} (pah!) or the ones which may not even be bugs (pah! pah!):

We should at least record somewhere (the BUGS file?) those that really
are bugs, so that we don't forget to address them later.

} > There's the ksh incompatibility with array export, 9576.
} 
} There's some commented-out code in there in one place already.  I think we
} should make ksharrays export the first word and with noksharrays, to be
} logical, export the array joined the same way we always get an array as a
} single word (c.f. singsub()).  We should make sure we don't export the
} array if it's tied to a colon-array.  I don't think we should export
} associative arrays at all --- the order is undefined, so we can't guarantee
} compatibility with ksh, nor promise a particular form for the non-ksh
} exported value.  Unless anyone has ideas.

The way ksh appears to treat an unsubscripted associative array reference
is to substitute the element whose hash key is "0".  That is, no matter
what kind of array it is, $array == $array[0].  The associative array
code in getstrvalue() already does this, but only when `emulate ksh' is
in effect (just ksharrays is not enough to activate it).

So one issue is whether `emulation == EMULATE_KSH' should be replaced by
`isset(KSHARRAYS)' in a number of places in params.c.

For noksharrays, I think we should just leave well enough alone and not
export the arrays at all.  The only reason to export one is because you
want to import it again, and tying to a colon-array is a more reliable
way of accomplishing that.  Of course there are joining/splitting issues
either way.

We could export an array as a whole bunch of variables ARRAY[0]=... etc.,
but then some programs (older shells in particular) get all huffy because
the string to the left of the `=' is "not an identifier".

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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