Did you know there exist an IMP operator in ColdFusion? Well, i didn't even after 8 years of day to day ColdFusion usage.
Found it accidentally when trying to have a variable name IMP.
For thouse who find IMP new too, here is how it work:
As opposite to AND and OR:

Categories
| ColdFusion | 125 | [RSS] |
| Other | 71 | [RSS] |
| My Projects | 46 | [RSS] |
| Fun | 34 | [RSS] |
| SQL | 24 | [RSS] |
| RIA | 17 | [RSS] |
| 1ssBlog | 14 | [RSS] |
| cfSQLMaster | 11 | [RSS] |
| Caching | 8 | [RSS] |
| Profit | 6 | [RSS] |
| AJAX | 3 | [RSS] |
| cfHSSF | 3 | [RSS] |
| cfWatcher | 3 | [RSS] |
| cfFirewall | 2 | [RSS] |
| JavaScript | 2 | [RSS] |
| Transerfing | 2 | [RSS] |
| 1ssChat | 1 | [RSS] |
| Adobe Air | 1 | [RSS] |
Recent Comments
- Better understand your traffic and usage with yahooSiteExplorer!
kenneth vincent said: Where does this website stand in ranking with others [More] - World's Largest Snake Found Dead
Ben Nadel said: That scared the heck out of me! [More] - World's Largest Snake Found Dead
Aaron West said: Oh my!! You punk, I'm still shaking after seeing this. [More] - Making your Database fly
mrhassell said: Great Post for SQL 2005 / 2008. Good example of the usage of the CROSS APPLY, which joins tables to ... [More] - ColdFusion 8 price madness
IdeoseSef said: emm... strange )) [More]
CFBloggers
Review Board: Code Reviews Made Easy (Installation)
Using Wordpress for the first time, my thoughts on the process...
Project HUGE: Huge In A Hurry - Get Big - Phase 3 / Week 1
Finally - some Railo VPS goodness
TV Game show for athiest?
Daily Links #7
Fun FusionReactor Screenshot! - 36 instances over 4 servers.....
Using Wordpress for the first time, my thoughts on the process...
Project HUGE: Huge In A Hurry - Get Big - Phase 3 / Week 1
Finally - some Railo VPS goodness
TV Game show for athiest?
Daily Links #7
Fun FusionReactor Screenshot! - 36 instances over 4 servers.....
Calendar
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
Adobe Feeds
- QoQ: Invalid Column Name Hack
- 30 Awesome Firework Effects for your Web Site
- iPhone Sample: Adding UILabel programatically
- OT: Null Characters Bring out the Beast
- Review Board: Code Reviews Made Easy (Installation)
- Top 7 Adobe AIR Apps for Videos you should know
- Streaming Video Between QuickTime Broadcaster and VLC
1ssBlog was created by Ed Tabara and is running version 1.1.























Cheers for the heads up.
Ike: you might want to revisit the logic of your assertion there I think: they're not the same.
Ed: your summary of how the processing of IMP is short-circuited is spot on, but it's not telling the whole picture.
If the first operand is true, then we care about the second operand, and that operand must be true for the expression to be true. If the first operand is false, the expression is true irrespective of the value of the second operator.
This is very interesting. I wonder how much of my mangled boolean contortions could have been avoided had I known about this.
Cheers!
--
Adam
So IMP works like this:
T+T = T
T+F = F
F+T = T
F+F = T
In ColdFusion, NOT x AND y is
T+T = F
T+F = F
F+T = T
F+F = F
(Remember NOT has higher precedence than AND.)
It's closer if you write NOT (x AND y):
T+T = F
T+F = T
F+T = T
F+F = T
But what you really want is NOT (x AND NOT y). And if you find yourself wanting that, then IMP would definitely be easier! (Although it might not be as understandable ... I think you'd want to comment that code.