fn label_binding(label_cell: FrameReference) -> impl BindingMonad<Binding=SyntaxCompiler> {
    // The label binding, which specifies which cell the compiler should load from
    LabelBinding(label_cell).map(|args| {
        let args = args.clone();

        // Compiler receives the label reference as an argument and flat_maps it
        let compile = |args: CellRef| {
            // Args should just be a frame reference generated by the binding operation
            let args                                    = FrameReference::try_from(args.clone())?;
            let FrameReference(cell_id, frame_id, _)    = args;

            if frame_id != 0 {
                return Err(BindError::CannotLoadCellInOtherFrame);
            }

            // Compilation reads the frame reference and applies the read_label_value flat map function
            Ok(CompiledActions::from(smallvec![
                Action::CellValue(cell_id),
                Action::Push,
                Action::Value(READ_LABEL_VALUE.clone()),
                Action::FlatMap
            ]))
        };

        SyntaxCompiler::with_compiler_and_reftype(compile, args, ReferenceType::Monad)
    })
}
///
/// Creates the syntax binding for a label name
/// 
/// This generates a monad to load the label value when it's used.
///
Creates the syntax binding for a label name
This generates a monad to load the label value when it's used.
Creates the syntax binding for a label name This generates a monad to load the label value when it ' s used .
fn label_binding(label_cell: FrameReference) -> impl BindingMonad<Binding=SyntaxCompiler> {
    // The label binding, which specifies which cell the compiler should load from
    LabelBinding(label_cell).map(|args| {
        let args = args.clone();
        // Compiler receives the label reference as an argument and flat_maps it
        let compile = |args: CellRef| {
            // Args should just be a frame reference generated by the binding operation
            let args                                    = FrameReference::try_from(args.clone())?;
            let FrameReference(cell_id, frame_id, _)    = args;
            if frame_id != 0 {
                return Err(BindError::CannotLoadCellInOtherFrame);
            }
            // Compilation reads the frame reference and applies the read_label_value flat map function
            Ok(CompiledActions::from(smallvec![
                Action::CellValue(cell_id),
                Action::Push,
                Action::Value(READ_LABEL_VALUE.clone()),
                Action::FlatMap
            ]))
        };
        SyntaxCompiler::with_compiler_and_reftype(compile, args, ReferenceType::Monad)
    })
}
fn label_binding ( label_cell : FrameReference ) -> impl BindingMonad < Binding = SyntaxCompiler > { // The label binding, which specifies which cell the compiler should load from LabelBinding ( label_cell ) . map ( | args | { let args = args . clone ( ) ; // Compiler receives the label reference as an argument and flat_maps it let compile = | args : CellRef | { // Args should just be a frame reference generated by the binding operation let args = FrameReference :: try_from ( args . clone ( ) ) ? ; let FrameReference ( cell_id , frame_id , _ ) = args ; if frame_id != 0 { return Err ( BindError :: CannotLoadCellInOtherFrame ) ; } // Compilation reads the frame reference and applies the read_label_value flat map function Ok ( CompiledActions :: from ( smallvec ! [ Action CellValue ( cell_id ) Action Push Action Value ( READ_LABEL_VALUE clone ( ) ) Action FlatMap ] ) ) } ; SyntaxCompiler :: with_compiler_and_reftype ( compile , args , ReferenceType :: Monad ) } ) }
Creates the syntax binding for a label name
This generates a monad to load the label value when it's used.
Creates the syntax binding for a label name This generates a monad to load the label value when it ' s used .
label_cell
FrameReference
label_cell
FrameReference