freenode/#lisp - IRC Chatlog
Search
6:33:12
azrazalea2
I've noticed in my sbcl 2.10 from the debian package the *evalhook* global doesn't exist. Is this intended behavior? From what I could tell, *evalhook*/*applyhook* was part of standard but I haven't used it before so might be wrong?
6:36:35
azrazalea2
So I was looking into it because I'm wanting to make a simple bot calculator by accepting lisp forms as a string from a user and then evaluating and returning them. I wanted those hooks so I could validate what types of data they had sent using *evalhook* to check overall types (numbers and symbols only) and *applyhook* to validate the functions
6:36:36
azrazalea2
are in a whitelist. Is the best way to do this going to be to use `read` and then walk the forms myself?
6:40:38
beach
That's one possibility. There are several other options. You could use Eclector to read the form. Then you can control how symbols are created and you can have those symbols interned in the package of your choice.
6:42:39
beach
Or, you can do what I do for SICL bootstrapping. I evaluate the forms relative to a first-class global environments of my choice.
6:47:34
azrazalea2
Well, I might eventually want to get more fancy and allow setting and expansion of local variables but to start with my needs were pretty simple. Just cons based lists with the basic numeric operations (including sqrt, expt, etc etc) as the first element and either another valid list or a numeric value as arguments.
6:48:17
azrazalea2
I can write it myself relatively easily, but I was looking to see if I didn't have ot