spy16 / parens

Parens is a highly flexible and embeddable LISP toolkit. :computer:
33 stars 3 forks source link

Make SExpr() method optional on Any type. #29

Closed lthibault closed 4 years ago

lthibault commented 4 years ago

@spy16 I had initially assumed that any parens form would be renderable into a valid s-expression, but this turns out to have been a mistake. Most things can be rendered back into an s-expression, but not all.

For example, Wetware has a notion of a process (think: UNIX process). What does the s-expression look like for a running process?

This PR removes the SExpr() method from Any, opting instead for the optional interface SExpressable. This changes is backwards-compatible.

⏱️ Estimated review time: <5 min ✅ Merge when ready

spy16 commented 4 years ago

Yea I realised this sometime back. That's why I had initially kept the Any as interface{} type only. 😛

lthibault commented 4 years ago

Yea I realised this sometime back. That's why I had initially kept the Any as interface{} type only. 😛

Haha I know, I know ... you called it! 😅