Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This looks really nice and the prose had a positive/easy-going feel to it.

When the actual code examples begin, the very first couple of lines confused me:

    package hellope

    import "core:fmt"
Is the quoting of package names optional?


Based on the official website[0], it would appear the package name is necessarily not quoted.

This doesn't strike me as odd at all. It's an identifier, not a string. The quoting of the import, on the other hand...

[0] https://odin-lang.org/docs/overview/


It looks like some borrowed Go convention, where package statements don't need to be quoted, but import statements may include URLs and, therefore, they are expected to be quoted.


As the docs do state, the package declaration has nothing to do with the import path. The package name is there for consistent ABI, so that the link names are prefixed with that. The import _path_ is just that, a path to where the package is stored. They can be different but it is conventional that they are similar-ish.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: