spy16 / sabre

Sabre is highly customisable, embeddable LISP engine for Go. :computer:
GNU General Public License v3.0
28 stars 5 forks source link

Print errors with extended formatting. #11

Closed lthibault closed 4 years ago

lthibault commented 4 years ago

This is useful for printing stack traces from github.com/pkg/errors.

lthibault commented 4 years ago

Upon further reflection, maybe it's best to make the REPL's print function configurable through a repl.Option?

The "print" part of "REPL" seems important enough to warrant some degree of configurability, and I think this can be achieved while keeping the code simple:

  1. Make repl.print a struct field instead of a method.
  2. Add a WithPrinter option to the repl package.

What do you think?

spy16 commented 4 years ago

That makes sense. Current print can be set as default.

lthibault commented 4 years ago

👍Ok, I'll whip something up this afternoon.