Category talk:OoRexx: Difference between revisions

m
→‎custom JavaScript: added a comment.
m (→‎ooRexx fully compatible with classic REXX: cleaned up a couple of phrases. -- ~~~~)
m (→‎custom JavaScript: added a comment.)
 
(21 intermediate revisions by 3 users not shown)
Line 1:
__TOC__
 
==ooRexx fully compatible with classic REXX==
 
Line 5 ⟶ 7:
<br><br>be removed or corrected? I know the next paragraph says otherwise, but why have an incorrect statement at all, even if corrected later in the same section? My area is classic REXX and I feel like a brown shoe at a tuxedo party here.
 
ooRexx isn't fully compatible with classic REXX, there are differences, even if only a few (I may be wrong on the number of differences). I don't want to enumerate them (at least the ones that I know of), for once done so, people will think that is the extent of the differences. I'm not an expert in the subtiltiessubtleties of ooRexx (differences). If the offending statement gets removed or corrected, feel free to delete this section (in the TALK section) in its entirety. -- [[User:Gerard Schildberger|Gerard Schildberger]] 20:24, 21 June 2012 (UTC)
 
----
Line 21 ⟶ 23:
-----
 
<br>There're different REXX interpreters, and most likely, for one reason (the main reason?) at least, is that the (at one time) REXX interpreter wasn't available for other platforms, and there was an apparent and obvious need (or desire) to have a REXX interpreter on DOS. I believe that's why the first non-IBM version (PC/REXX?) was written --- to make REXX available for the PC -- but it was bundled with KEDIT and that made the reasons a little murkeymurky in retrospect, part of KEDIT's (an XEDIT wannabe) flexabilityflexibility and useability was using REXX as it's macro language. -- [[User:Gerard Schildberger|Gerard Schildberger]] 19:10, 26 June 2012 (UTC)
 
The two main objectives of (classic Rexx) Regina are to "become 100% compliant with the ANSI Standard, and be available on as many platforms as possible". I'm sure that there are other (secondary) reasons as well for the various REXX interpreters. -- [[User:Gerard Schildberger|Gerard Schildberger]] 19:10, 26 June 2012 (UTC)
 
As for my wording (suggested or otherwise): no, I never said, implied, or suggesting that code from any classic REXX interpretorinterpreter would run on any other classic REXX interpreter. If it would, I wouldn't have so many Regina bugs entered in Source Forge. -- [[User:Gerard Schildberger|Gerard Schildberger]] 19:10, 26 June 2012 (UTC)
 
I should not be accused of not serving the truth for something that I did NOT say. (This is not true, no?) This is a strawman argument. I resolutely stand by the words that I did NOT say and will defend my right to not say those words that I won't say. -- [[User:Gerard Schildberger|Gerard Schildberger]] 19:10, 26 June 2012 (UTC)
 
I could say, ''"It is possible to write Classic REXX code that won't run unchanged on Fortran"''. Also, ''"it is possible to write Classic REXX code that will run unchanged on Fortran"''. But I was only contesting the statement that ''Since ooRexx is fully upward compatible with REXX, every REXX program shown here can also run, unchanged, using ooRexx''. That italicized statement isn't true. I asked to have that statement removed or corrected (and it was corrected). I also didn't suggest any sort of wording to be used for the manner of correction. -- [[User:Gerard Schildberger|Gerard Schildberger]] 19:10, 26 June 2012 (UTC)
 
Also, it was suggested that some classic REXX programs be changed to run under ooRexx. Could sauce for the gander be sauce for the goose? That is, could ooRexx programs be changed to run under classic REXX? [I'm not suggesting that this be done, I'm asking the more-or-less rhetorical question.] I'm not an ooRexx expert (I can spell it easily enough), but do simple tasks require the use of object-only features? I would imagine some tasks could use those features to make the code more concise or easier. I didn't intend for my dog to be dragged into this discussion (on ooRexx), I was entering classic REXX programs only. And then the ''24 game'' was thrown in front and center into a roiling controversy. If it weren't for the changes and programming style made to the classic REXX program that I entered, I wouldn't be here in an ooRexx discussion trying to defend statements that I didn't make concerning classic REXX vs. ooRexx. -- [[User:Gerard Schildberger|Gerard Schildberger]] 19:10, 26 June 2012 (UTC)
 
