Re: Two questions about character strings ...

From: Richard Maine (nospam_at_see.signature)
Date: 01/07/04


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


Relevant Pages

  • Re: to Ken Halter and the other dedicated VB MVPs
    ... Can't recall anyone saying that control arrays were inconvenient so ... >to pay our test engineers plus the 3rd party test engineers plus months and ... *It* is about trust and the fact that we can no longer trust MS to ...
    (microsoft.public.dotnet.languages.vb)
  • Re: to Ken Halter and the other dedicated VB MVPs
    ... Can't recall anyone saying that control arrays were inconvenient so ... >to pay our test engineers plus the 3rd party test engineers plus months and ... *It* is about trust and the fact that we can no longer trust MS to ...
    (microsoft.public.vb.com)
  • Re: Future generations
    ... conserve energy and other natural resources simply because someone ... act, call on their energy providers, etc... ... be saying we should fix social security or reduce the deficit simply ... may have be an "ism" but I can't recall that for sure either. ...
    (alt.usage.english)
  • Re: Gamble AB is the famous AAron Bartley?
    ... I *still* get the hotties staring at me =) ... his real name, ruy lopez, and I also recall him saying that he was ... caught lying about his SAT scores (first claiming that he got in the 99th ...
    (rec.gambling.poker)
  • Re: Future generations
    ... conserve energy and other natural resources simply because someone ... act, call on their energy providers, etc... ... be saying we should fix social security or reduce the deficit simply ... may have be an "ism" but I can't recall that for sure either. ...
    (alt.usage.english)