new import syntax doesn't work? #5185

Closed
dom96 opened this Issue Jan 6, 2017 · 5 comments

Projects

None yet

2 participants

@dom96
Member
dom96 commented Jan 6, 2017
import nimblepkg/cli, nimblepkg/tools

works, but this fails:

import nimblepkg/[cli, tools]
@Araq
Member
Araq commented Jan 6, 2017

works for me. Bootstrapping problem?

@dom96
Member
dom96 commented Jan 6, 2017

Also, now that I think about it. Shouldn't the following syntax be used for this instead?

from nimblepkg import cli, tools
@Araq
Member
Araq commented Jan 6, 2017

No, that would not be consistent with anything else.

@dom96
Member
dom96 commented Jan 6, 2017 edited

I don't know what is going on but the following works:

import strutils
import nimblepkg/[cli, tools]

and yet if I remove the first import it doesn't:

import nimblepkg/[cli, tools]

No, that would not be consistent with anything else.

This is how it works in Python. Although admittedly in Python you are always importing modules, not variables/procedures/templates/etc. Why can't we add modules into the list of things that can be imported using this syntax?

@Araq
Member
Araq commented Jan 6, 2017

Your proposed syntax is ambiguous: What if I have a nimblepkg.nim and a nimblepkg/ directory?

@Araq Araq added a commit that closed this issue Jan 6, 2017
@Araq Araq fixes #5185 64912d3
@Araq Araq closed this in 64912d3 Jan 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment