ImportSpecifierSet syntax

# Erik Arvidsson (12 years ago)

harmony:modules#syntax

Currently ImportSpecifierSet is proposed to start with "{" and end with "}". This made a lot more sense when we reused the destructuring syntax. Now that we are using "as", these curlies look like a remnant from the past.

import {a as b, c as d} from "e";

I'm proposing we remove these curly braces, giving:

import a as b, c as d from "e";

Same issue applies to ExportSpecifierSet.

# Axel Rauschmayer (12 years ago)

The problem is that you have to bite the bullet of syntactic inconvenience for either default imports or normal imports. I’d prefer the syntax you suggested, but there seem to be many people who want to make default imports as simple as possible.

# Erik Arvidsson (12 years ago)

Oh, I forgot about that wart.

# Brendan Eich (12 years ago)

Erik Arvidsson wrote:

Oh, I forgot about that wart.

Are default imports a wart no matter the syntax, or only because of this brace imposition issue you've identified? If the latter, perhaps there is another solution that gives us win-win.

# Rick Waldron (12 years ago)

On Sun, Sep 8, 2013 at 11:55 AM, Erik Arvidsson <erik.arvidsson at gmail.com> wrote:

I'm proposing we remove these curly braces, giving:

import a as b, c as d from "e";

Subjectively, this is really hard to read, versus the curlies which provide a visual boundary (also subjective)

# David Herman (12 years ago)

Axel wrote:

The problem is that you have to bite the bullet of syntactic inconvenience for either default imports or normal imports.

Correct. This is the #1 justification.

Rick wrote:

Subjectively, this is really hard to read, versus the curlies which provide a visual boundary (also subjective)

I also agree with this. Too much word-based syntax without any sigils becomes hard to distinguish.

# David Herman (12 years ago)

On Sep 8, 2013, at 12:45 PM, Brendan Eich <brendan at mozilla.com> wrote:

Are default imports a wart no matter the syntax, or only because of this brace imposition issue you've identified? If the latter, perhaps there is another solution that gives us win-win.

Best of luck. :) We've spent a long time in this space, considered many competing constraints, and we've settled on a good spot with the syntax. I'm not interested in spending more time on it.

# Brendan Eich (12 years ago)

David Herman <mailto:dherman at mozilla.com> September 11, 2013 10:24 AM

Best of luck. :) We've spent a long time in this space, considered many competing constraints, and we've settled on a good spot with the syntax. I'm not interested in spending more time on it.

I'm not either, but perhaps Arv or someone else is -- otherwise I agree we should close this out, and not worry about it.

# Erik Arvidsson (12 years ago)

Yeah, I don't think there is time to get this resolved.

it is a minor issue and not worth worrying about.