On Friday, April 11, 2014 03:49:16 PM Ben Racine wrote:
> But, when a function really does logically belong to its first argument, I 
> (sometimes) find myself missing the function namespacing inherent to those 
> systems. I find myself wanting to do what one can do in R and inject a '.' 
> into the function name just for the illusion of namespacing. 

I'm not sure I fully understand your question, but there is real namespacing 
available. Use modules and, if you want/need to force the user to include the 
module name, just don't export the function from the module. A great example 
is Pkg, which uses this for many of its functions to disambiguate meaning. 
update() would be rather vague (what am I updating?), but Pkg.update() is 
quite clear.

You can easily use the same technique yourself, with no conflict with Pkg:

module MyModule

function update()
    println("blah")
end

end

MyModule.update()
Pkg.update()


--Tim

Reply via email to