W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2009

An import statement for Web IDL

From: Cameron McCormack <cam@mcc.id.au>
Date: Mon, 29 Jun 2009 15:54:21 +1000
To: public-webapps@w3.org
Message-ID: <20090629055421.GC16905@arc.mcc.id.au>
The OMG-ish IDL fragments published for W3C specs use C preprocessor-
like directives to include other IDL fragments, so that names resolve
correctly.  For example,
http://www.w3.org/TR/DOM-Level-2-Events/idl/events.idl has:

  #ifndef _EVENTS_IDL_
  #define _EVENTS_IDL_

  #include "dom.idl"
  #include "views.idl"

  module events {

  #endif // _EVENTS_IDL_

I don’t think it would be good to require a C preprocessor to get the
same kind of inclusion behavior for Web IDL.  But I do think we need to
make sure that names resolve, so we need some kind of mechanism.

I propose that we have an import statement that takes a (possibly
relative) URL.  If I were writing the DOM 2 Events IDL, then I’d write:

  import "http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/idl/dom.idl";
  import "http://www.w3.org/TR/2000/REC-DOM-Level-2-Views-20001113/idl/views.idl";

  module events {

That way the IDL processor knows exactly what dependent IDL files it
needs to process, and there’s no need to assume that the user of the IDL
files has to place the DOM Core and Views IDL files with specific names
in the same directory as the events.idl file.


Cameron McCormack ≝ http://mcc.id.au/
Received on Monday, 29 June 2009 05:55:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:12:54 UTC