Talk:Loops/With multiple ranges: Difference between revisions

m
→‎other DO loop cases: added a new section.
m (→‎other DO loop cases: added a new section.)
Line 34:
 
: However, I'll take a stab at adding pseudo-code to explain '''do''' loops as used by the PL/I language.   By the way, PL/I isn't my language, it's been years since I even had access to a PL/I compiler, that is the only reason that I didn't enter a PL/I example (here and in other Rosetta Code tasks).   If I had access to a PL/I compiler, I'd be entering numerous PL/I examples;   PL/I syntax is very similar to REXX's, and indeed, REXX borrowed a lot of PL/I's syntax and PL/I's BIFs.   -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:26, 15 September 2018 (UTC)
 
==other DO loop cases==
Another good tasks for Rosetta Code would be the case of how a language treats the following code snippets:
<lang>k= 5
L= 2
do j=k to L
say j
end</lang>
and show what values (if any) are displayed.
 
Or, another case:
<lang>k= 5
L= 2
do j=L to k by -2
say j
end</lang>
 
Or, yet another case:
<lang>k= 5
L= 2
do j=L to k by -2
say j
k= 9
end</lang>
But I don't want to go through explaining those in pseudo-code. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 00:56, 16 September 2018 (UTC)