Re: avoiding writing an interface blocks



Richard E Maine <nospam@xxxxxxxxxxxxx> wrote:

My interpretation is that he wanted to declare the return type,
as required, without declaring the arguments, assuming that the
arguments wouldn't require an interface on their own.

Yes. This is what I meant.

But you need more than just the type. You also need the shape
information in this case, that being what trigerred the requirement for
an explicit interface here in the first place. Perhaps you are just
thinking that is part of declaring the type. If so, that is distinctly
wrong. It is important in Fortran that shape is distinct from type;
there are many implications of that, which I won't go into here (it gets
off topic, would take a lot of time, and I don't even recall them all
off the top of my head).

How about attributes? (I think in C type includes shape, but attributes
may overall be a better word to describe it.)

If you declare just the type and nothing else, then that's exactly what
an implicit interface is - not an explicit one. No, you can't ignore the
requirement and use an implicit interface when the standard requires an
explicit one.

What I meant was to declare all the properties needed for the return
value, without declaring those for the arguments. Yes, sorry, type
is just one of those properties.

I also agree that the bug finding properties of declaring the
argument properties are probably worth the extra work to get it right.

Then again, maybe a subroutine with an additional assumed size
array argument would satisfy the OP.

-- glen
.



Relevant Pages

  • Re: intel compiler and [REFERENCE] keyword?
    ... would not change by declaring the argument to be a character array as ... of the interface, ... compile, but have a trailing underscore on the exported function. ... the Fortran 2003 features of C interoperability or intrinsic modules. ...
    (comp.lang.fortran)
  • Re: Error signature when calling GetScriptCount of IWMHeaderInfo3
    ... public static extern uint WMCreateEditor( ... public interface IWMMetadataEditor ... public interface IWMHeaderInfo3 ... This is definitely your problem--when declaring COM interfaces ...
    (microsoft.public.windowsmedia.sdk)
  • Re: Error signature when calling GetScriptCount of IWMHeaderInfo3
    ... public static extern uint WMCreateEditor( ... public interface IWMMetadataEditor ... public interface IWMHeaderInfo3 ... This is definitely your problem--when declaring COM interfaces ...
    (microsoft.public.windowsmedia.sdk)
  • Re: Questions of Designs
    ... This is crude way of declaring complete abstract behavior using language specific syntax. ... What's so different about the C++ ABC above and this Java interface: ...
    (comp.object)
  • Re: noob question: "TypeError" wrong number of args
    ... Thus breaking not only "explicit is better than implicit", ... Not so much for the argument mismatch problem, ... As long as we're trotting out aphorisms, how about DRY: Don't Repeat ... that's exactly what explicitly declaring self does, ...
    (comp.lang.python)