jashkenas/coffeescript

Feature request: Multiple imports

kevinJ045 opened this issue · 1 comments

I was thinking about if coffeescript had a way to make multiple imports, like:

import (
   "one"
   "two"
   "three"
   "four"
) as (
   @one
   two
   { three }
);

which could translate to:

import * as one from "one"
import two from "two"
import { three } from "three"
import "four"

You can also:

import (
  "one"
  "two"
)

which will be:

import "one"
import "two"

now i don't know if this is any better than the normal imports, but it removes the duplicate import statements atleast...

adminy commented

its visually less plesant to look at than the 4 imports tbh. Even though I do agree the pythonic way of imports is more appealing than JS with their:

from module.path import func, cls
import module.path.func as fn

giving you the sense that from that file comes just this small thing.