# Simple swap problem

**URL:** <https://forums.eggplantsoftware.com/t/simple-swap-problem/2622>\
**Category:** Eggplant Functional\
**Created:** [June 24, 2010, 10:13am UTC](https://forums.eggplantsoftware.com/t/simple-swap-problem/2622 "2010-06-24T10:13:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![echelon](https://forums.eggplantsoftware.com/letter_avatar_proxy/v4/letter/e/4da419/32.png) [@echelon](https://forums.eggplantsoftware.com/u/echelon)\
**Post date:** [June 24, 2010, 10:13am UTC](https://forums.eggplantsoftware.com/t/simple-swap-problem/2622/1 "2010-06-24T10:13:42Z")

</div>

I made a list with two items, each with an x and a y property. I try to swap the location of the two items in the list, but it doesn’t work as expected. What’s the problem? Here’s the code:

put ((x:1, y:2), (x:3. y:4)) into list  
put list ---------------\> outputs ((x:“1”, y:“2”),(x:“3”, y:“4”)) as expected  
put item 1 of list into temp  
put item 2 of list into item 1 of list  
put temp into item 2 of list  
put list ---------------\> outputs ((x:“1”, y:“2”), (x:“1”, y:“2”)) rather than ((x:“3”, y:“4”), (x:“1”, y:“2”))

---

<div class="post-metadata">

**Author:** ![SenseTalkDoug](https://forums.eggplantsoftware.com/user_avatar/forums.eggplantsoftware.com/sensetalkdoug/32/88_2.png) [@SenseTalkDoug](https://forums.eggplantsoftware.com/u/SenseTalkDoug)\
**Post date:** [June 24, 2010, 10:48am UTC](https://forums.eggplantsoftware.com/t/simple-swap-problem/2622/2 "2010-06-24T10:48:35Z")

</div>

It appears you’ve run into an odd bug. We’ll look into getting it fixed right away. In the meantime, you can easily achieve what you want in this case with a single statement:

```auto
put (item 2 of list, item 1 of list) into list

```
