2 ms·
It took me days one time to figure out why 0 had adopted the value four. The technicality is that Fortran is call by descriptor (not by reference, not by value
by bregma 3y ago
It took me days one time to figure out why 0 had adopted the value four.
The technicality is that Fortran is call by descriptor (not by reference, not by value). That's a powerful difference but a sharp two-edged sword.
- kaba0 3y agoCould you please explain how is it differs from the other two? Never looked into Fortran.
- kergonath 3y agoThe Fortran standard does not specify anything about passing by references or value. Instead, it specifies the expected results. The compilers do it however they want or can, which means that they can pass pointers, values, copies, or pointers to copies depending on the situation. Sometimes (most of the time, to be fair), the compiler can work out the best solution. Sometimes, the developer has to jump through some hoops to avoid unnecessary copies.