Procedure with same name.

Can we have same name of the internal procedure say (try_load)?
Ex: try_load procedure is defined in a.p & b.p and both .p are running as persistent/super procedure?

Can we get error sometime while calling try_load by accessing through handle?

Kindly advise.
 

tamhas

ProgressTalk.com Sponsor
If you are running in a handle, the reference is unambiguous. If you are running in a super, it is also unambiguous. Read in the manual about the two different options for sequencing the call stack. You can even have the procedure in one call the procedure in another, similar to inheritance in OO ... or, you could just use classes and make it all clearer.
 
Thanking you for the quick reply.

Does this mean, I need to avoid having same internal procedure name?

This may be reason of the error i am facing which i have explained in my previous
thread "Critical issue: Persistent procedure".

Kindly advise.

Thanks in advance
 

tamhas

ProgressTalk.com Sponsor
No, it means that in both cases there is an unambiguous set of rules for resolving what gets called, so no possibility of confusion ... except on the part of the programmer. With a handle, you know exactly where it is pointing. With a super, there are two options for name resolution which you should read about, but in either case it is unambiguous and predictable which code will be run.

Which said, you should be asking yourself whether it is good practice. Certainly with super procedures, I would never have the same name in more than one super. I.e., I never rely on those name resolution rules since I think it makes the programs hard to understand.
 

tamhas

ProgressTalk.com Sponsor
Well, let's say that the AVM isn't going to get confused ... even if the programmer is. :)

While there is a certain parallel between OO and the use of persistent and super procedures, I am a little hesitant to stress that unless a person is actually starting to work with OO because there are also some significant differences.

Certainly, there is a parallel between

RUN SomeIP in AHandle

and

MyObj:SomeMethod

in that MyObj is a reference to the container holding the code to be executed and so is AHandle so in both cases one is pointing directly at the place where the code that is executed.

People sometimes talk about the parallel between super procedure stacks and inheritance, but I think that is much less clear. Super procedures extend the name space so that it is no longer necessary to use the handle reference. The path to find the executable code is still very well defined, but is not so apparent by simply reading the code. Of course, passing handles around willy-nilly can obscure the relationship as well. This name space extension aspect of supers is somewhat like the use of statics in OO. The percolation of the search for the correct code to execute that happens in an SP stack is vaguely like what happens with inheritance in OO, but is a run time behavior instead of a compile time resolution and the relationship is declarative in OO and empirical in procedural code.
 
Top