Skip to content

Instantly share code, notes, and snippets.

@ofan
ofan / lisp.cpp
Last active July 21, 2025 14:29
Lisp interpreter in 90 lines of C++
Lisp interpreter in 90 lines of C++
I've enjoyed reading Peter Norvig's recent articles on Lisp. He implements a Scheme interpreter in 90 lines of Python in the first, and develops it further in the second.
Just for fun I wondered if I could write one in C++. My goals would be
1. A Lisp interpreter that would complete Peter's Lis.py test cases correctly...
2. ...in no more than 90 lines of C++.
Although I've been thinking about this for a few weeks, as I write this I have not written a line of the code. I'm pretty sure I will achieve 1, and 2 will be... a piece of cake!
@anastasiadevana
anastasiadevana / 1_ButtonInvoke_Readme.md
Last active February 8, 2025 06:28
Quickly hook any function in your class to a button in the Unity3d Inspector.

How to use

Let's say you have a function called MyFunction, and you want to show a button in the inspector to trigger it.

Just add a "decoy" variable with the [ButtonInvoke] attribute in your script (type of the variable doesn't really matter, but its name will be used as button text.

// "MyFunction" is the name of the function you want to trigger
[ButtonInvoke("MyFunction")] public bool testMyFunction;

// OR use "nameof" to prevent typos