spy16 / sabre

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

Add slang tests using lisp files #8

Closed spy16 closed 4 years ago

spy16 commented 4 years ago

Adds tests for slang using lisp files in ./examples directory

spy16 commented 4 years ago

@lthibault Thoughts?

lthibault commented 4 years ago

Two general thoughts:

  1. I realize Slang is mostly a proof-of-concept language, but at some point we may want to start testing floating-point arithmetic like (/ 21 19). When this happens, we should revisit the assert function to handle floating-point errors. I think it's fine for now, though.
  2. Can we export functions like makeContainer and containerString in a utility package (e.g. sabre/util/container) ? I'd like to reuse this logic in wetware.

Other than that, 👍. Looks like the beginnings of a nice little standard library !

spy16 commented 4 years ago

Not a big fan of utility packages because they have a tendency to be a dumping ground. And also not a fan of exposing things unless they are very generic and necessary to be exposed.. That said, I do have plans to create a generic version of type initialization. sabre.Type type is invokable. And my idea is to use this invocation to enable initialization of that type. When that is done, makeContainer will be removed. Also, when this is done many of the type init functions and type check functions will be removed from go code and added as pure lisp code (vector, vector? etc.)