the future of import #503
Replies: 2 comments 6 replies
-
As a human reader of the written malloy text, I would love to be able to encounter a novel 'token' in the file, and quickly look up to the top of the file and see where it is imported from. If there is a large block of 'import' statements, any of which could have added to the symbol table, I have to look in all of them. I understand that may not be idiomatic though, if other symbols appear magically in the table as a result of database schema discovery. But at least for the symbols that are defined in the malloy language itself, explicitly naming imports and exports seems like a benefit to me. |
Beta Was this translation helpful? Give feedback.
-
Selective import, and renaming import is in 4.0. |
Beta Was this translation helpful? Give feedback.
-
This is just a placeholder.
Currently the import statement looks like:
import "string"
The
"string"
is a URL, which could also be a filename relative to the file which contains the import statement (the most common case), but it really is a URL.What it does is compile that file, and merge the namespace from that compilation in the current file's namespace.
This is pretty much the way that Javascript works.
We are missing a few of features though, and the intention is to do them eventually:
Beta Was this translation helpful? Give feedback.
All reactions