|
|
Up |
|
|
  |
|
|
  |
Author: glen herrmannsfeldtglen herrmannsfeldt Date: Oct 16, 2006 18:12
In comp.lang.fortran Rostyslaw J. Lewyckyj bellsouth.net> wrote:
(someone wrote)
>>>>I don't know why PI wasn't a function.
>>>I do. Fortran did not support macros.
>> I don't understand what you meant here.
(snip)
> But, To have the compiler automatically furnish a value
> at compilation time you need to name it eg "PI" , and then
> you refer to it using that name "PI" throughout the code.
> I.e. you have introduced the mis feature of reserved keywords
> into the language. :)
As an intrinsic function it would not be any different
than any other intrinsic function. It could even
have an argument which was then multiplied by pi.
(Especially useful on non-binary machines.)
|
| Show full article (1.70Kb) |
|
| | 221 Comments |
|
  |
Author: Rostyslaw J. LewyckyjRostyslaw J. Lewyckyj Date: Oct 17, 2006 12:41
glen herrmannsfeldt wrote:
> In comp.lang.fortran Rostyslaw J. Lewyckyj bellsouth.net> wrote:
>
> (someone wrote)
>
>>>>>I don't know why PI wasn't a function.
>
>>>>I do. Fortran did not support macros.
>
>>>I don't understand what you meant here.
>
> (snip)
>
>>But, To have the compiler automatically furnish a value
>>at compilation time you need to name it eg "PI" , and then
>>you refer to it using that name "PI" throughout the code.
>>I.e. you have introduced the mis feature of reserved keywords
>>into the language. :)
>
> As an intrinsic function it would not be any different ...
|
| Show full article (3.29Kb) |
| 220 Comments |
|
  |
Author: glen herrmannsfeldtglen herrmannsfeldt Date: Oct 17, 2006 13:56
In comp.lang.fortran Rostyslaw J. Lewyckyj bellsouth.net> wrote:
(snip on PI and intrinsic functions)
> Well yes and no. The intrinsics are not really a part
> of the language, though almost. I don't believe any such
> functions are mandated for the language in the standard.
> They are functions known to the compiler that are a part
> of the supporting libraries, and the compiler generates
> special execution time calls to the these functions.
> (I don't think any of these are evaluated at compile time )
Fortran 66 has intrinsic functions and basic external
functions. Basic external functions must exist such
that they can be passed as an actual argument to another
function. Intrinsic functions can, and usually are,
generated inline. Some that are usually generated inline
are type conversion, max/min, mod. The max and min
series, accepting a variable number of arguments,
can't be generated as Fortran functions. (That is,
written in standard Fortran.)
|
| Show full article (2.40Kb) |
| 9 Comments |
|
  |
Author: TerenceTerence Date: Oct 17, 2006 16:07
I see a few of us are still alive!
I was flying RAF planes in post-war 1946; Then I worked on a
DC-amplifier based teletype output computer for 200 strain gauges an
aircraft factory in 1951 and 52 to find why tails fell off (metal
fatigue at low temperatures).
And later used the Mercury STAR computer for De Havilland "Blue Streak"
guidance simulations (using paper tape and big boxes of spare
dual-triodes). Then I installed several paper-tape 1620's for IBM in
the UK and was involved with Fortran for IBM in the 1961-64 period (and
still use F77 in preference to anything else). Yes, I have the 704
manual and others..
I also wrote the card loader that played music pieces on the 1403
printer chain, and a simple tape operating system for the 1401 (and I
could go on..).
If anybody wants war stories...
|
| Show full article (0.86Kb) |
| 5 Comments |
|
  |
