Re: F2003: pass disallowed for procedure pointer components?



Reinhold Bader <Bader@xxxxxx> wrote:

C1212 (R1215) The name shall be the name of an abstract interface or
of a procedure that has an explicit interface. If name is declared by a
procedure-declaration-stmt it shall be previously declared. If name
denotes an intrinsic procedure it shall be one that is listed in 13.6 and
not marked with a bullet (?).

provided the second sentence of C1212 can be interpreted as having the
same meaning as "A /name/ referenced by a /procedure-declaration-stmt/
shall be previously declared."

No. I think you are misreading that. Horrible sentence, I agree, but it
does have a sensible literal interpretation - not an immediately obvious
one, but at least a literal one that would just constitute unclear
writing style, rather than an error. Your substitution of "referenced"
for "declared" assumes that the standard's wording is flatly in error;
there is no way that I can read the standard's actual wording as saying
that. "Defined" and "referenced" are not at all the same thing;
substituting one for the other would be a substantiative error - not
just sloppy or imprecise writing. Note by the way that "referenced"
would be wrong anyway because "referenced" has a precise meaning in the
standard and it isn't what you mean.

I'd read the sentence in question as follows. Consider

procedure (foo) .... :: bar

The name that C1212 refers to is foo - not bar. Foo might be declared in
any of several ways. One of those ways is that foo might have been
declared in a procedure declaration statement. If so, the constraint
says that the procedure declaration statement for foo must be previous
to the one shown above for bar. That is, this is just a
defined-before-used restriction for that case.

This doesn't apply to the code shown because foo isn't defined by a
procedure declaration statement.

--
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: Learning Lisp the hard way
    ... where bar is a generic function having several methods for different ... I would just type (foo) to the REPL and see what it returns. ... Some code uses a VALUES declaration. ... Often it is just sufficient to use a documentation ...
    (comp.lang.lisp)
  • Re: Interface and struct
    ... Class Foo: Implements IFace ... Structure Bar ... Interface IFace ... > The interface declaration is more like ...
    (microsoft.public.dotnet.languages.vb)
  • Re: A roguelike programming contest
    ... Foo's use of bar becomes a private matter, ... Here is C++ example of a forward declaration: ... class Foo; // forward class declaration ... Baz & _baz; ...
    (rec.games.roguelike.development)
  • Re: Question about multiple files
    ... No. extern just means: The actual definition is somewhere else. ... the compiler can differentiate between declaration and definition just ... > declaration it finds and in this way can I write code expecting it to be ... When the compiler reaches the line foo(); ...
    (alt.comp.lang.learn.c-cpp)
  • RE: RFC on first perl script
    ... print $foo; ... Global symbol "$foo" requires explicit package name at - line 4 ... my EXPR: ATTRS ... The "our" declaration has no semantic ...
    (perl.beginners)