You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 20, 2024. It is now read-only.
import IO.*
def test {
return isDirectory("foo")
}
One should be able to import individual functions from a namespace as well.
This would be useful e.g. for DSL-like namespaces - e.g. parser libraries, routers, etc. where you have lots of factory functions packed into a single namespace.
The text was updated successfully, but these errors were encountered:
Perhaps this is by design? May be you don't want to deal with filename references. I could understand that.
It looks like you get around this very nicely by carefully organizing your namespaces in the Skew compiler project itself, but is this never going to be a requirement? Perhaps not.
If not, then maybe some means of addressing one namespace from within another namespace and/or scope?
So like, without this feature:
namespace Hello {
def hello {
World.world
}
}
namespace World {
def world {}
}
@export
def test {
Hello.hello
}
And adding, say, a use statement, instead:
namespace Hello {
use World # imports the world function from the World namespace
def hello {
world # calls the imported function
}
}
namespace World {
def world {}
}
@export
def test {
use Hello as H # imports the Hello namespace with an alias H
H.hello # calls the imported function
}
This is probably simpler and avoids dealing with files.
(if something like a package manager is implemented in the future, avoiding file paths entirely, even for external dependencies, would then likely be consistent and preferable)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Any plans to add an import statement?
For example:
One should be able to import individual functions from a namespace as well.
This would be useful e.g. for DSL-like namespaces - e.g. parser libraries, routers, etc. where you have lots of factory functions packed into a single namespace.
The text was updated successfully, but these errors were encountered: