One plausible variant to our proposal that might be easier to swallow (as
it doesn't have the special-cased ObjectLiteral problem) is:

   - Replace `export ExportSpecifierSet` with `export ObjectLiteral` for
   static exports
   - Allow `export = foo` (or something like it) for single exports
   - Unify the import syntax to support the full destructuring syntax and
   to work on both static and single exports

This retains the advantages of reducing micro-syntax and reforming import
without forcing an awkward special-casing of `export ObjectLiteral`


On Thu, Dec 6, 2012 at 7:44 AM, Domenic Denicola <
dome...@domenicdenicola.com> wrote:

>  For the record, here's the idea Yehuda and I worked out:
>
> https://gist.github.com/1ab3f0daa7b37859ce43
>
> I would *really* appreciate if people read it (it's easy reading, I
> promise!) and incorporated some of our concerns and ideas into their
> thinking on module syntax.
>
> In general, it tries to eliminate the ExportSpecifierSet and
> ImportSpecifierSet microsyntaxes in favor of standard object
> literal/destructuring forms, respectively. It also made export and import
> syntax symmetric.
>
> It apparently failed to get much traction among committee members, mainly
> because of objections to our reformation of the export-side syntax.
> (Second-hand info.) E.g. the current export function foo() { } was
> preferred to the proposed export { foo() { } }, and---less
> aesthetically---our special behavior for ObjectLiteral expressions over
> other expressions was a bit weird.
>
> I still think the import-side reformation is important and stand by
> everything in the proposal in that regard. As mentioned in other messages
> in this thread, the current form is confusingly dual-natured. And I
> maintain that the incomplete semi-destructuring microsyntax of
> ImportSpecifierSet adds a lot of cognitive burden.
>
> If we can start by fixing the import side, I have some other ideas on how
> to make the export side better that hopefully will be more appealing to the
> committee. But I don't want to try proposing those yet until we can get the
> buy-in on fixing import.
>
>  ------------------------------
> *From:* es-discuss-boun...@mozilla.org [es-discuss-boun...@mozilla.org]
> on behalf of Erik Arvidsson [erik.arvids...@gmail.com]
> *Sent:* Thursday, December 06, 2012 09:54
> *To:* Kevin Smith
> *Cc:* es-discuss
> *Subject:* Re: Module Comments
>
>
>  On Thu, Dec 6, 2012 at 9:42 AM, Kevin Smith <khs4...@gmail.com> wrote:
>
>> Dave responded by pointing out that we don't want "from" to have
>> overloaded semantics.  I actually think this form has potential, because it
>> further aligns import with the other binding forms:
>>
>>      var a = x;
>>     var { b } = y;
>>
>>      // Symmetry!
>>
>>      import a from "x";
>>     import { b } from "y";
>>
>
>  +1
>
>  This also matches what Yehuda and Domenic proposed a few weeks ago.
>
>  --
> erik
>
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>


-- 
Yehuda Katz
(ph) 718.877.1325
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to