----
Apologies if I misquoted you - the only quote I can see that I attributed to you was ''fully compatible'' which I see even now in the 2nd para of this section and the section header. I admit that you did not press for this wording, merely included it in your argument. It was careless of me to refer to you as ''pressing for it'', and reading your post again in the light of your more recent post, your original post seems more reasonable. My mistake.
 
I'm not sure I follow all your arguments Gerard.
 
As I see it, ooRexx is a classic rexx interpreter, that also has object oriented abilities. I would be surprised if there are any tasks that would run on the other classic rexx interpreters that could not be made to run on the ooRexx interpreter using only the classic features with few changes.
 
It seems true - though it comes as a genuine surprise to me that many of the rexx examples here are written in such a way that they will not run on ooRexx.
 
: I can only speak for the REXX code that was entered by me, the programs were written and tested in three classic REXX interpreters and I don't assume they'll run anywhere else, I would test CMS and TSO versions if I could. I may be reading into your statement more than was intended, but it was not written in such a way that they won't run, that is, no other intention was intended to have them also runnable in other (object-oriented) REXX interpreters (as far as ooRexx). I have no interest in writing code that may or may not work for ooRexx, only classic REXX. Some run correctly under ROO (at least, it produces the same results which could be happenstance), but I don't pretend to know all the nuances and/or subtleties of object oriented REXX, and saying that would (or does) run would be a tacit way to say that it works correctly as intended under ooRexx.
 
I don't have the numbers, but I believe there are many people who run ooRexx, without taking advantage of the oo facilities. The point I was trying to make is that the differences you find when you use it like this are like the differences between one classic rexx interpreter and another.
 
: How so? Which differences would those be (excluding bugs, of course). Of course, some classic REXX interpreters are much older than others and don't have some of the newer BIFs or their extensions, but those differences weren't made that way, there was an evolution while keeping capability to the older versions of REXX. REXX programs that I wrote in 1982 will will run unchanged in the CMS and TSO REXXes of 2012.
 
:: What I had in mind here particularly was permitted character sets. I am not an expert in different interpreters - I have used VM/SP on CMS, the Rexx interpreter that came with PCDos7, Kexx, Personal rexx, and for the last decade or more ooRexx (or Object rexx as it was back then) with a little Kexx thrown in. I don't remember it all, but I remember that the not symbol on sp6 was ¬, I don't now remember what was not on PC Dos7. On personal rexx it was ~ which is the message operator on ooRexx. On SP6 you had to start your code with a comment /* */ so the correct interpreter was invoked. In Kexx comments are lines starting with a * - that is a standard, but not a Rexx one.
 
::: Yes, KEXX was a subset of REXX, a few other notable restrictions is that every clause had to be complete within one line, and that included comments. KEXX also accepted the normal REXX comments, but again, they had to be complete within one line (no multi-line comments). There were many other restrictions, most of which aren't probably germane to this discussion.
 
I would say that the main difference between ooRexx as a classic rexx interpreter and the other classic rexx interpreters is that ooRexx syntax checks the whole code before running any of it thus you cannot have syntactically invalid code in a clause even if it is never run.
Other differences can generally be avoided, the use of -- for + is problematic in ooRexx, but you could write code that would function on any interpreter by leaving a space between the operators without changing the meaning or function of your code. Certain characters such as @ were valid in early interperters, but cannot be used in ooRexx, although it does honour the ¬ sign.
 
