vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.79k stars 2.16k forks source link

Document auto import #18207

Open tintin10q opened 1 year ago

tintin10q commented 1 year ago

Describe the issue

Here you mention in the docs that you use helper functions from other files. But you don't show how. It might be good to tell people they can just use the functions without importing them because this was not clear for me.

Links

https://github.com/vlang/v/blob/master/doc/docs.md#running-a-project-folder-with-several-files

ttytm commented 1 year ago

I wouldn't really call it auto import. It is more that functions belonging to the same module can inherently be used within that module. It's similar to the way packages work in go. It wouldn't hurt to document it tho. The section to document it would probably be: https://github.com/vlang/v/blob/master/doc/docs.md#modules