nim


Is there a “default” file name that can be used for importing modules?


What I mean is if there's some standard name that can be used for the primary file in a local Nim module so that when importing by path, we can simply reference the directory?
For example, it seems right now I need to specify both the directory and file name of the local module like this:
import my_module.main
Whereas I was hoping to simply be able to reference the directory if the expected file name was found:
import my_module
Aside from using Nimble or creating a separate --path flag for every module in a nim.cfg file, is there anything that will allow this?
Also, in general, is there a conventional name to use for the main file of a module?
If I have a simple app like this:
myapp--+
|
+--myapp.nim
|
+--sub--+
|
+--sub.nim
In myapp.nim I have to use import sub.sub to load the sub-module. With import sub, I get Error: cannot open sub.
Likewise if I have modules outside the app and set the --path to the parent of those modules, I have to use import my_module.my_module.
The idea is to have a my_module.nim and sub-modules in a my_module directory. Then you can just import my_module.

Related Links

Remove element at index from sequence
Is it possible / easy to include some mruby in a nim application?
Reading bytes from many files performance
Program doesn't compile when “concept” defines a method with a parameter
How do I create a directory?
Why is my string nil?
Nim code parser
What's the meaning of “magic” pragma in nim?
Unpack multiple variables from sequence
Nim: How to prove not nil?
Error: expression has no address
MD5 on an array, array[0..63, uint8] to cstring conversion
Converting a seq[char] to string
Nim: On mac, cannot open standard import
How to compare two typedesc in a template for equality
Is there a “default” file name that can be used for importing modules?

Categories

HOME
django
cygwin
awk
time-complexity
telegram
fpga
depth
jmx
numbers
replace
newrelic
nsbundle
gluon-mobile
retrofit2
character
elasticsearch-5
spin
why3
php-5.6
dynatrace
gource
symbol
azure-powershell
red5
bourbon
react-toolbox
hta
maze
jquery-multiselect
uitapgesturerecognizer
nsurl
scrollview
powershell-ise
simplecv
openwhisk
yowsup
numpy-broadcasting
health-monitoring
diacritics
comparison-operators
visa
watchface
escpos
lpsolve
dapper-simplecrud
vugen
scalding
sundials
arules
payload
trigger.io
mathcad
usart
cudd
meteor-packages
jodd
drawstring
jquery-jscrollpane
android-dateutils
dbamp
halcon
piracy-prevention
asyncdisplaykit
xenomai
file-move
computer-architecture
skspritenode
dnssec
broadband
contrast
jama
mdichild
ignite-ui
mintty
cancellation
alternate
terminate
square-bracket
qscrollarea
xmltodict
notorm
oocss
jquery-1.9
composite-component
cardreader
swfobject
web-notifications
saleslogix
appjs
usertype
screen-size
promotion-code
mbeans
folding
openfaces
cfwindow
django-piston
mathematical-notation
xpsdocument
linfu-dynamicproxy

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App