Module system strawpersons

Kam Kasravi kamkasravi at yahoo.com
Fri Jan 15 10:26:23 PST 2010


Thanks for the clarification, I misunderstood it as being replaceable with the current commonjs require.

Kam



________________________________
From: "ihab.awad at gmail.com" <ihab.awad at gmail.com>
To: kkasravi <kkasravi at me.com>
Cc: es-discuss <es-discuss at mozilla.org>
Sent: Fri, January 15, 2010 9:18:58 AM
Subject: Re: Module system strawpersons

Hi Kam,

My proposal is attempting to present two alternative ways to implement
"require" on top of the "import" keyword. The first option, as you
point out:

On Fri, Jan 15, 2010 at 9:13 AM, kkasravi <kkasravi at me.com> wrote:
> Within the Layered systems, the wrapper require looks like
> require('util/pointUtils')

needs "require" itself to be recognized as a special form in the input
language, which involves parsing the input code. The second form:

> However the proposal also suggests that require could be
> require(import 'util/pointUtils')

does not, and as you point out:

> Since import 'util/pointUtils' returns a Function Object and require needs a
> string literal, I'm wonder how the second require (above) would work.

the second "require" would not comply with the existing CommonJS
"require", but would be close to it.

Ihab

-- 
Ihab A.B. Awad, Palo Alto, CA
_______________________________________________
es-discuss mailing list
es-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20100115/5dc9d346/attachment.html>


More information about the es-discuss mailing list