(define spec-form-name
  (fn
    (form)
    (if
      (< (len form) 2)
      nil
      (let
        ((head (symbol-name (first form))) (name-part (nth form 1)))
        (cond
          (= head "define")
          (if (= (type-of name-part) "symbol") (symbol-name name-part) nil)
          (or (= head "defcomp") (= head "defisland") (= head "defmacro"))
          (if (= (type-of name-part) "symbol") (symbol-name name-part) nil)
          :else nil)))))
