INPUT-OUTPUT parameters

Posted by ksv on 16-May-2017 00:18

Recently I found out that you can easily omit INPUT-OUTPUT option when you call a function or a method like that

FUNCTION Func RETURNS CHARACTER PRIVATE ( INPUT-OUTPUT yyy AS CHARACTER ):

END FUNCTION.

Func(x).

I think it's an awful thing in the language syntax.  It makes the code VERY confusing because when you see F(X)  you think X is immutable here but suddenly it turns out that it is mutable and it's a disaster!

It's OpenEdge 11.5.

All Replies

Posted by Mike Fechner on 16-May-2017 00:22

This has been discussed here before. I agree it's awful and dangerous.

Chances to get this fixed however are almost zero.

Posted by Laura Stern on 16-May-2017 09:59

I agree that this is not good.  We could add this on to our compiler OPTIONS feature - i.e., RequireExplicitParameterCompatibility (I know - the name is probably too long!  But you get the point.)

Posted by tpavlovic on 16-May-2017 11:12

[quote user="Laura Stern"]

I agree that this is not good.  We could add this on to our compiler OPTIONS feature - i.e., RequireExplicitParameterCompatibility (I know - the name is probably too long!  But you get the point.)

[/quote]

+1

or +101 if I may.

Posted by Alex Herbstritt on 16-May-2017 11:28

You will be happy to know that this concept is already included under our future considerations for the COMPILER OPTIONS. No specifics on its ranking yet.

Posted by ksv on 17-May-2017 00:22

I'm looking forward to it! When's this option going to appear?

Posted by cverbiest on 17-May-2017 03:08

+1
On the function/method definition it should be mandatory
for the method/function/procedure call  we consider "input" as default and optional, the rest (output, input-output, …) should be specified
 
I hope an RequireExplicitParameterCompatibility will be flexible enough for that behaviour.
 
Kind regards/Met vriendelijke groeten,
Carl Verbiest
 

Posted by Evan Bleicher on 10-Jul-2017 07:50

This capability is on the Core Client team’s 12.0.0 enhancement list.  Once the team has a prototype of this functionality, we will share it with the Community via an 12.0.0 ESAP.
 
To date, the Core Client team has provided as part of the first ESAP for 12.0.0 a change to the Compiler Option feature which was first introduced in 11.7.0.  It has now been augmented to associate a severity level (error or warning) with each compiler option you identify.  Our intent is back port this functionality to an 11.7 service pack.
 
Thanks
 

This thread is closed