14 points · by joejev · 11y ago · 9 comments
Found this example which seems a little clearer: https://pypi.python.org/pypi/quasiquotes/0.2.0
Initially I thought this was something like James Powell's "astexpr" literals example (towards the end of < http://www.youtube.com/watch?v=2O7yj-Nh6AY >), which would require actually implementing a new C-API type, adding parser logic for its literals, and recompiling Python.
If you can add a comment or two to clear up my confusion, I would really appreciate it.
Great work on this!
'[$qq|this is the body|]'.encode('utf-8').decode('quasiquotes') "qq._quote_expr(0,' this is the body')"
btw - I suspect a different title might help get more traction on hn - inlining C isn't that interesting (scipy.weave has done this for years) but this approach to inlining is super cool, and can be extended to other langs. none of this is obvious from the title