Rosetta Code/Rank languages by popularity: Difference between revisions
Content added Content deleted
m (→REXX program: optimized the program, added suppression on the ranking messages to the terminal.) |
m (→REXX program: elided the need for the CHANGESTR BIF.) |
||
Line 4,728:
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. */
if pos(',', mems)\==0 then mems=
if \datatype(mems, 'W') then iterate /*is the "members" number not numeric? */
#.0= #.0 + mems /*bump the number of members found. */
Line 4,738:
end /*j*/
!.= /*array holds indication of TIED langs.*/
call tell right(commas(#), 9) '(total) number of languages detected in the category file
call tell right(commas(langs),9) ' " " " " " " " language "
call tell right(commas(#.0), 9) '(total) number of entries (solutions) detected
term= 0 /*don't show any more messages to term.*/
call eSort #,0 /*sort the languages along with number.*/
Line 4,761:
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
commas:
/*──────────────────────────────────────────────────────────────────────────────────────*/
eSort: procedure expose #. @. !tr.; arg N,p2; h= N /*sort: number of members*/
Line 4,784:
old.1= '╬£C++' ; new.1= "µC++" /*Unicode ╬£C++ ───► ASCII─8: µC++ */
old.2= 'UC++' ; new.2= "µC++" /*old UC++ ───► ASCII─8: µC++ */
old.3= 'МК-' ; new.3= "MK-" /*Unicode М
old.4= 'D├⌐j├á' ; new.4= "Déjà" /*Unicode ├⌐j├á ───► ASCII─8: Déjà */
old.5= 'Cach├⌐' ; new.5= "Caché" /*Unicode Cach├⌐ ───► ASCII─8: Caché */
Line 4,799:
end /*v*/ /* [↑] handle different lang spellings*/
if igAst then do; igAst= pos(' * ',$)==0; if igAst then iterate; end
$$u = $$; upper $$u
if pos('RETRIEVED FROM',$$u)\==0 then leave /*is this a pseudo End─Of─Data? */
if which=='L' then do
Line 4,816:
s: if arg(1)==1 then return arg(3); return word(arg(2) 's',1) /*pluralizer.*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
tell: do '0'arg(2); call lineout outFID," " ;
call lineout outFID,arg(1)
do '0'arg(3); call lineout outFID," " ;
return /*show BEFORE blank lines (if any), message, show AFTER blank lines.*/</lang
===all ranked 723 languages===
|