Ruby2Ruby#process destroys its input
heathd opened this issue · 3 comments
heathd commented
Hi
seems that Ruby2Ruby#process
destroys the sexp passed in. Here's a failing test:
def test_process_is_non_destructive
sexp = s(:call, s(:call, nil, :a), :b)
Ruby2Ruby.new.process(sexp)
assert_equal s(:call, s(:call, nil, :a), :b), sexp
end
It would be good at least to document this fact clearly as I wouldn't normally expect a library to have side-effects on the inputs passed in.
thanks
David
zenspider commented
Yup. Doco PR welcome.
Just so you know, all you needed was a call to deep_clone
which is provided by sexp_processor.