pub fn fn_type(&mut self, expr: AstExpr) -> ExprCompiledValue {
        // Note that `type([fail("bad")])` must still raise an exception.
        // In practice people only really use the empty versions as constants.
        match &expr.node {
            Expr::Dict(xs) if xs.is_empty() => {
                return ExprCompiledValue::Value(self.heap.alloc_str(Dict::TYPE));
            }
            Expr::List(xs) if xs.is_empty() => {
                return ExprCompiledValue::Value(self.heap.alloc_str(List::TYPE));
            }
            // No need to handle Tuple as it will become frozen if it has no inner-calls
            _ => {}
        }
        match self.expr(expr) {
            ExprCompiledValue::Value(x) => ExprCompiledValue::Value(x.to_value().get_type_value()),
            ExprCompiledValue::Compiled(x) => {
                expr!("type", |eval| {
                    x(eval)?.get_ref().get_type_value().to_value()
                })
            }
        }
    }
/// Compile the operation `type(expr)`, trying to produce a constant
/// where possible.
Compile the operation `type(expr)`, trying to produce a constant
where possible.
Compile the operation ` type ( expr ) ` trying to produce a constant where possible .
pub fn fn_type(&mut self, expr: AstExpr) -> ExprCompiledValue {
        // Note that `type([fail("bad")])` must still raise an exception.
        // In practice people only really use the empty versions as constants.
        match &expr.node {
            Expr::Dict(xs) if xs.is_empty() => {
                return ExprCompiledValue::Value(self.heap.alloc_str(Dict::TYPE));
            }
            Expr::List(xs) if xs.is_empty() => {
                return ExprCompiledValue::Value(self.heap.alloc_str(List::TYPE));
            }
            // No need to handle Tuple as it will become frozen if it has no inner-calls
            _ => {}
        }
        match self.expr(expr) {
            ExprCompiledValue::Value(x) => ExprCompiledValue::Value(x.to_value().get_type_value()),
            ExprCompiledValue::Compiled(x) => {
                expr!("type", |eval| {
                    x(eval)?.get_ref().get_type_value().to_value()
                })
            }
        }
    }
pub fn fn_type ( & mut self , expr : AstExpr ) -> ExprCompiledValue { // Note that `type([fail("bad")])` must still raise an exception. // In practice people only really use the empty versions as constants. match & expr . node { Expr :: Dict ( xs ) if xs . is_empty ( ) => { return ExprCompiledValue :: Value ( self . heap . alloc_str ( Dict :: TYPE ) ) ; } Expr :: List ( xs ) if xs . is_empty ( ) => { return ExprCompiledValue :: Value ( self . heap . alloc_str ( List :: TYPE ) ) ; } // No need to handle Tuple as it will become frozen if it has no inner-calls _ => { } } match self . expr ( expr ) { ExprCompiledValue :: Value ( x ) => ExprCompiledValue :: Value ( x . to_value ( ) . get_type_value ( ) ) , ExprCompiledValue :: Compiled ( x ) => { expr ! ( " " eval { x ( eval ) get_ref ( ) get_type_value ( ) to_value ( ) } ) } } }
Compile the operation `type(expr)`, trying to produce a constant
where possible.
Compile the operation ` type ( expr ) ` trying to produce a constant where possible .
&mut self
expr
AstExpr
&mut self
expr
AstExpr