Skip to content

Instantly share code, notes, and snippets.

@adh
Created February 10, 2012 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adh/1788298 to your computer and use it in GitHub Desktop.
Save adh/1788298 to your computer and use it in GitHub Desktop.
/\___/\ dfsch version 0.4.0-dev
( o o ) (rel-0.3.0-1300-gef083bd) [Feb 10 2012 08:46:38]
== * == dfsch is free software, and you are welcome to redistribute it
) ( under certain conditions; see file COPYING for details.
]=> (define (fact x)
..> (if (< x 2)
..> 1
..> (* x (fact (1- x)))))
#<standard-function 0x1d23aa0 fact(x)>
]=> (trace-function! fact)
#<standard-function 0x1d23aa0 fact(x)>
]=> (fact 6)
;; +<< #<standard-function 0x1d23aa0 fact(x)>
;; | \ (6)
;; | +<< #<standard-function 0x1d23aa0 fact(x)>
;; | | \ (5)
;; | | +<< #<standard-function 0x1d23aa0 fact(x)>
;; | | | \ (4)
;; | | | +<< #<standard-function 0x1d23aa0 fact(x)>
;; | | | | \ (3)
;; | | | | +<< #<standard-function 0x1d23aa0 fact(x)>
;; | | | | | \ (2)
;; | | | | | +<< #<standard-function 0x1d23aa0 fact(x)>
;; | | | | | | \ (1)
;; | | | | | +>> #<standard-function 0x1d23aa0 fact(x)>
;; | | | | | \ (1) -> 1
;; | | | | +>> #<standard-function 0x1d23aa0 fact(x)>
;; | | | | \ (2) -> 2
;; | | | +>> #<standard-function 0x1d23aa0 fact(x)>
;; | | | \ (3) -> 6
;; | | +>> #<standard-function 0x1d23aa0 fact(x)>
;; | | \ (4) -> 24
;; | +>> #<standard-function 0x1d23aa0 fact(x)>
;; | \ (5) -> 120
;; +>> #<standard-function 0x1d23aa0 fact(x)>
;; \ (6) -> 720
720
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment