// TODO: this ought to at least warn if we're losing anything other than `Shape`
this ought to at least warn if we're losing anything other than `Shape`
this ought to at least warn if we ' re losing anything other than ` Shape `
pub fn flatten(&self) -> EnvMBE<Ast> {
        match *self {
            Trivial | Atom(_) => EnvMBE::new(),
            VariableReference(_) => EnvMBE::new(),
            Shape(ref v) => {
                let mut accum = EnvMBE::new();
                for sub_a in v {
                    accum = accum.combine_overriding(&sub_a.flatten())
                }
                accum
            }
            IncompleteNode(ref env) => env.clone(),
            Node(ref _f, ref _body, ref _export) => {
                // TODO: think about what should happen when
                //  `Scope` contains a `Scope` without an intervening `Named`
                panic!("I don't know what to do here!")
            }
            QuoteMore(ref body, _) => body.flatten(),
            QuoteLess(ref body, _) => body.flatten(),
            ExtendEnv(ref body, _) | ExtendEnvPhaseless(ref body, _) => body.flatten(),
        }
    }
pub fn flatten ( & self ) -> EnvMBE < Ast > { match * self { Trivial | Atom ( _ ) => EnvMBE :: new ( ) , VariableReference ( _ ) => EnvMBE :: new ( ) , Shape ( ref v ) => { let mut accum = EnvMBE :: new ( ) ; for sub_a in v { accum = accum . combine_overriding ( & sub_a . flatten ( ) ) } accum } IncompleteNode ( ref env ) => env . clone ( ) , Node ( ref _f , ref _body , ref _export ) => { // TODO: think about what should happen when //  `Scope` contains a `Scope` without an intervening `Named` panic ! ( " " ) } QuoteMore ( ref body , _ ) => body . flatten ( ) , QuoteLess ( ref body , _ ) => body . flatten ( ) , ExtendEnv ( ref body , _ ) | ExtendEnvPhaseless ( ref body , _ ) => body . flatten ( ) , } }
TODO: this ought to at least warn if we're losing anything other than `Shape`
TODO : this ought to at least warn if we ' re losing anything other than ` Shape `
&self