0
Posted on Tuesday, August 29, 2017 by 醉·醉·鱼 and labeled under



  1. def...end, class...end, module...end都是作用域门,进入他们就会出现新的scope
  2. block是特殊的scope,block中initialize的局部变量在外部没法访问
  3. 扁平作用域可以用,define_method, Class.new, Module.new来实现。
0
Responses to ... Ruby中的Scope

Post a Comment