lib/bmg/operator/shared/nary.rb in bmg-0.16.7 vs lib/bmg/operator/shared/nary.rb in bmg-0.17.0
- old
+ new
@@ -1,12 +1,20 @@
module Bmg
module Operator
module Nary
include Operator
+ def bind(binding)
+ _with_operands(operands.map{|op| op.bind(binding) })
+ end
+
protected
- attr_reader :operands
+ attr_accessor :operands
+
+ def _with_operands(operands)
+ dup.tap{|d| d.operands = operands }
+ end
def _visit(parent, visitor)
visitor.call(self, parent)
operands.each{|op|
op.send(:_visit, self, visitor)