On 5/26/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
Perhaps it could be used with $ to drop the sillyness with $ expanding to a single token inside "". Instead, [$foo] is always a single token. Worth considering.
Note that for indexing you the brackets to remain in the expansion (a[1] a[2]), but for general use you want the operator to disappear. [snip]
'foo[1' '2' '3]' It's not hard to update the code to guess the latter case, but I'd be surprised if there aren't any weird corner cases lurking around.
Yikes! Forget the implementation, this would be a weird corner case in the syntax, which is even worse ;-) If you want to go that way, at least tokenize on the brackets: 'foo[' '1' '2' '3' ']' or: 'foo' '[' '1' '2' '3' ']' But remember that set syntax should mirror $foo[abc] expansion syntax. We want something elegant that works for both, and splitting to multiple words like this doesn't look like somthing that fits expansion. How about this idea: let brackets be like braces but space-separated and the brackets remain in the expansion, and let them expand *before* brace and command expansion. Then 'a[7 (seq 2)]' expands into 'a[7]' 'a[(seq 2)]' which is then command-expanded into 'a[7]' 'a[1]' 'a[2]'. Subtle but appears to work. Don't know whether it matches the Right order of expansion in general. -- Beni Cherniavsky <[EMAIL PROTECTED]>, who can only read email on weekends. Governments are like kernels - everything possible should be done in user space. ------------------------------------------------------- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 _______________________________________________ Fish-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fish-users
