Rosetta Code/Rank languages by popularity: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: updated the number of computer programming languages that are on Rosetta Code.) |
m (→REXX program: optimized the program, added suppression on the ranking messages to the terminal.) |
||
Line 4,714:
<lang rexx>/*REXX program reads two files and displays a ranked list of Rosetta Code languages.*/
sep= '█'; L.=0; #.=0; u.=0; catHeap=; old.= /*assign some REXX variable defaults. */
term= 1 /*show some early messages to terminal.*/
parse arg catFID lanFID outFID . /*obtain optional arguments from the CL*/
if catFID=='' then catFID = "RC_POP.CAT" /*Not specified? Then use the default.*/
Line 4,724 ⟶ 4,725:
do j=1 until catHeap=='' /*process the heap of categories. */
parse var catHeap cat.j (sep) catHeap /*get a category from the catHeap. */
parse var cat.j cat.j '<' "(" mems . /*untangle the
cat.j= space(cat.j); ?= cat.j; upper ? /*remove any superfluous blanks. */
if ?=='' | \L.? then iterate /*it's blank or it's not a language. */
Line 4,740 ⟶ 4,741:
call tell right(commas(langs),9) ' " " " " " " " language " ,'
call tell right(commas(#.0), 9) '(total) number of entries detected.', , 1
term= 0 /*don't show any more messages to term.*/
call eSort #,0 /*sort the languages along with number.*/
tied= /*add true rank (tR) ───► the entries. */
Line 4,780 ⟶ 4,782:
Formulae = 'F┼ìrmul├ª' /*Unicode (in text) name for Fôrmulæ */
Uyir = 'உயிர்/Uyir' /*Unicode (in text) name for Uyir */
old.1= '╬£C++' ; new.1= "µC++" /*Unicode ╬£C++ ───►
old.2= 'UC++' ; new.2= "µC++" /*old UC++ ───►
old.3= '╨£╨Ü-' ; new.3= "MK-" /*Unicode ╨£╨Ü- ───►
old.4= 'D├⌐j├á' ; new.4= "Déjà" /*Unicode ├⌐j├á ───►
old.5= 'Cach├⌐' ; new.5= "Caché" /*Unicode Cach├⌐ ───►
old.6= '??-61/52' ; new.6= "MK-61/52" /*somewhere past, a mis─translated: MK-*/
old.7= Formulae ; new.7= 'Fôrmulæ' /*Unicode ───► ASCII─8: Fôrmulæ */
Line 4,797 ⟶ 4,799:
end /*v*/ /* [↑] handle different lang spellings*/
if igAst then do; igAst= pos(' * ',$)==0; if igAst then iterate; end
$$u = $$; upper $$u /*define uppercase version of $$*/
if pos('RETRIEVED FROM',
if which=='L' then do
if left($$, 1)\=='*' then iterate /*lang not legitimate?*/
parse
langs= langs+1 /*bump the number of languages found. */
iterate /*iterates the DO recs loop. */
Line 4,813 ⟶ 4,816:
s: if arg(1)==1 then return arg(3); return word(arg(2) 's',1) /*pluralizer.*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
tell:
return /*show BEFORE blank lines (if any), message, show AFTER blank lines.*/</lang>
Some older REXXes don't have a '''changestr''' BIF, so one is included here: ───► [[CHANGESTR.REX]].
|