On 5/13/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
What you are suggesting is essentially a different parameter expanson
paradigm than the one I have designed into fish. The underlying
concept in my expansion design is that everything is treated as an
outer product. Using this design, I can express almost every type of
operation that I often use in a way that is terse but very powerful.

Yes, it makes some sense to me too in the example of "img(seq 3).jpg",
but not with array slicing.

You are suggesting that a totally different paradigm might be better.
I think that with Bens suggestion of how to use brace expansion, the
concatenation paradigm will work. [...]

I guess you mean expanding "(command ...)".  Then parentheses inside
double-quotes would have to be escaped in order not to be expanded.

Otherwise I'm not sure how the idea of concatenating adjacent arrays
can be combined with Beni's suggestion for brace expanion.  Beni
suggested that adjacent arrays should be crossed (as currently) but
braces should concatenate arrays; you would have to write

   x[{5,(seq 2}]

for array slicing.  And how is this better than making brackets
concatenate instead (to which you were opposed)?


You said before that you think concatenation is more often useful, but
I can see two large classes of operations where an outer product is
what you want, namely array slicing and operations like 'rm image_(seq
12 49).jpg'. Both of these (to me) very common operations would
suddenly also require a bracket. This is not a major problem in
itself, but in _my_ experience, the outer product behaviour is more
often what you want, since the above two examples are used very
frequently by me. I haven't seen any examples of when string
concatenation is what you want. Could you give me some examples of
common operations where concatenation gives you a better syntax?

Am I misunderstanding again?  Array slicing is exactly where
cross-product is *not* useful, as it produces

   arr[5 1] arr[5 2]

when

   arr[5 1 2]

is more useful and more intuitive.  Using array concatenation instead
fixes this and then "img{(seq 12 39)}.jpg" must be written with
braces.

As I said, I think the advantage of having the cross-product operator
be explicit is that it is similar to Bash, and  the advantage of
concatenation that it is more intuitive because the elements are
adjacent.

Also it is not very orthogonal that the cross-product expansion
duplicates the purpose of {}.


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to