What literary devices does Walt Whitman use in "To a Stranger"?
The only literary devices I can possibly see is that the stranger symbolizes a possible friend and the tone is kind of hopeful because he wants to bump into the stranger again and maybe he'll have the courage next time to start talking.
"To A Stranger," probably written in 1860, is part of Whitman's collection "Leaves of Grass," published in 1900.
The principal literary device Whitman uses here is the framework of the poet's experience of the stranger--essentially, a dream vision. In fact, the poem is reminiscent of Medieval dream visions in which a poet envisions a combination of elements from several experiences that expresses his current psychological state. In the second line, for example, Whitman says "You must be he I was seeking, or she I was seeking, (it comes to me as of a dream)." One of the ways we know this is occurring as a dream vision is that Whitman clearly is seeing no particular person; rather, the vision of the stranger is close to an allegory in which the stranger doesn't represent an individual (neither a man nor a woman) but a generic "everyman" or "every person."
The very intimate tone is more appropriate for a dream/vision than it is for a representation of reality. When Whitman says that "you give me the pleasure of your eyes, face, flesh . . .you take of my beard, breast, hands, in return," that is better seen as a metaphorical construct than actual physical reality simply because it is too intimate, too sexual, and Whitman, even though many of his poems exude sexuality, means for us to understand that the relationship he is describing here is spiritual.
Whitman is describing the spiritual closeness he feels with all men and women, which gives the lie to the concept of "stranger." Because he describes the sharing of being between himself and the stranger, Whitman is describing the commonalities among people, those elements that we can share with one another--precisely why we should not be strangers.
He concludes the poem by affirming that the stranger is a product of his vision--"I am not to speak to you, I am to think of you when I sit alone. . . ."--a construct of his mind that he cannot lose because the vision resides in his intellect.