jamiebuilds / ghost-lang

:ghost: A friendly little language for you and me.
302 stars 10 forks source link

import .. as #6

Closed aleclarson closed 6 years ago

aleclarson commented 6 years ago
// Import all under a namespace
import './utils/currency' as currency

// Import some into this namespace
import './utils/currency' as { a, b }

// Import all into this namespace
import './utils/currency'

Side note: I hope the lack of string quotes is optional.

Yay or nay?

aleclarson commented 6 years ago

Could also do:

let currency = import './utils/currency'
let { a, b } = import './utils/currency'
jamiebuilds commented 6 years ago

The import location specifier should come first for IDEs. The lack of quotes is intentional as these specifiers are not analygous to file paths. I was already thinking of a import ./foo as bar syntax though.

jamiebuilds commented 6 years ago

updated