Hacker News new | past | comments | ask | show | jobs | submit login

You could do the jump tables if your CL gives you some access to the lexenv at compile time.

What you do is modify the individual cases so that instead of accessing the surrounding runtime lexenv directly, they go through reader and writer thunks. These thunks are then passed in as a separate argument to the lambda for each case. The table mapping case values to these lambdas is a compile time constant.

You might complain that this takes time proportional to the number of accessed objects in the lexenv, to set up the thunks. And that's true, but it's constant in the number of cases.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: