Brian's Waste of Time

Tue, 20 Jul 2004

Corrupted By Scheme

I was warned, but I did not heed the warnings. Scheme has corrupted me. Aside from getting annoyed with some things Java lacks, I have found my way of treating variables has become very different. Two recent happenings pointed this out to me:

  1. While pairing (I was driving) I started to recur through what amounted to a null-terminated linked list (in Java). Pair pointed out that while would be easier. I was confused. He then kindly reminded me that you can reassign values to variables in Java (yes, I know set! exists, but I don't use it ;-)
  2. Chatting with a co-conspiritor working on a library for use in OJB (and hopefully elsewhere) via IM this morning, he pointed out that I could make a couple more variables final. I nodded, smiled. Then it hit me... I could make every single argument, field, and local variable in the entire library final, with one exception -- the counter in the for (int i = 0; i < my_array.length; ++i) array traversal constructs. Cdr'ing down them isn't worth the ugliness it would take in Java, though.

The scary part is that this total lack of side effects in code was completely by accident -- I didn't even know I was doing it until it was pointed out.

The worse part? I have been making enquiries about mod_haskell. I am doomed!

4 writebacks [/src] permanent link