[Asterisk-Dev] Function format
Olle E. Johansson
oej at edvina.net
Thu May 19 23:33:32 MST 2005
Leif Madsen - Certified Asterisk Consultant wrote:
> On 5/17/05, Tilghman Lesher <tilghman at mail.jeffandtilghman.com> wrote:
>
>>As soon as you nest that deep (3 or more levels), it's going to look
>>ugly, no matter what the syntax. It's not that big a deal; move on.
>
>
> I disagree. By having curly braces you end up up doubling the number
> of closing braces required. While I'm not a parsing expert in
> Asterisk, I believe something like the following would be easier to
> read:
>
> Original:
>
> exten => 100,n,Goto(${IF(${EXISTS(${DB(foo/bar)})})}?:novalue)
>
> Proposed(?):
>
> exten => 100,n.Goto(%IF(%EXISTS(%DB(foo/bar)))?:novalue)
>
> You end up with half the number of closing braces, and is much easier
> visually on the eyes.
>
Agree. The % construct makes more sense and is easier to distinguish
from the variables. It will be much easier to teach a newbie.
/O
More information about the asterisk-dev
mailing list