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))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which procedure returns the number of elements in a list?
Visually impaired? Let me spell it for you (wav file) download WAV