Continued fraction/Arithmetic/Construct from rational number: Difference between revisions

Content added Content deleted
(→‎{{header|REXX}}: re-added the REXX program source text.)
Line 1,327: Line 1,327:
Light weight, explicit state:
Light weight, explicit state:
<lang zkl>fcn r2cf(nom,dnom){ // -->Walker (iterator)
<lang zkl>fcn r2cf(nom,dnom){ // -->Walker (iterator)
Walker.tweak(fcn(_,state){
Walker.tweak(fcn(state){
nom,dnom:=state;
nom,dnom:=state;
if(dnom==0) return(Void.Stop);
if(dnom==0) return(Void.Stop);
Line 1,333: Line 1,333:
state.clear(dnom,d);
state.clear(dnom,d);
n
n
}.fp1(List(nom,dnom)))
}.fp(List(nom,dnom))) // partial application (light weight closure)
}</lang>
}</lang>
Heavy weight, implicit state:
Heavy weight, implicit state: