//alias apple if (boat) return $!upper($1-) | if (carrot) echo -a $v1 - $apple($v1) - $v1 | alias apple

or
Code:
alias apple { if (boat) return $upper($1-) }

//if (carrot) echo -a $v1 - $apple($v1) - $v1

Returns: carrot - CARROT - boat
Expected: carrot - CARROT - carrot

I wasn't aware that $v1 was global, transcending scope, like a global variable.

(Also, $result is always empty. $result should contain CARROT.)


Well. At least I won lunch.
Good philosophy, see good in bad, I like!