Remarks about module import
petermichaux at gmail.com
Sat Aug 23 18:44:51 PDT 2008
On Sat, Aug 23, 2008 at 5:41 PM, Kris Kowal <kris.kowal at cixar.com> wrote:
> On Mon, Aug 18, 2008 at 1:44 PM, <ihab.awad at gmail.com> wrote:
>> Hi folks,
>> The module system proposals, especially the one here --
> Oh, a module party! Sorry I'm late and thanks to Peter Michaux for
> alerting me that I was missing out. Ihab, if you recall, I met you
> and "The Mikes" last December to talk about module systems. I really
> like the direction of this thread and thought I'd put in a couple
> cents. A lot of the things I want from a module system have already
> been mentioned, so some of this is just a reiteration of some of the
> great ideas that have been posed; some beg distinctions.
Can you provide concrete examples (something a few lines longer than a
hello world module) which shows both the module and importer code?
> The module scope could also contain a "module" variable that refers to
> the current module, plus "moduleScope", and "builtins" as deemed fit.
> Also, the "moduleUrl", like "__FILE__" would be handy for
__DIR__ has been even more handy for me so one file can load another
one at a relative position in the file system.
> // in <http://my.com/site.html> where the moduleRoot is the same
> as the page URL by implication:
> import "window"; // moduleScope.window = require("window");
> import "http://jquery.com/jquery-2.6.js"; // moduleScope.jQuery =
> import "./widget.js" as widget; // moduleScope.widget =
> from "./widget.js" import Widget; // moduleScope.widget =
(< 72 chars/line usually avoids wrapping.)
More information about the Es-discuss