-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Side effects should be considered a code smell - currently, when importing a module, if it is not specified what you want from the module, it will effectively load and execute the module without binding anything to the current scope. I don't really like this, so instead it should just default to assigning everything to a new variable of the same "name":
import "math" // import and assign to the variable "math" by default
print(math.pi)import "math" as m // import and assign to the variable "m"import pi from "math" // import only "pi" and assign to variable "pi"import pi, e, tau from "math" // import only "pi", "e", and "tau" and assign to their respective variablesimport abs as absolute from "math" // import only "abs" and assign to variable "absolute"Metadata
Metadata
Assignees
Labels
No labels