Re: intent(in)

From: Richard E Maine (nospam_at_see.signature)
Date: 11/03/04


Date: Wed, 03 Nov 2004 07:48:55 -0800

Gordon Sande <g.sande@worldnet.att.net> writes:

> (The official definitions of explicit and implicit interfaces do not
> match common usage and seem to cause no end of problem. Implicit is
> "no interface" and explicit is either the result of being contained
> in program/module or the (awkward) interface block if I have gotten
> it straight.)

Yes, you have it straight. As a memory aid, think of it as just
like variable types.

Explicit is when you supply the information to the compiler. In the
case of a variable type, you have a type declaration statement; in the
case of an interface it is when you either write an interface body
or a USE statement to tell the compiler what's up.

Implicit is when the compiler deduces the information implicitly.
For a variable type, the deduction is based on teh first letter of
the variable name. For an interface, the deduction is based on
what the invocation of the procedure looks like. For example if the
invocation looke like call sub(x,y) where x and y are real, then
the compiler implicitly deduces that sub better be a subroutine with
2 real arguments.

-- 
Richard Maine                       |  Good judgment comes from experience;
email: my first.last at org.domain  |  experience comes from bad judgment.
org: nasa, domain: gov              |        -- Mark Twain


Relevant Pages

  • Re: Old Fortran code
    ... do you mean when you say that "'IMPLICIT LOGICAL' won't work"? ... you are assuming the compiler will give you a list of undeclared ... these tests are only on assignmnt of one variable type relative to ... variable type is assumed from the first character of the name UNLESS ...
    (comp.lang.fortran)
  • RESULT attribute not working
    ... BIND RESULT ... IMPLICIT NONE ... Having this interface block verbatim in the calling program, ... IntelC Compiler for applications running on Intel64, ...
    (comp.lang.fortran)
  • Re: implicit cast operator funny-ness
    ... The compiler does not know when of the million possible implicit ... specific interface you are thinking of, ... so assigning A to an IB will cause who knows what, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: MFC and c++ problems
    ... compiler to generate code that is architecturally nonsensical. ... So a design in which a control has any syntactic knowledge of any container of itself ... GetParent->SendMessage is the interface of choice, ...
    (microsoft.public.vc.mfc)
  • Re: module
    ... implicit none ... !gcc$ ATTRIBUTES STDCALL:: GetLastError ... realsimpson ...
    (comp.lang.fortran)