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 | 160 | [RSS] |
| Other | 99 | [RSS] |
| My Projects | 60 | [RSS] |
| Fun | 54 | [RSS] |
| SQL | 50 | [RSS] |
| Deals | 18 | [RSS] |
| RIA | 18 | [RSS] |
| 1ssBlog | 16 | [RSS] |
| cfSQLMaster | 12 | [RSS] |
| Caching | 8 | [RSS] |
| Profit | 8 | [RSS] |
| Transerfing | 6 | [RSS] |
| AJAX | 5 | [RSS] |
| cfHSSF | 5 | [RSS] |
| cfWatcher | 5 | [RSS] |
| JavaScript | 5 | [RSS] |
| Amazon | 4 | [RSS] |
| cfFirewall | 4 | [RSS] |
| jQuery | 3 | [RSS] |
| 1ssChat | 2 | [RSS] |
| Security | 2 | [RSS] |
| SEO | 2 | [RSS] |
| Adobe Air | 1 | [RSS] |
| jQuery Mobile | 1 | [RSS] |
| MMA | 1 | [RSS] |
My Sites
Recent Entries
Recent Comments
- Looking for advice
Ed Tabara said: thx guys [More] - Looking for advice
Andy Jarrett said: [bick] + [lee] [More] - Looking for advice
jd said: bick + lee [More] - Looking for advice
me said: bi+kli bi fom bin and cli from click [More] - Is your site still vulnerable to SQLi attacks?
Ed said: no problem at all :) [More]
Search
Open Source
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 |
Tags Cloud
1ssblog
about
access
adobe
ajax
amazon
caching
cfhssf
cfsqlmaster
cfwatcher
coldfusion
data
deals
fun
jquery
list
moldova
mssql
my projects
optimization
other
over
performance
profit
ria
sites
sql
this
transerfing
your
Subscribe
Enter your email address to subscribe to this blog.
Adobe Feeds
- Save 15% on Adobe Software with Promotion Code, for 8 Days Only
- Finding a new webhost: WPEngine.com and the others…
- Christophe Coenraets On Backbone.js And PhoneGap
- Flex User Group 2012 Tour European Dates
- YUI Theater — Gonzalo Cordero: “Yahoo! Local Mobile Case Study” (33 min.)
- Envato Community Meetup 2012 in Kuala Lumpur: RSVP Now!
- 23 Feb: Design event in Antwerp
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.