[Asterisk-Users] Re: Everyone-- the scoop on Bison/Flex --

Moises Silva moises.silva at gmail.com
Fri Jun 3 13:32:49 MST 2005


i think is very usefull actually. please keep us updated about this issue.

best regards

On 6/3/05, Steve Murphy <murf at e-tools.com> wrote:
> On Gnu, 2005-06-03 at 10:38 -0500, Tony Mountifield wrote:
> >
> > I was trying to do something today for which I would have found the
> > following construct VERY useful:
> >
> > $[ expr1 ? expr2 : expr3 ]
> >
> > which, obviously, would evaluate expr1 as boolean, and return expr2 as
> > the expression value if expr1 was true, and return expr3 otherwise.
> >
> > e.g. SetVar(CLID=$[ $[ ${CLID} : 00 ] ? ${CLID:2} : 44${CLID:1} ])
> >
> > Or is it already lurking in there and I didn't know?
> >
> > I had to use a couple of GotoIfs instead.
> >
> 
> Shucks, now I'm kicking myself for not thinking of that myself!
> 
> Actually, it's lunchtime, had a moment, so I just threw it in. I'll test
> it out later, and if it works like I'd expect I'll submit a bug+patch
> and see if anyone else would like this. Maybe they'll incorporate it. I
> have to take some time and document it properly.
> 
> The way I set it up, is the test is true if expr1 is a string and not
> null (or "") , ... and true if a number, and not zero. Depending on the
> test, expr2 or expr3 are the result, without any forced type
> conversions.  I'll send you a note as to which bug it is, so you track
> it, if you are interested.
> 
> murf
> 
> --
> Steve Murphy <murf at e-tools.com>
> Electronic Tools Company
> 
> 
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
> 
> 
> 


-- 
"Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org"



More information about the asterisk-users mailing list