This page is under heavy construction, as I am writing this as I digest the XML DOM specification. All are encouraged to contribute. - EricAnderton
IDL?The Interface Description Language is used all over the computer science landscape, especially when concepts are described in a language-neutral way. It is also used directly by some languages and compilers as a means of describing an interface with an external system (like in CORBA). One can describe a binary interface for two systems, written in completely different languages, in IDL and expect them to inter-operate.
IDL to D
So you want to implement an IDL module or interface in D? The process is actually very straightforward, and can be done about 90% via search-and-replace.
- readonly attribute - Read-only attributes can be best emulated via D's 'property method' technique.
- raises(exceptionname) - There is no equivalent for this in D, so just throw it out. You may want to include this bit in your documentation for use later.
Wikipedia: IDL - http://en.wikipedia.org/wiki/Interface_description_language Example: W3C? XML DOM IDL - http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl/dom.idl
(*) some programmers may recognize this matrix from C/C++ to D type conversions, which are largely the same