Today I was coding and unthinkingly wrote "~foo" as a test of a variable foo being nil. I stared at the code for a long time before I realized that I wanted "no.foo". What do you guys think about extending "~" to mean applying "no" to non-functions? Other languages have things like "!" which are much more concise than "no.", and the overload feels natural to me. "~" is already an abbreviation for "no:", run-time performance issues aside, are there stylistic reasons why it shouldn't also be an abbreviation for "no."? |