For debuging I like
(define (show x)
(display x)
x)
(define (noshow x)
x)
For example in
(define (average x)
(/ (+ (car x) (show (cdr x))) 2))
noshow is useful to turn on/off them fast.
But this is different from the convension of << in the streams of C, that
return the
Racket's also flexible enough that you can say "to hell with void, I want
function chaining" if you decide it's more appropriate:
(require fancy-app) ;; now (+ _ 1) means (lambda (v) (+ v 1))
(require point-free) ;; now (~> x f g h) means (h (g (f x)))
;; makes voidful procedures return their
2 matches
Mail list logo