Author: nospamnospam Date: Oct 17, 2006 16:22
Rostyslaw J. Lewyckyj bellsouth.net> wrote:
> Well yes and no. The intrinsics are not really a part
> of the language, though almost. I don't believe any such
> functions are mandated for the language in the standard.
I couldn't quirte follow whether you were talking about Fortran or PL/I,
both having been mentioned in prior paragraphs. I don't know enough PL/I
to comment, so I won't tr. But in Fortran, the standard intrinsic
functions most definitely are part of the language. They are specified
in the standard, are required of all compilers, and are in general just
as much a part of the language as the syntax is.
> (I don't think any of these are evaluated at compile time )
|
| Show full article (2.13Kb) |
| no comments |
|
  |
Author: Rostyslaw J. LewyckyjRostyslaw J. Lewyckyj Date: Oct 17, 2006 20:50
glen herrmannsfeldt wrote:
> In comp.lang.fortran Rostyslaw J. Lewyckyj bellsouth.net> wrote:
> (snip on PI and intrinsic functions)
>
>
>>Well yes and no. The intrinsics are not really a part
>>of the language, though almost. I don't believe any such
>>functions are mandated for the language in the standard.
>>They are functions known to the compiler that are a part
>>of the supporting libraries, and the compiler generates
>>special execution time calls to the these functions.
>>(I don't think any of these are evaluated at compile time )
>
>
> Fortran 66 has intrinsic functions and basic external
> functions. Basic external functions must exist such
> that they can be passed as an actual argument to another
> function. Intrinsic functions can, and usually are,
> generated inline. Some that are usually generated inline
> are type conversion, max/min, mod. The max and min ...
|
| Show full article (3.59Kb) |
| 2 Comments |
|
  |
Author: Rostyslaw J. LewyckyjRostyslaw J. Lewyckyj Date: Oct 17, 2006 21:18
Richard Maine wrote:
> Rostyslaw J. Lewyckyj bellsouth.net> wrote:
>
>
>>Well yes and no. The intrinsics are not really a part
>>of the language, though almost. I don't believe any such
>>functions are mandated for...
|
| Show full article (2.58Kb) |
| 207 Comments |
|
  |
Author: nospamnospam Date: Oct 17, 2006 23:39
Rostyslaw J. Lewyckyj bellsouth.net> wrote:
> Ok,ok, I stand corrected. However as a result I need an explanation
> and clarification of the 'practical ?' difference between intrinsics
> and reserved words/identifiers in the Fortran language.
The names of intrinsics are not reserved. You can use them for anything
you like. The practical effects of using the name of an intrinsic depend
on whether you are using it as an external procedure or not.
If you are using the name for something other than an external
procedure, nothing special is required. You can't use the same name for
2 different things in the same scoping unit (with a few exceptions, but
this isn't one), so you won't be able to use that name for the intrinsic
in that scoping unit, although you can still use the intrinsic by that
name in other scoping units. Just using the name for something else will
declare it to be whatever that is instead of the intrinsic.
If you use the name of the intrinsic for an external procedure, then you
must explicitly specify the external attribute (by any of several ways;
the EXTERNAL statement is the oldest). That's basically what the
EXTERNAL attribute says - that the name is being used for an external
instead of for an intrinsic.
|
| Show full article (3.04Kb) |
| no comments |
|
  |
|
|
  |
Author: nospamnospam Date: Oct 17, 2006 23:47
Rostyslaw J. Lewyckyj bellsouth.net> wrote:
> I was thinking of
> things like sin({var}) where unless you specified
> EXTERNAL sin, the compiler chose which of it's library
> routines to call depending on the type of {var}.
That is genericity. It is not directly related to whether or not
something is intrinsic. Generic intrinsic procedures were added to the
language in f77. As of f90, the user can also define generics (or extend
the intrinsic generics).
To re-emphasize generic/=intrinsic. They are unrelated concepts. All 4
combinations of generic/specific crossed with intrinsic/nonintrinsic
exist.
> I forgot to consider max/min, mod which did sometimes
> get done at compile time. Though again you could override.
> I never tried changing the use of any of these names
> e.g. max=....... . So I don't recall any warnings, or
> error messages because of these names having that special
> almost reserved word status.
|
| Show full article (1.48Kb) |
| no comments |
|
|
|
|