Honestly, you should be redirecting from either www. to . or vice versa, having one of them broken or doing something else is bad in 99.99% of cases.
Obviously it's a separator, I just found writing "" and "www" too weird. Not to mention that in this context where you're not really a recursive DNS resolver it really doesn't matter how one specifies the existence or lack of it of a subdomain. In addition to that some things use "@" (instead of the dot I used).
The hostname-as-tld example is sort of against the rules:
https://serverfault.com/questions/907226/is-it-possible-to-c...
Either way, "." by itself can only meaningfully refer to the root, not some arbitrary enclosing domain name. There is no way you will convince me that using "." as a shorthand for "parent domain" is a good idea, for that and all the other reasons.