On 14.03.2021 12:08, Rick McGuire wrote: > It really is a security feature. Things start getting terribly wonky if the > behavior of a class > gets altered beyond the author's intentions.
This may be the case, but the same (a very general) argument would work against almost anything where the original authors are not involved and changes get applied to their code one way or the other. (It is always the programmer's responsibility to do something useful with existing implementations, not to break anything.) It is quite likely that under certain circumstances it may be beneficiary to allow going beyond the author's original intentions for whatever reasons (new needs, new concepts, ...). This has also been the reason why there are programming languages which allow the "extension" concept which allows to extend existing classes. Here two IT giants that have the extension concept in their most important system programming languages available: * Apple: the Objective-C ("Smalltalk in C") system programming language which has also been allowing extending existing classes/types with "extension methods": <https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/CustomizingExistingClasses/CustomizingExistingClasses.html> * Microsoft: the C# language which is one of the most important system languages for Microsoft and proven as such (.Net/CLR). Here the Microsoft documentation for "extension methods": <https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods>. > On Sun, Mar 14, 2021 at 6:44 AM Erich Steinböck <erich.steinbo...@gmail.com > <mailto:erich.steinbo...@gmail.com>> wrote: > > For an elegant solution I so often wish I could add a method to a class > within the REXX > package, but can't, as it's forbidden. I think it's also impossible to > add a method to an > existing instance of such a class (an instance like e. g. a DateTime that > is returned from a > .File method). > > What is preventing us from allowing this? > Is this a technical thing (because these classes are in the image)? > Or is it meant to be a security feature? > > Any ideas how we could allow this (or similar)? > Yes (but please, only after releasing the current 5.0 beta first), as it had been done for ooRexx 4.x alreday, believe it or not! :) Background: there is an ooRexx committer, Jean-Louis Faucher, who is incredible knowledgeable, loves programming concepts, and has been doing incredible things with his sandbox version of ooRexx 4.x for many years. Among the many, many concepts he has implemented into a running ooRexx 4.x interpreter has been this very "extension method" concept! And by the way, his sandbox version of ooRexx 4.x enhanced with his abilities and knowledge is available (for testing or using) via: <https://github.com/jlfaucher>, just look around what gems he has there and you know, why I am really very impressed by his work. As Jean-Louis is a very constructive and polite person, he has never attempted to push his stuff into the ooRexx project. Rather he keeps his work separate for everyone interested to see, to testand to use, who has an interest or maybe even a need for it. A couple of years ago he created presentations that allow a glimpse over all his work and features he added to his sandbox version of ooRexx 4.x back then that can be fetched from the RexxLA symposium page (the 2012 symposium that is). Here the links to it: * Symposium 2012 schedule with links: <https://www.rexxla.org/events/2012/schedule.html> * Jean-Louis Faucher: <https://www.rexxla.org/events/2012/presentations/201205-Sandbox-jlf.pdf> o Experimental ooRexx #1: ooRexxShell, Unicode ooDialog, *Extensions*, Blocks, Doers o Experimental ooRexx #2: Coactivity (Coroutine), Closure by Value, Partial Arguments, Higher-order Methods, Generators o Experimental ooRexx #3: Pipelines, Concurrency Trace, Outlook of Todos If you look at his current version <https://github.com/jlfaucher> you see that everything is there, still working, but got enhanced over time. So, there is even an ooRexx committer who knows (at least for ooRexx 4.x) how to do what he has done! Of course, these features would add to the ooRexx language and would therefore need to undergo thorough discussions (features, syntax, core-feature, optional-add-on-feature, implications, side-effects, Rexx/ooRexx philosophy, ...) which the "architecture board" for ooRexx should take on IMHO. As Jean-Louis has gathered an incredible wealth of experience and know-how with respect to ooRexx 4.x it would be probably important to request a more active role in this from him, if he would be interested to add this to the ooRexx 5 line as well. ooRexx and ooRexx programmers IMHO would benefit a lot from some, if not all new features he has experimentally implemented already in his sandbox version of ooRexx 4.x! ---rony
_______________________________________________ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel