dput(x) brings you closer:
R> dput(x)
c(4L, 5L, 6L, 5L, 6L, 7L, 8L, 9L)
Or, if the character representation is enough, then the idiom may be enough deparse(substitute()):
foo <- function(x) {
deparse(substitute(x))
}
:
R> foo(c(4:6,5:9))
[1] "c(4:6, 5:9)"
R> foo(x)
[1] "x"