Written a long time ago in the Arduino complier using their flavor of C/C++. Thought I'd put it up now.
If you hook a servo and LED to PWM outputs and a microphone (I used an Electret one with the MAX4466 Op-Amp) to an analog input on an arduino then run the program, the servo should turn after the microphone registers a clap. All that is left to do then is to attach the servo to a light switch.