The following examples illustrate the use of `defadvice` and related advising constructs.

```;; Define a function that adds 1 to its argument.
> (defun add-one (x) (+ x 1))

> (add-one 3)               ; 3+1 = 4
4

;; Put some advice on it that gives a default value for the
;; argument.

> (add-one)                 ; No argument supplied, so 0+1 = 1
1

;; Put some more advice on to double the result.

> (add-one)                 ; (default 0+1)*2 = 2
2

> (add-one 5)               ; (5+1)*2 = 12
12

;; See what is there now.
B3619F>
Original definition: #<Interpreted-Function (NAMED-LAMBD
(BLOCK ADD-ONE (+ X 1))) AF1A57>
NIL

;; Get rid of one of the pieces of advice.

;; Now install more advice to add 1 to the result.  Put it outside
;; the advice that does the doubling.
(:outside double-result)) (x)
> (add-one 2)               ; ((2+1)*2)+1 = 7
7

;; Replace that advice with the same piece of advice but put it
(:inside double-result)) (x)

> (add-one 2)               ; ((2+1)+1)*2 = 8
8

;; Redefine the basic function inside the advice to return its
;; argument unchanged.

> (add-one 2)               ; (2+1)*2 = 6
6

;; Remove all the advice from the function.