: I'm not sure, but the way the REXX interpreter parses the source isn't defined in the language specifications. The reason that the older REXX executed code as it read the file (line by line) was a matter of speed, as I recall. Hard disks were a lot slower than today, of course. I believe ''R4'' parses the whole of the program before it begins execution, and almost all REXX program normally invoke a BIF at some point, which necessitates the need for the interpreter to parse the rest of the source anyway (looking for an internal version, which at the invocation time, it can't tell if the subroutine/function is internal or external, excluding those subroutines enclosed in quotes). Also, you presume that the use of a double negative was a conscious choice, it may be (macro/program) generated statement, or a user-entered REXX clause for instance, among other reasons. I hate to think about writing any code (REXX or otherwise) that could become invalid in another five or ten years time. Unforeseen "requirements" changing the validity of valid REXX statements. I have yet to see the advantage of introducing the double-minus comment to classic REXX, especially in the light that it disables (breaks or invalidates) a legitimate REXX statement. One could use the same argument (say) for using a '''//''' comment, everyone could break up the two '''/''' in their programs (albeit, this particular example has a lot more uses than a double negative, but that's only a popularity contest). Implementing a new way to code comments via least astonishment, in my opinion, isn't a sound way to extend a language. But then, nobody asked for my opinion when the vote came up. -- [[User:Gerard Schildberger|Gerard Schildberger]] 00:23, 27 June 2012 (UTC)
 
:: I also as far as I remember was not at the right place at the right time for that decision either, and I take your point, it probably wasn't an entirely smart move, but taking the -- as a given now, removing it would break many programs, whereas, if there were actual programs that were broken by this (I have never heard of any actual cases), then they could have been repaired by the simple expedient I mentioned, however generated.
 
Of course Regina has several features such as address-with that I believe are unique to it just as personal Rexx did (I loved the RxWindow package).
 
I don't know which of the rexx examples are yours, but many of them would run on ooRexx if they didn't use variable names like @. However, if the task demanded single character unreadable variable names you could still use ! or ?.
 
: I use '''@''' and '''$''' more or less consistency (to mean certain things), as well as '''!''' and '''?'''. I do note that ''ROO'' supports all those characters just fine without precluding them for use as variables. [''ROO'' is an object-oriented REXX interpreter.]
 
:: I have met roo, though I find it as baffling as some people seem to find the oo side of ooRexx. Again, I'm not an expert on the developments that rexx has gone through, and I could be wrong about this, but I understand that the decision to disallow those particular characters pre-dates Object Rexx, and I assume that there was some reason behind the decision.
 
::: I don't know where (or when) that happened (the disallowing). What classic REXX doesn't allow those national characters? -- [[User:Gerard Schildberger|Gerard Schildberger]] 20:14, 27 June 2012 (UTC)
 
Perhaps you might explain to me why you would object to the rexx code examples here being written in such a way that they would be portable between what are probably the two most popular rexx interpreters. I would see that as an improvement that would serve visitors to this site and cannot understand why you would object. If you do object, then it might be as well to know which of the rexx examples are yours.
 
: I never thought about "signing" my REXX examples, if that would help someone's understanding of where it would run, I'll do it. It would take me a while to go through the 380+ REXX examples. As I stated elsewhere, I wrote all my code to work on Classic REXX and don't assume it runs anywhere else, nor do I test it for a REXX interpreter that I don't have installed. I don't write the classic REXX code and keep thinking if this will or will not run on ooRexx. I concern myself to make sure it runs as intended for the Rosetta Code REXX entry for classic REXX. If writing code for maximum portability is good, then writing ooRexx code that doesn't need object-oriented features would also be good, this would lead to more ooRexx code being portable to classic REXX. I hope that one can see the obvious absurdity of that fallacious statement. Of course, you could always look in the history of who entered the code (for the example program). I have noticed that very very very few people sign their code. It seems rather egocentric to do so. -- [[User:Gerard Schildberger|Gerard Schildberger]] 00:23, 27 June 2012 (UTC)
 
:: I think this is the nub of the problem, not wishing to repeat myself, but to many people ooRexx is just another classic Rexx interpreter. For them, I assume that portability is important. Anders and Mark have done a good job, and there is a fantastic product there. Were it not for an accident of history I might have been a Regina user too. There are things you can do in Regina that cannot be done with ooRexx (address-with springs to mind, some of the options). ooRexx also has it's strengths, and if someone wants to meet the oo paradigm it is a jolly good place to start. Of course I see that it is absurd to value compatibility so highly that you deny yourself the power of the language. I just didn't see that choosing particular single character variable names should rank that highly as a priority. However, I did write that before you said that these variable names have a consistent meaning.
 
::: The very definition of a classic REXX interpreter excludes an object-oriented REXX. Some people may think that ooRexx is a classic interpreter, after all, some people believe that ooRexx will run any classic REXX code without change. It'll be interesting to see the list (matrix) of incompatibles (or differences, if you prefer) between the various classic REXX interpreters and ooRexx. I would hope that ''roo'' would be included in that matrix. ROO (as far as I can tell) has fewer restrictions in that regard. -- [[User:Gerard Schildberger|Gerard Schildberger]] 20:14, 27 June 2012 (UTC)
 
::: Also, keep in mind, some of these classic REXX programs were written before there was an ooRexx, and the choice of variable names was made for (and under) classic REXX, others were simply inherited from older code that couldn't/shouldn't be changed. Some of the decision making was colored by PC/REXX's restrictions, and at the time, that was the only game in town as far as coding REXX on a PC in a Windows world (or MS' DOS). The PC/REXX's restrictions that were applicable (and still are): no single REXX line could be longer than 250 characters (a limit that my tested and true ''one-liner'' subroutines share), and a limit of a 40k memory pool (called an ISA) of literals and symbols. There is also a limit on the length of a REXX clause. Now 40k isn't that much when you start writing a serious REXX program. I had often wished that limit was raised or eliminated entirely. (I still wish for world peace also, but there ya have it). I still use PC/REXX in syntax checking (without actual execution). I wonder why the the '''S''' option (Scan) for the '''TRACE''' instruction was dropped from non-IBM REXX interpreters, it was a very useful option for debugging. Oh well, water under the bridge. I regularly use PC/REXX's "optimize" option for that purpose, in addition to creating an "optimized" version of the program, it checks for syntax errors at the same time (without executing the program, of course). It should be noted that the word ''optimized'' would better be replaced with ''tokenized'', but ... that's the word used, and it does optimize the REXX program's execution. One nice thing is that ''R4'' will execute the optimized REXX program correctly, but Regina doesn't (execute it at all). It has to do with Regina's ignoring the end-of-file character. -- [[User:Gerard Schildberger|Gerard Schildberger]] 20:14, 27 June 2012 (UTC)
:: I certainly don't want to be an irritant to you, and I am incredibly busy at the moment, but I could offer to take a bit at a time the classic Rexx samples here and see what it would take to make them run on ooRexx. I could then pass them back to you and if I hadn't broken them for regina etc., then you could choose to post them or not. I quite understand if you are not interested. --[[User:Sahananda|Sahananda]] 12:24, 27 June 2012 (UTC)
 
