direct & indirect object conflict
A direct object is the noun or pronoun that the verb acts directly on, while an indirect object is the person affected by the action but not acted directly upon.
I understand and agree with this sentence: El le esta mostrando sus maletas al oficial de aduanas. The "le" is an indirect object and refers to the "oficial de aduanas". It is required as per standard Spanish grammar. "Sus maletas" is the direct object because it receives the action from the verb.
I completely disagree with this sentence: El le esta pegando al agente de inmigracion. In this sentence "al agente de inmigracion" is the direct object because the verb is directly affecting the "agente". What or who is being hit - the "agente". How can they use "le" since "le" is indirect? If i remove "al agente de inmigracion" the thought is incomplete and we must have the direct object to make the sentence complete. another example: ?por que le estan pegando a ese carro? The direct object is "carro" there is no indirect object yet the word "le" is included. How is this possible? What is the rule that governs this usage? And if you tell me indirect is correct, then how do you define a direct and indirect object in spanish?
2 Answers
One of the problems that English speakers have understanding Spanish's use of direct and indirect objects is that they are not the same, but teachers rarely explain that. Read these two (for confirmation) definitions of English direct objects.
English indirect object definition 1
English indirect object definition 2
First distinction: in English when there is an indirect object there must be a direct object. Since the i.o. is the receiver of the d.o. it must exist. This is not so in Spanish, so the Spanish i.o. is not quite the same as the English i.o.
Second distinction: both definitions state that the indirect object can not be part of a prepositional phrase.
He gives her the book.
Her is the i.o. according to the English definition.
He gives the book to her.
There is no i.o. in that sentence according to the English definition (her is the object of a prepositional phrase). (similar to how some treat para ella.)
However, if you ask a Spanish speaker, either sentence would be translated as
Él le da el libro [a ella]. using the i.o. pronoun.
My point is the Spanish i.o. is not exactly the same as our concept of an i.o. in English. I usually see that (a ella) called a clarifying prepositional phrase. The Spanish speaker tends to see the a ella, not as a prepositional phrase removing the i.o. from the sentence, but as a clarifier. It is why the le is necessary for there to be an i.o., because the i.o. cannot be part of a prepositional phrase.
Another common problem is a lot of people think of the direct object as a thing, not a who. If it is a who then it is an i.o. Not true. In English the d.o. can be either. I pushed him. I pushed who? Him is a d.o.
Notice Robertico's example:
El le está pegando ¿A quién? al agente de inmigración.
To the English eye this who would be a d.o. who.; not a i.o. who. The Spanish eye doesn't see it that way since they are not used to sentences having to have an d.o. to have an i.o. as in English.
And then there is that ***** leísmo that doesn't even let you know if that is what the Spanish speaker is thinking. He could be thinking, yes, the immigration agent is a d.o., but he is male so the d.o.p. must be le.
The other answer to your question concerned implied d.o.'s with certain verbs. I believe this answer was given before the with verbs like pegar: implied d.o.'s are assumed like un golpe so, therefore, the agent would be an i.o. You will see many Spanish speakers use llamar por teléfono in that manner. In English you can say: I called him. him being a d.o. Some regions treat that like "I gave him a call" with the him being an i.o. and call being the d.o." Again, sometimes, it is just the $%^#@ leísmo.
And finally, there is the problem with the "personal a" and the preposition "a".
Picking on Robertico again:
El está (pegándole) al agente de inmigración.
When you see the "a" after the verb you must decide whether it is a "personal a" and the agent is being seen as a d.o. or whether the "a" is the preposition in a clarifying prepositional phrase for the i.o.p. (le).
My next pet peeve is with Spanish intransitive sentence where there is an i.o.p., and no d.o., but I'll save that rant for some other time. Suffice it to say that recognizing i.o. and d.o. in Spanish is much more difficult in Spanish because your can have either without the other.
¿Por qué (ellos le) están pegando a ese carro?
Ellos están pegándole a ese carro. Ellos le están pegando al carro.
El le está pegando ¿A quién? al agente de inmigración.
El está (pegándole) al agente de inmigración.