[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

null list concatenation



One of the things which has been bugging me lately is the way that
list concatenation works. In most cases, I prefer it to rc's strict
ruling (I think - I haven't really used it in anger yet). But in the
case where at least one of the lists is empty, things aren't so hot.
Mainly because it's such a break from traditional shell behavior:

x =
echo $x/bin

produces nothing, which isn't necessarily what is wanted. Paul has suggested
using:

x =
echo $^x/bin

instead, which is a reasonably workaround if you're writing scripts, but it's
something else to remember when you're working interactively across different
environments, using n different shells each day. I think it's in the same
category of implicit ^ operators.

However, changing es's default behaviour isn't a good idea, because it's
regular (and correct) as it is. So how about some more re-writing, to
produce another hook function:

echo $x^$y
=>
echo <={%concat $x $y}

...then I can break my own environment without upsetting everyone else. :-)

Steve.