Tcl namespaces and private procedures and variables

Ryan Schmidt ryandesign at macports.org
Wed Oct 10 02:09:42 UTC 2018



On Oct 9, 2018, at 17:45, Rainer Müller wrote:

> The obvious difference would be the name of the procedure. That is also
> the main purpose of namespaces: to provide a hierarchical structure for
> naming procedures and variables.

Well, you could say that's also the purpose of the naming conventions we've used in other portgroups. The naming of the github.setup procedure and the github.homepage option and so forth are intended to convey that they are part of the github portgroup. I realize that from Tcl's standpoint the "." in the name is no different than any other character, so technically these is just a top-level procedures and options like any a port could define, but conceptually they're meant to be seen as part of the portgroup.

I assume that for example if I migrate the github portgroup to use a namespace, I will hide internal procedures like handle_tarball_from inside the namespace, while keeping things a Portfile is intended to use, like github.setup and github.homepage, outside of the namespace.



More information about the macports-dev mailing list