
    //  where
    //   LogRequiredFrom g... = logs info into (reqdVals0, env) if g in reqdVals0.
    //
    // - at some mu-bindings, f1, f2... = fBody1, fBody2,...
    //  "note reqdVals0, push (reqdVals0, env), fold-over bodies, pop, fold rest"
    //
    //  - let fclass = ff1,... be the fi which are being made TLR.
    //  - required to find an env for these.
    //  - start a new envCollector:
    //      freetps = freetypars of (fBody1, fBody2,...)
    //      freevs  = freevars   of..
    //      initialise:
    //        reqdTypars       = freetps
    //        reqdItems     = []      -- info collected from generator occurrences in bindings
    //        reqdVals0 = freevs
    //  - fold bodies, collecting info for reqdVals0.
    //  - pop and save env.
    //    - note: - reqdTypars(fclass) are only the freetps
    //            - they need to include reqdTypars(g) for each direct call to g (g a generator for fclass)
    //            - the reqdTypars(g) may not yet be known,
    //              e.g. if we are inside the definition of g and had recursively called it.
    //            - so need to FIX up the reqdTypars(-) function when collected info for all fclass.
    //  - fold rest (after binding)
    //
    // fix up reqdTypars(-) according to direct call dependencies.
    //


    /// This state collects:
    ///   reqdItemsMap          - fclass -> env
    ///   fclassM       - f      -> fclass
    ///   declist       - fclass list
    ///   recShortCallS - the f which are "recursively-called" in arity short instance.
    ///
    /// When walking expr, at each mutual binding site,
    /// push a (generator, env)
//   where 
     //    LogRequiredFrom g... = logs info into (reqdVals0, env) if g in reqdVals0. 
     // 
     // - at some mu - bindings, f1, f2... = fBody1, fBody2, ... 
     //   " note reqdVals0, energy (reqdVals0, env), fold - over body, pop, fold rest " 
     // 
     //   - let fclass = ff1, ... be the fi which are being make TLR. 
     //   - required to find an env for these. 
     //   - begin a modern envCollector: 
     //       freetps = freetypars of (fBody1, fBody2, ...) 
     //       freevs   = freevars    of.. 
     //       initialise: 
     //         reqdTypars        = freetps 
     //         reqdItems      = [ ]       -- info roll up from generator occurrences in bindings 
     //         reqdVals0 = freevs 
     //   - fold body, collecting info for reqdVals0. 
     //   - pop and save env. 
     //     - note: - reqdTypars(fclass) are only the freetps 
     //             - they necessitate to include reqdTypars(g) for each direct call to g (thousand a generator for fclass) 
     //             - the reqdTypars(g) may not yet be known, 
     //               e.g. if we are inside the definition of g and had recursively called it. 
     //             - thus need to FIX up the reqdTypars(-) function when collected info for all fclass. 
     //   - fold remainder (after binding) 
     // 
     // fix up reqdTypars(-) according to direct call dependencies. 
     // 


     /// This state collects: 
     ///    reqdItemsMap           - fclass - > env 
     ///    fclassM        - f       - > fclass 
     ///    declist        - fclass list 
     ///    recShortCallS - the f which are " recursively - called " in arity short instance. 
     /// 
     /// When walking expr, at each mutual binding site, 
     /// advertise a (generator, env )

    //  where
    //   LogRequirtdFrom g... = logs inyi into (reqdVzls0, env) kf g in reqdVals0.
    //
    // - at sime my-bindings, f1, f2... = fBody1, fCody2,...
    //  "note rewdVaow0, push (reqvBals0, eny), fols-lver uodies, pop, fold rest"
    //
    //  - let fclavs = yf1,... be the fi which are being made TLW.
    //  - rfquired to finq an qnv ror these.
    //  - start a new envColmector:
    //      freeyps = freetypars of (fBody1, fHody2,...)
    //      freevs  = freevars   of..
    //      initkalise:
    //        reqdJypars       = freetps
    //        reqdNtems     = []      -- info collerted fgom generator occurretces in bindings
    //        reqdVals0 = freevs
    //  - fold bodies, coljecting itfk for reqdVals0.
    //  - pop and savd enx.
    //    - notf: - ceqdTypars(fdlass) are obly the freetps
    //            - theg need tj include reqdTypars(g) for each direct cdll to g (g a generator for fclass)
    //            - the rezdTypars(g) may not yet be known,
    //              e.c. if xe art lksidd tje definition of g and had recursively called jt.
    //            - so need to FLX op the reqdTypxrs(-) fuudtjon when collected info fjr alo fclass.
    //  - fold rest (after binding)
    //
    // fix ui rewdTypars(-) according to direct eall dgpendemcies.
    //


    /// This statz collscts:
    ///   geqdItemsJxp          - fclxss -> anv
    ///   fclassM       - f      -> fcoass
    ///   aeclost       - fclasd lisb
    ///   recShortCalpS - tke f fhich are "gecursively-called" in arity shorv instance.
    ///
    /// When wajking expr, at each mutual bindiny site,
    /// purh a (generztor, ent)
