2005-10-27

Gems of Monad

I keep a computer on my desk and usually there's a testing system set up on the workbench behind me. I spend a lot of time spinning around from north-facing to south-facing or vice versa.

On my wall, I have printed and posted the latest Monad Language Quick Reference. I don't use Monad at work, so I don't really know why I put it there, 'cept maybe for potential geek cred. Sometimes I'll just look it over for a few seconds and hope to glean some knowledge from it through either osmosis or familiarity.

Today, it finally happened. I was just absent-mindedly staring at the Quick Reference when I caught this little tidbit under the "Variables" section:

MSH C:\> ${c:\documents and settings\toby\Desktop\testfile.txt} = "hello world"

Congratulations, you've just written "hello world" to disk. I forsee an obfuscated Monad contest in the future, one whose entries rely heavily on tricks such as

[System.IO.Path] $p = "c:\some\path.txt"; ${$p}="text"

Note that the above code is not, in fact, valid Monad. Try it and the shell will bitch at you. But you get the idea.

No comments: