fn closure(&mut self, expr: Expr, return_expr: bool, ty: Option<JType>) {
    let mut variables = vec![];
    self.collect_variables(&mut variables, expr.clone());
    self.list_of_accesses(&variables, false);
    self.fmt.terminate_line(&format!(", ({}) -> {{", CLOSURE_ARGS));
    self.fmt.indent();
    if return_expr {
      self.fmt.push("return ");
    }
    self.compile(expr, &variables, ty);
    self.fmt.unindent();
    self.fmt.terminate_line(";}");
  }
/// A closure is generated each time we call a Java expression or need the value of a variable.
/// The closure is needed for retrieving these values from the environment.
A closure is generated each time we call a Java expression or need the value of a variable.
The closure is needed for retrieving these values from the environment.
A closure is generated each time we call a Java expression or need the value of a variable . The closure is needed for retrieving these values from the environment .
fn closure(&mut self, expr: Expr, return_expr: bool, ty: Option<JType>) {
    let mut variables = vec![];
    self.collect_variables(&mut variables, expr.clone());
    self.list_of_accesses(&variables, false);
    self.fmt.terminate_line(&format!(", ({}) -> {{", CLOSURE_ARGS));
    self.fmt.indent();
    if return_expr {
      self.fmt.push("return ");
    }
    self.compile(expr, &variables, ty);
    self.fmt.unindent();
    self.fmt.terminate_line(";}");
  }
fn closure ( & mut self , expr : Expr , return_expr : bool , ty : Option < JType > ) { let mut variables = vec ! [ ] ; self . collect_variables ( & mut variables , expr . clone ( ) ) ; self . list_of_accesses ( & variables , false ) ; self . fmt . terminate_line ( & format ! ( " " CLOSURE_ARGS ) ) ; self . fmt . indent ( ) ; if return_expr { self . fmt . push ( " " ) ; } self . compile ( expr , & variables , ty ) ; self . fmt . unindent ( ) ; self . fmt . terminate_line ( " " ) ; }
A closure is generated each time we call a Java expression or need the value of a variable.
A closure is generated each time we call a Java expression or need the value of a variable .
&mut self
expr
Expr
return_expr
bool
ty
Option<JType>
&mut self
expr
Expr
return_expr
bool
ty
Option<JType>