Re: [Vala] Confusing closure behavior



 
    > On Tuesday, 9 April 2019, 07:25:43 GMT+1, Vivien Kraus <vivien planete-kraus eu> wrote:  
Digging a little deeper, I have some more confusion.  This makes the
for-loop and the foreach-loop behave differently.  What do you think of:

The scope for i is main () and the for loop will finish when i is 1, The bodyof the loop won't be run when i 
is 1 though.
The foreach loop iterates over the array, but the end check is hidden in theunderlying code generated by 
Vala, The count isn't available to the Vala code.
I can't think of a way of fixing an enclosed variable at the point the closure isdeclared, rather than run.
Al
  


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]