declare % ForLoop: > }> }>}: >> fun {ForLoop Exp ?Name Body} local Z Res = Z#Z % the automatically generated proc Name = proc {$ X} local _#ResEnd = Res in ResEnd = X|_ end end % processing each list element proc {Loop Ls} case Ls of H|T then {Body H} {Loop T} else skip end end in {Loop Exp} % convert the difference list to a list local ResFront#ResEnd = Res in ResEnd = nil ResFront end end end