Hacker News new | ask | show | jobs
by TazeTSchnitzel 1919 days ago
How does Fortran enforce this, actually? Does it just not let you pass the same array to a function via multiple parameters?
2 comments

Fortran didn't originally have pointers, and pointer based code is relatively rare in fortran, so making requirements about pointer aliasing doesn't have same potential to completely break your code that it does in c. The reason c can't actually restrict the restrict keywoard, is that the standard would break code!
The storage association rules have nothing to do with pointers like that. Code will typically break because arguments are passed with copy-in/copy-out semantics, not by reference.
It does, indeed, but that's not the only way to associate storage. Using INTENT to specify whether an array is updated is useful.