pub fn look_up(&self, symbol: u64) -> Option<(CellRef, u32)> {
        let mut binding = Some(self);
        let mut level   = 0;

        while let Some(current_binding) = binding {
            // Look up in the current binding
            if let Some(symbol) = current_binding.symbols.get(&symbol) {
                // Return the value if we find it, adjusting the frame level for cells that need to be imported
                if let Some((cell, bound_level, ref_type)) = symbol.frame_reference() {
                    if level == 0 {
                        return Some((Arc::clone(&symbol), level));
                    } else {
                        return Some((SafasCell::FrameReference(cell, bound_level + level, ref_type).into(), level));
                    }
                } else {
                    return Some((Arc::clone(&symbol), level));
                }
            }

            // Move up a level
            if !current_binding.is_interior {
                level += 1;
            }

            binding = current_binding.parent.as_ref().map(|parent| &**parent);
        }

        None
    }
///
/// Looks up the value for a symbol in this binding. If the symbol is found the return value is the
/// cell bound to this symbol and the number of frames 'above' the current stack frame that the
/// match was made.
/// 
/// For frame references, the FrameReference is returned updated with the level where the symbol
/// could be found.
///
Looks up the value for a symbol in this binding. If the symbol is found the return value is the
cell bound to this symbol and the number of frames 'above' the current stack frame that the
match was made.

For frame references, the FrameReference is returned updated with the level where the symbol
could be found.
Looks up the value for a symbol in this binding . If the symbol is found the return value is the cell bound to this symbol and the number of frames ' above ' the current stack frame that the match was made . For frame references the FrameReference is returned updated with the level where the symbol could be found .
pub fn look_up(&self, symbol: u64) -> Option<(CellRef, u32)> {
        let mut binding = Some(self);
        let mut level   = 0;
        while let Some(current_binding) = binding {
            // Look up in the current binding
            if let Some(symbol) = current_binding.symbols.get(&symbol) {
                // Return the value if we find it, adjusting the frame level for cells that need to be imported
                if let Some((cell, bound_level, ref_type)) = symbol.frame_reference() {
                    if level == 0 {
                        return Some((Arc::clone(&symbol), level));
                    } else {
                        return Some((SafasCell::FrameReference(cell, bound_level + level, ref_type).into(), level));
                    }
                } else {
                    return Some((Arc::clone(&symbol), level));
                }
            }
            // Move up a level
            if !current_binding.is_interior {
                level += 1;
            }
            binding = current_binding.parent.as_ref().map(|parent| &**parent);
        }
        None
    }
pub fn look_up ( & self , symbol : u64 ) -> Option < ( CellRef , u32 ) > { let mut binding = Some ( self ) ; let mut level = 0 ; while let Some ( current_binding ) = binding { // Look up in the current binding if let Some ( symbol ) = current_binding . symbols . get ( & symbol ) { // Return the value if we find it, adjusting the frame level for cells that need to be imported if let Some ( ( cell , bound_level , ref_type ) ) = symbol . frame_reference ( ) { if level == 0 { return Some ( ( Arc :: clone ( & symbol ) , level ) ) ; } else { return Some ( ( SafasCell :: FrameReference ( cell , bound_level + level , ref_type ) . into ( ) , level ) ) ; } } else { return Some ( ( Arc :: clone ( & symbol ) , level ) ) ; } } // Move up a level if ! current_binding . is_interior { level += 1 ; } binding = current_binding . parent . as_ref ( ) . map ( | parent | & * * parent ) ; } None }
Looks up the value for a symbol in this binding.
Looks up the value for a symbol in this binding .
&self
symbol
u64
&self
symbol
u64