Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

The Sandbox

This is just a page to practice and learn WikiFormatting.

Go ahead, edit it freely.

The Juno Project

Introduction

Juno is a general-purpose class library for the D programming language. It aims to offer the kind of power and ease-of-use enjoyed on platforms such as .NET and Java to D developers.

Juno compiles only on Windows and is distributed under the BSD licence.

More details, documentation and downloads will be coming soon. In the meantime, here's Juno in action, loading an XML document and getting notified when it's loaded.

import juno.base.all,
  juno.xml.msxml;

void main() {
  // Create an instance of IXMLDOMDocument3.
  using (XMLDOMDocument60.createInstance!(IXMLDOMDocument3), delegate(IXMLDOMDocument3 doc) {

    // Create an event provider.
    alias EventProvider!(XMLDOMDocumentEvents) Events;
    using (new Events(doc), delegate(Events e) {

      // Attach an event handler for doc's onReadyStateChange event.
      alias EventProvider!(XMLDOMDocumentEvents) Events;
      e.bind("onReadyStateChange", delegate {
        writefln("state changed");
        int readyState;
        doc.get_readyState(readyState);
        // Do something once the document has fully loaded.
        if (readyState == 4)
          writefln("document complete.");
      });

      // Tell the document to load asynchronously.
      doc.set_aync(com_true);
      // Load the XML document.
      com_bool result;
      doc.load("books.xml".toVariant(), result);

    }); // e is automatically released at the end of the scope.

  }); // doc is automatically released
}