Thanks for taking the time to reply to me, and I'm glad to get a quick 
response that return-type annotations are coming.  That makes a lot of 
sense.

However, I'd like to also continue to argue in favor of const annotations 
for input arguments.  Julia aims to become the language of choice for 
large-scale scientific computing, and so it would be wise to learn the 
lessons of the Fortran-90 community and C++-community that such annotations 
are valuable.

The exclamation-point convention is fine for simple functions like 'sort', 
but functions in large-scale scientific programs typically have a long list 
of arguments (look at LAPACK for example), and in this case the exclamation 
point is obviously limited since it conveys no information about which 
arguments are modified.

I realize that part of the beauty of Julia is that the more advanced type 
system will presumably cut down on the number of arguments for many 
scientific functions, but I would still argue that the exclamation point is 
an inadequate substitute for const argument annotation.

-- Steve Vavasis


On Thursday, June 12, 2014 8:28:18 PM UTC+3, [email protected] wrote:
>
> Both C++ and Fortran 90 allow the programmer to annotate call-by-reference 
> arguments to a function as to whether the function is allowed to change 
> them (this is denoted  const & in C++).  The compiler then enforces the 
> const-ness of the argument.  I don't see how to do this in Julia.  Is it 
> available?  If not, is there a reason why it was not included?  This is a 
> fairly basic tool for self-documenting code and for ensuring program 
> correctness.
>
> And a related question: the documentation makes a big deal about "stable 
> types" for function return arguments.  An obvious question is why the 
> language doesn't allow the programmer to declare in the function heading 
> what will be the return types of the function, and then have the compiler 
> enforce this stability.  Is this possible in Julia?  If not, is there a 
> technical reason for omitting it?
>
> Thanks,
> Steve Vavasis
>
> P.S. I have a few more questions but I'll pause now to wait for answers to 
> these questions.  I hope they are easy to answer!
>

Reply via email to