nsf/sexp — pull request #1 by xiam (2012-12-27 14:21:22+00:00)
Title: A function that dumps a *Node to a io.Writer

I was fooling around with your cool s-expression parser, I would find it very useful to have a way to print a `*Node` and its children to an `io.Writer` so I added a prototype function `Dump` that does the job.

However, I am not sure of these things:

...If it should be called `Marshal`, as you already have `Unmarshal` tied to a *Node.
...If a function such as `Marshal` should exists, should it act like json.Marshal([]byte, error)?

And there's another thing that I was thinking, should a `*Node` have functions such as `Marshal`, `Unmarshal` and `Dump`/`Print` that are not strictly related to a `*Node` or should they be part of a subpackage keeping the `*Node` struct clean? I am thinking on something like the JSON *package* and the `interface{}` *type*, not that it bothers me but `Marshal` and `Unmarshal` may be best fitted on a *decoder* subpackage instead of a *type*.

I'd like to help on your s-expression parser and I would be glad to take the above tasks I suggested if they help on the project's development. I'm not planning to keep a fork of sexp if it's not being useful for the main package, a unuseful fork is a dead fork. I'll be checking from time to time if there are some issues I can fix :-).

Regards,

José Carlos