On 5/9/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
On 5/9/06, Philip Ganchev <[EMAIL PROTECTED]> wrote:
> On 5/9/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
>
> > set foo[(seq 3 5)] foo bar baz
> >
> > [...] Parameter expansion will make sure that the
> > former example gets expanded into
> >
> > set foo[3] foo[4] foo[5] foo bar baz
>
> Is it not possible to instead make parameter expansion convert it to
> "set foo[3 4 5] foo bar baz"?  This is the more intuitive behavior to
> me.  The other one seems a bit magical and surprising.
>

How would you note the difference? In either case, you write 'set
foo[(seq 3 5)] foo bar baz' and you get the same results.

The kludge is apparent in that, as you mentioned,

   set foo[1 (seq 4 6)] a b c d

refers to the indexes 1 4 1 5 1 6, rather than 1 4 5 6 as one would
expect.  It's surprising; I would much prefer the latter.  Instead of
creating an illusion, why not change make expansion more intuitive?

But this
way, we don't make parameter expansion behave in a different, magical
way when operating on the set builtin, instead the same rules as
always apply.

Sorry, I was not clear.  I did not mean anything about the "set"
builtin.  I was suggesting that

   foo[(seq 1 2)]

should expand to

   foo[1 2]

not to

   foo[1] foo[2]

One way to achieve this is to make expansion work differently with
brackets than with other strings.  Currently,

   foo(seq 1 2)

Expands to

   foo1 foo2

Another way is to make the above behave instead as a concatenation of
the strings "foo" and "1 2", namely

   foo1 2

Then "foo1 foo2" can be achieved as

   foo{"",(seq 1 2)}


-------------------------------------------------------
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