::: If you're going to change them for ooRexx, why not also test them to see if they still work with the three class REXX interpreters that they were intended to work for (and also already tested)? I really don't want to spend that amount of time re-testing other people's code. I'm pretty sure your time is as valuable to you as my time is to me. I'm not sure if you appreciate the amount of time that will be spent in just visiting each of the classic REXX programs, updating (changing) them, added summaries, and testing for (at least) four REXX environments, and that's assuming that you have the aforementioned classic REXX interpreters. Some (ok, ok, a few) of the classic REXX programs were also tested under CMS and/or TSO (by obliging dear friends) [--- if it works on one, it'll most likely work on the other, as it's the same REXX interpreter] --- and I certainly don't want to put them through that again (running of non-business work on the company's dime). This avenue of testing is water over the dam ... most of them have retired. I started to go through the REXX examples, trying to removed the extra blanks lines that my earlier REXX examples had at the beginning and end of the REXX programs, and even that was taking a lot of my time. So far, I got through the '''A'''s and '''B'''s. -- [[User:Gerard Schildberger|Gerard Schildberger]] 20:14, 27 June 2012 (UTC)
I should not be accussed of not serving the truth for something that I did NOT say. (This is not true, no?) This is a strawman argument. I resolutely stand by the words that I did NOT say and will defend my right to not say those words that I won't say. -- [[User:Gerard Schildberger|Gerard Schildberger]] 19:10, 26 June 2012 (UTC)
 
