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: Eric Blake
Subject: Re: Passing variables by reference conflicts with local
Date: Tue, 04 May 2010 07:40:54 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Lightning/1.0b1 Thunderbird/3.0.4

On 05/04/2010 03:11 AM, Marc Herbert wrote:
> I'd like to know why you absolutely want the callee to perform a
> side-effect on the caller. This is your original sin
> IMHO. Side-effects are evil, use as little of them as you can.

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 whenever "blackbox" returns only one value the whole thing
> can be much simpler, just: b=$(blackbox)

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.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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