Explciit `use` lines? (bad idea?) ================================= `use` wculd be a way to specify dependencies on a per-file level. The idea is to make it clear (to a human reader) which classes are being used in a class, as well as to allow file-local version overrides. However, `use` lines might not be necessary at all (see the end of this file). See also import_groups.txt Could `use` lines be combined with `giveme` lines? -------------------------------------------------- * Ordering might be an issue. - io-`use` should preferably come first. - `giveme`s are not type-unique (e.g. there can be 2 `Reader`s) - `giveme`s can be ordered in a certain way. (e.g. related CLI options grouped together) * Combining them can lead to duplication (e.g. of the module name). Syntax tests ------------ 1: giveme io std Reader srcfile1 = inputparam "-f,--file1" "Input file 1" giveme io std Reader srcfile2 = inputparam "-g,--file2" "Input file 2" ... # but there could be `io` giveme's "hidden" below! 2: io std Reader srcfile1 srcfile2 ... giveme srcfile1 = inputparam "-f,--file1" "Input file 1" srcfile2 = inputparam "-g,--file2" "Input file 2" end # but adding/removing parameters requires editing in two places! 3: Alternative solution -------------------- Skip `use` (only have project-wide imports) and instead have per-file renames in order to support upgrades? Or have per-file `use` only to *override* versions of dependencies, i.e. to use an older API of a depdendency. Maybe call it something else than `use`? Not sure if this is even necessary at all? Maybe it is sufficient to be able to turn off specific deprecation warnings/errors? Perhaps the central dependency file should have lower and upper bounds of the version: # use 1.0.1 but allow source files to suppress deprecation warnings/errors # back to how it was in 0.6.0 somedep >= 1.0.1 and 0.6.0 # similar, but use 0.6.0 by default somedep >= 0.6.0 and 1.0.1 And in source files: useversion somedep 0.6.0 Skip `use` entirely? -------------------- Not sure if even `use` is necessary? Maybe it is better to have smaller modules and upgrade one module at a time? "Modules" could perhaps even be single-file modules? While `use` lines makes it easier to audit/review files, that could also be done with some kind of tooling, e.g. a command that shows which classes / modules / qualifiers(`!` etc.) are in use by each source file.