I::: couldOne say,option ''"Itwould is possiblebe to writeinclude Classica REXX2nd codeversion, with a comment or note that won'tit was changed to run unchangedunder onooRexx Fortran"''.and only Also,tested ''"itunder isooRexx. possible toI writesuppose Classicthat REXXjust codeplacing that willversion runin unchangedthe onooRexx Fortran"''language section would be simpler. By Butthe Iway was(and onlythis contestingis theno statementsmall thatthing), ''Sinceit ooRexxwas isthis fullymultiple upwardtesting compatibleof withmy classic REXX, everyexample REXXprograms programthat shownled hereto canme alsofinding run,numerous unchanged,errors usingin ooRexx''.the Regina Thatand italizedR4 statementclassic isn'tREXX trueinterpreters. I asked tonever haveassume that statementeven removedwriting orsimple correctedcode (andwill itcorrectly waswork corrected).on all REXX interpreters until I alsoactually didn'texecute suggestthem. anyYa sortnever ofcan wordingtell towhen besomething usedwill forrise theup mannerand of<strike>bit</strike> bite ya in the correctionhinder. -- [[User:Gerard Schildberger|Gerard Schildberger]] 1920:1014, 2627 June 2012 (UTC)
 
thanks. --[[User:Sahananda|Sahananda]] 22:48, 26 June 2012 (UTC)
Also, it was suggested that some classic REXX programs be changed to run under ooRexx. Could sauce for the gander be sauce for the goose? That is, could ooRexx programs be changed to run under classic REXX? [I'm not suggesting that this be done, I'm asking the more-or-less rhetorical question.] I'm not an ooRexx expert (I can spell it easily enough), but do simple tasks require the use of object-only features? I would imagine some tasks could use those features to make the code more concise or easier. -- [[User:Gerard Schildberger|Gerard Schildberger]] 19:10, 26 June 2012 (UTC)
 
== Plagiarism ==
Line 64 ⟶ 120:
--[[User:Walterpachl|Walterpachl]] 08:30, 11 June 2012 (UTC)
 
:: (Removed my incorrect comments about CMS and TSO recogniztionrecognition of the ¬ (not) symbol) -- [[User:Gerard Schildberger|Gerard Schildberger]] 22:51, 19 June 2012 (UTC)
 
:: I should also mention that Regina REXX doesn't honor the not (⌐) symbol, but PC/REXX, R4, and ROO do. I would like to know if NetRexx, ooRexx, CRX, AREXX, BREXX, and others support that characgercharacter. Perhaps if someone could chime in who know those interpreters. -- [[User:Gerard Schildberger|Gerard Schildberger]] 08:52, 11 June 2012 (UTC)
 
----
Line 74 ⟶ 130:
 
: Are you saying that TSO doesn't support the logical or symbol (|) and that it also doesn't support the \ (backslash) symbol for negation? -- [[User:Gerard Schildberger|Gerard Schildberger]] 22:51, 19 June 2012 (UTC)
 
: I believe what Walter is saying is that his German keyboard and/or code page don't support those characters in the same way as they don't support other characters commonly found on a US keyboard (like the $ character). As I remember this is the reason that !, ? and _ were introduced as symbols and $, @ and # were deprecated. [Ref. ''The REXX Language : A Practical Approach to Programming, <small>Second Edition</small>'' by M. F. Cowlishaw, 1990. <small>Page 21, Footnote 14.</small>] --[[User:Alansam|Alansam]] 02:00, 27 June 2012 (UTC)
 
