Code Comments
Programming Forum and web based access to our favorite programming groups.James Giles wrote: > The problem with that is I would prefer that statement functions > be inherently generic. That is, the return type of the statement > function should be the result type (rank, KIND) of the expression > that defines it based on the types (ranks, KINDs) of the actual > arguments to the function. Are trying to sneak Python into Fortran? :) Python does not have declarations, and I think functions in Python have the property you described. Some features in Python (and in some other languages) that are introduced in Fortran 2003 (in a different form) are (1) classes with inheritance (2) procedures taking allocatable arrays as arguments and returned values (F95 already allows pointer arguments) (3) automatic allocation of arrays in an expression (my understanding is that if x has known dimensions, and y has not been allocated yet, and x and y have the same rank, then the statement y = x both allocates y and sets its elements equal to those of x) (5) allocatable structure components (6) interoperability with C I think features (2) and (3), along with the array operations and intrinsic function present since Fortran 90, are giving Fortran some of the features of a high-level scientific scripting language (similar to Python with Numarray, or Matlab/Octave/Scilab, or IDL, or R/S-Plus), which is a good thing IMO, as long as users still get good performance and stand-alone executables. Getting non-Fortran-95 programmers to think of the language this way is difficult.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.