I have no opinion on the RFE as such but I am curious on the implications. What is the added value of declaring a value as a constant compare to just allocating a variable? I understand that for a language like C it might make a difference (as to where and when the constant is allocated by the compiler) but for ooRexx? If you never change the variable it is „constant“, right? Is the execution in some significant way faster when using constants?
Put differently: what is the difference between ::constant pi = 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899863 And pi = 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899863 ? Hälsningar/Regards/Grüsse, P.O. Jonsson oor...@jonases.se > Am 19.12.2018 um 07:50 schrieb <mgaub...@groupgw.com> <mgaub...@groupgw.com>: > > Håkan: > > I strongly disagree with your assessment. Say I have a series of similar > values that I will be using in a program, ‘a5a5a5a5’x, ‘a5a5a9a5’x, and > ‘a5b5a5a5’x, all used multiple times. The eye does not readily catch the > differences between the values, while names of cv1, cv2, and cv3 are readily > distinguishable by comparison. Also, when I am dealing with 100+ > digit/character constants, do I really want to risk making sure that I am > using the same constant by either retyping or cut-and-paste methods that are > both prone to procedural errors on input? > > In addition, certain constants that can readily be calculated are welcome. > For example, if I need the constant 2π/3 frequently, while numeric digits <= > 84, specifying: > > ::constant pi = > 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899863 > ::constant TwoThirdsPi = (2*pi)/3 > > n = (r*r) * TwoThirdsPi > > makes a lot more sense than having code that says: > > -- r**2 * 2 * pi / 3 > n = (r*r) * > 2.09439510239319549230842892218633525613144626625007054731662972820521093752413933242 > > or similar for each use of the same constant. One program I wrote for a > client used hundreds of specified constants, scattered throughout tens of > thousands lines of code. Given that the constants were specified – and could > be changed by the client’s whim – I, for one, am looking forward to the RFE > and the time savings it will engender both in program maintenance and > execution time. > > Regards, > > Mark L. Gaubatz > > From: Håkan Erixon <hakan.hex.eri...@outlook.com > <mailto:hakan.hex.eri...@outlook.com>> > Sent: Tuesday, December 18, 2018 1:09 PM > To: Open Object Rexx Developer Mailing List > <oorexx-devel@lists.sourceforge.net > <mailto:oorexx-devel@lists.sourceforge.net>> > Subject: Re: [Oorexx-devel] One more feature 730 restriction. > > I think this is a typically suboptimazing RFE. > First, a constant have a constant value. > If a programmer want to use a expression in a constant, it´s better to use > the constant it in the code and calculate it there. > Drop this RFE. > > > From: Rick McGuire <object.r...@gmail.com <mailto:object.r...@gmail.com>> > Sent: den 18 december 2018 21:42 > To: Open Object Rexx Developer Mailing List > <oorexx-devel@lists.sourceforge.net > <mailto:oorexx-devel@lists.sourceforge.net>> > Subject: Re: [Oorexx-devel] One more feature 730 restriction. > > It would be trivial to create such a method, but the evaluation would not > take place in the context of the owning class, and more importantly, the > returned value would not longer be guaranteed to be a constant. Consider a > constant like > > ::constant loadTime (.datetime~new) > > attached to a class, it would always return the same value. Unattached, it > would return something different each time. > > Rick > > On Tue, Dec 18, 2018 at 12:15 PM Erich Steinböck <erich.steinbo...@gmail.com > <mailto:erich.steinbo...@gmail.com>> wrote: >>> unattached dynamic constants will be an error >> As an alternative we could evaluate floating dynamic constants each time >> they are used (effectively making them normal floating methods). >> _______________________________________________ >> Oorexx-devel mailing list >> Oorexx-devel@lists.sourceforge.net >> <mailto:Oorexx-devel@lists.sourceforge.net> >> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >> <https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Foorexx-devel&data=02%7C01%7C%7C75640b03eab94c32eee208d665295c99%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636807625651151095&sdata=M4c457SSZWzVtsRNxC361cE%2BTnu5ckPYJ0r4H%2BOHJ3c%3D&reserved=0>_______________________________________________ > Oorexx-devel mailing list > Oorexx-devel@lists.sourceforge.net <mailto:Oorexx-devel@lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > <https://lists.sourceforge.net/lists/listinfo/oorexx-devel>
_______________________________________________ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel