I have a global variable `x` and want to build a function `f` that returns the value of `x` at the time the function is created. Example:

```
x <- 5
f <- function() return(x)
f()
> 5
x <- 10
f()
> 10 # Should return 5

```

I want a function that always return `5` (or whatever the value of `x` is at the time of function creation) without using another global variable. Is that possible?