akeep / nanopass-framework-racket

Racket port of the nanopass-framework
MIT License
34 stars 9 forks source link

Srfi + eval #2

Closed LeifAndersen closed 9 years ago

LeifAndersen commented 9 years ago

Includes both removing srfi from pass.rkt, and making eval work for unit tests not as a script.

I'd be happy to split out these two pull requests if you'd rather (they are already two different commits).

To run the unit tests, at the moment you can do:

raco test test-all.rkt

(In this case you could also do racket test-all.rkt as well).

akeep commented 9 years ago

I think it is fine to keep it combined. Look at that, we've actually got a useable nanopass-framework on racket now. And it is even starting to get some nice racket idioms in it, instead of my scheme idioms.

Incidentally, which version of racket are you using? (I ask, because the eval I had before was working for me in 6.1.)

Thanks for help :)

LeifAndersen commented 9 years ago

I'm using 6.1.1.8 (basically, HEAD as of a few days ago). eval works for me too when I run it as a script. (take out the #lang and run it with the -f flag as you said). I suspect the reason is because the top level's default namespace has the bindings we need, while the module level default namespace does not. (Based on the docs here: http://docs.racket-lang.org/guide/eval.html?q=Namespaces#%28part._namespaces%29 ), although I'm not entirely sure as my knowledge about namespaces is pretty minimal.

I guess we technically don't need to run unit tests in a module, we just get nice things (like automated testing) if we do.

Thanks for help :)

Any time, I'm glad to see it coming to Racket. :)

akeep commented 9 years ago

Makes sense. I certainly have no objection to passing in the namespace, just wondered what the difference was for future reference. I noticed you are using some syntax-parse as well, which is very cool.

-andy:)

On Jan 30, 2015, at 1:16 AM, Leif Andersen notifications@github.com wrote:

I'm using 6.1.1.8 (basically, HEAD as of a few days ago). eval works for me too when I run it as a script. (take out the #lang and run it with the -f flag as you said). I suspect the reason is because the top level's default namespace has the bindings we need, while the module level default namespace does not. (Based on the docs here: http://docs.racket-lang.org/guide/eval.html?q=Namespaces#%28part._namespaces%29 ), although I'm not entirely sure as my knowledge about namespaces is pretty minimal.

I guess we technically don't need to run unit tests in a module, we just get nice things (like automated testing) if we do.

— Reply to this email directly or view it on GitHub.