#lang racket (require (planet williams/describe/describe)) (displayln (string-join (map (λ (t) ((if (exact-integer? t) integer->string (curry format "~a")) t)) `(I will show you how Racket knows how to count.,"\n" Racket knows that 3 + 4 is ,(+ 3 4),"\n" Racket knows that 5 * 9 is ,(* 5 9),"\n" and that 5 / 4 is ,(/ 5 4),"\n" and 2 ^ 10 is ,(expt 2 10),"\n" and much more...)) " ")) (define (! n) (if (= n 0) 1 (* n (! (sub1 n))))) (describe (- (! 40) (! 41)))
Tão esperando que pra instalar o Racket e ver o output?
(Alias, que tal implementarmos um "describe" no dojo?)
Veja a documentação do describe pra ver o que mais ele pode fazer...
No comments:
Post a Comment