Print

Print


--- On Thu, 1/6/11, Van Snyder <[log in to unmask]> wrote:

<SNIP> 
> I suggested A :=: B for value swapping, and A <=> B
> for pointer swapping.

Pascal uses := for assignment. Giving the A :=: B a very different meaning with just an extra colon would invite confusion. Either a swap subroutine or the more general feature allowed by Python or Matlab,

A, B = B, A

would be clearer.

One can write an ELEMENTAL swap function for each of the basic Fortran types and create an INTERFACE so they can all be called as "swap". What would be the advantage of having swap in the standard (unless it automatically worked on user-defined types)?

Vivek Rao