Re: Modules Question

2010-12-28 Thread David Herman
We would probably make it a contextual keyword so you could still use it in non-expression contexts (e.g., to the right of '.' and left of ':' in object literals), but unless we played some clever tricks, which I'm not sure would be worth it, using it as an identifier would be a syntax error.

Re: Modules Question

2010-12-28 Thread Mark S. Miller
On Tue, Dec 28, 2010 at 8:06 AM, David Herman dher...@mozilla.com wrote: We would probably make it a contextual keyword so you could still use it in non-expression contexts (e.g., to the right of '.' and left of ':' in object literals), but unless we played some clever tricks, which I'm not

Re: Modules Question

2010-12-28 Thread Kevin Smith
While I'm at it (and feel free to direct me to the archives if this has already been discussed): Say I'm developing a library, and I have two files with one module per file, like this: /project a.js b.js How would I bring b into a? Like this? // a.js module a { module b = b.js; }

Re: Modules Question

2010-12-28 Thread David Herman
There's some flexibility built in to the system via module loaders. The filesystem modules example is hypothetical; it assumes a built-in module loader that maps files available on the filesystem to corresponding pre-defined, nested modules. On the web, you would do almost as you suggest: //

Re: Modules Question

2010-12-28 Thread Kevin Smith
Sweet - I was hoping that the module wouldn't have to name itself. My next question has to do with bundling. Let's say I want to bundle a.js and b.js into a single file, with the exports of a.js providing the exports of this bundled thing. I suppose I could wrap both of the individual modules

Re: Modules Question

2010-12-28 Thread David Herman
I'm not quite sure I understand the scenario you're describing. Do you mean that we dump the contents of a.js and b.js into all.js and delete the first two files? In that case you can do: // all.js: export module a { export module b { // original b.js contents ...

Re: Modules Question

2010-12-28 Thread Kevin Smith
Ah - that's much more elegant. Let me see if I can describe better though. I want to keep my library in source form as separate modules (one module per file, probably). I'll do development and testing that way. But I want to distribute my library as a single file. Presumably I'll need some

Re: XML-RPC is possible?

2010-12-28 Thread Erik Arvidsson
The mechanism to include a script is outside the language. Different environments have different mechanisms to do this. For example, in HTML you include scripts using script tags. On Sun, Dec 26, 2010 at 05:46, Giuseppe Luigi Punzi glpu...@lordzealon.com wrote: Hi all, Merry Crishmas for all

Re: RegExp syntax suggestion: allow CharacterClassEscape in CharacterRange

2010-12-28 Thread Gavin Barraclough
Hi Lasse, Thank you for the comprehensive list! In all these cases we should perhaps first attempt to determine whether these could just be considered spec compliance issues that ought to be fixed in implementations. If retaining compatibility with existing code is going to require continued

Additional syntax - B.1.2 String Literals

2010-12-28 Thread Gavin Barraclough
Hi, In the definition of OctalEscapeSequence, and in the accompanying semantics, it is required at numerous points that the subsequent character is not a DecimalDigit: OctalEscapeSequence :: OctalDigit [lookahead ∉ DecimalDigit] ZeroToThree OctalDigit [lookahead ∉ DecimalDigit]