Looking at the language spec, X10 has no syntactic support for
deterministic finalization. The common example is file access,
like this C# code:
using (File myFile = File.Open("foo.txt"))
{
/* Do something with myFile */
}
Similar things can be done in C++:
{
File myFile("foo.txt");
/* Do something with myFile */
}
In both cases, the file is closed at the end of the block and the
programmer cannot forget to write myFile.close(). While this mistake is
relatively easy to spot, consider exceptions. Usually, the close() call
should be inside a finally block.
In Scala it is possible to implement this as a trait.
http://blog.omega-prime.co.uk/?p=17
What does X10 offer?
--
Andreas Zwinkau
Karlsruhe Institute of Technology (KIT)
Institut für Programmstrukturen und Datenorganisation (IPD)
Lehrstuhl Prof. Snelting
Adenauerring 20a
76131 Karlsruhe
Phone: +49 721 608 48351
Fax: +49 721 608 48457
Email: [email protected]
Web: http://pp.info.uni-karlsruhe.de/person.php?id=107
KIT – University of the State of Baden-Wuerttemberg and
National Research Center of the Helmholtz Association
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
X10-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/x10-users