Closed rattrayalex closed 6 years ago
Given that to_s
and inspect
both produce strings here, I figured to_json
should both exist and produce a string.
I created a new to_sexp_array
helper which is identical to to_a
but includes the type
as a symbol as the first element. I'm all ears for other ideas on the name.
I also added tests. I am relying on Travis to run them as I haven't set this up locally.
Thanks for the reviews so far! Appreciate your patience
Get rid of to_json
since it's redundant with JSON.dump
and an implementation is trivial and noninvasive. to_sexp_array
seems fine.
Awesome, thanks! I also renamed to to_sexp_arr
since that was what I found intuitive when writing tests. Hope that's okay.
No, to_sexp_array
was fine...
K I'll move it back haha
Sorry for all the back and forth, thanks so much for your patience!
This is for consumption from the parser in https://github.com/whitequark/parser/pull/442