For quite a long time now, I have been using a calling convention from C++ google style guide, which boils down to the following: [for a function] arguments are values or const references while output arguments are pointersThe reason I like it so much is that at the point of call you can clearly see whether an argument is going to be modified or not, for example:// Defined in a.cpp:void transmogrify(const & Foo foo, Bar * bar) { /* do something */ }// Used in b.cpp:Foo foo;Bar bar;transmogrify(foo, &bar);Seeing an address-of operator in the call of transmogrify tells me that bar is going to be modified. This is A Good Thing: the flow of data transformation is now more obvious -- foo is an input argument and bar is an output. Moreover I do not need to go to the definition of transmogify to understand it. However, the bar can be an in-out argument, which is not clear from the call spot. Another problem is that it is a convention and the check is not enforced by compiler -- consider some refactoring that changes transmogrify in a way that bar is no longer modified -- the C++ compiler won't tell you that passing by pointer is not needed any more, despite this information is available at compile time.I would like to know if there is any (non functional) language that demands specifying the argument passing convention at the point of call (not the point of definition like ).
Is there a programming language which requires argument qualifiers (reference/value) to be specified at the call point?
programming languages;coding style;functions;calling conventions