Alex is in bed, asleep, meaning I can now unwind in the manner I see fit, which will probably involve watching some TV and reading. Among today's accomplishments was creating a random name generator in Lisp so I can call names out of thin air in Emacs. When you do a fair amount of running/writing paper and pencil RPG stuff, coming up with names on the fly is a necessary thing. This hack is based off the data I use for the name generator on my site (which is quite the popular little thing, it seems).
The only issue I have with it is that that lists for the names (three of them: male first names, female first names and last names) are large. In particular, the list for last names can from the US Census and has over 88,000 elements. They all load fairly quickly (barely any noticeable delay when loading the last names) but it's horribly inefficient to burn nearly a megabyte of RAM for this. I've looked at autoload, provide and require but I'm not entirely sure that any of those can do what I want or won't cause a delay when I don't need one. In no particular order:
1. I want the function (there's only one) and the data in one file.
2. Whenever the function gets run (even the first time), it should be snappy with no noticeable delay whatsoever.
3. It should be tit-easy for someone to add this functionality to their Emacs (i.e., one expression, at most, to load it and one expression to bind it to an appropriate key sequence).
I
think the only way to do this is what I'm doing now. That is, the three lists are defconsts at the end of the file with the function and the whole thing comes in via my .emacs with a load expression. I'm eager to be proven wrong though.
Anyway, once I'm satisfied I'm done I'll probably toss the code up on my site for those interested. Now, though, I think it's time to rot my brain with Fringe.