(in-package :parse)

(defclass scope-error ()
  ((value
     :initarg :value
     :initform nil
     :accessor value)))

(defclass no-function-error (scope-error)
  ((name
     :initarg :name
     :reader name)
   (command
     :initarg :command
     :reader command)))

(defmethod initialize-instance
  :after ((no-function-error no-function-error) &key)
  (setf
    (value no-function-error)
    (format nil "No function for command \\"~A\\" in scope ~A"
      (command no-function-error)
      (name no-function-error))))

(defun make-no-function-error (name command)
  (make-instance (quote no-function-error)
    :name name
    :command command))
