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

Exactly. If the preprocessor respected file scope or better yet namespace scope it would be much much better. The way it works now there is no encapsulation. preprocessor definition in one library header will inadvertently affect code in other libraries, depending on the order in which they happen to be included and compiled. Its such a mess its embarrassing we still put up with it in the year 2015.



In 1999 or so I tried to write a better macro preprocessor. I called it MPP. Here it is, via the Wayback Machine

https://web.archive.org/web/20070209223522/http://users.foot...

Oh, I have the sources. I haven't lost anything. Why I don't host that project anywhere is that I'm not all that proud of it.

I worked for one startup some almost years ago whose guys looked at that thing before they hired me and liked it.

MPP has namespaces, and it also tries to preserve whitespace (expansions occurring at some indentation level are indented). It could be used for Python, in theory.

Thinking along those lines, I posted to a Python newsgroup around then: reactions were mixed:

http://code.activestate.com/lists/python-list/9193/

:)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: