Common Lisp Variable addFraction is unbound

88 views Asked by At

Why does it say that the variable addFraction is Unbound?

(defun addFraction (N1 D1 N2 D2)
  (format t "~d ~d"
          (+ (+ (lcm D1 D2) N1) (+ (lcm D1 D2) N2))
          (lcm D1 D2)))

When I ran the code it says this:

#<THREAD "main thread" RUNNING {10010B0523}>:
  The variable ADDFRACTION is unbound.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE   ] Retry using ADDFRACTION.
  1: [USE-VALUE  ] Use specified value.
  2: [STORE-VALUE] Set specified value and use it.
  3: [ABORT      ] Exit debugger, returning to top level.

(SB-INT:SIMPLE-EVAL-IN-LEXENV ADDFRACTION #<NULL-LEXENV>)
0]
1

There are 1 answers

0
popsymark On

My Bad!

When I called the function I typed

addFunction (1 2 1 4)

Instead of

(addFunction 1 2 1 4)