:: I always remembered all those six characters as being in the earliest release of REXX, along with the '''¢''' (cent) sign, all seven of them are still supported on the CMS and TSO version of classic REXX, as well as ''R4'' and ''ROO''. You may say some of those characters were deprecated, but they're all supported still on the IBM mainframe REXXes, as well as the REXX compiler. It should be noted that current IBM (REXX) publications note that not all keyboards and/or code pages support the '''!''' (exclamation point) symbol, but that doesn't stop (IBM) REXX from supporting that character (or others) for use in REXX programs. -- [[User:Gerard Schildberger|Gerard Schildberger]] 02:44, 27 June 2012 (UTC)
 
:: '''I'm''' not saying the characters were [[wp:Deprecation|deprecated]], the author of the language in his last publication (see the reference above) is saying it. There are many features in many programming environments that are deprecated; it doesn't mean that they don't/won't work it just means that you should think carefully before using them because as the environment evolves they '''may''' stop working. Such is the case with these characters in (for example) ooRexx. --[[User:Alansam|Alansam]] 20:02, 27 June 2012 (UTC)
 
== Coloring / Highlighting Rexx code ==
Line 115 ⟶ 177:
But it's far beyond my reach whether this is feasible and even further to implement it.
--[[User:Walterpachl|Walterpachl]] 07:14, 10 June 2012 (UTC)
 
::: I've done this via some code &nbsp; (Shared CSS/JavaScript) &nbsp; that was written/given to me, so I have a toggle switch that gives me the ability to turn off syntax highlighting when I want. &nbsp; I think that switch should be made available to everyone without the need for everyone to install the script to enable the toggle. &nbsp; If anybody wants to view it, I could display it within a html PRE window. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:59, 25 March 2016 (UTC)
 
: Categorically NO to “crexx” (well, unless someone produces a REXX variant that actually has that name after case-normalization). The parameter to <nowiki><lang></nowiki> is semantic, not just some flag to the highlighter; it's actually used for some of the off-line tools associated with RC. However, having a separate oorexx version ''is OK'' exactly because that is naming a language variation; it would cause different semantic markup to be applied (which might happen to include some extra syntax classes, but that's a side-effect).
Line 193 ⟶ 257:
I vote YES for syntax colouring as I've never seen anything else that makes code easier readable and in consequence more comprehensible especially to others. At this level I would describe syntax colouring as a no-brainer.
I understand that someone feels no need to use syntax highlighting for himself, but it should be clear that he'll do a favour to others by providing it. --[[User:DMacho|D.Macho]] 11:29, 11 June 2012 (UTC)
 
: Yes, provide it as an option (or even as the default), but don't force the user to use it or provide no means to toggle it; the example shown below not withstanding.
 
I'm not voting, but if color highlight is really undesirable, here's a compromise: go to your RC preference page, select "Appearance", then "custom javascript", edit and add the following:<lang javascript>
Line 237 ⟶ 303:
add_toggle_links();
})();</lang> which will <s>format your hard drive</s> add a link before each code block to toggle highlights. I only tested it on Firefox, though it should work with other browsers. If you want to used it and find it lacking, let me know. --[[User:Ledrug|Ledrug]] 16:08, 12 June 2012 (UTC)
 
::: Also, see my (below) version of the above custom javascript. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:38, 2 June 2017 (UTC)
 
Thanks. When I uncommented that one line, it did exactly what I wanted, but still allowed me to use highlighting when I want it.
<br>It receives a nag message when using I.E., however, but I rarely use itI.E. sparingly [I use FireFox Aurora almost exclusively].
<br>I would quote the script error, but I don't know nuttin' about nuttin' in Javascript, and it may just be something in my environment.
<br>I have since found that when browsing other webpages using I.E. (not just Rosetta Code), I'm receiving the same error and it's becoming a pita. [Error: object doesn't support this property method; Code: 0; URL: http://www.imbd.com/]. Usually, two such errors are presented, and then I.E. proceeds to display the page ok.
<br>I wish this code (as is) would be present without having to install in all my preferences, which would give the viewer a choice (and presumably, the default would be highlighting). As someone else said, I don't like to have highlighting forced on my viewing of source code, having the toggle allows me a choice. -- [[User:Gerard Schildberger|Gerard Schildberger]] 20:31, 12 June 2012 (UTC)
<br><br>I wish this code (as is) would be present without having to install in all my preferences, which would give the viewer a choice (and presumably, the default would be highlighting). As someone else said, I don't like to have highlighting forced on my viewing of source code, having the toggle allows me a choice. -- [[User:Gerard Schildberger|Gerard Schildberger]] 20:31, 12 June 2012 (UTC)
 
: One thing I noticed, it sure has a number of chicken lips. --- Or is it chickenlips? -- [[User:Gerard Schildberger|Gerard Schildberger]] 20:35, 12 June 2012 (UTC)
:: (small fix in the code above--shouldn't have caused malfunction, though) I don't know much about IE, and frankly I don't want to care. As to "installing in all your preferences", putting it in the shared custom javascript alone should be enough--or so I thought, I'm no MediaWiki expert. And, "chickenlips"? That's a midwestern euphemism for somthing? --[[User:Ledrug|Ledrug]] 03:00, 13 June 2012 (UTC)
 
::: Oh, I'm sorry, I thought everybody knew what that is. Chickenlips are the (curly) braces: ''' { } ''' --- a somewhat pejorative and amusing term, I believe.
----
I also vote YES for syntax coloring. As I'm new to Rexx it's fairly difficult for me to read the code without syntax highlights. On the other side I guess everybody agrees that Rexx is not the most widespread and most popular language around, so there are potentially more developers out there who are actually very interested in Rexx and who would need the highlighting as much as I do. --[[User:RolandR|RolandR]] 08:10, 13 June 2012 (UTC)
i also vote YES for syntax coloring; it's easier to read. --[[User:Glehm|Glehm]] 09:11, 15 June 2012 (UTC)
 
==custom JavaScript==
This is my version of the (above) JavaScript, the main difference is an inclusion of a solid separator (with a slightly different text) &nbsp; between computer programming languages &nbsp; (to aid in scrolling), &nbsp; and it defaults to &nbsp; ''no'' &nbsp; colorization.
 
I also tried to indent stuff to help me better understand the code logic and flow.
<lang Javascript>(function(){
function get_code_pres() {
var pres = document.getElementsByTagName('pre');
var codes = [];
for(var i=0;i<pres.length;i++)
if(pres[i].className.match(/\bhighlighted_source\b/)) codes.push(pres[i]);
return codes;
}
 
function toggle_highlight(pre) {
if(pre._alt_html == null) {
pre._alt_html = pre.innerHTML;
var spans = pre.getElementsByTagName('span');
for(var i=0;i<spans.length;i++) spans[i].className = '';
}
else {var z=pre.innerHTML;
pre.innerHTML=pre._alt_html;
pre._alt_html=z;
}
}
 
function add_toggle_links() {
// the bar below has 66 'db'x characters.
var xdb = '████████████████████████████████████████████████████████████████';
var bar = xdb.concat(' «toggle highlighting»');
var codes = get_code_pres();
for(var i=0;i<codes.length;i++) {
var a=document.createElement('a');
a.textContent = bar;
a.style.cursor = 'pointer';
(function(e) {a.addEventListener('click', function(){ toggle_highlight(e); }, false);
e.parentNode.insertBefore(a, e);
} ) (codes[i]);
toggle_highlight(codes[i]);
}
}
 
add_toggle_links();
})();</lang>
 
I wish the &nbsp; ''choice'' &nbsp; of colorization would be made available to all users without each user to have to enter a JavaScript program. &nbsp; The above JavaScript version assumes the choice of '''off''', &nbsp; but that's my choice. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:38, 2 June 2017 (UTC)
 
Also, with large Rosetta Code tasks &nbsp;(that is, which large programs and/or a large number of programming entries), &nbsp; it's faster &nbsp; ("loading"/display the page). &nbsp; [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:43, 2 June 2017 (UTC)
 
<br>
-----
<br>