Re: Question on complex algebra
From: James Giles (jamesgiles_at_worldnet.att.net)
Date: 04/27/04
- Next message: glen herrmannsfeldt: "Re: Fortran memory allocation (stack/heap) issues"
- Previous message: Richard Maine: "Re: Fortran memory allocation (stack/heap) issues"
- In reply to: Dr Chaos: "Re: Question on complex algebra"
- Next in thread: Eric J. Kostelich: "Re: Question on complex algebra"
- Reply: Eric J. Kostelich: "Re: Question on complex algebra"
- Reply: Dr Chaos: "Re: Question on complex algebra"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 27 Apr 2004 21:15:00 GMT
Dr Chaos wrote:
> James Giles <jamesgiles@worldnet.att.net> wrote:
>> [...] with the more
>> consistent KIND rules and to allow the REAL and
>> IMAGINARY parts of a complex
>> Z to be accessed as Z%R and Z%I respectively. That way
>> you could, say, zero the imaginary part of a complex
>> variable thus:
>>
>> z%i = 0.0
>
> or what about
>
> AIMAG(Z) = 0.0
>
> does this interfere with statement functions?
>
> probably %r and %i are more natural.
Exactly. The functional form of the syntax is also being proposed.
But it's much less legible. Since I believe legibility is one of the
important language design goals (and probably the most important),
selecting something less legible, no matter the claimed justification,
is to be opposed.
Aside from the possible ambiguity with statement functions (which
are on the obsolescent list and could actually be deleted from any
standard which accepted the form above), the functional form is
less legible in that the base named entity being manipulated is
buried rather than being the first token. There seems to be a
common choice in most languages that the name of a component
of anything is given as the name of the base entity followed
by some syntax to select the component. Array names are
followed by their subscripts rather than the other way around.
Manipulating components of unnamed entities (like expressions)
have other syntactic constraints that make things difficult, but
it's also a rarer activity (and it might be worth it to try to figure
a way to subscript or extract components of expressions anyway).
I suppose something like
Z(imag) = 0.0
might be acceptable. But complex already has a lot in common
with derived types. It seems fitting to eliminate the remaining
distinctions and have them work as much as possible as
derived types.
-- J. Giles
- Next message: glen herrmannsfeldt: "Re: Fortran memory allocation (stack/heap) issues"
- Previous message: Richard Maine: "Re: Fortran memory allocation (stack/heap) issues"
- In reply to: Dr Chaos: "Re: Question on complex algebra"
- Next in thread: Eric J. Kostelich: "Re: Question on complex algebra"
- Reply: Eric J. Kostelich: "Re: Question on complex algebra"
- Reply: Dr Chaos: "Re: Question on complex algebra"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]