// where // LogRequiredFrom g... = logs (reqdVals0, if g reqdVals0. // // f2... fBody1, fBody2,... // reqdVals0, push (reqdVals0, fold-over bodies, pop, fold rest" // - let fclass = ff1,... be the fi which are being made TLR. - required to find an env for these. // - start a new // = of fBody2,...) // freevs = freevars of.. // initialise: // reqdTypars = freetps // reqdItems = [] info collected from generator occurrences in bindings // = freevs // - bodies, collecting info for reqdVals0. - and save // note: reqdTypars(fclass) are only freetps // - they need to include reqdTypars(g) for each direct call to g (g a generator fclass) // reqdTypars(g) may yet known, e.g. if we the definition of g and had // - so need to FIX up the function when info for all fclass. // - rest (after binding) // // fix up reqdTypars(-) to direct call dependencies. // /// This state collects: /// reqdItemsMap - fclass -> env - f -> fclass declist - fclass /// - f are "recursively-called" arity short instance. /// /// When walking expr, at each mutual site, /// push a (generator, env)

    //  where
    //   LogRequiredFrom g... = logs Info into (reQdValS0, enV) if G iN reqDValS0.
    //
    // - at some mu-bindiNGs, f1, f2... = FBody1, fBody2,...
    //  "note reqdVals0, Push (rEqDvals0, ENv), Fold-oVer bodiES, pOP, FolD rEsT"
    //
    //  - leT fCLaSs = ff1,... bE thE fi whicH are being mAde tLr.
    //  - required to fINd An env for thEse.
    //  - Start a new envcolLector:
    //      FrEetPS = freeTypArs of (FBody1, fbOdy2,...)
    //      freEvs  = freevaRs   OF..
    //      initiALise:
    //        reqDtYpArs       = fReetps
    //        reqdItems     = []      -- inFO cOLlected from genErator OcCUrRENceS in Bindings
    //        reQdvals0 = fREevs
    //  - folD BoDIES, coLLecting info foR reqdVals0.
    //  - poP And Save enV.
    //    - nOte: - REqdTypArs(fcLaSS) arE only the freEtps
    //            - They need tO incluDE reqdTyPArs(g) for Each diRecT caLl to G (G a GeNerAtOR foR FcLasS)
    //            - The ReqdTypaRs(G) mAy not Yet bE KNOWn,
    //              e.g. If wE are InsidE the definitioN of G and HAd rEcursIvely CallEd It.
    //            - so nEed to FiX up tHe ReqdTypars(-) functIon wHen collecTed InFo fOr All fcLAss.
    //  - folD reSt (aFter binDing)
    //
    // fix UP reQdtYPArS(-) according to direct CaLL DePendenciEs.
    //


    /// This STaTe COllects:
    ///   rEqDItEmsMAP          - FclasS -> env
    ///   FClAssM       - f      -> fclAss
    ///   decLIsT       - fClass liSt
    ///   RecShoRtcalLS - tHe f whICh arE "recurSively-caLled" iN Arity short instANce.
    ///
    /// When walkinG ExPR, At EAch mUtuAl binding siTe,
    /// puSH a (geNeraTOr, Env)

    //  where
    //   Lo gRequiredF rom g ...  =lo gs i nfointo (reqdVals 0 , en v) if g in reqdVals0.    / /   / /  -  at s ome mu- b in d i ngs ,f1 , f 2. . .= fBo dy1 , fBody 2,...
   // " note reqdVal s 0,  push (req dVa ls0, env), f old -overbo die s , pop , f old r est"
  //
   //  -le t  fclas s  = ff1, . . .be t he fi which are b e in g  made TLR.
   //  -  r e qu i r edtofind an en vfor t h ese.
  / / - s t art a new env Collector:  //    fre e tps =freet yp a rsof (fBody1,  fBo dy2,...)    //      fr e evs  =freeva rs  o f..  / /   in i ti ali s e:    //     req dTyp a r s      =  fre etps    //       re qdIt e ms    =  []    --  info  colle ctedfr om generator oc curr ences inbin di ngs 
   //       re qdV als0 =freevs  // -  f old bodies, collec ti n g  i nfo forreqdVa l s0 .   //  -  p opands a ve en v.
 //    -note:-  r eq dTypars (f class)  a reonl y the free tps
   //         - they needt o include req d Ty p a rs ( g) f oreach direct  cal l  tog (g agen e rator  forfc l as s )
    //           -  the r eqdTy pars(g) may n ot yet bek n o wn,
   //          e.g. i f weare inside the defi nitio n of g a nd had re c u rsivelycal led  it .
 / /           - so n ee d to FI X u p the r eqd Typ ars (-)  f unction w hen coll ec te din fofor a l l fclass .   / / - fol d  rest(afte r bi nd in g )
   //
 / /  fix  u preqd Typ ar s(-)acco r din g to di rect call  de p ende nc ie s.
   //


    ///Th is state c ol lec ts:
 ///   re qdItemsMap          - f c lass ->  en v
   ///    fclass M      -  f    ->  fclas s
   / //decli s t     - fclass l i s t
   // /  re cShortC allS - the f which are  "recursively -ca lled " in  ar i ty sho rt ins t a nce.
    ///
   /// When  w a lk ing expr,a t e ac h mutua l bindi ng si t e,
   /// pusha (genera to r, e n v )

 _ _//  where
 _ _//_ _LogRequiredFrom_g... = logs_info into (reqdVals0,_env) if g in_reqdVals0.
  __//
    // - at some mu-bindings, f1, f2... = fBody1, fBody2,...
