Category talk:OoRexx: Difference between revisions

m
→‎custom JavaScript: added a comment.
m (→‎custom JavaScript: added a comment.)
 
(5 intermediate revisions by the same user not shown)
Line 1:
__TOC__
 
==ooRexx fully compatible with classic REXX==
 
Line 48 ⟶ 50:
: 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.
Line 83 ⟶ 85:
::: 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)
 
::: One option would be to include a 2nd version, with a comment or note that it was changed to run under ooRexx and only tested under ooRexx. I suppose that just placing that version in the ooRexx language section would be simpler. By the way (and this is no small thing), it was this multiple testing of my classic REXX example programs that led to me finding numerous errors in the Regina and R4 classic REXX interpreters. I never assume that even writing simple code will correctly work on all REXX interpreters until I actually execute them. Ya never can tell when something will rise up and <strike>bit</strike> bite ya in the hinder. -- [[User:Gerard Schildberger|Gerard Schildberger]] 20:14, 27 June 2012 (UTC)
 
thanks. --[[User:Sahananda|Sahananda]] 22:48, 26 June 2012 (UTC)
Line 118 ⟶ 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 175 ⟶ 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 299 ⟶ 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.
Line 309 ⟶ 315:
:: (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 perjorativepejorative 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>