This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: TRIM


On Jul 18 2014, Salvatore Filippone wrote:

Is TRIM() supposed to delete TAB characters or not?
I just discovered (the hard way) that at least in 4.8 it does not, and
that makes for some surprises for novice users.

I disagree with Lamport, and am quite happy with capital punishment for
anyone who includes TABs into a data format.  Novice users should be told
that TAB is not a data character, and they should not treat it as such.

The Fortran standard does not include TAB as part of its character set,
so gfortran can do whatever it likes with them.  I agree that TRIM
(and LADJUST and probably more) should treat them as standing for one
or more spaces, which is what the ASCII standard said.  But please
don't trim newline-like control characters!

NUL is seriously nasty, because its original purpose (as stated in
ASCII) was to be an ignorable character, and it is still used in just
that way in some protocols.  Heaven help me, I have even seen editors
use it as a non-significant space!  Arguably, it should also be
trimmed :-)


Regards,
Nick Maclaren.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]