Advertisement
Guest User

Untitled

a guest
Jul 26th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.21 KB | None | 0 0
  1.   def operand modify
  2.     # line is an array of strings
  3.     v = line.index { |l| l['V'] }
  4.     line[v] = line[v].sub(/-?\d+/) { |o| modify[o.to_i] } rescue nil
  5.   end
  6.  
  7. # elsewhere
  8. operand -> o { o.send OPS[$1], arg }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement