On 5/14/06, Philip Ganchev <[EMAIL PROTECTED]> wrote:
On 5/10/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
> On 5/10/06, Philip Ganchev <[EMAIL PROTECTED]> wrote:
> >
> >
> > One way to achieve this is to make expansion work differently with
> > brackets than with other strings.  Currently,
>
> I am uncomfortable with making command substitution tokenize
> differently depending on whether we are in brackets or not. Introduces
> far too much modality.

It seems it currently works differently inside brackets.  If it didn't, then

   [a (seq 2)]

would expand to

    [a 1] 2]

and

    [a (seq 2) ]

would expand to

    [a 1 2 ]

So would it be such a leap to make sure that

    [a (seq 1 2)]

instead expands to

    [a 1 2]

and the array splicing problem is solved.


Dang, I _knew_ you where going to bring that up sooner or later. You
are perfectly correct, spaces are allowed between brackets. It's ugly
and slightly evil, but ever so useful. To make things worse, there is
an exception to this rule, since lone brackets are ok, since '[' is
often a symlink to 'test'. But still I think this is a relatively
small source of confusion making [] even more magic would in my
opinion be bad.

But I have though about scrapping the magic status of [], one could
popssibly do some form of magic, weird recombining of parameters
during expansion.

If given the three parameters '$foo[1', '5' and '7]', a clever
recombination pass coul try to make sure all variable array brackets
properly close. The set builtin could do the same. It's harder to
implement for sure, but [] would no longer be magic and the syntax
would remain otherwise unchanged. Might have weird corner cases,
though.

--
Axel


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