slot_name} of @var{obj} to @var{value}."
  (let ((class (class-of obj)))
    (define (have-slot slot)
      ((%slot-definition-slot-set! slot) obj value))
    (define (no-slot)
      (unless (symbol? slot-name)
        (scm-error 'wrong-type-arg #f "Not a symbol: ~S"
                   (list slot-name) #f))
      (slot-missing class obj slot-name value))

    (%class-slot-definition class slot-name have-slot no-slot)))

(define (slot-bound? obj slot-name)
  "Return the value from @var{obj}'s slot with the nam var{slot_name}."
  (let ((class (class-of obj)))
    (define (have-slot slot)
      (not (unbound? ((%slot-definition-slot-ref/raw slot) obj))))
    (define (no-slot)
      (unless (symbol? slot-name)
        (scm-error 'wrong-type-arg #f "Not a symbol: ~S"
                   (list slot-name) #f))
      (not (unbound? (slot-missing class obj slot-name))))
    (%class-slot-definition class slot-name have-slot no-slot)))

(define (slot-exists? obj slot-name)
  "Return @code{#t} if @var{obj} has a slot named @var{slot_name}."
  (define (have-slot slot) #t)
  (define (no-slot)
    (unless (symbol? slot-name)
      (scm-error 'wrong-type-arg #f "Not a symbol: ~S"
                 (list slot-name) #f))
    #f)
  (%class-slot-definition (class-of obj) slot-name have-slot no-slot))


