Wednesday, February 29, 2012

Rubymoticons

   A few days ago, I was demonstrating injection of a symbol, to perform a series of subtractions in an array, and noticed a familiar pattern of characters.  That inspired a bit more investigation.  So now I present some basic Rubymoticons:
[].inject(  :-)
{}[         :-]
->() {      :-}
   These are perfectly valid Ruby code, and evaluate to nil, nil, and a lambda.

   Of course, the nose is easily substitutable, and noseless ones can use any mouth they please... but what about changing the eyes, or the mouth on full-size ones, and additional adornments?  Let's see how creative you can get, especially in as few characters as possible on either side.  Put some new Rubymoticons in the comments.

1 comment:

Note: Only a member of this blog may post a comment.