Currently PLUCK function treats second argument specially, as it expects an identifier, but uses it as a key name instead.
I think it would be more consistent to be able to write following:
Dentaku::Calculator.new.evaluate!('PLUCK(hashes, "key")', hashes: [{key: 1}])
Dentaku::Calculator.new.evaluate!('PLUCK(hashes, key)', hashes: [{'a' => 1}], key: 'a')
Dentaku::Calculator.new.evaluate!('PLUCK(hashes, key)', hashes: [{a: 1}], key: 'a')
Dentaku::Calculator.new.evaluate!('PLUCK(hashes, 1)', hashes: [{1 => 2}])
Dentaku::Calculator.new.evaluate!('PLUCK(hashes, key)', hashes: [{1 => 2}], key: 1)
For access it works:
Dentaku::Calculator.new.evaluate!('hashes[0][key]', hashes: [{'a' => 1}], key: 'a')
Currently
PLUCKfunction treats second argument specially, as it expects an identifier, but uses it as a key name instead.I think it would be more consistent to be able to write following:
For access it works: