bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing variables by reference conflicts with local


From: Marc Herbert
Subject: Re: Passing variables by reference conflicts with local
Date: Tue, 04 May 2010 16:35:51 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Thunderbird/3.0.4

Le 04/05/2010 14:40, Eric Blake a écrit :
> Except that in computing tab completion, side effects are _all_ that
> you want - basically, Freddie's problem is how to populate the
> global completion variables from within helper functions.

Of course you want a side-effect in the caller, and my example
achieves that.  I only moved the side-effect from the callee to the
caller, from where it is spurious to where it is wanted.


> Except that it forks a subshell and consumes trailing newlines, and
> the whole point of this exercise is to avoid forks and spurious
> corruption of trailing newlines.

I fail to see the link between completion and newlines but that's
probably just because I am not interested enough. I will try to find
an alternative to eval $( )

Are you are worried about the *cost* of the subshell? How can
interactive completion be performance-sensitive?

In shell there is really not much left you can do if you forbid
yourself from forking. The whole philosophy is based on small
cooperating processes isn't it?
  http://www.faqs.org/docs/artu/ch01s06.html
I guess this is why it still stands today after decades while kids
play with shared memory and race conditions.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]