Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Object REXX
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Message paradigm === Similar to the messaging paradigm implemented by [[Alan Kay]] in Smalltalk, everything in ooRexx is an object that can be communicated with. The notion of sending messages to objects as if they were living beings helps beginners to learn OOP concepts.<ref name=":4">{{Cite journal |last1=Flatscher |first1=Rony G. |last2=Winkler |first2=Till |title=Employing the Message Paradigm to Ease Learning Object-oriented Concepts and Programming |url=https://research.wu.ac.at/files/64505159/mipro24_9194_Flatscher_Winkler_EmployingMessageParadigm_final-4.pdf |journal=In 2024 47th MIPRO ICT and Electronics Convention (MIPRO) |pages=1244β1249}}</ref> In contrast to Smalltalk, there is an explicit message operator, the tilde (<code>~</code>), where the receiving object is placed to the left of it and the result of the operation is returned. Sending a message leads to the activation of a method with the corresponding method name and to the manipulation of the receiving object. Like Smalltallk, ooRexx messages can be cascaded if two tildes (<code>~~</code>) are used instead of one, returning the object that received the method rather than the result produced.<ref name=":9">{{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/rexxpg.pdf |title=ooRexx Documentation 5.0.0 Programmer Guide |last2=Flatscher |first2=Rony G. |last3=Hessling |first3=Mark |last4=McGuire |first4=Rick |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Wolfers |first7=Jon |date=2022 |publisher=RexxLA}}</ref> The default behavior of most methods can be changed by specifying an option, which can be either spelled out or abbreviated and is not case-sensitive. When reading code, this enables a literal understanding and reduces the learning effort for beginners, as there is no need to learn the meaning of abbreviations.<ref name=":3" /> For example, the method with the name <code>strip</code> removes leading and trailing blanks by default. This behavior can be changed, for example, by specifying <code>"leading"</code> or <code>"l"</code> as an option. While functions are nested in classic Rexx, messages can be chained in ooRexx, which improves the readability of a [[Statement (computer science)|statement]].<ref name=":4" /><syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> a = " I am ooRexx!" say a /* output: I am ooRexx! */ say a~Strip("Leading") /* output: I am ooRexx! */ say a~strip("l")~reverse /* output: !xxeRoo ma I */ </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)