We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Courtesy Ben Sklaroff:)
The typical array-assignment syntax for ruby seems to cause errors within the block of a Bloom collection's reduce.
Given that the syntax seems to be perfectly legal Ruby, it's tempting to think that the bug may occur as a result of rewriting somewhere...
require 'rubygems' require 'bud' class Test include Bud state do table :a, [:idx] end bloom do a <= [[23], [47]] stdio <~ a.reduce({}) do |memo, t| memo[[0, 0, 'joe']] ||= 0 # this works: memo[[0,0,'joe']] += 1 # this doesn't work # memo[[0, 0, 'joe']] = memo[[0, 0, 'joe']] + 1 # nor does the following memo[[0,1,'joe']] = 7 memo end.inspected end end x = Test.new x.tick
The text was updated successfully, but these errors were encountered:
At first glance looks like a bug in either RubyParser or Ruby2Ruby:
require 'rubygems' require 'ruby_parser' require 'ruby2ruby' src="a = [[23], [47]] a.reduce({}) do |memo, t| memo[[0, 0, 'joe']] ||= 0 memo[[0, 0, 'joe']] = memo[[0, 0, 'joe']] + 1 memo end " p = RubyParser.for_current_ruby ast = p.parse(src) new_src = Ruby2Ruby.new.process(ast) puts new_src
Output:
a = [[23], [47]] a.reduce({}) do |memo, t| memo[[0, 0, "joe"]] ||= 0 memo[0, 0, "joe"] = (memo[[0, 0, "joe"]] + 1) memo end
From looking at the AST it seems more likely to be a RubyParser bug. I'll file a ticket with the upstream folks.
Sorry, something went wrong.
palvaro
No branches or pull requests
(Courtesy Ben Sklaroff:)
The typical array-assignment syntax for ruby seems to cause errors within the block of a Bloom collection's reduce.
Given that the syntax seems to be perfectly legal Ruby, it's tempting to think that the bug may occur as a result of rewriting somewhere...
The text was updated successfully, but these errors were encountered: