Why do just two elements in a list cease to be recognized after I wrap my code in a package?
<p>I'm getting my feet wet with <code>defpackage</code> in Lisp and got off to an ignominious start, namely a bug I can't begin to understand. </p>

<p>The code below is an attempt to create a sublanguage to perform infix operations on vectors. I'd like to use this for a project involving some linear algebra.</p>

<p>The 'meat' of my code is <code>parse-infix</code>. This function finds the operator with the highest priority, calls <code>apply-op</code> to replace said operator and its operands with <code>operator (operand, operand)</code> and thus shrink the list, and iterates until the list contains only the result. Supported operators are the four rules, equality (which binds a result to a Lisp symbol), and vector concatenation.</p>

<p>Here's the code, warts and all:</p>

<pre><code>(defpackage :infix
       (:use :common-lisp)
   (:export operator-list
            operators
            parse-infix
            infix))

(in-package :infix)

(defun parse-input (a)
 "Turns symbols into numbers as necessary while reading an expression"
    (if (symbolp a) (symbol-value a) a))

;; Definition of structure containing data for one operator

(defmacro mapf (op type)
 ""
   `(lambda (a b) 
       (map ,type #'(lambda (x y)
                       (funcall ,op x y)) (parse-input a) (parse-input b))))

(defstruct (operator
              (:conc-name op-)
              (:constructor op (sym &amp;key (func (mapf sym 'vector)) priority associativity n-operands)))
            sym                            ; Operator symbol
            func                           ; Function to be applied to operands
            priority                       ; Other operators attributes
            (associativity 'left-to-right) ; Evaluation order for operators
                                           ; that appear more than once in a row
            (n-operands 2))                ; Number of operands (NOT IMPLEMENTED)

(defmacro operator-list (&amp;body ops)
 "Produces an operator list from a list of operator structs."
   `(mapcar #'(lambda (y) (apply #'op 
       (mapcar #'(lambda (x) (if (listp x) (eval x) x)) y))) ',ops))


(defparameter operators
  (operator-list 
     (+ :priority 4)
     (- :priority 4)
     (* :priority 3)
     (/ :priority 3)
     (^ :priority 2  :func expt :associativity right-to-left)
     (&amp; :priority 2  :func (lambda (x y) (concatenate 'vector x y)))
     (= :priority 10 :func (lambda (x y) (set (intern (string x)) y))))
 "Default set of operators, which perform arithmetic operations on
  vectors lengthwise. If one vector is shorter than the other, the result
  is truncated.")

(defun apply-op (b)
 "Reads a segment of a list of the format operand/operator/operand (in 3 consecutive
  cells) and leaves operator (operand, operand) in a single cell."
   (setf (car b) (funcall (op-func (caadr b))
                          (car b)
                          (caddr b))
         (cdr b) (cdddr b)))

(defun parse-infix (b &amp;key (operator-list operators))
 "Parses an infix expression by calling apply-op repeatedly until the entire
  expression is processed."
(let ((expr (mapcar #'(lambda (x)
                         (case (type-of x)
                                 (symbol (or (member x operator-list :key #'op-sym) x))
                                 (cons (parse-infix x))
                                 (otherwise x))) b)))
    (loop while (cdr expr) do
        (apply-op (reduce #'(lambda (x y &amp;aux (op1 (caadr x)) (op2 (caadr y)))
                                       (if (or (&lt; (op-priority op2) (op-priority op1))
                                           (and (= (op-priority op1) (op-priority op2))
                                                (eq (op-associativity op1) 'right-to-left))) y x))
                            (remove-if #'listp (mapcon #'list expr) :key #'caddr)))
     finally (return (car expr)))))

(defmacro infix (&amp;rest b)
 "Wrapper to create lists for parse-infix"
   `(parse-infix ',b))
</code></pre>

<p>And here's the snag. The functions seems to be working...</p>

<pre><code>? (infix (#(2 3) + #(4 5)) * #(2 2))
#(12 16)
? (infix (#(100) &amp; (#(2 3) + #(4 5)) * #(2 2))) ; '&amp; is concatenation
#(200 12)
? (infix A = #(5 5) + #(10 10))
#(15 15)
? A
#(15 15)
</code></pre>

<p>... but when I leave the package, the concatenation (&amp;) operator suddenly 'dies':</p>

<pre><code>? (in-package :cl-user)
#&lt;Package "COMMON-LISP-USER"&gt;
? (infix:infix A = #(5 5) + #(10 10))
#(15 15)
? (infix:infix (#(2 3) + #(4 5)) * #(2 2))
#(12 16)
? (infix:infix (#(100) &amp; (#(2 3) + #(4 5)) * #(2 2)))
&gt; Error: The value &amp; is not of the expected type LIST.
&gt; While executing: (:INTERNAL INFIX:PARSE-INFIX), in process listener(1).
&gt; Type :POP to abort, :R for a list of available restarts.
&gt; Type :? for other options.
1 &gt;
</code></pre>

<p>I tried to trace the package's functions and noticed that, for whatever reason, '&amp; ceases to be recognized as an operator when I leave the <code>infix</code> package. I don't have the foggiest idea why this is the case. Any input is appreciated.</p>

<p>PS. As many probably noticed, all this is in Clozure Common Lisp.</p>