Re: Two questions about character strings ...
From: Richard Maine (nospam_at_see.signature)
Date: 01/07/04
- Next message: Richard Maine: "Re: Merseene Twister -- A New Fortran 95 Implementation"
- Previous message: Richard Maine: "Re: ALLOCATABLE arrays"
- In reply to: Dick Hendrickson: "Re: Two questions about character strings ..."
- Next in thread: Arjen Markus: "Re: Two questions about character strings ..."
- Reply: Arjen Markus: "Re: Two questions about character strings ..."
- Reply: Jan C. Vorbrüggen: "Re: Two questions about character strings ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 06 Jan 2004 19:14:50 -0800
Dick Hendrickson <dick.hendrickson@att.net> writes:
>> > > > call subroutine ( [ (character_function(i), i = 1,n) ] )
>> > What if len(character_function(i)) changes with i?
>> > What if n = 0?
> That's a reasonable extension. You didn't say what happens in the
> n = 0 case.
Yes. Things like that n=0 case are *VERY* tricky (as I'm sure Dick
knows). I don't even recall what the f95 interp ended up saying about
it, but I do recall that interp taking several years, many attempts,
and holes blown through suggestions. (Heck, this one is relatively
simple. Henry Zongaro could come up with the most horrible cases
that would show the flaws in suggestions that I thought were
watertight; he must have a twisted mind.....if you know me well,
you'd know that I mean that as a compliment).
Speaking of n=0, one thing that the f2003 syntax now allows is a
reasonable way to write a zero-sized array constructor (of any type).
Yes, there are uses for such things - comes up reasonably often.
Used to be that you had to do a Rube Goldberg trick involving a zero
trip count implied DO loop. In the f2003 draft, you can just write
[real:: ]
or
[character(10):: ]
or whatever. A bit verbose, I agree (but I haven't seen an
alternative that was both more concise and worked everywhere).
I find these a lot more clear than things like
(/ (some_real_variable_we_dont_really_use, i = 1 , 0) /)
-- Richard Maine email: my last name at domain domain: sumertriangle dot net
- Next message: Richard Maine: "Re: Merseene Twister -- A New Fortran 95 Implementation"
- Previous message: Richard Maine: "Re: ALLOCATABLE arrays"
- In reply to: Dick Hendrickson: "Re: Two questions about character strings ..."
- Next in thread: Arjen Markus: "Re: Two questions about character strings ..."
- Reply: Arjen Markus: "Re: Two questions about character strings ..."
- Reply: Jan C. Vorbrüggen: "Re: Two questions about character strings ..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|