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!
=== Everything is an Object === While classic Rexx follows the "Everything is a String" philosophy and has [[String (computer science)|string]] as its only data type, ooRexx considers everything as objects, including non-string objects such as arrays, streams and many more. Objects are manipulated using methods instead of traditional functions. In ooRexx, a string variable is a reference to a string object and does not need to be declared, which reduces the effort for programmers compared to [[Type system|strictly typed languages]].<ref>{{Cite journal |last1=Stefik |first1=Andreas |last2=Siebert |first2=Susanna |date=2013 |title=An empirical investigation into programming language syntax. |url=https://dl.acm.org/doi/10.1145/2534973 |journal=ACM Transactions on Computing Education |volume=13 |issue=4 |pages=1β40 |doi=10.1145/2534973|url-access=subscription }}</ref> A string object can be of any length and contain any characters, including numerical values. It is therefore possible to change numerical values with string manipulations and methods of the <code>String</code> class. In addition, a string variable can contain any type of expression, including executable instructions, which can be evaluated or executed with the <code>INTERPRET</code> keyword instruction.<ref name=":2" /><syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> a = 2 /* string with numerical value */ a = a || '0' /* resulting string: 20 */ str = "do i = 1 to "a"; say i; end" /* string contains loop instruction */ interpret str /* interpret string: counts to 20 */ </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)