Monday, November 08, 2010 at 12:06 AM.


on getMyDomainName () { //return the domain name of the machine we're running on
	<<9/26/98; 6:44:09 AM by DW
		<<It's such a common thing to want, why replicate the code?
	<<5/7/00; 11:37:38 AM by DW
		<<Optimized by caching the domain name in system.temp.
	if not defined (system.temp.myDomainName) {
		system.temp.myDomainName = tcp.dns.getDomainName (tcp.addressDecode (tcp.myAddress ()))};
	return (system.temp.myDomainName)}
<<bundle //test code
	<<local (tc = clock.ticks ())
	<<for i = 1 to 1000
		<<getMyDomainName ()
	<<dialog.alert (clock.ticks () - tc)

This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.