Category Archives: Muesli

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. […]

Nesting programming language text

Some time ago I started to implement nested language evaluation in Muesli, but I got bogged down. Now I’ve re-written it from scratch, as a state machine that copies the program text, making the necessary substitutions as it does so. So now it can evaluate this (with Scheme as the base language): (+ 3 {{lua: […]