While the 40 looks appealing, realize that there aren't any Nikon prime lenses with built-in autofocus motors.
Well, I can't let that slide. You either are not aware of what a Prime lens is, or what Nikon calls their autofocus motor, but that is dead wrong.
ANY Nikon lens with the designation of AF-S has the motor. So just off the top of my head, I own the 300mm F4 AFS. The 105mm macro VR is AF-S. Every Slab of big Nikon glass has AF-S, so 300mm 2.8/2, 400mm, 500mm, 600mm.
The real question here is WHY does it matter if the motor is in the Camera body, or in the lens, or both!
Canon does not put the motor in the Body. Nikon does. Initially this resulted in the increased cost of Canon lenses.
Recognize that all motors are not equal. What does one get with Canon's *KIT* lenses for a motor... Well basically a junky slow motor. If the motor fails, forget AF.
There are arguments on both sides as to what the best approach is. But let's not state mis-information as fact.
From my perspective, the reason one may want to consider something other than the D40 is IF there are prime lenses that one wants to use that do not have a motor. The 60mm macro is a good example.
Nikon's thinking is cut costs, and offer a low end, low cost DSLR. Msost folks that won't pay more than $500 for a body are not going to purchase expensive glass. Prime lenses are generally expensive, and most consumers out there looking for a low end DSLR want zooms.