Category Archives: Programming languages

Plans for the year

Although New Year’s resolutions are apparently mostly useless, I do have some targets for the next year or so. The article linked above mentions: people who kept their resolutions tended to have broken their goal into smaller steps and rewarded themselves when they achieved one of these. They also told their friends about their goals, […]

Python: working out whether it’s an expression or a program

Here’s a code fragment I wrote for my project Muesli that tries to figure out whether a fragment of Python code should be parsed as an expression or a program, which is necessary as the Python parser API needs to be told. int muesli_python_input_type(const char *python_c_string) { /* Suggested heuristic: Skip initial docstrings and comments. […]