About The Contest

The first ever Olympiad of Misguided Geeks contest at Worse Than Failure (or OMGWTF for short) is a new kind of programming contest. Readers are invited to be creative with devising a calculator with the craziest code they can write. One lucky and potentially insane winner will get either a brand new MacBook Pro or comparable Sony VAIO laptop.



Entry #100139: half-ass-expr

by Steve Hawley
All applications should include a half-assed, ill-defined scripting language. To that end, half-ass-expr includes a full implementation of a very lisp-like language, except that I wrote this late at night around the feeding schedule of my newborn son, and therefore didn't have time to actually implement lambda calculus, looping, error handling, real garbage collection, efficient atom lookup, and so on.

Through the magic of the primitive operations "join" and "parse-eval", you can get the near equivalent of lambda calculus anyway by creating new strings on the fly and parsing and evaluating them.

You'll note that the calculator buttons are bound to lisp programs instead of vectoring through C code. This teensy hit in efficiency is clearly outweighed by the added flexibility.

I'd intended to bind the button creation code to lisp and then run an external program which would create the buttons and then bind them to lisp programs, but that might actually be useful.

Download0 Comments