Re: [Vala] RAII support in VALA¿??¿?



hi:
have Vala suppor to RAII like c++, D, c# or ruby???

http://en.wikipedia.org/wiki/Resource_acquisition_is_initialization

In c# something like this:

string line;
*using (StreamReader sr = new StreamReader("file.txt"))*
{
   line = sr.ReadLine();
}

// **sr ** is closed already!!!!!


In ruby something like this:

File.open("logfile.txt", "w+") do |logfile|
  logfile.write("hello logfile!")
end

#logfile is closed!!!!!!

regards.





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