[asterisk-dev] Reverse Inheritance

Atis Lezdins atis at iq-labs.net
Wed Nov 12 17:45:34 CST 2008


On Tue, Nov 11, 2008 at 7:38 PM, Atis Lezdins <atis at iq-labs.net> wrote:
> On Tue, Nov 11, 2008 at 7:26 PM, Trevor Peirce <tpeirce at digitalcon.ca> wrote:
>> Tilghman Lesher wrote:
>>> On Monday 10 November 2008 23:07:19 Trevor Peirce wrote:
>>>
>>>> I would strongly advise against this as it starts to resemble math too
>>>> much and could misleading. As an alternative I suggest appending _ to
>>>> the variable name in contrast to prepending.
>>>>
>>> If the plus sign sounds too much like math, which is an objection I can
>>> understand, how about using the caret sign ('^'), which is another character
>>> that Jared Smith suggested in our discussion
>>
>> The caret did occur to me as a possible solution as well, but it is
>> already used to pass multiple values to some Dial options such as
>> G(context^exten^pri) and M(x[^arg]). Again, it would be confusing to
>> have multiple uses of the same character.
>>
>> As I am not a C programmer the coding inconvenience wasn't apparent to
>> me. Perhaps another potential idea would be to add an option to the
>> existing naming scheme?
>>
>> Forward inherit: _blah or __blah
>> Reverse inherit: _+blah or __+blah
>>
>> I think this sufficiently resolves the confusion that it could be a math
>> operator as the inheritance operator is still there.
>>
>
> Perhaps it's better to use functions as there are already GLOBAL(var)
> and SHARED(var). One way would be to have it set by PARENT(var) and
> read by SHARED(var), but some other namespace (and function name)
> could be used too.
>

BUMP!

I'm not very much insisting, however as i recall - main argument for
introducing SHARED() function was that those variables could change at
any time, so users must take extra care when accessing their value.
With + or ^ it would be the same - you modify variable in child
channel with special prefix, but access in parent channel as regular
variable which shouldn't be used in loop statement etc directly, but
copied first.

Btw, I haven't looked at this SHARED() stuff closely - so i wonder,
what's the difference between Reverse Inheritance and SHARED()
varibles, so far i just had feeling that SHARED was reverse inherited.

Regards,
Atis

-- 
Atis Lezdins,
VoIP Project Manager / Developer,
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835



More information about the asterisk-dev mailing list