Loops/Foreach: Difference between revisions

no edit summary
No edit summary
Line 516:
'Because this is a console only program.
END
</lang>
 
=={{headre|Lambdatalk}}==
<lang scheme>
{def collection alpha beta gamma delta}
-> collection
 
{S.map {lambda {:i} {br}:i} {collection}}
->
alpha
beta
gamma
delta
 
or
 
{def S.foreach
{lambda {:s}
{if {S.empty? {S.rest :s}}
then {S.first :s}
else {S.first :s} {br}{S.foreach {S.rest :s}}}}}
 
{S.foreach {collection}}
->
alpha
beta
gamma
delta
 
</lang>