On Mon, Jan 21, 2013 at 8:33 PM, Gustavo Sverzut Barbieri
<[email protected]> wrote:
> On Mon, Jan 21, 2013 at 9:22 AM, Cedric BAIL <[email protected]> wrote:
>> On Mon, Jan 21, 2013 at 7:39 PM, Gustavo Sverzut Barbieri
>> <[email protected]> wrote:
>>> This macro declares a variable and do a mix of do-while split into two
>>> macros that will likely cause errors. Why did you choose that over let user
>>> declare the variable, avoiding the do-while?
>>
>> Because you need to execute something at the end of the block anyway.
>> I first tried with a for, but it's even more error prone in fact.
>
> I don't get. You keep begin/end macros, just do not use the new block
> as it will break things as goto to outside (variable won't exist
> anymore) and some other constructs. People usually don't expect these
> things.

I like the fact that the variable is valid only inside the block. This
force it to have a life time related to the call to eina_cow request.
Sadly I can't really prevent return and goto from inside the block.

> what did you try with for? to have for (i = 0; i < 1; i++,
> eina_cow_done())? so the braces would be on user? It is very unlikely
> to work well in C because you can't declare a new variable in for().

Something like that, but requiring the user to provide the variable.

> I'm fine with begin/end, but the do-while is not expected and I fear
> it will bring headaches. Just use a variable declared by user and have
> him to begin/end.

I really do like the idea of having a new block here. It reduce
problem (like the variable being used after eina_cow_done).
--
Cedric BAIL

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to