View Problem

Rotate a list

Given a list ["apple", "orange", "grapes", "bananas"], rotate it by removing the first item and placing it on the end to yield ["orange", "grapes", "bananas", "apple"]
ExpandDiskEdit
php
$list = array("Apple", "Orange", "Grapes", "Banana");
$first = array_shift($list); //get and remove the first
array_push($list, $first); //prepend the $first to the array
DiskEdit
clojure
(let [fruit ["apple" "orange" "grapes" "bananas"]]
(concat (rest fruit) [(first fruit)])

Submit a new solution for php or clojure
There are 21 other solutions in additional languages (cpp, csharp, erlang, fantom ...)