I was going to natter on about rainbows, because there were some really awesome ones yesterday, but it was pointed out that I've already done rainbows. If there's one thing that makes me twitchy, it's when I've done something and I go to do it again thinking it's the first time, and nobody says anything. "Hey, have I told you this story? Your silence and attempts to claw your way through the door tell me 'no'...sooooo, once upon a time..."
I spent the weekend working. This wasn't part of the plan. I was going to do other stuff. Well, I did do some other stuff. I cleaned. That doesn't count. I was going to do fun stuff, but that didn't happen.
And I guess I can't grouse too much about it not being 'fun', because it was programming, and that's fun to me, it was just the wrong kind of fun... >.<
My first programming language was APL. And the operation I loved the most was Quad-FX, which in the font looked like a box with an FX next to it. This beastie accepted a matrix. The first line was the name of the function, and the subsequent lines constituted the function. What this meant was that I would write programs that created other programs. My first foray into this involved writing an editor. I learned a lot. And I'm sure I freaked out the interpreter.
Generally speaking this kind of fun behavior is allowed by interpreters. Compilers rarely get to play. I've done similar stuff in VAX DCL and various UNIX and Linux shells.
Well, I've been forced to write my own interpreter, basically my own language. It's kind of fortrany, because one can do a hell of a lot with gotos and call functions. But the one thing I really needed was a good evaluation system. After I tokenize the input I run it through the evaluator system, which recursively expands symbols until they can't be expanded anymore. Then it dispatches the result.
That allows me to do things like...
>>> B=hello world
>>> $A $B
>>> hello world
Having this allowed me to reduce a function that could have been more than a couple hundred lines line down to about 12 lines. Woof. It's clean, it's nice. I like it.
Okay, I've totally geeked out now. Back to work...