你要求的地方
a := b := c := AutoHash.new.few 3
我想(不确定我是否理解你的愿望)你真的想要
a,b,c=Autohash.new.few 3
我也发现你创造的回报价值是混乱的,也许尝试
def few(n=0)
Array.new(n) { AutoHash.new }
end
除此之外,似乎
few
a,b,c=AutoHash.few 3
如果您在类中定义了几个:
def AutoHash.few(n=0)
Array.new(n) { AutoHash.new }
end
如果
a、 b,c=自动哈希。3
不是你要找的,你呢
真正地
想要实现你自己的操作符,那就去看看吧
黑客解析.y
,这是2009年RubyConf上的一次演讲。你可以在
http://rubyconf2009.confreaks.com/19-nov-2009-17-15-hacking-parsey-tatsuhiro-ujihisa.html
你可以在
http://www.slideshare.net/ujihisa/hacking-parsey-rubyconf-2009