[Devel] 'switch' statements

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Jul 12 13:23:52 CEST 2005


Hi everybody,

form consistency point of view, I totally agree with Juha's suggestion - 
go for a C-like language and use break only for switch and return for 
exiting the routes.
on the other hand, I worry about backward compatibility - the change 
will have quite an impact - and SER compatibility (SER scripts will not 
work on OpenSER).

IMHO we should go for a middle stage (as Daniel suggested): the syntax 
will accept break outside switch, but generating a warning and 
converting it internally to return(1); break will be normally accepted 
in switches.


regards,
bogdan


Daniel-Constantin Mierla wrote:

> On 07/11/05 21:52, Juha Heinanen wrote:
>
>> Daniel-Constantin Mierla writes:
>>
>> > It is similar with C 'switch' construct, but it uses 'sbreak' 
>> instead of > C-'break', because in openser the keyword 'break' is 
>> already used for > other meaning. I am not fully convinced whether to 
>> use this 'sbreak' > keyword, or better 'esac' (shell-like), any 
>> better idea?
>>
>> since the language is changing anyway, why not introduce "return" that
>> returns from a route block and then use break to beak from switch and
>> possibly other statements you come up with.  then semantics would be the
>> same as in c.
>>  
>>
> this is an option, too. But I am afraid that some users will be scared 
> when they will see that compatibility is broken and they will not 
> easily test the development version using their old config file. Maybe 
> a intermediary version that display warnings at startup that 'break' 
> is obsolete and will be dropped soon in favor of 'return' would be 
> better;
>
> 'esac' seems more appropriate to avoid more mess up between 'break' 
> and 'sbreak'.
>
> Daniel
>
>> -- juha
>>
>>  
>>
>
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel
>




More information about the Devel mailing list