pub fn mk_local_params<'l, 'e : 'l>(
    rem_params : u16,
    ind_type : ExprPtr<'l>,
    ctx : &mut Live<'l, 'e>
) -> ExprsPtr<'l> {
    match ind_type.read(ctx) {
        Pi { b_name, b_type, b_style, body, .. } if rem_params != 0 => {
            let local = <ExprPtr>::new_local(b_name, b_type, b_style, ctx);
            let body = body.inst1(local, ctx);
            let sink = mk_local_params(rem_params - 1, body, ctx);
            Cons(local, sink).alloc(ctx)
        },
        _ => Nil::<Expr>.alloc(ctx)
    }
}
// This only needs to be executed once for the whole block, since all
// of the mutuals share the same type parameters.
This only needs to be executed once for the whole block, since all
of the mutuals share the same type parameters.
This only needs to be executed once for the whole block since all of the mutuals share the same type parameters .
pub fn mk_local_params<'l, 'e : 'l>(
    rem_params : u16,
    ind_type : ExprPtr<'l>,
    ctx : &mut Live<'l, 'e>
) -> ExprsPtr<'l> {
    match ind_type.read(ctx) {
        Pi { b_name, b_type, b_style, body, .. } if rem_params != 0 => {
            let local = <ExprPtr>::new_local(b_name, b_type, b_style, ctx);
            let body = body.inst1(local, ctx);
            let sink = mk_local_params(rem_params - 1, body, ctx);
            Cons(local, sink).alloc(ctx)
        },
        _ => Nil::<Expr>.alloc(ctx)
    }
}
pub fn mk_local_params < ' l , ' e : ' l > ( rem_params : u16 , ind_type : ExprPtr < ' l > , ctx : & mut Live < ' l , ' e > ) -> ExprsPtr < ' l > { match ind_type . read ( ctx ) { Pi { b_name , b_type , b_style , body , .. } if rem_params != 0 => { let local = < ExprPtr > :: new_local ( b_name , b_type , b_style , ctx ) ; let body = body . inst1 ( local , ctx ) ; let sink = mk_local_params ( rem_params - 1 , body , ctx ) ; Cons ( local , sink ) . alloc ( ctx ) } , _ => Nil :: < Expr > . alloc ( ctx ) } }
This only needs to be executed once for the whole block, since all
of the mutuals share the same type parameters.
This only needs to be executed once for the whole block since all of the mutuals share the same type parameters .
rem_params
u16
ind_type
ExprPtr<'l>
ctx
&mut Live<'l, 'e>
rem_params
u16
ind_type
ExprPtr<'l>
ctx
&mut Live<'l, 'e>