That was just a simple example, but what if there were multiple results?
on *:text:*:#: {
....
calling somealias...
....
}
alias -l somealias {
...lost of complex stuff here...
var %var1 = ..., %var2 = blah blah, %var3 = somthing else, %var4 = ..., %varX = ...
...
}
Then the only way to solve it would be hash tables, but it would be slower to make a hash table, and populate it with the data.
It would be nice to be able to return an array.
However set -u0 does this, but it's somewhat messy. Also, all the lenghts of the variables differ, and the number of spaces/etc they contain is also different. /tokenize wouldn't work, nor would $gettok.
Unless escaping all the spaces, pipes or whatever, or using hash tables, or global variables (which would make it really messy, and hard to read), this wouldn't be possible. Also, not all the variables would be taken from a hash table. Some of them might have been calculated or altered in some way.