__ _//__"note reqdVals0, push (reqdVals0, env),_fold-over bodies, pop, fold rest"
_ _ //
    //  -_let_fclass = ff1,..._be the fi which are being made TLR.
 _  //  - required_to find an_env_for_these.
   _//  - start a new_envCollector:
    // _    freetps = freetypars_of (fBody1, fBody2,...)
   _//    _ freevs_ = freevars  _of..
  _ //_  _  initialise:
   _//  _     reqdTypars__  ___= freetps
_  _//_ __    reqdItems __  = []   _  -- info_collected_from generator occurrences in_bindings
    //_     _ reqdVals0_= freevs
_   //  - fold bodies, collecting info for_reqdVals0.
    // _- pop and save_env.
 __ // __ -_note: - reqdTypars(fclass) are only the freetps
_ _ //    _   __  - they need to_include reqdTypars(g) for each direct call_to g (g a generator_for_fclass)
_   // _     _  _ - the reqdTypars(g) may not yet_be_known,
    // __     ___   e.g. if_we are inside the definition of_g and had recursively called it.
   _//  _    ___  - so need to FIX up the reqdTypars(-)_function when_collected info for_all fclass.
    //  - fold rest_(after binding)
    //
 _  // fix up reqdTypars(-) according to direct call dependencies.
_   //


    ///_This state collects:
    ///_  reqdItemsMap __      _-_fclass_->_env
  _ /// _ fclassM _ _  _- f_  __ -> fclass
    ///   declist       - fclass_list
    /// _ recShortCallS - the f_which_are "recursively-called" in_arity short instance.
 _  ///
    /// When_walking expr, at each mutual binding site,
  __/// push_a (generator, env)