                         (destructuring-bind (obj field) lhs
                           (let ((obj-sym (gensym)))
                             `(let ((,obj-sym (copy-alist ,obj)))
-                               (setcdr (assq ,field ,obj-sym) ,expr)
+                               (setcdr (assq ,field (cdr ,obj-sym)) ,expr)
                                ,obj-sym)))))))
     (+         . ,(lambda (token op) (psl--apply 'psl-+ (nth 1 op))))
     (-         . ,(lambda (token op) (psl--apply 'psl-- (nth 1 op))))

    (==        . ,(lambda (token op) (psl--apply 'psl-== (nth 1 op))))
    (print     . ,(lambda (token op) (psl--apply 'psl-print (nth 1 op))))
    (index     . ,(lambda (token index)
                    `(cdr (assq ,(nth 1 index) ,(nth 0 index)))))
    (index=    . ,(lambda (token index) index))
    (message   . ,(lambda (token msg)
                    (destructuring-bind (obj at f args) msg
                      `(funcall (cdr (assq ,f ,obj))
                                ,@(psl--apply obj args)))))
    (field     . ,(lambda (token field) `(quote ,field)))
    (index-str . ,(lambda (token index) `(intern ,(nth 1 index))))

  "Implement ParselTongue's == function."
  (equal a b))

(defun psl-object-p (o)
  "Return t if argument is ParselTongue object."
  (and (listp o) (eq (car o) 'object)))

(defun psl-print (o)
  "Implement ParselTongue's print function."
  (cond
    ((eq o t)          (princ "true" t))
    ((null o)          (princ "false" t))
    ((functionp o)     (princ "function" t))
    ((psl-object-p o)  (princ "object" t))
    (t (princ o t)))
  o)

