[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [YANG] [sub]module name uniqueness



Andy Bierman writes:
>  1) modules and sub-module names are globally unique, and there can
>     only 1 file that corresponds to a given import or include statement.

This would lead to scoped names ala java class names, giving us
module names like "org.ietf.smi.interface-mib.yang".  This is
partially elegant, but mostly verbose.

>  2) there is some proprietary mechanism to determine which file
>     is requested when more than 1 corresponds to the import or include
>     statement value.

This could be done with simple rules like:

- Imported modules must be found in a directory given via the
  -I option.
- Multiple -I options may be listed.
- They are searched in the order they appear on the command
  line.
- Included submodules must be found in the same directory
  as their module.

This makes "import" behave similarly to '#include <foo.h>'
and "include" behave similarly to '#include "foo.h"'.
(Yes, not exactly, but similar.)

>  3) there is some standard mechanism to determine which file
>     is requested when more than 1 corresponds to the import or include
>     statement value.

The standard doesn't need to talk about files, since your YANG IDE
may keep all your modules in a database.  It's all implementation
specific.

>IMO, modules and submodules need to share the
>same naming scope, and be globally unique.

Are we wiling to live with module names like "org.ietf.foo.bar.yang"?

Thanks,
 Phil
_______________________________________________
YANG mailing list
YANG at ietf.org
https://www.ietf.org/mailman/listinfo/yang