Skip to content

Instantly share code, notes, and snippets.

@alexandre
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save alexandre/02f08da58cc46f3625e0 to your computer and use it in GitHub Desktop.

Select an option

Save alexandre/02f08da58cc46f3625e0 to your computer and use it in GitHub Desktop.
testando recursão e avaliação preguiçosa...se é que eu entendi...
(comment
Tentando onseguir o mesmo resultado em clojure:
#Python3
>>> x = [1, 2, 3]
>>> x.append(x)
>>> x[3][3][3] == x
True
)
user=> (def x (list 1 2 3))
#'user/x
user=> x
(1 2 3)
user=> (nth x 2)
3
user=> (concat x x)
(1 2 3 1 2 3)
user=> x
(1 2 3)
user=> (def x (concat x x))
#'user/x
user=> (= x (nth x 3))
false
user=> x
(1 2 3 1 2 3)
user=>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment