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

what is nim type definition for generic procedure?
Does a nim library contain an argsort implementation or wrapper?
nim jester how to change static route and directory
nim linker error while linking to libsodium
Can countup and countdown iterators in Nim language be used in variable declaration?
How do I write unit test for code that should fail to compile in Nim?
Difference between void proc and void proc with discard
nim nimscript is not executing commands
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?

Categories

HOME
cygwin
xml
design-patterns
deep-learning
developer-tools
yahoo-finance
jwplayer
rendering
rds
pyqt4
maxscript
jetty
polling
data-visualization
gluon-mobile
little-proxy
google-chrome-app
heap
emoji
stellar.js
code-generation
renjin
magnetic-cards
heat
symbol
screen-readers
azure-powershell
glyphicons
dreamweaver
video-editing
drive
breadth-first-search
ag
named-entity-recognition
postscript
roslyn
interpreter
roundup
beta
jboss6.x
pic32
asymptotic-complexity
mat
iis-express
failover
record
database-comparison
cart
android-sugarorm
hreflang
slacktextviewcontroller
browser-extension
numpy-broadcasting
reason
urlsession
hackintosh
trigonometry
claims
clang++
memory-mapping
phpdbg
dynamic-linq
term
openblas
compiler-design
ngmaterial
avx
css-transforms
type-theory
cd-burning
docpad
ziparchive
dotnetnuke-7
resourcemanager
macaulay2
drawstring
nss
query-by-example
bizagi
ellucian-scribe
jaunt-api
include-guards
rubaxa-sortable
uncompress
baasbox
skspritenode
aspectj-maven-plugin
j-security-check
document-repository
spy++
syndicationfeed
multitasking
high-resolution
dtmf
unit-of-work
inappsettingskit
actiondispatch
insert-id
chart-director
vfs
objectquery
hibernateexception
box2d-iphone
screen-size
fsevents
tournament
uipagecontrol
inline-formset
mtu
instantiationexception
delimited-text
globals
dot-emacs
ajax-polling
hbm2java
request-headers
asynchronous-wcf-call
wysiwym
cardspace

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