Welcome to the CHICKEN Scheme pasting service
binding example added by phm 3 days ago
(define (something x) (let ((x (cond ((string? x) x) ((char? x) (string x)) ((pair? x) (list->string x)) (else (error "invalid string" x))))) (do-something-with x))) ;;; The following won't work because `x` is bound to an unspecified ;;; value during execution. (define (something x) (define x (cond ((string? x) x) ((char? x) (string x)) ((pair? x) (list->string x)) (else (error "invalid string" x)))) (do-something-with x))