some templates (e.g. nbInitPython, nbPython) require additional dependencies in order to be used (e.g. nimpy), dependencies that are not need by nimib. Currently if a user of nimib tries to call nbPython without having nimpy module available the error will be somthing like nbPython not found (since the template in nimib.nim is wrapped in a when moduleAvailable(nipmy)).
To improve the error message we could (instead of wrapping in the when) add as first line of any template that requires an additional dependency, a new onlyWhenModuleAvailable(requiredModule) template that gives the correct error message: "to use myTemplate you need to have module requiredModule available, check nimib.nimble on github to see constraints on version number".
And probably instead of a onlyWhenModuleAvailable template it should be a pragma to get name of template (or we just pass it); do template allows pragmas? a requiresModule seems general purpose enough... (but likely applies only to templates...)
some templates (e.g.
nbInitPython
,nbPython
) require additional dependencies in order to be used (e.g.nimpy
), dependencies that are not need by nimib. Currently if a user of nimib tries to callnbPython
without havingnimpy
module available the error will be somthing likenbPython
not found (since the template innimib.nim
is wrapped in awhen moduleAvailable(nipmy)
).To improve the error message we could (instead of wrapping in the when) add as first line of any template that requires an additional dependency, a new
onlyWhenModuleAvailable(requiredModule)
template that gives the correct error message: "to usemyTemplate
you need to have modulerequiredModule
available, checknimib.nimble
on github to see constraints on version number".And probably instead of a
onlyWhenModuleAvailable
template it should be a pragma to get name of template (or we just pass it); do template allows pragmas? arequiresModule
seems general purpose enough... (but likely applies only to templates...)