Why are Fortran pointers always variable -


Started using pointers in Fortran and recently stumbled on the fact that pointers in Fortran could not be stable. This means, nothing is possible:

  process (proc_type), pointer, parameter :: fPtr = & gt; MyFunc  

I tried to know why this is not possible. But the only thing I found was in "Modern Fortran explained":

Also keep in mind that there can not be a continuous indicator [..] because they are always variable.

But this does not explain the reason behind it, does anyone know about this?

Because Fortran rules say so

Fortran 2008 (ISO / IEC 1539- 1: 2010):

5.3.14 Multiplier Properties

During the execution with 1 units, various data objects or processes can be linked to an event indicator or So there is a data pointer or a process indicator. Process indicators are described in 12.4.3.6.

It is not compatible with constants.

Why are the rules in this form? Because the authors of the standard have done this.

Why did they do this? The answer is often very simple - because no committee presented a separate rule to be discussed and approved by any committee, or some members of the committee did not like it. You really have to ask them - and, but be prepared for the answer that there is no specific reason for it.

In some languages, which fall into the same category, e.g. C and C ++, continuous signal is possible to indicate an integer constant, a constant indicator was started

  const int i = 3; Static int * const x = (int *) & amp; I;  

Fixed a constant indicator to indicate the integer function

  int (fun) {return1; } Fixed Ent (* Cans X) () = & amp; Funny;  

It is definitely possible to do something like this in Fortran. Contact your representative to suggest such a feature in Fortran Standard Committee.

There are ways in which the restrictions imposed by INH and Critodo restrain, but this answer tries to stay in the line of the original question. Why this restriction exists?


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -