spy16 / sabre

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

Remove all type specific functions in favor of generic core #9

Closed spy16 closed 4 years ago

spy16 commented 4 years ago
spy16 commented 4 years ago

I will keep this PR for now. I still need to fix the special forms.. Bit of complexity involved.. Let me know i you have any pointers for the following problem (which unfortunately is also a blocker for macro system):

In some scenarios, an intermediate step is required (in addition to read and eval). For example, when fn* is used to define a function, it needs to walk recursively into the body of the fn* and validate if the forms are correct (For example, (fn* [] (if)) is wrong since if needs more at-lest 2 args, and sabre should throw error when this is executed not when the resultant function is invoked). This works right now, but is very buggy and needs to be re-visited. To understand the current implementation, take a look at analyze function in sabre.

lthibault commented 4 years ago

@spy16 Ok, I'll look into this (probably over the weekend).