-
-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is no clear document for how require "foo/bar/baz"
work.
#677
Comments
Here you go: https://crystal-lang.org/reference/1.7/syntax_and_semantics/requiring_files.html#other-forms |
Oops, sorry, i don't know why i missing it! BTW: the explain in other-forms is not accurate, because |
Indeed that seems to be the case. I figure this might be an unintended omission. So we probably need to change the implementation, not the documentation. I think this might've eventually been lost in crystal-lang/crystal#10820. I created crystal-lang/crystal#13210 to address the issues with require paths. |
Oops, i thought i see it before, but i lose completely now for how Let us not think about our implementation(it probably wrong, right?) What is the expected search path for following requires? (for lib only) require "foo"
# lib/foo.cr
# lib/foo/foo.cr
# lib/foo/src/foo.cr
# ??? require "foo/bar/baz"
# lib/foo/bar/baz.cr
# lib/foo/bar/baz/baz.cr
# lib/foo/src/bar/baz.cr
# ??? I remember when i first use Crystal (1.4), i read document somewhere said |
No, |
After i test it, it seem like the lookup path is: (assume CRYSTAL_PATH is lib)
But, i never saw any document mention it.
I consider this is a really important concept for the crystal user, but i understood it until now because there no document.
Before this, i have to use absolute path from the lib. e.g. require "foo/src/bar/baz"
The text was updated successfully, but these errors were encountered: